/* ==========================================================================
   SMK Negeri 1 Rawamerta - Style Khusus Halaman Home
   --------------------------------------------------------------------------
   Warna & font memakai variabel dari app.css (:root).
   Ritme section: putih -> abu lembut -> putih -> abu lembut ...

   Daftar isi:
   1. Elemen umum (section, eyebrow, heading, link)
   2. Hero slider
   3. Statistik
   4. Tentang sekolah
   5. Program keahlian
   6. Berita (grid mosaik)
   7. Galeri (kolase)
   8. Mitra industri
   9. Responsif
   ========================================================================== */


/* 1. ELEMEN UMUM
   ========================================================================== */
.section { padding: 64px 0; background: #fff; }
.section--soft { background: var(--bg-soft); }

/* section dengan foto latar + lapisan navy agar card & teks tetap terbaca
   cara pakai: <section class="section section--image" style="--bg-image: url('...')"> */
.section--image {
  position: relative;
  color: #fff;
  background-color: var(--primary);
  background-image:
    linear-gradient(180deg, rgba(11, 31, 58, .88) 0%, rgba(11, 31, 58, .78) 100%),
    var(--bg-image);
  background-size: cover;
  background-position: center;
}

.section--image .heading { color: #fff; }
.section--image .eyebrow { color: var(--accent); }
.section--image .section-head > p { color: rgba(255, 255, 255, .75); }

.eyebrow {
  display: block;
  margin-bottom: .9rem;
  font-family: var(--font-heading);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: .14em;
}

.heading {
  margin-bottom: 1.25rem;
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.025em;
}

.lead-text {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
}

/* judul section: teks di kiri, keterangan / tombol di kanan */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 4rem;
  margin-bottom: 3.5rem;
}

.section-head .heading { margin-bottom: 0; }

.section-head > p,
.section-head__desc {
  max-width: 440px;
  margin: 0;
  color: var(--text-muted);
}

.section-head__desc { margin-top: 1rem; max-width: 560px; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--primary);
}

.link-arrow i { font-size: 12px; transition: transform var(--transition); }
.link-arrow:hover { color: var(--accent-dark); }
.link-arrow:hover i { transform: translateX(4px); }

/* tombol garis putih untuk di atas foto gelap */
.btn-pill--outline-light {
  color: #fff;
  background: transparent;
  border-color: rgba(255, 255, 255, .55);
}

.btn-pill--outline-light:hover {
  color: var(--primary);
  background: #fff;
  border-color: #fff;
}

.empty-state {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-soft);
  border-radius: var(--radius);
}

.empty-state i { margin-bottom: 1rem; font-size: 32px; color: var(--accent); }
.empty-state h3 { font-size: 20px; }
.empty-state p { margin: 0; }
.empty-state--small { padding: 2rem; }
.empty-state.is-hidden { display: none; }


/* 2. HERO SLIDER
   ========================================================================== */
.hero-slider {
  position: relative;
  height: 86vh;
  min-height: 560px;
  max-height: 860px;
  overflow: hidden;
  color: #fff;
  background: var(--primary);
  outline: none;
}

.hero-slider__slides { position: absolute; inset: 0; }

/* semua slide ditumpuk, hanya .is-active yang terlihat (efek fade) */
.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease, visibility 1s;
}

.hero-slide.is-active { opacity: 1; visibility: visible; }

.hero-slide__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  transition: transform 7s ease-out;
}

/* efek zoom pelan pada foto yang sedang aktif */
.hero-slide.is-active .hero-slide__img { transform: scale(1); }

/* gradasi gelap dari kiri & bawah agar teks terbaca, foto tetap terang di kanan */
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 31, 58, .82) 0%, rgba(11, 31, 58, .45) 50%, rgba(11, 31, 58, .1) 100%),
    linear-gradient(0deg, rgba(11, 31, 58, .55) 0%, transparent 40%);
}

.hero-slide__content {
  position: relative;
  z-index: 1;
  padding-bottom: 60px;
}

.hero-slide__eyebrow {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .16em;
}

.hero-slide__title {
  max-width: 760px;
  margin-bottom: 1.5rem;
  font-size: clamp(34px, 4.4vw, 60px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.03em;
  color: #fff;
}

.hero-slide__text {
  max-width: 560px;
  margin-bottom: 2.25rem;
  font-size: 18px;
  line-height: 1.65;
  color: rgba(255, 255, 255, .85);
}

.hero-slide__actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* animasi teks masuk bertahap (stagger) saat slide aktif */
.hero-slide__content > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s ease, transform .7s ease;
}

.hero-slide.is-active .hero-slide__content > * { opacity: 1; transform: none; }
.hero-slide.is-active .hero-slide__content > :nth-child(1) { transition-delay: .3s; }
.hero-slide.is-active .hero-slide__content > :nth-child(2) { transition-delay: .45s; }
.hero-slide.is-active .hero-slide__content > :nth-child(3) { transition-delay: .6s; }
.hero-slide.is-active .hero-slide__content > :nth-child(4) { transition-delay: .75s; }

/* --- Kontrol slider --- */
.hero-slider__controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.hero-slider__counter {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, .6);
  letter-spacing: .05em;
}

.hero-slider__counter [data-slider-current] { color: #fff; }

.hero-slider__dots { display: flex; gap: .5rem; }

.hero-slider__dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  background: rgba(255, 255, 255, .4);
  border: 0;
  border-radius: 999px;
  transition: all var(--transition);
}

.hero-slider__dots button.is-active { width: 28px; background: var(--accent); }

.hero-slider__arrows { display: flex; gap: .5rem; margin-left: auto; }

.hero-slider__arrows button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  transition: all var(--transition);
}

.hero-slider__arrows button:hover { color: var(--primary); background: #fff; border-color: #fff; }

.hero-slider button:focus-visible,
.hero-slider:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* garis progress di bawah hero (lebarnya diatur oleh app.js) */
.hero-slider__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: 3px;
  background: rgba(255, 255, 255, .15);
}

.hero-slider__progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}


/* 3. STATISTIK
   ========================================================================== */
.stats {
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stats__item {
  padding: 2.5rem 2rem;
  border-left: 1px solid var(--border);
}

.stats__item:first-child { padding-left: 0; border-left: 0; }

.stats__item strong {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(32px, 3.2vw, 44px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--primary);
}

.stats__item span {
  display: block;
  margin-top: .5rem;
  font-size: 14px;
  color: var(--text-muted);
}


/* 4. TENTANG SEKOLAH
   ========================================================================== */
.about__note {
  margin: 1.25rem 0 2rem;
  padding-left: 1.25rem;
  font-size: 15px;
  color: var(--text-muted);
  border-left: 2px solid var(--accent);
}

.about__figure {
  position: relative;
  margin: 0;
}

.about__figure img {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  border-radius: var(--radius);
}

.about__figure figcaption {
  position: absolute;
  left: 24px;
  bottom: 24px;
  padding: .7rem 1.1rem;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  border-radius: 999px;
}

.about__figure figcaption strong { color: var(--primary); }


/* 5. PROGRAM KEAHLIAN
   ========================================================================== */
.programs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
}

.program {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 270px;
  padding: 1.75rem 1.5rem 1.6rem;
  color: var(--text);
  background: #fff;
  border-radius: var(--radius);
  transition: transform var(--transition), box-shadow var(--transition);
}

.program:hover {
  color: var(--text);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.program > i {
  margin-bottom: 0;          /* teks rata atas agar sejajar antar kartu */
  font-size: 24px;
  color: var(--accent-dark);
}

.program__code {
  margin-top: 2rem;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .12em;
}

.program h3 {
  margin: .4rem 0 .5rem;
  font-size: 17px;
  line-height: 1.35;
}

/* keterangan singkat jurusan */
.program p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* panah muncul di pojok kanan atas saat hover */
.program__arrow {
  position: absolute;
  top: 1.85rem;
  right: 1.5rem;
  font-size: 13px;
  color: var(--primary);
  opacity: 0;
  transform: translateX(-6px);
  transition: all var(--transition);
}

.program:hover .program__arrow { opacity: 1; transform: none; }


/* 6. BERITA (GRID MOSAIK)
   ==========================================================================
   Grid 4 kolom. Ukuran card ditentukan urutannya (span kolom x baris):

     [   1 (2x2)   ][   2 (2x1)   ]
     [             ][ 3 ][ 4 ]
     [ 5 ][   6 (2x1)  ][ 7 ]
     [1x2][   8 (2x1)  ][1x2]

   grid-auto-flow: dense mengisi celah jika berita kurang dari 8.
   ========================================================================== */
.news-mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 230px;
  grid-auto-flow: dense;
  gap: 1rem;
}

.news-tile--1 { grid-column: span 2; grid-row: span 2; }
.news-tile--2,
.news-tile--6,
.news-tile--8 { grid-column: span 2; }
.news-tile--5,
.news-tile--7 { grid-row: span 2; }

/* penyesuaian jika jumlah berita kurang dari 8 (desktop) agar tidak ada celah kosong */
@media (min-width: 992px) {
  .news-mosaic--1 .news-tile--1 { grid-column: span 4; }
  .news-mosaic--2 .news-tile--2 { grid-row: span 2; }
  .news-mosaic--3 .news-tile--3 { grid-column: span 2; }
  .news-mosaic--5 .news-tile--5 { grid-column: span 4; grid-row: span 1; }
  .news-mosaic--6 .news-tile--5 { grid-row: span 1; }
  .news-mosaic--6 .news-tile--6 { grid-column: span 3; }
  .news-mosaic--7 .news-tile--6 { grid-row: span 2; }
}

/* --- Card: foto penuh + teks di atas gradasi gelap --- */
.news-tile { position: relative; min-width: 0; }

.news-tile__link {
  position: relative;
  display: block;
  height: 100%;
  overflow: hidden;
  color: #fff;
  background: var(--primary);
  border-radius: 14px;
}

.news-tile__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s ease;
}

.news-tile__link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(11, 31, 58, .92) 0%, rgba(11, 31, 58, .45) 45%, rgba(11, 31, 58, 0) 75%);
  transition: background var(--transition);
}

.news-tile__link:hover { color: #fff; }
.news-tile__link:hover .news-tile__img { transform: scale(1.05); }

.news-tile__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.25rem;
}

.news-tile__badge {
  margin-bottom: .6rem;
  padding: .25rem .7rem;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--accent);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-radius: 999px;
}

.news-tile__title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 .5rem;
  font-size: 16px;
  line-height: 1.35;
  color: #fff;
}

.news-tile__excerpt { display: none; }

.news-tile__date {
  font-size: 12.5px;
  color: rgba(255, 255, 255, .75);
}

.news-tile__date i { margin-right: .3rem; color: var(--accent); }

/* --- Card besar (berita utama) --- */
.news-tile--1 .news-tile__body { padding: 2rem; }

.news-tile--1 .news-tile__title {
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.2;
  letter-spacing: -.02em;
}

.news-tile--1 .news-tile__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 520px;
  margin: 0 0 .75rem;
  font-size: 15px;
  color: rgba(255, 255, 255, .8);
}

/* --- Card lebar --- */
.news-tile--2 .news-tile__title,
.news-tile--6 .news-tile__title,
.news-tile--8 .news-tile__title { font-size: 19px; }


/* 7. GALERI (KOLASE)
   ==========================================================================
   Grid 4 kolom yang rapat. Ukuran foto ditentukan urutannya (kolom x baris):

     [  1 (2x2)  ][ 2 ][ 3 ]
     [           ][ 4 ][1x2]
     [ 5 ][  6 (2x1)  ][ 7 ]
     [ 8 ][  9 (2x2)  ][10 ]
     [1x2][           ][1x2]

   Total 20 kotak = penuh tanpa celah untuk 10 foto.
   ========================================================================== */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 180px;
  grid-auto-flow: dense;
  gap: 8px;
}

.gallery__item--1,
.gallery__item--9 { grid-column: span 2; grid-row: span 2; }
.gallery__item--6 { grid-column: span 2; }
.gallery__item--3,
.gallery__item--8,
.gallery__item--10 { grid-row: span 2; }

/* penyesuaian jika foto kurang dari 10 agar kolase tetap penuh */
.gallery--1 .gallery__item--1 { grid-column: span 4; }
.gallery--2 .gallery__item--2 { grid-column: span 2; grid-row: span 2; }
.gallery--3 .gallery__item--2 { grid-row: span 2; }
.gallery--5 .gallery__item--5 { grid-column: span 4; }
.gallery--6 .gallery__item--6 { grid-column: span 3; }
.gallery--8 .gallery__item--8 { grid-column: span 4; grid-row: span 1; }
.gallery--9 .gallery__item--9 { grid-column: span 3; }

.gallery__item {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--border);
  border-radius: 8px;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s ease;
}

/* lapisan gelap tipis + ikon perbesar saat hover */
.gallery__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(11, 31, 58, 0);
  transition: background var(--transition);
}

.gallery__item:hover img { transform: scale(1.05); }
.gallery__item:hover::after { background: rgba(11, 31, 58, .25); }

.gallery__zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 13px;
  color: var(--primary);
  background: #fff;
  border-radius: 50%;
  opacity: 0;
  transform: scale(.85);
  transition: all var(--transition);
}

.gallery__item:hover .gallery__zoom { opacity: 1; transform: none; }


/* 8. MITRA INDUSTRI
   Strip ringkas di tengah, tetap rapi walau mitra hanya sedikit.
   ========================================================================== */
.partners {
  padding: 48px 0 56px;
  text-align: center;
  background: #fff;
  border-top: 1px solid var(--border);
}

.partners__label {
  margin-bottom: 1.5rem;
  font-family: var(--font-heading);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .12em;
}

.partners__logos { overflow: hidden; }

.partners__track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.partner-logo {
  display: grid;
  place-items: center;
  width: 160px;
  height: 80px;
  margin: 0;
  padding: .75rem 1.25rem;
  background: var(--bg-soft);
  border-radius: 12px;
}

.partner-logo img {
  max-width: 100%;
  max-height: 52px;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: .65;
  transition: all var(--transition);
}

.partner-logo:hover img { filter: none; opacity: 1; }

/* mode marquee: logo bergerak pelan dari kanan ke kiri */
.partners__logos.is-marquee {
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.is-marquee .partners__track {
  flex-wrap: nowrap;
  justify-content: flex-start;
  width: max-content;
  animation: marquee 40s linear infinite;
}

.is-marquee:hover .partners__track { animation-play-state: paused; }

@keyframes marquee { to { transform: translateX(-50%); } }


/* 9. RESPONSIF
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .hero-slide__img,
  .hero-slide__content > * { transition: none; }
  .is-marquee .partners__track { animation: none; }
}

/* Laptop */
@media (max-width: 1199.98px) {
  /* 6 kolom bantu: baris 1 = 3 kartu (2 kolom), baris 2 = 2 kartu (3 kolom) -> tanpa celah */
  .programs { grid-template-columns: repeat(6, 1fr); }
  .program { grid-column: span 2; }
  .program:nth-child(n + 4) { grid-column: span 3; }
  .program { min-height: 210px; }
}

/* Tablet */
@media (max-width: 991.98px) {
  .section { padding: 80px 0; }

  .hero-slider { height: 78vh; min-height: 520px; }

  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .stats__item:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats__item:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }

  /* berita: 2 kolom, card 1 tetap besar, sisanya ukuran normal */
  .news-mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 220px; }
  .news-tile--2, .news-tile--6, .news-tile--8 { grid-column: span 1; }
  .news-tile--5, .news-tile--7 { grid-row: span 1; }
  /* card terakhir yang sendirian di barisnya dibuat selebar 2 kolom */
  .news-tile:last-child:nth-child(even) { grid-column: span 2; }

  .gallery { grid-auto-rows: 150px; }

}

/* Mobile */
@media (max-width: 767.98px) {
  .section { padding: 64px 0; }
  .section-head { margin-bottom: 2.25rem; }

  .hero-slider { height: 82vh; min-height: 540px; max-height: 720px; }
  .hero-slide { align-items: flex-end; }
  .hero-slide::after {
    background: linear-gradient(0deg, rgba(11, 31, 58, .92) 0%, rgba(11, 31, 58, .55) 55%, rgba(11, 31, 58, .2) 100%);
  }
  .hero-slide__content { padding-bottom: 110px; }
  .hero-slide__text { font-size: 15.5px; margin-bottom: 1.75rem; }
  .hero-slide__actions .btn-pill { padding: .75rem 1.3rem; font-size: 14px; }

  .hero-slider__controls { bottom: 28px; gap: 1.25rem; }
  .hero-slider__arrows button { width: 42px; height: 42px; }

  .stats__item { padding: 1.75rem 1rem; }
  .stats__item:nth-child(even) { padding-right: 0; }

  .lead-text { font-size: 16.5px; }

  .programs { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .program:nth-child(n) { grid-column: auto; }
  .program { min-height: 0; padding: 1.5rem 1.25rem; }
  .program__code { margin-top: 1.5rem; }
  .program h3 { font-size: 15.5px; padding-right: 0; }
  .program__arrow { display: none; }

  /* jika jumlah jurusan ganjil, kartu terakhir dibuat selebar 2 kolom */
  .program:last-child:nth-child(odd) { grid-column: span 2; min-height: 0; }

  /* berita: 1 kolom, card pertama lebih tinggi */
  .news-mosaic { grid-template-columns: 1fr; grid-auto-rows: 240px; gap: .85rem; }
  .news-tile--1,
  .news-tile:last-child:nth-child(even) { grid-column: span 1; grid-row: span 1; }
  .news-tile--1 { min-height: 340px; }
  .news-tile--1 .news-tile__body { padding: 1.4rem; }
  .news-tile--1 .news-tile__excerpt { display: none; }

  /* galeri HP: 2 kolom, foto pertama besar, sisanya kotak sama besar */
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 140px; gap: 6px; }
  .gallery .gallery__item { grid-column: span 1; grid-row: span 1; }
  .gallery .gallery__item--1 { grid-column: span 2; grid-row: span 2; }
  /* foto terakhir yang sendirian di barisnya dibuat selebar 2 kolom */
  .gallery .gallery__item:last-child:nth-child(even) { grid-column: span 2; }
  .gallery__zoom { display: none; }
}

@media (max-width: 399.98px) {
  .programs { grid-template-columns: 1fr; }
  .program { min-height: 0; }
  .program:last-child:nth-child(odd) { grid-column: auto; }
  .program__code { margin-top: 1.25rem; }
}
