/* ==========================================================================
   Pondok Pesantren — tema hijau & emas (islami, formal)
   ========================================================================== */
:root {
    --green-950: #07271c;
    --green-900: #0b3d2c;
    --green-800: #0f5132;
    --green-700: #12684a;
    --green-600: #15885c;
    --green-100: #e3f1e9;
    --gold: #c9a227;
    --gold-2: #e0bd55;
    --gold-soft: #f6ecc9;
    --cream: #f8f7f1;
    --paper: #ffffff;
    --ink: #17251f;
    --muted: #5b6b63;
    --line: #e5e2d5;
    --shadow: 0 10px 30px rgba(11, 61, 44, 0.08);
    --shadow-lg: 0 18px 46px rgba(11, 61, 44, 0.14);
    --radius: 16px;
    --radius-sm: 10px;
    --wrap: 1180px;
    --serif: Georgia, 'Times New Roman', 'Noto Serif', serif;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--ink);
    background: var(--cream);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--gold); }

h1, h2, h3, h4 {
    font-family: var(--serif);
    color: var(--green-900);
    line-height: 1.3;
    margin: 0 0 .6em;
    font-weight: 700;
}

h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.85rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; background: #fff; padding: 8px 14px; border-radius: 8px; z-index: 99; }

/* ------------------------------- Top bar ------------------------------- */
.topbar {
    background: var(--green-950);
    color: #cfe6da;
    font-size: .82rem;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 42px; flex-wrap: wrap; }
.topbar-info { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.topbar-info span { display: inline-flex; align-items: center; gap: 6px; }
.topbar-social { display: flex; gap: 8px; }
.topbar-social a {
    width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, .1); color: #e8f3ed; font-size: .72rem;
}
.topbar-social a:hover { background: var(--gold); color: #221c04; }

/* ------------------------------- Header ------------------------------- */
.site-header { background: var(--paper); border-bottom: 3px solid var(--gold); position: relative; z-index: 30; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo {
    width: 58px; height: 58px; border-radius: 14px; flex: 0 0 auto;
    background: linear-gradient(135deg, var(--green-800), var(--green-600));
    border: 2px solid var(--gold);
    display: grid; place-items: center;
    color: var(--gold-2); font-family: var(--serif); font-size: 1.5rem; font-weight: 700;
}
.brand-text strong { display: block; font-family: var(--serif); font-size: 1.18rem; color: var(--green-900); line-height: 1.25; }
.brand-text small { color: var(--muted); font-size: .8rem; }
.brand-sub { display: block; color: var(--gold); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; }
.header-cta { display: flex; align-items: center; gap: 10px; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 20px; border-radius: 999px; border: 0; cursor: pointer;
    font: inherit; font-weight: 600; font-size: .9rem;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: linear-gradient(135deg, var(--green-800), var(--green-600)); color: #fff; box-shadow: 0 8px 20px rgba(15, 81, 50, .22); }
.btn-primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 12px 26px rgba(15, 81, 50, .28); }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #2a2205; }
.btn-gold:hover { color: #2a2205; transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--green-800); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--green-600); color: var(--green-700); }
.btn-sm { padding: 7px 14px; font-size: .82rem; }
.btn-danger { background: #b42318; color: #fff; }
.btn-danger:hover { color: #fff; }

/* ------------------------------- Nav ------------------------------- */
.main-nav { background: linear-gradient(180deg, var(--green-800), var(--green-900)); position: relative; z-index: 25; }
.main-nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nav-list { display: flex; align-items: stretch; margin: 0; padding: 0; list-style: none; flex-wrap: wrap; }
.nav-list > li { position: relative; }
.nav-list > li > a {
    display: flex; align-items: center; gap: 6px;
    padding: 15px 16px; color: #eaf4ee; font-weight: 600; font-size: .9rem;
}
.nav-list > li > a:hover, .nav-list > li.is-active > a { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-list > li.is-active > a { box-shadow: inset 0 -3px 0 var(--gold); }
.caret { font-size: .6rem; opacity: .8; }
.submenu {
    position: absolute; top: 100%; left: 0; min-width: 250px;
    background: #fff; border-top: 3px solid var(--gold);
    border-radius: 0 0 12px 12px; box-shadow: var(--shadow-lg);
    list-style: none; margin: 0; padding: 8px; display: none;
}
.nav-list > li:hover > .submenu, .nav-list > li:focus-within > .submenu { display: block; }
.submenu li a { display: block; padding: 9px 14px; border-radius: 8px; color: var(--ink); font-size: .87rem; font-weight: 500; }
.submenu li a:hover { background: var(--green-100); color: var(--green-800); }
.nav-toggle {
    display: none; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25);
    color: #fff; border-radius: 10px; padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer;
}
.nav-search { display: flex; align-items: center; }
.nav-search input {
    border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .12);
    color: #fff; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: .82rem; width: 170px;
}
.nav-search input::placeholder { color: #cfe6da; }

/* ---------------------------- Running text ---------------------------- */
.running { background: var(--gold-soft); border-bottom: 1px solid #e7d79c; overflow: hidden; }
.running .wrap { display: flex; align-items: center; gap: 14px; min-height: 44px; }
.running-label {
    background: var(--green-800); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; padding: 5px 12px; border-radius: 999px; flex: 0 0 auto;
}
.running-track { overflow: hidden; white-space: nowrap; flex: 1; }
.running-track span { display: inline-block; padding-left: 100%; animation: slide 32s linear infinite; font-size: .87rem; color: #4b3d09; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* ------------------------------- Hero ------------------------------- */
.hero { position: relative; color: #fff; overflow: hidden; background: var(--green-900); }
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.hero-bg::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(100deg, rgba(7, 39, 28, .94) 8%, rgba(15, 81, 50, .78) 55%, rgba(15, 81, 50, .45) 100%);
}
.hero .wrap { position: relative; padding-top: 72px; padding-bottom: 72px; display: grid; gap: 34px; grid-template-columns: 1.25fr .85fr; align-items: center; }
.hero h1 { color: #fff; margin-bottom: .35em; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px; color: var(--gold-2);
    font-size: .76rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; margin-bottom: 14px;
}
.eyebrow::before { content: ''; width: 26px; height: 2px; background: var(--gold); display: inline-block; }
.hero p.lead { font-size: 1.02rem; color: #dcece3; max-width: 58ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.quote-card {
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22);
    backdrop-filter: blur(8px); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-lg);
}
.quote-card .ar { font-family: var(--serif); font-size: 1.7rem; color: var(--gold-2); direction: rtl; text-align: right; margin-bottom: 12px; }
.quote-card .id { color: #eaf3ee; font-style: italic; }
.quote-card .src { margin-top: 14px; font-size: .8rem; color: var(--gold-2); }

/* ------------------------------ Stats ------------------------------ */
.stats { background: var(--green-950); color: #fff; }
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding-top: 26px; padding-bottom: 26px; }
.stat { text-align: center; border-right: 1px solid rgba(255, 255, 255, .12); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2.1rem); color: var(--gold-2); }
.stat span { font-size: .8rem; color: #bcd6c8; letter-spacing: .06em; text-transform: uppercase; }

/* ---------------------------- Sections ---------------------------- */
.section { padding: 62px 0; }
.section.alt { background: #fff; }
.section.dark { background: var(--green-900); color: #e8f2ec; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head.center { flex-direction: column; align-items: center; text-align: center; }
.section-head p { color: var(--muted); max-width: 62ch; margin: 0; }
.section.dark .section-head p, .section.dark h2 { color: #eaf4ee; }
.section-title h2 { margin-bottom: .18em; }
.section-title .orn { display: flex; align-items: center; gap: 8px; }
.section-title .orn i { width: 34px; height: 2px; background: var(--gold); display: block; }
.section-title .orn i:first-child { width: 12px; }
.section-title .orn i:last-child { width: 12px; }
.section-title.center .orn { justify-content: center; }
.more-link { color: var(--green-700); font-weight: 600; font-size: .9rem; }

/* ------------------------------ Cards ------------------------------ */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-thumb { position: relative; aspect-ratio: 16 / 10; background: var(--green-100); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-thumb img { transform: scale(1.05); }
.card-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.06rem; }
.card-body p { margin: 0; color: var(--muted); font-size: .9rem; }
.card-meta { display: flex; align-items: center; gap: 10px; font-size: .78rem; color: var(--muted); margin-top: auto; flex-wrap: wrap; }
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .7rem; font-weight: 700;
    background: var(--green-100); color: var(--green-800); letter-spacing: .04em; text-transform: uppercase;
}
.badge.gold { background: var(--gold-soft); color: #7a6109; }
.badge.soft { background: #eef1ee; color: var(--muted); }

/* Post kecil (daftar) */
.mini-list { display: grid; gap: 18px; }
.mini { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.mini img { width: 96px; height: 76px; object-fit: cover; border-radius: 12px; }
.mini h4 { margin: 0 0 4px; font-family: var(--serif); font-size: .98rem; color: var(--ink); }
.mini small { color: var(--muted); font-size: .76rem; }
.mini:hover h4 { color: var(--green-700); }

/* --------------------------- Layout dua kolom --------------------------- */
.layout { display: grid; grid-template-columns: 290px 1fr; gap: 32px; align-items: start; }
.sidebar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: sticky; top: 18px; }
.sidebar-head { background: linear-gradient(135deg, var(--green-800), var(--green-700)); color: #fff; padding: 18px 20px; }
.sidebar-head b { display: block; font-family: var(--serif); font-size: 1.02rem; }
.sidebar-head small { color: #cfe6da; font-size: .76rem; }
.sidebar-nav { list-style: none; margin: 0; padding: 10px; display: grid; gap: 4px; }
.sidebar-nav a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 9px; color: var(--ink); font-size: .88rem; font-weight: 500; }
.sidebar-nav a:hover { background: var(--green-100); color: var(--green-800); }
.sidebar-nav a.is-active { background: var(--green-800); color: #fff; }
.sidebar-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-top: 22px; }
.sidebar-box h4 { margin-top: 0; }

.content-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; }
.prose { font-size: 1rem; }
.prose h2, .prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose blockquote {
    margin: 1.2em 0; padding: 16px 20px; background: var(--green-100); border-left: 4px solid var(--gold);
    border-radius: 0 12px 12px 0; font-style: italic; color: var(--green-900);
}
.prose img { border-radius: 12px; margin: 1em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .92rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.prose th { background: var(--green-100); color: var(--green-900); }

.page-hero { position: relative; color: #fff; background: var(--green-900); overflow: hidden; }
.page-hero .bg { position: absolute; inset: 0; }
.page-hero .bg img { width: 100%; height: 100%; object-fit: cover; opacity: .38; }
.page-hero .bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(7, 39, 28, .92), rgba(15, 81, 50, .55)); }
.page-hero .wrap { position: relative; padding: 52px 20px; }
.page-hero h1 { color: #fff; margin-bottom: .2em; }
.page-hero p { color: #d6e8de; margin: 0; }

.breadcrumb { font-size: .8rem; color: #b9d3c6; display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.breadcrumb a { color: var(--gold-2); }

/* ------------------------------ Galeri ------------------------------ */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.gallery-item { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #000; }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .4s ease, opacity .3s ease; }
.gallery-item:hover img { transform: scale(1.06); opacity: .85; }
.gallery-cap {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 16px 14px; color: #fff;
    background: linear-gradient(transparent, rgba(7, 39, 28, .88)); font-size: .86rem;
}
.gallery-cap small { display: block; color: #cfe6da; font-size: .72rem; }
.albums { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.chip { padding: 7px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .84rem; font-weight: 600; color: var(--ink); }
.chip.is-active, .chip:hover { background: var(--green-800); color: #fff; border-color: var(--green-800); }

/* ------------------------------ Agenda ------------------------------ */
.agenda-list { display: grid; gap: 18px; }
.agenda-item {
    display: grid; grid-template-columns: 96px 1fr auto; gap: 20px; align-items: center;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow);
}
.agenda-date {
    text-align: center; background: var(--green-800); color: #fff; border-radius: 12px; padding: 10px 6px;
    border-bottom: 3px solid var(--gold);
}
.agenda-date b { display: block; font-family: var(--serif); font-size: 1.7rem; line-height: 1; color: var(--gold-2); }
.agenda-date span { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; }
.agenda-item h3 { margin: 0 0 4px; font-size: 1.05rem; }
.agenda-item p { margin: 0; color: var(--muted); font-size: .88rem; }
.agenda-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-top: 6px; }

/* ------------------------------ Fasilitas ------------------------------ */
.facility { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.facility img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.facility .body { padding: 18px; }

/* ------------------------------ Guru ------------------------------ */
.teacher { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 18px; box-shadow: var(--shadow); }
.teacher img { width: 108px; height: 108px; border-radius: 50%; object-fit: cover; margin: 0 auto 14px; border: 3px solid var(--gold-soft); }
.teacher h3 { margin: 0 0 2px; font-size: 1rem; }
.teacher .pos { color: var(--green-700); font-size: .82rem; font-weight: 600; }
.teacher p { color: var(--muted); font-size: .84rem; margin: 10px 0 0; }

/* ------------------------------ Prestasi ------------------------------ */
.achv { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.achv-item { display: grid; grid-template-columns: 74px 1fr; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.achv-medal { width: 74px; height: 74px; border-radius: 16px; background: linear-gradient(135deg, var(--gold), var(--gold-2)); display: grid; place-items: center; color: #3a2d05; font-family: var(--serif); font-size: 1.5rem; font-weight: 700; }

/* ------------------------------ PPDB CTA ------------------------------ */
.ppdb { background: linear-gradient(120deg, var(--green-800), var(--green-600)); color: #fff; border-radius: var(--radius); padding: 40px; display: flex; align-items: center; justify-content: space-between; gap: 30px; box-shadow: var(--shadow-lg); }
.ppdb h2 { color: #fff; margin-bottom: .25em; }
.ppdb p { color: #dcece3; margin: 0; }

/* ------------------------------ Kontak ------------------------------ */
.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 28px; align-items: start; }
.info-item { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px dashed var(--line); }
.info-item:last-child { border-bottom: 0; }
.info-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--green-100); color: var(--green-800); display: grid; place-items: center; font-weight: 700; }
.info-item b { display: block; font-family: var(--serif); }
.info-item span { color: var(--muted); font-size: .88rem; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 600; font-size: .84rem; margin-bottom: 6px; color: var(--green-900); }
.input, textarea.input, select.input {
    width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    font: inherit; font-size: .92rem; background: #fff; color: var(--ink);
}
.input:focus, textarea.input:focus, select.input:focus { outline: 2px solid var(--green-600); outline-offset: 1px; border-color: var(--green-600); }
textarea.input { min-height: 130px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.alert { border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 20px; font-size: .9rem; border: 1px solid transparent; }
.alert-success { background: #e7f5ec; border-color: #b6e0c5; color: #14532d; }
.alert-error { background: #fdecea; border-color: #f5c2bd; color: #a01c10; }
.alert-info { background: var(--gold-soft); border-color: #e7d79c; color: #6d5507; }

/* ------------------------------ Pager ------------------------------ */
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pager-link { min-width: 40px; text-align: center; padding: 9px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: .86rem; }
.pager-link:hover { border-color: var(--green-600); color: var(--green-800); }
.pager-link.is-active { background: var(--green-800); color: #fff; border-color: var(--green-800); }

/* ------------------------------ Footer ------------------------------ */
.site-footer { background: var(--green-950); color: #bcd6c8; padding-top: 52px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 32px; padding-bottom: 36px; }
.site-footer h4 { color: #fff; font-size: .95rem; letter-spacing: .04em; margin-bottom: 16px; }
.site-footer a { color: #bcd6c8; font-size: .88rem; }
.site-footer a:hover { color: var(--gold-2); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer-brand strong { color: #fff; font-family: var(--serif); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); padding: 18px 0; font-size: .82rem; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* --------------------------- Tombol edit admin --------------------------- */
.edit-float {
    display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700;
    background: var(--gold); color: #2a2205; padding: 4px 12px; border-radius: 999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18); vertical-align: middle;
}
.edit-float .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-800); display: inline-block; }
.edit-float:hover { background: #f0d27a; color: #2a2205; }
.edit-bar { background: #2a2205; color: #f6ecc9; font-size: .82rem; padding: 8px 0; }
.edit-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.edit-bar a { color: #f0d27a; font-weight: 700; }

/* ------------------------------ Utilitas ------------------------------ */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
.detail-img { width: 100%; border-radius: var(--radius); margin-bottom: 22px; box-shadow: var(--shadow); }
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { text-align: center; padding: 50px 20px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }

/* ------------------------------ Logo pesantren ------------------------------ */
.brand-logo-img {
    width: 60px; height: 60px; flex: 0 0 auto; object-fit: contain;
    border-radius: 14px; background: #fff; border: 1px solid var(--line); padding: 4px;
}
.footer-logo { width: 52px; height: 52px; background: rgba(255, 255, 255, .92); }

/* ------------------------------ Foto & tulisan ------------------------------ */
.foto-tulisan { display: grid; grid-template-columns: .85fr 1.15fr; gap: 26px; align-items: start; }
.foto { margin: 0; }
.foto img { width: 100%; border-radius: 14px; box-shadow: var(--shadow-lg); object-fit: cover; }
.foto figcaption { font-size: .78rem; color: var(--muted); margin-top: 10px; font-style: italic; }
.foto-tulisan .tulisan { min-width: 0; }
.foto-tulisan:not(:has(.foto)) { grid-template-columns: 1fr; }

/* ------------------------------ Agenda detail ------------------------------ */
.agenda-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 18px 0 22px; }
.fact { background: var(--green-100); border-radius: 12px; padding: 12px 16px; border-left: 3px solid var(--gold); }
.fact-label { display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--green-700); font-weight: 700; }
.fact strong { font-family: var(--serif); color: var(--green-900); font-size: .95rem; }
.agenda-item h3 a { color: inherit; }
.agenda-item h3 a:hover { color: var(--green-600); }

/* ------------------------------ Pendaftaran (PPDB) ------------------------------ */
.ppdb-nav { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.ppdb-tab {
    display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px;
    background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: .88rem; color: var(--ink);
    box-shadow: var(--shadow);
}
.ppdb-tab:hover { border-color: var(--green-600); color: var(--green-800); }
.ppdb-tab.is-active { background: linear-gradient(135deg, var(--green-800), var(--green-600)); color: #fff; border-color: var(--green-800); }
.ppdb-tab .ico { font-size: 1rem; }

.steps { display: grid; gap: 16px; margin-top: 22px; }
.step-card {
    display: grid; grid-template-columns: 54px 1fr; gap: 18px; align-items: start;
    background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--gold);
    border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
}
.step-card.compact { padding: 12px 16px; }
.step-card h3 { margin: 0 0 4px; font-size: 1.02rem; }
.step-card p { margin: 0; font-size: .9rem; }
.step-no {
    width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--green-800), var(--green-600)); color: var(--gold-2);
    font-family: var(--serif); font-size: 1.25rem; font-weight: 700;
}
.ppdb-help { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 24px; }
.ppdb-help > div { background: var(--green-100); border-radius: var(--radius); padding: 20px; }
.ppdb-help h3 { margin: 0 0 8px; font-size: .98rem; }
.ppdb-foot { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.inline-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 24px; }

.form-section { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 0 0 22px; background: #fff; }
.form-section legend {
    display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 700;
    color: var(--green-900); font-size: 1rem; padding: 0 10px;
}
.form-section legend span {
    width: 26px; height: 26px; border-radius: 8px; background: var(--green-800); color: var(--gold-2);
    display: grid; place-items: center; font-size: .82rem; font-family: var(--sans);
}
.form-row.full { grid-column: 1 / -1; }
.check-line {
    display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start;
    font-size: .9rem; color: var(--ink); background: var(--gold-soft); border-radius: 12px; padding: 14px 16px;
}
.check-line input { width: 20px; height: 20px; accent-color: var(--green-700); margin-top: 2px; }
.num-list { padding-left: 1.3em; }
.num-list li { margin-bottom: .5em; }

.success-panel { text-align: center; }
.success-badge {
    width: 62px; height: 62px; margin: 0 auto 16px; border-radius: 50%;
    background: linear-gradient(135deg, var(--green-800), var(--green-600)); color: var(--gold-2);
    display: grid; place-items: center; font-size: 1.8rem; font-weight: 700;
}
.reg-no {
    display: inline-block; background: var(--gold-soft); border: 1px dashed var(--gold);
    border-radius: 14px; padding: 14px 28px; margin: 12px 0 18px;
}
.reg-no span { display: block; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: #7a6109; }
.reg-no b { font-family: var(--serif); font-size: 1.5rem; color: var(--green-900); }
.success-panel .steps, .success-panel .inline-actions { text-align: left; }

.submenu li a.is-active { background: var(--green-100); color: var(--green-800); font-weight: 700; }

/* ------------------------------ Bagan struktur ------------------------------ */
.struktur { margin: 0 0 20px; }
.struktur img {
    width: 100%; border-radius: 16px; border: 1px solid var(--line); background: #fff;
    box-shadow: var(--shadow-lg); cursor: zoom-in; padding: 10px;
}
.struktur figcaption {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    margin-top: 12px; font-size: .86rem; color: var(--muted);
}
.zoom-btn {
    background: var(--green-100); border: 1px solid var(--green-600); color: var(--green-800);
    border-radius: 999px; padding: 7px 16px; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer;
}
.zoom-btn:hover { background: var(--green-800); color: #fff; }
.zoom-hint { font-size: .8rem; color: var(--muted); margin: 0 0 22px; }

.duty-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.duty-mini {
    display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center;
    background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow);
}
.duty-mini img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.duty-mini strong { display: block; font-family: var(--serif); color: var(--green-900); font-size: .95rem; }
.duty-mini span { font-size: .82rem; color: var(--muted); }

/* ------------------------------ Daftar tugas pokok ------------------------------ */
.duty-list { display: grid; gap: 22px; margin-top: 24px; }
.duty-card {
    display: grid; grid-template-columns: 210px 1fr; gap: 24px; align-items: start;
    background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--gold);
    border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
    scroll-margin-top: 90px;
}
.duty-foto { margin: 0; }
.duty-foto img {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 14px;
    border: 1px solid var(--line); cursor: zoom-in;
}
.duty-body h3 { margin: 12px 0 8px; font-size: 1.1rem; }
.duty-text { font-size: .93rem; }
.duty-text p { margin: 0 0 .6em; }
.duty-text ol, .duty-text ul { padding-left: 1.25em; margin: 0; }
.duty-text li { margin-bottom: .35em; }

/* ------------------------------ Lightbox ------------------------------ */
.lightbox {
    position: fixed; inset: 0; z-index: 999; background: rgba(7, 39, 28, .93);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    padding: 26px; cursor: zoom-out;
}
.lightbox img {
    max-width: min(1200px, 94vw); max-height: 84vh; border-radius: 14px;
    background: #fff; padding: 8px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.lightbox-note { color: #cfe6da; font-size: .8rem; }
.lightbox-close {
    position: absolute; top: 16px; right: 22px; color: #fff; font-size: 2rem; line-height: 1;
    cursor: pointer;
}

/* ------------------------------ Responsif ------------------------------ */
@media (max-width: 1024px) {
    .hero .wrap { grid-template-columns: 1fr; }
    .layout, .detail-grid, .contact-grid { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
    .sidebar { position: static; }
}

@media (max-width: 760px) {
    .nav-toggle { display: inline-block; }
    .main-nav .wrap { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
    .nav-list { display: none; width: 100%; flex-direction: column; }
    .nav-list.is-open { display: flex; }
    .submenu { position: static; box-shadow: none; border-top: 0; background: rgba(255, 255, 255, .06); border-radius: 10px; padding: 6px; }
    .nav-list > li:hover > .submenu { display: none; }
    .nav-list > li.is-open > .submenu { display: block; }
    .submenu li a { color: #e8f2ec; }
    .submenu li a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
    .nav-search { width: 100%; margin-bottom: 10px; }
    .nav-search input { width: 100%; }
    .stats .wrap { grid-template-columns: repeat(2, 1fr); }
    .stat { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .12); padding-bottom: 12px; }
    .grid-3, .grid-4, .grid-2, .gallery-grid, .achv, .form-grid { grid-template-columns: 1fr; }
    .agenda-item { grid-template-columns: 74px 1fr; }
    .ppdb { flex-direction: column; text-align: center; padding: 30px 22px; }
    .section { padding: 44px 0; }
    .content-panel { padding: 22px; }
    .hero .wrap { padding-top: 52px; padding-bottom: 52px; }
    .footer-grid { grid-template-columns: 1fr; }
    .site-header .wrap { flex-wrap: wrap; }
    .foto-tulisan { grid-template-columns: 1fr; }
    .duty-grid { grid-template-columns: 1fr; }
    .duty-card { grid-template-columns: 1fr; gap: 16px; padding: 18px; }
    .duty-foto img { max-width: 260px; }
    .agenda-facts { grid-template-columns: 1fr; }
    .ppdb-help { grid-template-columns: 1fr; }
    .form-section { padding: 18px 14px; }
    .step-card { grid-template-columns: 44px 1fr; gap: 14px; padding: 16px; }
    .step-no { width: 38px; height: 38px; font-size: 1.05rem; }
    .ppdb-tab { padding: 9px 14px; font-size: .84rem; }
    .reg-no { padding: 12px 18px; }
    .reg-no b { font-size: 1.2rem; }
}
