/* =========================================================
   MAN 2 NGANJUK — Website Resmi
   Design tokens: hijau tua madrasah, emas, gading, malam
========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=Amiri:wght@400;700&display=swap');

:root{
  /* Color */
  --hijau-tua:   #0E3B2E;
  --hijau:       #17553F;
  --hijau-terang:#1F8A63;
  --emas:        #C9982F;
  --emas-terang: #E4BE6A;
  --gading:      #FBF6EA;
  --gading-redup:#F1E9D6;
  --malam:       #0A1F17;
  --tinta:       #17251F;
  --tinta-lunak: #4B5D54;
  --garis:       #E1D8BF;
  --putih:       #FFFFFF;
  --merah:       #A9432E;

  /* Type */
  --f-display: 'Fraunces', serif;
  --f-arab: 'Amiri', serif;
  --f-body: 'Plus Jakarta Sans', sans-serif;

  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 28px;
  --shadow-1: 0 1px 2px rgba(10,31,23,.06), 0 8px 24px -12px rgba(10,31,23,.18);
  --shadow-2: 0 20px 60px -20px rgba(10,31,23,.35);
  --container: 1180px;
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto;}
  *{animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; scroll-behavior:auto !important;}
}

body{
  margin:0;
  font-family:var(--f-body);
  color:var(--tinta);
  background:var(--gading);
  -webkit-font-smoothing:antialiased;
  line-height:1.6;
}

a{color:inherit; text-decoration:none;}
img{max-width:100%; display:block;}
ul{margin:0; padding:0; list-style:none;}
button{font-family:inherit;}

h1,h2,h3,h4{
  font-family:var(--f-display);
  color:var(--malam);
  margin:0 0 .5em;
  line-height:1.15;
  font-weight:600;
}
.h-serif-italic{font-style:italic; font-weight:500;}

.container{max-width:var(--container); margin:0 auto; padding:0 24px;}

.skip-link{
  position:absolute; left:-999px; top:0; background:var(--emas); color:var(--malam);
  padding:12px 18px; z-index:999; border-radius:0 0 8px 0; font-weight:700;
}
.skip-link:focus{left:0;}

:focus-visible{ outline:3px solid var(--emas); outline-offset:2px; }

/* ---------- Eyebrow / badges ---------- */
.eyebrow{
  display:inline-flex; align-items:center; gap:8px;
  font-size:12.5px; letter-spacing:.14em; text-transform:uppercase;
  font-weight:700; color:var(--hijau);
}
.eyebrow::before{
  content:''; width:18px; height:1px; background:var(--emas);
}
.eyebrow.on-dark{ color:var(--emas-terang); }
.eyebrow.on-dark::before{ background:var(--emas-terang); }

/* ---------- Islamic geometric motif (signature element) ---------- */
.motif-star{
  position:absolute; inset:0; pointer-events:none;
  background-image:
    radial-gradient(circle at 50% 50%, transparent 0 0), var(--star-svg);
  opacity:.14;
}
.rosette{
  width:1px;height:1px; /* base for inline svg sizing via CSS var if needed */
}

/* =========================================================
   TOP UTILITY BAR
========================================================= */
.topbar{
  background:var(--malam);
  color:var(--gading-redup);
  font-size:12.5px;
}
.topbar .container{
  display:flex; align-items:center; justify-content:space-between;
  padding-top:8px; padding-bottom:8px; gap:16px; flex-wrap:wrap;
}
.topbar-left{display:flex; gap:18px; align-items:center; flex-wrap:wrap;}
.topbar-item{display:flex; align-items:center; gap:6px; opacity:.92;}
.topbar-item svg{width:13px; height:13px; flex:none;}
.prayer-widget{
  display:flex; align-items:center; gap:8px;
  background:rgba(228,190,106,.12);
  border:1px solid rgba(228,190,106,.28);
  padding:4px 12px; border-radius:999px;
}
.prayer-widget .dot{width:6px;height:6px;border-radius:50%;background:var(--emas-terang); animation:pulse 2s infinite;}
@keyframes pulse{0%,100%{opacity:1} 50%{opacity:.35}}
.topbar-right{display:flex; gap:14px; align-items:center;}
.topbar a:hover{color:var(--emas-terang);}

/* =========================================================
   RUNNING TEXT — Kata Mutiara Madrasah
========================================================= */
.marquee-strip{
  background:linear-gradient(90deg,var(--malam),var(--hijau-tua) 55%,var(--malam));
  border-bottom:1px solid rgba(228,190,106,.25);
  overflow:hidden; position:relative; padding:10px 0;
}
.marquee-strip::before,.marquee-strip::after{
  content:''; position:absolute; top:0; bottom:0; width:70px; z-index:2; pointer-events:none;
}
.marquee-strip::before{ left:0; background:linear-gradient(90deg,var(--malam),transparent); }
.marquee-strip::after{ right:0; background:linear-gradient(270deg,var(--malam),transparent); }
.marquee-track{ display:flex; width:max-content; animation:marquee-scroll 50s linear infinite; }
.marquee-strip:hover .marquee-track{ animation-play-state:paused; }
.marquee-track span{
  display:inline-flex; align-items:center; white-space:nowrap; padding:0 2.6rem;
  font-family:var(--f-display); font-style:italic; font-weight:500;
  font-size:14.5px; color:var(--emas-terang);
}
.marquee-track span::before{
  content:'\2726'; margin-right:2.6rem; font-style:normal; color:var(--emas); opacity:.85;
}
@keyframes marquee-scroll{ from{transform:translateX(0);} to{transform:translateX(-50%);} }
@media (prefers-reduced-motion:reduce){ .marquee-track{ animation:none; } }

/* =========================================================
   SCROLL PROGRESS BAR
========================================================= */
.scroll-progress{
  position:fixed; top:0; left:0; height:3px; width:0%; z-index:201;
  background:linear-gradient(90deg,var(--emas),var(--emas-terang));
  transition:width .1s linear;
}

/* =========================================================
   NAV
========================================================= */
.site-header{
  background:rgba(251,246,234,.96);
  -webkit-backdrop-filter:saturate(160%) blur(10px);
  backdrop-filter:saturate(160%) blur(10px);
  border-bottom:1px solid var(--garis);
  position:sticky; top:0; z-index:100;
  transition:box-shadow .25s ease, padding .25s ease;
}
.site-header.is-scrolled{
  box-shadow:0 6px 24px -12px rgba(10,31,23,.25);
}
.site-header.is-scrolled .nav{ padding:8px 0; }
.site-header.is-scrolled .brand-logos img{ height:36px; }

/* Header gets a little extra breathing room vs. the body container,
   since the nav carries several menu items and needs space to avoid
   crowding/overlap on laptop-size screens. */
.site-header .container{ max-width:1440px; }

.nav{
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap:nowrap; gap:16px;
  padding:13px 0;
}
.brand{display:flex; align-items:center; gap:12px; min-width:0; flex:none;}
.brand-mark{
  width:48px; height:48px; border-radius:12px;
  background:linear-gradient(155deg, var(--hijau) 0%, var(--hijau-tua) 100%);
  display:flex; align-items:center; justify-content:center;
  color:var(--emas-terang); flex:none;
  box-shadow: var(--shadow-1);
}
/* Logo resmi (MAN 2 Nganjuk + Kemenag) di header */
.brand-logos{ display:flex; align-items:center; gap:9px; flex:none; }
.brand-logos img{ height:44px; width:auto; display:block; transition:height .25s ease; }
.brand-divider{ width:1px; height:32px; background:linear-gradient(180deg,transparent,var(--emas),transparent); opacity:.7; flex:none; }
@media (max-width:640px){ .brand-logos img{ height:34px; } .brand-divider{ height:24px; } }
.brand-text{ min-width:0; }
.brand-text .nama-madrasah{
  font-family:var(--f-display); font-weight:700; font-size:17px; color:var(--malam);
  line-height:1.2; white-space:nowrap;
}
.brand-text .tagline{
  display:block; font-size:11px; color:var(--tinta-lunak); letter-spacing:.03em;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:230px;
}

.nav-menu{display:flex; align-items:center; gap:0; flex-wrap:nowrap;}
.nav-menu a{
  display:inline-flex; align-items:center;
  padding:8px 10px; font-size:13px; font-weight:600; color:var(--tinta);
  border-radius:8px; position:relative; white-space:nowrap;
  transition:color .2s ease, background .2s ease;
}
.nav-menu a:hover{color:var(--hijau-tua); background:var(--gading-redup);}
.nav-menu a.active{color:var(--hijau-tua);}
.nav-menu a.active::after{
  content:''; position:absolute; left:12px; right:12px; bottom:3px; height:2px; background:var(--emas);
  border-radius:2px;
}
/* The "Info PPDB" link is duplicated as a full CTA button in .nav-cta —
   only show it inside the mobile off-canvas panel, not the desktop row. */
.nav-menu > a.btn-primary{ display:none; }

.nav-cta{
  display:flex; align-items:center; gap:10px; flex:none;
}
.nav-toggle{
  display:none; background:none; border:none; cursor:pointer;
  padding:8px; border-radius:8px; line-height:0;
}
.nav-toggle:hover{ background:var(--gading-redup); }
.nav-toggle svg{width:24px;height:24px;color:var(--malam);}

/* Switch to the off-canvas mobile menu well before the row gets tight —
   with 9 nav links + a CTA button, anything narrower than this needs the
   compact menu, otherwise the links get squeezed and their text wraps
   and overlaps. */
@media (max-width:1359px){
  .nav-menu{
    position:fixed; inset:0 0 0 auto; width:min(320px,86vw); height:100vh;
    height:100dvh;
    background:var(--gading); flex-direction:column; align-items:stretch;
    padding:88px 22px 22px; gap:2px; box-shadow:var(--shadow-2);
    transform:translateX(100%); transition:transform .35s ease; overflow-y:auto;
  }
  .nav-menu.open{transform:translateX(0);}
  .nav-menu a{
    padding:14px 14px; font-size:16px; border-bottom:1px solid var(--garis);
    border-radius:0; white-space:normal;
  }
  .nav-menu a.active::after{ display:none; }
  .nav-menu a.active{ background:var(--gading-redup); }
  .nav-menu > a.btn-primary{ display:flex; margin-top:14px !important; }
  .nav-toggle{display:block;}
  .nav-cta .btn-text{display:none;}
}

@media (max-width:400px){
  .brand-text .tagline{ display:none; }
}

/* =========================================================
   BUTTONS
========================================================= */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 22px; border-radius:999px; font-weight:700; font-size:14.5px;
  border:1px solid transparent; cursor:pointer; transition:.2s ease; white-space:nowrap;
}
.btn-primary{ background:var(--hijau-tua); color:var(--gading); }
.btn-primary:hover{ background:var(--hijau); transform:translateY(-1px); box-shadow:var(--shadow-1); }
.btn-emas{ background:var(--emas); color:var(--malam); }
.btn-emas:hover{ background:var(--emas-terang); transform:translateY(-1px); }
.btn-outline{ border-color:var(--hijau-tua); color:var(--hijau-tua); background:transparent; }
.btn-outline:hover{ background:var(--hijau-tua); color:var(--gading); }
.btn-outline.on-dark{ border-color:rgba(251,246,234,.5); color:var(--gading); }
.btn-outline.on-dark:hover{ background:var(--gading); color:var(--malam); }
.btn-sm{ padding:9px 16px; font-size:13px; }
.btn svg{width:16px; height:16px;}

/* =========================================================
   HERO — foto penuh (full-bleed), gaya fotografis & elegan
========================================================= */
.hero{
  position:relative; overflow:hidden; min-height:86vh; display:flex; align-items:flex-end;
  --hero-photo:none;
  background-image:
    linear-gradient(100deg, rgba(10,31,23,.95) 0%, rgba(10,31,23,.84) 34%, rgba(10,31,23,.38) 64%, rgba(10,31,23,.58) 100%),
    var(--hero-photo);
  background-size:cover; background-position:center 38%; background-repeat:no-repeat;
  color:var(--gading);
  padding:132px 0 0;
}
.hero-inner{ width:100%; padding-bottom:52px; }
.hero-content{ max-width:660px; }
.hero h1{
  color:var(--putih); font-size:clamp(32px,4.4vw,56px); margin-top:14px;
}
.hero h1 em{ color:var(--emas-terang); font-style:italic; }
.hero p.lead{
  color:#D8E6DD; font-size:17px; max-width:54ch; margin:18px 0 0;
}
.hero-actions{display:flex; gap:14px; flex-wrap:wrap; margin:30px 0 44px;}

/* Panel statistik melayang di tepi bawah hero, seperti kartu kaca */
.hero-stats{
  display:grid; grid-template-columns:repeat(4,1fr); gap:0;
  background:rgba(251,246,234,.08); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  border:1px solid rgba(251,246,234,.18); border-radius:var(--radius-m); overflow:hidden;
  box-shadow:var(--shadow-2);
}
.hero-stats .stat{ padding:22px 24px; border-right:1px solid rgba(251,246,234,.16); }
.hero-stats .stat:last-child{ border-right:none; }
.hero-stats .stat b{ display:block; font-family:var(--f-display); font-size:32px; color:var(--emas-terang); line-height:1; }
.hero-stats .stat span{ display:block; font-size:12px; color:#C8D8CD; margin-top:6px; font-weight:600; }

@media (max-width:760px){
  .hero{ min-height:auto; padding-top:112px; }
  .hero-inner{ padding-bottom:32px; }
  .hero-stats{ grid-template-columns:1fr 1fr; }
  .hero-stats .stat{ border-bottom:1px solid rgba(251,246,234,.16); }
  .hero-stats .stat:nth-child(2){ border-right:none; }
}

/* =========================================================
   SECTION SCAFFOLD
========================================================= */
.section{ padding:88px 0; }
.section.tight{ padding:64px 0; }
.section-alt{ background:var(--putih); }
.section-dark{ background:var(--malam); color:var(--gading-redup); }
.section-dark h2{ color:var(--putih); }
.section-head{
  display:flex; justify-content:space-between; align-items:flex-end; gap:24px;
  margin-bottom:44px; flex-wrap:wrap;
}
.section-head h2{ font-size:clamp(26px,3vw,38px); max-width:16ch; }
.section-head p{ color:var(--tinta-lunak); max-width:44ch; margin:0; }
.section-dark .section-head p{ color:#B9C7BE; }

/* =========================================================
   CARDS
========================================================= */
.card{
  background:var(--putih); border:1px solid var(--garis); border-radius:var(--radius-m);
  padding:26px; transition:.25s ease;
}
.card:hover{ transform:translateY(-4px); box-shadow:var(--shadow-1); border-color:transparent; }
.card .icon-badge{
  width:46px; height:46px; border-radius:12px; display:flex; align-items:center; justify-content:center;
  background:var(--gading-redup); color:var(--hijau-tua); margin-bottom:16px;
}
.card .icon-badge svg{ width:22px; height:22px; }
.card h3{ font-size:18px; margin-bottom:8px; }
.card p{ color:var(--tinta-lunak); font-size:14.5px; margin:0; }

.grid{ display:grid; gap:22px; }
.grid-2{ grid-template-columns:repeat(2,1fr); }
.grid-3{ grid-template-columns:repeat(3,1fr); }
.grid-4{ grid-template-columns:repeat(4,1fr); }
@media (max-width:980px){ .grid-4{grid-template-columns:repeat(2,1fr);} .grid-3{grid-template-columns:repeat(2,1fr);} }
@media (max-width:640px){ .grid-2,.grid-3,.grid-4{grid-template-columns:1fr;} }

/* Program / jurusan cards */
.prog-card{
  border-radius:var(--radius-m); padding:28px; color:var(--putih); position:relative; overflow:hidden;
  min-height:210px; display:flex; flex-direction:column; justify-content:flex-end;
}
.prog-card::before{
  content:''; position:absolute; inset:0; opacity:.16;
  background-image:var(--pat);
  background-size:120px;
}
.prog-card .kode{ font-family:var(--f-display); font-size:13px; letter-spacing:.14em; opacity:.85; }
.prog-card h3{ color:var(--putih); font-size:21px; margin:6px 0 8px; }
.prog-card p{ color:rgba(255,255,255,.82); font-size:13.5px; }

/* Achievement cards */
.prestasi-card{ display:flex; gap:16px; align-items:flex-start; }
.prestasi-card .tier{
  flex:none; width:50px; height:50px; border-radius:50%;
  background:linear-gradient(155deg,var(--emas-terang),var(--emas));
  display:flex; align-items:center; justify-content:center; color:var(--malam); font-family:var(--f-display); font-weight:700;
}
.tag{
  display:inline-block; font-size:11.5px; font-weight:700; letter-spacing:.04em;
  padding:4px 10px; border-radius:999px; background:var(--gading-redup); color:var(--hijau-tua); margin-bottom:8px;
}
.tag.non-akademik{ background:#F0E6D8; color:#8A5A22; }
.tag.keagamaan{ background:#E4EEE7; color:var(--hijau-tua); }

.filter-row{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:34px; }
.filter-btn{
  padding:9px 18px; border-radius:999px; border:1px solid var(--garis); background:var(--putih);
  font-weight:600; font-size:13.5px; cursor:pointer; color:var(--tinta-lunak);
}
.filter-btn.active{ background:var(--hijau-tua); color:var(--gading); border-color:var(--hijau-tua); }

/* Ekstrakurikuler */
.ekskul-card{ text-align:center; padding:0; overflow:hidden; }
.ekskul-photo{
  height:132px; position:relative; overflow:hidden;
  background:linear-gradient(135deg,var(--hijau),var(--hijau-tua));
}
.ekskul-photo::after{ content:''; position:absolute; inset:0; opacity:.25; background-image:var(--pat); background-size:70px; }
.ekskul-photo.foto{ background-size:cover; background-position:center; }
.ekskul-photo.foto::after{ content:none; }
.ekskul-card .icon-badge{
  margin:-26px auto 12px; width:52px; height:52px; position:relative; z-index:2;
  background:var(--putih); box-shadow:var(--shadow-1); border:3px solid var(--putih);
}
.ekskul-card .ekskul-body{ padding:0 18px 26px; }
.ekskul-card .ekskul-body h3{ font-size:16.5px; }

/* News / berita */
.berita-card{ overflow:hidden; padding:0; }
.berita-thumb{
  height:150px; position:relative; overflow:hidden;
  background:linear-gradient(135deg,var(--hijau),var(--hijau-tua));
}
.berita-thumb::after{ content:''; position:absolute; inset:0; opacity:.25; background-image:var(--pat); background-size:80px; }
/* Saat sudah ada foto asli: matikan pola dekorasi, foto memenuhi kotak & terpotong rapi */
.berita-thumb.foto{ background-size:cover; background-position:center; }
.berita-thumb.foto::after{ content:none; }
.berita-body{ padding:20px; }
.berita-date{ font-size:12px; color:var(--hijau); font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
.berita-body h3{ font-size:17px; margin:8px 0; }
.berita-body p{ color:var(--tinta-lunak); font-size:13.5px; }

/* Portal / app cards */
.portal-card{
  display:flex; flex-direction:column; gap:14px; padding:28px; border-radius:var(--radius-m);
  background:var(--putih); border:1px solid var(--garis);
}
.portal-card .top{ display:flex; justify-content:space-between; align-items:flex-start; }
.status-pill{ font-size:11px; font-weight:700; padding:4px 10px; border-radius:999px; }
.status-pill.aktif{ background:#E4EEE7; color:var(--hijau-tua); }
.status-pill.segera{ background:#F0E6D8; color:#8A5A22; }
.portal-card .users{ display:flex; gap:6px; flex-wrap:wrap; margin-top:4px; }
.chip{ font-size:11.5px; background:var(--gading-redup); color:var(--tinta-lunak); padding:3px 9px; border-radius:999px; }

/* Timeline (PPDB) */
.timeline{ position:relative; padding-left:34px; }
.timeline::before{ content:''; position:absolute; left:9px; top:6px; bottom:6px; width:2px; background:var(--garis); }
.t-item{ position:relative; padding-bottom:34px; }
.t-item::before{
  content:''; position:absolute; left:-34px; top:2px; width:20px; height:20px; border-radius:50%;
  background:var(--gading); border:3px solid var(--hijau-tua);
}
.t-item h4{ margin:0 0 4px; font-size:16px; }
.t-item span{ font-size:12.5px; color:var(--emas); font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.t-item p{ margin:6px 0 0; color:var(--tinta-lunak); font-size:14px; }

/* Quote / sambutan */
.sambutan{
  display:grid; grid-template-columns:.8fr 1.2fr; gap:48px; align-items:center;
}
.sambutan-photo{
  aspect-ratio:4/5; border-radius:var(--radius-l); background:linear-gradient(160deg,var(--hijau),var(--hijau-tua));
  position:relative; overflow:hidden;
  box-shadow:0 0 0 6px var(--putih), 0 0 0 7px rgba(228,190,106,.5), var(--shadow-2);
}
.sambutan-photo::after{ content:''; position:absolute; inset:0; opacity:.18; background-image:var(--pat); background-size:100px;}
/* Saat sudah ada foto asli kepala madrasah: matikan pola dekorasi, foto memenuhi kotak & terpotong rapi */
.sambutan-photo.foto{ background-size:cover; background-position:top center; }
.sambutan-photo.foto::after{ content:none; }
.sambutan-photo .kepala-caption{
  position:absolute; left:0; right:0; bottom:0; padding:22px 20px 16px; color:var(--putih);
  background:linear-gradient(0deg,rgba(10,31,23,.92) 15%,rgba(10,31,23,.5) 65%,transparent 100%);
}
.sambutan-photo .kepala-caption b{ display:block; font-family:var(--f-display); font-size:17px; }
.sambutan-photo .kepala-caption span{ display:block; font-size:12.5px; color:var(--emas-terang); margin-top:2px; }
.sambutan blockquote{ font-family:var(--f-display); font-style:italic; font-size:22px; line-height:1.5; color:var(--malam); margin:0 0 20px; }
@media (max-width:860px){ .sambutan{grid-template-columns:1fr;} }

/* FAQ accordion */
.faq-item{ border-bottom:1px solid var(--garis); }
.faq-q{
  display:flex; justify-content:space-between; align-items:center; gap:16px; width:100%;
  background:none; border:none; text-align:left; padding:20px 4px; cursor:pointer; font-weight:700; font-size:15.5px; color:var(--malam);
}
.faq-q svg{ transition:.25s ease; flex:none; width:18px; height:18px; color:var(--hijau); }
.faq-item.open .faq-q svg{ transform:rotate(45deg); }
.faq-a{ max-height:0; overflow:hidden; transition:.3s ease; color:var(--tinta-lunak); font-size:14.5px; }
.faq-a p{ padding:0 4px 20px; margin:0; }
.faq-item.open .faq-a{ max-height:300px; }

/* Gallery */
.galeri-tile{
  aspect-ratio:1; border-radius:var(--radius-m); position:relative; overflow:hidden; color:var(--putih);
  display:flex; align-items:flex-end; padding:16px;
}
.galeri-tile::before{ content:''; position:absolute; inset:0; background-image:var(--pat); background-size:70px; opacity:.9; }
.galeri-tile::after{ content:''; position:absolute; inset:0; background:linear-gradient(180deg,transparent 40%, rgba(10,31,23,.75) 100%); }
.galeri-tile span{ position:relative; font-weight:700; font-size:13.5px; }
/* Saat sudah ada foto asli: matikan pola dekorasi, foto memenuhi kotak & terpotong rapi,
   teks caption tetap kebaca karena gradasi gelap (::after) tetap dipertahankan */
.galeri-tile.foto{ background-size:cover; background-position:center; }
.galeri-tile.foto::before{ content:none; }

/* Stat strip */
.strip{ background:var(--hijau-tua); color:var(--gading); }
.strip .grid-4{ text-align:center; }
.strip b{ display:block; font-family:var(--f-display); font-size:34px; color:var(--emas-terang); }
.strip span{ font-size:12.5px; color:#C8D8CD; text-transform:uppercase; letter-spacing:.06em; }

/* Prayer table */
.prayer-table{ width:100%; border-collapse:collapse; }
.prayer-table th,.prayer-table td{ padding:14px 16px; text-align:left; border-bottom:1px solid var(--garis); font-size:14.5px; }
.prayer-table th{ font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--tinta-lunak); }
.prayer-table tr.now td{ background:var(--gading-redup); font-weight:700; }

/* Form */
.form-field{ margin-bottom:18px; }
.form-field label{ display:block; font-size:13.5px; font-weight:700; margin-bottom:6px; color:var(--malam); }
.form-field input, .form-field select, .form-field textarea{
  width:100%; padding:12px 14px; border-radius:10px; border:1px solid var(--garis); font-family:inherit; font-size:14.5px; background:var(--putih);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus{ outline:none; border-color:var(--hijau); box-shadow:0 0 0 3px rgba(31,138,99,.15); }

/* Footer */
.site-footer{ background:var(--malam); color:#B9C7BE; padding:64px 0 0; }
.footer-grid{ display:grid; grid-template-columns:1.4fr 1fr 1fr 1fr; gap:40px; padding-bottom:48px; border-bottom:1px solid rgba(255,255,255,.08); }
.footer-grid h4{ color:var(--putih); font-size:14px; margin-bottom:16px; text-transform:uppercase; letter-spacing:.06em; }
.footer-grid ul li{ margin-bottom:10px; font-size:14px; }
.footer-grid a:hover{ color:var(--emas-terang); }
.footer-brand p{ font-size:14px; max-width:34ch; color:#9FB0A6; }
.footer-logos{ background:rgba(255,255,255,.06); padding:6px 10px; border-radius:12px; }
.footer-logos img{ height:36px; width:auto; border-radius:6px; }
.footer-bottom{ display:flex; justify-content:space-between; padding:22px 0; font-size:12.5px; color:#8AA095; flex-wrap:wrap; gap:10px; }
.social-row{ display:flex; gap:10px; margin-top:16px; }
.social-row a{
  width:36px; height:36px; border-radius:50%; border:1px solid rgba(255,255,255,.18);
  display:flex; align-items:center; justify-content:center;
}
.social-row a:hover{ background:var(--emas); color:var(--malam); border-color:var(--emas); }
.social-row svg{ width:16px; height:16px; }

/* Page hero (inner pages) */
.page-hero{
  background:linear-gradient(160deg, var(--hijau-tua), var(--malam));
  color:var(--gading); padding:64px 0 56px; position:relative; overflow:hidden;
}
.page-hero .container{ position:relative; }
.page-hero .breadcrumb{ font-size:13px; color:#B9C7BE; margin-bottom:14px; }
.page-hero .breadcrumb a:hover{ color:var(--emas-terang); }
.page-hero h1{ color:var(--putih); font-size:clamp(30px,4vw,46px); max-width:20ch; }
.page-hero p{ color:#D8E6DD; max-width:60ch; margin-top:14px; font-size:16px; }

/* Perataan rata kanan-kiri untuk paragraf isi */
.lead, .muted, .sambutan blockquote, .berita-body p, .prog-card p,
.portal-card p, .card p, .section-head p, .footer-brand p, .page-hero p{
  text-align:justify; text-justify:inter-word; hyphens:auto;
}

/* Utility */
.center{ text-align:center; }
.muted{ color:var(--tinta-lunak); }
.mt-0{margin-top:0;}
.divider-gold{ width:64px; height:3px; background:var(--emas); border-radius:3px; margin:0 0 20px; }
.badge-inline{ display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:700; color:var(--hijau-tua); background:var(--gading-redup); padding:5px 12px; border-radius:999px; }

.wa-float{
  position:fixed; right:22px; bottom:22px; z-index:90; width:56px; height:56px; border-radius:50%;
  background:#1F8A63; color:#fff; display:flex; align-items:center; justify-content:center; box-shadow:var(--shadow-2);
}
.wa-float svg{ width:26px; height:26px; }

.back-top{
  display:none; position:fixed; left:22px; bottom:22px; z-index:90; width:48px; height:48px; border-radius:50%;
  background:var(--malam); color:var(--emas-terang); border:none; cursor:pointer; align-items:center; justify-content:center;
  box-shadow:var(--shadow-2); transform:rotate(-90deg);
}

@media (max-width:640px){
  .section{padding:56px 0;}
  .sambutan blockquote{font-size:18px;}
  .footer-grid{grid-template-columns:1fr 1fr; row-gap:32px;}
}
@media (max-width:480px){
  .footer-grid{grid-template-columns:1fr;}
}

/* =========================================================
   INTERAKTIVITAS TAMBAHAN — hover lift, fade-in gambar, lightbox
========================================================= */
.card, .portal-card, .berita-card, .ekskul-card, .prog-card, .galeri-tile{
  transition:transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease;
}
.card:hover, .portal-card:hover, .berita-card:hover, .ekskul-card:hover, .prog-card:hover{
  transform:translateY(-5px);
  box-shadow:var(--shadow-2);
}
.galeri-tile{ cursor:pointer; }
.galeri-tile:hover{ transform:scale(1.02); box-shadow:var(--shadow-2); }
.galeri-tile img, .berita-thumb.foto, .sambutan-photo.foto{
  transition:transform .5s ease;
}
.galeri-tile:hover img{ transform:scale(1.08); }

img[loading]{ opacity:0; transition:opacity .5s ease; }
img[loading].img-loaded, img[loading]:not([data-fade]){ opacity:1; }

/* Lightbox */
.lightbox{
  position:fixed; inset:0; z-index:300; display:none; align-items:center; justify-content:center;
  background:rgba(6,16,12,.92); padding:40px;
}
.lightbox.open{ display:flex; }
.lightbox img{ max-width:min(90vw,1000px); max-height:85vh; border-radius:var(--radius-m); box-shadow:var(--shadow-2); }
.lightbox-close{
  position:absolute; top:22px; right:22px; width:44px; height:44px; border-radius:50%;
  background:rgba(251,246,234,.12); border:1px solid rgba(251,246,234,.3); color:var(--gading);
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.lightbox-close:hover{ background:var(--emas); color:var(--malam); border-color:var(--emas); }
.lightbox-caption{
  position:absolute; bottom:28px; left:0; right:0; text-align:center; color:var(--gading-redup); font-size:13.5px;
}

/* =========================================================
   ARTIKEL BERITA (halaman detail) — berita-detail.html
========================================================= */
.artikel-wrap{ max-width:760px; margin:0 auto; }
.artikel-meta{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; font-size:13px; color:var(--tinta-lunak); margin-bottom:14px; }
.artikel-meta .tag{ margin:0; }
.artikel-cover{ width:100%; aspect-ratio:16/9; border-radius:var(--radius-m); background:var(--gading-redup) center/cover no-repeat; margin:22px 0 30px; box-shadow:var(--shadow-1); }
.artikel-body{ font-size:16px; line-height:1.85; color:var(--tinta); }
.artikel-body p{ margin:0 0 20px; }
.artikel-body h2{ font-size:24px; margin:34px 0 14px; }
.artikel-body h3{ font-size:19px; margin:28px 0 12px; }
.artikel-body ul, .artikel-body ol{ margin:0 0 20px; padding-left:22px; list-style:revert; }
.artikel-body li{ margin-bottom:8px; }
.artikel-body a{ color:var(--hijau-tua); font-weight:700; text-decoration:underline; }
.artikel-body blockquote{
  border-left:3px solid var(--emas); margin:24px 0; padding:4px 22px; font-style:italic;
  font-family:var(--f-display); font-size:18px; color:var(--hijau-tua);
}
.artikel-body img{ width:100%; border-radius:var(--radius-s); margin:10px 0 22px; }
.artikel-penulis{ margin-top:36px; padding-top:20px; border-top:1px solid var(--garis); font-size:13.5px; color:var(--tinta-lunak); }
.artikel-kosong{ text-align:center; padding:60px 0; }

/* =========================================================
   ADMIN — editor teks kaya (rich text) & form konten halaman
========================================================= */
.rich-toolbar{
  display:flex; flex-wrap:wrap; gap:4px; padding:6px; border:1px solid var(--garis); border-bottom:none;
  border-radius:10px 10px 0 0; background:var(--gading-redup);
}
.rich-toolbar button{
  border:1px solid transparent; background:none; border-radius:6px; padding:6px 10px; font-size:13px; font-weight:700;
  cursor:pointer; color:var(--malam); min-width:32px;
}
.rich-toolbar button:hover{ background:var(--putih); border-color:var(--garis); }
.rich-editor{
  min-height:220px; max-height:480px; overflow-y:auto; border:1px solid var(--garis); border-radius:0 0 10px 10px;
  padding:14px 16px; font-size:14.5px; line-height:1.7; background:var(--putih);
}
.rich-editor:focus{ outline:none; box-shadow:0 0 0 3px rgba(31,138,99,.15); }
.rich-editor:empty:before{ content:attr(data-placeholder); color:var(--tinta-lunak); }
.rich-editor h2{ font-size:19px; } .rich-editor h3{ font-size:16.5px; }
.rich-editor ul, .rich-editor ol{ padding-left:20px; list-style:revert; margin:0 0 10px; }
.rich-editor p{ margin:0 0 10px; }
.cms-field-row{ padding:16px 0; border-bottom:1px solid var(--garis); }
.cms-field-row:last-child{ border-bottom:none; }
.cms-field-row label{ display:block; font-size:13.5px; font-weight:700; margin-bottom:6px; color:var(--malam); }
.cms-field-row input[type="text"], .cms-field-row textarea{
  width:100%; padding:12px 14px; border-radius:10px; border:1px solid var(--garis);
  font-family:inherit; font-size:14.5px; background:var(--putih); box-sizing:border-box;
}
.cms-field-row input[type="text"]:focus, .cms-field-row textarea:focus{
  outline:none; border-color:var(--hijau); box-shadow:0 0 0 3px rgba(31,138,99,.15);
}
.cms-field-row .grid-3, .cms-field-row .grid-2{ margin-top:2px; }
.cms-field-row .hint{ font-size:12px; color:var(--tinta-lunak); margin-top:5px; }
.cms-save-bar{ display:flex; align-items:center; gap:14px; margin-top:22px; }
.cms-save-status{ font-size:12.5px; color:var(--hijau-tua); }

/* =========================================================
   GALERI — penanda video & lightbox pemutar foto/video
========================================================= */
.galeri-tile.galeri-video .galeri-play{
  position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); z-index:2;
  width:52px; height:52px; border-radius:50%; background:rgba(10,31,23,.55);
  display:flex; align-items:center; justify-content:center; color:#fff;
  border:1.5px solid rgba(251,246,234,.6); transition:transform .25s ease, background .25s ease;
}
.galeri-tile.galeri-video:hover .galeri-play{ background:var(--emas); color:var(--malam); transform:translate(-50%,-50%) scale(1.08); }
.galeri-tag-video{
  position:absolute; top:12px; left:12px; z-index:2; font-size:10.5px; font-weight:700; letter-spacing:.04em;
  text-transform:uppercase; background:rgba(10,31,23,.7); color:#fff; padding:3px 9px; border-radius:6px;
}

.lb-overlay{
  position:fixed; inset:0; z-index:400; background:rgba(10,20,16,.92);
  display:flex; align-items:center; justify-content:center; padding:24px;
  animation:lbFade .2s ease;
}
@keyframes lbFade{ from{opacity:0;} to{opacity:1;} }
.lb-box{ position:relative; max-width:920px; width:100%; }
.lb-media{ width:100%; border-radius:var(--radius-m); overflow:hidden; background:#000; box-shadow:var(--shadow-2); }
.lb-media img{ display:block; width:100%; max-height:82vh; object-fit:contain; }
.lb-media video{ display:block; width:100%; max-height:82vh; }
.lb-media-16x9{ aspect-ratio:16/9; }
.lb-media-16x9 iframe, .lb-media-16x9 video{ width:100%; height:100%; border:0; }
.lb-caption{ color:#EDE7D6; text-align:center; margin-top:14px; font-size:14px; }
.lb-close{
  position:absolute; top:10px; right:10px; width:38px; height:38px; border-radius:50%;
  background:rgba(10,20,16,.55); color:#fff; border:1px solid rgba(251,246,234,.4);
  font-size:22px; line-height:1; cursor:pointer; z-index:2;
}
.lb-close:hover{ background:var(--emas); color:var(--malam); border-color:var(--emas); }

/* =========================================================
   PERBAIKAN TAMPILAN MOBILE (HP & TABLET)
========================================================= */
html, body{ overflow-x:hidden; max-width:100%; }

/* Cegah Safari iOS otomatis memperbesar (zoom) halaman saat sebuah
   input/textarea disentuh — ini terjadi kalau font-size elemen form
   di bawah 16px. Ukuran font desktop yang lebih ringkas (14.5px) tetap
   dipakai di layar lebar; di HP dinaikkan ke 16px supaya tidak zoom. */
@media (max-width:640px){
  .form-field input, .form-field select, .form-field textarea,
  .cms-field-row input[type="text"], .cms-field-row textarea,
  .rich-editor, #galeri-youtube-url{
    font-size:16px;
  }
}

/* Tabel data (jadwal, identitas madrasah, dsb) — jaga supaya tetap
   nyaman dibaca & tidak mendorong halaman melebar di layar sempit. */
.prayer-table th, .prayer-table td{ word-break:break-word; }
@media (max-width:480px){
  .prayer-table th, .prayer-table td{ padding:11px 10px; font-size:13.5px; }
}

/* Baris pilihan "Jenis Media" (Foto / Unggah Video / Tautan YouTube)
   di dashboard admin — jaga agar tidak menyempit & saling tumpang
   tindih di layar HP/tablet. */
.media-jenis-row{ flex-wrap:wrap; row-gap:10px; }

/* Grid form admin (kolom form di kiri, daftar isi di kanan) sudah
   menumpuk jadi 1 kolom di bawah 900px lewat .admin-grid — pastikan
   kartu & tombol aksinya tetap penuh lebar & mudah disentuh di HP. */
@media (max-width:640px){
  .admin-card{ padding:18px; }
  .form-actions{ flex-wrap:wrap; }
  .form-actions .btn{ flex:1 1 auto; }
  .rich-toolbar button{ padding:8px 11px; }
}
