:root{--maroon:#8b0000;--maroon-d:#5f0010;--maroon-s:#fdecee;--gold:#b7791f;--gold-s:#fef3c7;--blue:#4f46e5;--blue-s:#e0e7ff;--ink:#111827;--mute:#6b7280;--bg:#f5f6fb;--card:#fff;--line:#e5e7eb;--navy:#1e293b}
*{box-sizing:border-box;margin:0;padding:0}
html,body{overflow-x:hidden}
html{scroll-behavior:smooth;scroll-padding-top:120px}
body{font-family:Inter,system-ui,sans-serif;background:var(--bg);color:var(--ink);max-width:480px;margin:0 auto;line-height:1.5;font-size:14px}
a{color:inherit;text-decoration:none}
button{font:inherit;border:0;background:none;cursor:pointer;color:inherit}
small{font-size:11px;color:var(--mute);display:block}
:focus-visible{outline:2px solid var(--gold);outline-offset:2px}

.topbar{background:var(--maroon);color:#fff;font-size:10px;padding:4px 14px;text-align:center}
.header{position:sticky;top:0;z-index:30;background:#fff;display:flex;justify-content:space-between;align-items:center;padding:10px 14px;box-shadow:0 1px 6px rgba(0,0,0,.08)}
.brand{display:flex;gap:10px;align-items:center}
.brand strong{display:block;color:var(--maroon);font-size:15px;font-weight:800;line-height:1.1}
.logo{width:42px;height:42px;border-radius:50%;background:#fff;display:grid;place-items:center;flex:none;overflow:hidden;box-shadow:0 0 0 1px var(--line)}
.logo img{width:100%;height:100%;object-fit:cover}
.icon-btn{width:38px;height:38px;border-radius:12px;background:var(--bg);font-size:16px}

.overlay{position:fixed;inset:0;background:rgba(15,23,42,.65);opacity:0;pointer-events:none;transition:opacity .25s;z-index:40}
.overlay.show{opacity:1;pointer-events:auto}
.drawer{position:fixed;top:0;bottom:0;left:0;width:78%;max-width:300px;background:#fff;z-index:50;transform:translateX(-100%);transition:transform .28s;display:flex;flex-direction:column}
.drawer.open{transform:none}
.drawer-head{background:var(--maroon);color:#fff;padding:16px;display:flex;gap:10px;align-items:center;position:relative}
.drawer-head small{color:#fbd5d5}
.drawer-head .logo{background:#fff;color:var(--maroon)}
.close-btn{margin-left:auto;width:34px;height:34px;border-radius:50%;background:rgba(255,255,255,.18);color:#fff}
.close-btn.dark{background:var(--bg);color:var(--ink);position:absolute;top:12px;right:12px}
.drawer nav{flex:1;padding:8px 0}
.drawer nav a{display:flex;gap:12px;align-items:center;padding:14px 20px;font-weight:600;font-size:13px}
.drawer nav a i{color:var(--maroon);width:18px}
.drawer nav a:hover{background:var(--maroon-s)}
.drawer-foot{background:var(--blue-s);padding:14px 20px}

.hero {
  min-height: 340px;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: linear-gradient(
    180deg,
    rgba(95,0,16,.3),
    rgba(60,0,10,.92)
), url("../images/foto-sekolah.jpg") center/cover no-repeat;
}

.hero-body {
  padding: 24px 18px 46px;
}

.hero h1{font-size:34px;font-weight:800;letter-spacing:-.03em;margin:10px 0 6px}
.hero p{font-size:14px;opacity:.92;margin-bottom:16px}
.chips{display:flex;gap:6px;flex-wrap:wrap}
.chip{background:rgba(255,255,255,.92);color:var(--ink);font-size:10px;font-weight:700;padding:4px 10px;border-radius:99px}
.chip.red{color:var(--maroon)}
.chip.dark{background:rgba(255,255,255,.12);color:#fff}
.btn{display:inline-block;background:var(--maroon);color:#fff;font-weight:700;padding:12px 20px;border-radius:12px;box-shadow:0 6px 16px rgba(0,0,0,.3)}
.btn:hover{background:#a10012}

.sheet{background:var(--bg);border-radius:24px 24px 0 0;margin-top:-24px;position:relative;padding:14px 14px 20px}
.card{background:var(--card);border-radius:18px;box-shadow:0 1px 4px rgba(17,24,39,.07);padding:14px}
.card.mt{margin-top:15px}
.sec{display:flex;justify-content:space-between;align-items:baseline;font-size:17px;font-weight:800;margin:26px 0 12px;padding-left:10px;border-left:4px solid var(--maroon);line-height:1.1}
.sec small{font-size:10px;font-weight:600}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
.grid2.tight{margin:12px 0 10px}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.red-t{color:var(--maroon)}.gold-t{color:var(--gold)}
.badge{display:inline-block;font-size:10px;font-weight:800;padding:3px 9px;border-radius:99px}
.badge.gold{background:var(--gold-s);color:#92400e}
.tile{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;flex:none}
.tile.blue{background:var(--blue-s);color:var(--blue)}.tile.red{background:var(--maroon);color:#fff}.tile.gold{background:var(--gold-s);color:var(--gold)}
.tile.round{border-radius:50%}
.label{font-weight:800;color:var(--maroon);margin-bottom:2px}

.welcome{display:flex;gap:12px}
.welcome p{font-size:13px}

/* Data pokok: selalu 3 kolom (HP & laptop) */
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;width:100%}
.stat{display:block;color:inherit;cursor:pointer;transition:transform .15s}
.stat:active{transform:scale(.97)}
.stat b{display:block;font-size:26px;font-weight:800;margin:4px 0 8px}
.stat em{font-size:11px;font-weight:500;color:var(--mute);font-style:normal}
.stat .foot{display:block;background:var(--bg);border-radius:8px;padding:5px 8px;font-size:10px;text-align:center;color:var(--mute)}
.legal-head{display:flex;gap:10px;align-items:center}
.legal-head div{flex:1}.legal-head strong{font-size:13px;display:block}
.cell{background:var(--blue-s);border-radius:12px;padding:10px}
.cell b{font-size:13px}
.note{background:var(--maroon-s);border-radius:12px;padding:10px 12px;font-size:11px;font-weight:600;color:var(--maroon)}

.quick{background:#fff;border-radius:16px;padding:14px 6px;display:flex;flex-direction:column;align-items:center;gap:4px;text-align:center;box-shadow:0 1px 4px rgba(17,24,39,.07);transition:transform .15s}
.quick:active{transform:scale(.96)}
.quick b{font-size:12px}.quick small{font-size:10px}

.announce{background:var(--maroon);color:#fff;border-radius:18px;padding:14px;margin-bottom:10px}
.announce small{display:inline;color:#fbd5d5}
.announce h3{font-size:15px;margin:6px 0 4px}.announce p{font-size:11px;opacity:.9}
.news{display:flex;gap:12px;margin-bottom:10px;align-items:center}
.news h3{font-size:13px;margin:4px 0}
.thumb,.photo{display:grid;place-items:center;color:#fff;font-size:26px;border-radius:12px}
.thumb{width:84px;height:84px;flex:none}
.g1{background:linear-gradient(135deg,#16a34a,#065f46)}.g2{background:linear-gradient(135deg,#dc2626,#7f1d1d)}
.g3{background:linear-gradient(135deg,#ef4444,#7f1d1d)}.g4{background:linear-gradient(135deg,#f59e0b,#78350f)}

/* Ekskul: memanjang ke samping & bisa digeser */
.scroller{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;padding-bottom:8px}
.scroller .mini{flex:0 0 42%;scroll-snap-align:start}
.scroller::-webkit-scrollbar{height:6px}
.scroller::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:99px}
.mini{text-align:center;display:flex;flex-direction:column;align-items:center;gap:4px}
.mini-photo{width:100%;height:90px;border-radius:14px 14px 0 0;object-fit:cover;display:block;margin:0 0 6px}
.mini b{font-size:12px}
.gal{padding:0;overflow:hidden}
.gal .photo{height:110px;border-radius:0;width:100%;object-fit:cover;display:block}
.gal b,.gal small{padding:0 10px}.gal b{display:block;margin-top:8px;font-size:12px}.gal small{padding-bottom:10px}

/* Galeri di beranda: berjajar ke samping & bisa digeser */
.gal-scroll{margin-bottom:12px}
.gal-scroll .gal{flex:0 0 46%;scroll-snap-align:start}
.gal-scroll .gal .photo{display:grid;place-items:center}
.gal-scroll .gal img.photo{display:block}

.prestasi{background:var(--gold-s)}
.prestasi strong{display:block;margin-bottom:10px;font-size:13px}
.row{background:#fff;border-radius:12px;padding:10px;margin-bottom:6px;display:flex;gap:10px;align-items:center;font-size:12px}
.row b{margin-left:auto;font-size:11px}
.num{width:24px;height:24px;border-radius:50%;background:var(--gold-s);color:var(--gold);display:grid;place-items:center;font-weight:800;font-size:11px;flex:none}

.map{height:220px;border-radius:14px;position:relative;margin-bottom:10px;overflow:hidden}
.map iframe{width:100%;height:100%;display:block}
.coord{position:absolute;left:8px;right:8px;bottom:8px;background:var(--navy);color:#fff;border-radius:10px;padding:8px 10px;display:flex;justify-content:space-between;align-items:center;font-size:11px}
.coord a{background:var(--maroon);padding:4px 10px;border-radius:8px;font-weight:700}
.addr{background:var(--bg);color:var(--ink);font-weight:500;font-size:13px;margin-bottom:8px}
.addr small{font-weight:700;margin-bottom:2px}
.contact{display:flex;gap:12px;align-items:center;background:var(--bg);border-radius:14px;padding:10px;margin-bottom:8px}
.contact span:nth-child(2){flex:1}.contact b{font-size:14px;word-break:break-all}
.tagline{margin-top:12px;text-align:center}.tagline small{margin-top:4px;font-size:10px}

.footer{background:var(--navy);color:#cbd5e1;padding:26px 18px 20px}
.footer .brand strong{color:#fff}.footer small{color:#94a3b8}
.footer p{margin:12px 0;font-size:13px}
.footer h4{font-size:11px;color:#fbbf24;margin-top:16px}
.social{display:flex;gap:8px;margin:14px 0}
.social a{width:34px;height:34px;border-radius:50%;background:rgba(255,255,255,.1);display:grid;place-items:center}
.copy{text-align:center;margin-top:20px;font-size:10px}

.modal{position:fixed;inset:0;z-index:60;background:rgba(15,23,42,.7);display:none;align-items:flex-end;justify-content:center}
.modal.show{display:flex}
.modal-box{background:#fff;width:100%;max-width:480px;max-height:85vh;overflow-y:auto;border-radius:24px 24px 0 0;padding:24px 20px 28px;position:relative;animation:up .25s}
.modal-box h3{color:var(--maroon);font-size:18px;margin-bottom:10px;padding-right:40px}
.modal-box p,.modal-box li{font-size:13px;margin-bottom:8px}
.modal-box ul{padding-left:18px}
@keyframes up{from{transform:translateY(40px);opacity:0}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important;scroll-behavior:auto!important}}

/* ===== Halaman Profil ===== */
.drawer nav a.active{background:var(--maroon-s);color:var(--maroon)}
.page{padding:16px 18px 40px;background:var(--bg)}
.crumb{display:flex;align-items:center;gap:8px;font-size:11px;color:var(--mute);margin-bottom:14px}
.crumb i{font-size:9px}.crumb span{color:var(--maroon);font-weight:700}
.page h1{font-size:28px;font-weight:800;letter-spacing:-.03em;margin-bottom:8px}
.lead{font-size:15px;color:#6b4a4f;margin-bottom:18px}
.photo-hero{position:relative;height:200px;border-radius:18px;overflow:hidden;margin-bottom:22px;box-shadow:0 4px 14px rgba(0,0,0,.18);background:linear-gradient(180deg,#7dd3fc,#86efac 60%,#166534)}
.photo-hero img{width:100%;height:100%;object-fit:cover;display:block}
.photo-hero figcaption{position:absolute;left:0;right:0;bottom:0;display:flex;justify-content:space-between;padding:26px 14px 10px;color:#fff;font-size:11px;background:linear-gradient(transparent,rgba(0,0,0,.75))}
.prose{font-size:15px;color:#6b4a4f;margin-bottom:14px;line-height:1.7}
.prose.dark{color:var(--ink)}
.sub{font-size:12px;color:var(--mute);margin:-4px 0 12px}
.idlist{background:#fff;border-radius:18px;box-shadow:0 1px 4px rgba(17,24,39,.07);overflow:hidden}
.idrow{padding:12px 14px;border-bottom:1px solid #f1f2f6}
.idrow:last-child{border:0}
.idrow small{color:#6b2a33;font-weight:700;margin-bottom:2px}
.idrow span{font-size:14px}
.idrow .strong{font-weight:800}
.idrow em{font-size:11px;color:var(--mute);font-style:normal}
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--maroon);margin-right:6px}
.pill{display:inline-block;background:#fed7aa;color:#7c2d12;font-size:12px;font-weight:800;padding:2px 10px;border-radius:99px}
.pill.blue{background:var(--blue-s);color:#3730a3;font-size:11px;font-weight:600;margin-top:8px}
.addr-t{line-height:1.7}
.akr{background:#fff;border-radius:18px;padding:14px;box-shadow:0 1px 4px rgba(17,24,39,.07);margin-bottom:14px}
.akr strong{display:block;font-size:14px}
.totop{display:table;margin:24px auto 0;background:#fff;border-radius:99px;padding:8px 16px;font-size:11px;font-weight:600;box-shadow:0 1px 4px rgba(17,24,39,.1)}

/* ===== Tampilan laptop / komputer ===== */
.desktop-nav{display:none}

@media (min-width:992px){
  body{max-width:100%}
  .header .icon-btn{display:none}
  .desktop-nav{display:flex;align-items:center;gap:8px}
  .desktop-nav a{color:var(--maroon);font-size:14px;font-weight:700;padding:8px 14px;border-radius:8px;white-space:nowrap;transition:background .2s}
  .desktop-nav a:hover,.desktop-nav a.active{background:var(--maroon-s)}
  .header{padding:14px 24px}
  .hero-body{padding:60px 24px}
  .sheet{padding:24px}
  .grid2{grid-template-columns:repeat(4,1fr)}
  .grid2.gal-grid{grid-template-columns:repeat(2,1fr)}
  .grid3{grid-template-columns:repeat(6,1fr)}
  .scroller .mini{flex:0 0 calc(33.333% - 7px)}
  .gal-scroll .gal{flex:0 0 calc(25% - 8px)}
  .mini-photo{height:140px}
  .gal .photo{height:180px}
  .photo-hero{height:380px}
  .page{padding:24px}
  .idlist{display:grid;grid-template-columns:1fr 1fr}
}

/* ===== Detail Ekskul & Galeri ===== */
#ekskul .mini,#galeri .gal,#galeriHome .gal{cursor:pointer;transition:transform .15s,box-shadow .15s}
#ekskul .mini:hover,#galeri .gal:hover,#galeriHome .gal:hover{transform:translateY(-3px);box-shadow:0 8px 20px rgba(17,24,39,.14)}
#galeri .gal:has(a){cursor:default}
.hint-tap{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--mute);margin:-4px 0 10px}
.hint-tap i{color:var(--maroon)}
body.no-scroll{overflow:hidden}
.detail{position:fixed;inset:0;z-index:70;background:rgba(15,23,42,.78);display:none;align-items:flex-end;justify-content:center}
.detail.show{display:flex}
.detail-box{background:#fff;width:100%;max-width:580px;max-height:92vh;overflow-y:auto;border-radius:24px 24px 0 0;position:relative;animation:up .25s}
.detail .close-btn{position:absolute;top:12px;right:12px;z-index:2;background:rgba(255,255,255,.95);color:var(--ink);box-shadow:0 2px 8px rgba(0,0,0,.25)}
.detail-media{height:240px;background:linear-gradient(135deg,var(--maroon),var(--maroon-d));display:grid;place-items:center;color:rgba(255,255,255,.5);font-size:48px}
.detail-media img{width:100%;height:100%;object-fit:cover;display:block}
.detail-body{padding:20px 20px 26px}
.detail-body .badge{margin-bottom:8px}
.detail-body h3{font-size:22px;font-weight:800;letter-spacing:-.02em;color:var(--maroon);margin-bottom:8px}
.detail-body p{font-size:14px;line-height:1.7;color:#374151}
.detail-meta{display:grid;gap:8px;margin-top:16px}
.detail-meta div{display:flex;gap:12px;align-items:center;background:var(--bg);border-radius:12px;padding:10px 12px}
.detail-meta i{color:var(--maroon);width:18px;text-align:center}
.detail-meta small{font-weight:700;margin:0}
.detail-meta b{font-size:13px}
@media (min-width:700px){
  .detail{align-items:center;padding:24px}
  .detail-box{border-radius:24px}
  .detail-media{height:340px}
}

/* ===== Navigasi antar halaman ===== */
.view{display:none}
.view.active{display:block}
.page-top{background:linear-gradient(135deg,var(--maroon),var(--maroon-d));color:#fff;padding:26px 18px 46px}
.page-top h1{font-size:26px;font-weight:800;letter-spacing:-.03em}
.page-top p{font-size:13px;opacity:.9;margin-top:4px}
.more{font-size:11px;font-weight:700;color:var(--maroon)}
.more i{font-size:9px;margin-left:2px}
.text-card p{font-size:14px;line-height:1.7;margin-bottom:8px;color:#374151}
.text-card p:last-child{margin-bottom:0}
.text-card ul{padding-left:18px}
.text-card li{font-size:14px;line-height:1.7;margin-bottom:4px;color:#374151}
.contact-card{display:flex;gap:12px;align-items:center;color:inherit}
.contact-card span:nth-child(2){flex:1}
.contact-card b{font-size:14px;display:block}
.cta{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.cta b{font-size:14px;display:block}
.cta .btn{padding:10px 18px;box-shadow:none}
@media (min-width:992px){.page-top{padding:40px 24px 56px}}

.back{display:inline-block;color:var(--maroon);font-weight:600;font-size:13px;margin:6px 0 12px}


/* Detail berita */
.detail-berita {
    margin-top: 12px;
    font-size: 14px;
}

.detail-berita summary {
    color: #9b0000;
    font-weight: 600;
    cursor: pointer;
}

.isi-berita {
    margin-top: 10px;
    line-height: 1.8;
    white-space: pre-line;
}


/* ===== KARTU BERITA RESPONSIF ===== */

#warta .card.news {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    margin-bottom: 16px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#warta .card.news:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.10);
}

#warta .card.news > div:first-child {
    min-width: 0;
    flex: 1;
}

#warta .card.news .thumb {
    width: 180px;
    height: 135px;
    flex: 0 0 180px;
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f0e9;
}

#warta .card.news img.thumb {
    object-fit: cover;
    display: block;
}

#warta .card.news .thumb i {
    font-size: 34px;
}

#warta .card.news h3 {
    margin: 10px 0;
    font-size: 18px;
    line-height: 1.5;
    color: #202b3c;
}

#warta .card.news p {
    margin: 8px 0;
    line-height: 1.7;
    color: #4b5563;
    overflow-wrap: anywhere;
}

#warta .card.news small {
    display: inline-block;
    margin-top: 10px;
    color: #64748b;
    font-size: 12px;
}

#warta .detail-berita {
    margin-top: 12px;
}

#warta .detail-berita summary {
    display: inline-block;
    color: #a00000;
    font-weight: 700;
    cursor: pointer;
}

#warta .isi-berita {
    margin-top: 12px;
    color: #374151;
    line-height: 1.8;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* Pengumuman penting */
#warta .announce {
    padding: 22px;
    margin-bottom: 16px;
    border-radius: 16px;
    background: #fff8e7;
    border-left: 5px solid #a00000;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

#warta .announce h3 {
    margin: 12px 0;
    line-height: 1.5;
}

#warta .announce p {
    line-height: 1.7;
    overflow-wrap: anywhere;
}

/* Tampilan HP */
@media (max-width: 600px) {
    #warta .card.news {
        flex-direction: column;
        gap: 14px;
        padding: 14px;
    }

    #warta .card.news .thumb {
        width: 100%;
        height: 200px;
        flex: none;
    }

    #warta .card.news h3 {
        font-size: 16px;
    }

    #warta .announce {
        padding: 16px;
    }
}


/* ===== FIX LAYOUT KARTU BERITA ===== */

#warta .card.news {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: start;
    gap: 20px;
    box-sizing: border-box;
}

#warta .card.news > div:not(.thumb) {
    min-width: 0;
    width: 100%;
}

#warta .card.news h3 {
    overflow-wrap: break-word;
    word-break: normal;
}

#warta .card.news p {
    overflow-wrap: break-word;
    word-break: normal;
}

#warta .card.news .detail-berita {
    margin-bottom: 12px;
}

#warta .card.news small {
    display: block;
}

#warta .card.news .thumb {
    width: 180px;
    height: 135px;
    max-width: 100%;
    box-sizing: border-box;
}

#warta .card.news img.thumb {
    object-fit: cover;
}

@media (max-width: 600px) {
    #warta .card.news {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    #warta .card.news .thumb {
        width: 100%;
        height: 200px;
    }
}


/* FIX FINAL LAYOUT WARTA */

#warta article.card.news {
    display: grid !important;
    grid-template-columns: 180px minmax(0, 1fr) !important;
    gap: 20px !important;
    align-items: start !important;
    width: 100%;
    box-sizing: border-box;
}

#warta article.card.news > div:not(.thumb) {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
}

#warta article.card.news .thumb {
    grid-column: 1;
    grid-row: 1;
    width: 180px !important;
    height: 135px !important;
    margin: 0 !important;
}

#warta article.card.news > div:not(.thumb) {
    grid-column: 2;
    grid-row: 1;
}

#warta article.card.news h3,
#warta article.card.news p,
#warta article.card.news .detail-berita,
#warta article.card.news small {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
}

#warta article.card.news p {
    line-height: 1.7;
    margin: 10px 0;
}

#warta article.announce {
    display: block !important;
    width: 100%;
    box-sizing: border-box;
}

#warta article.announce h3,
#warta article.announce p {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
}

@media (max-width: 600px) {
    #warta article.card.news {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    #warta article.card.news .thumb {
        grid-column: 1;
        grid-row: 1;
        width: 100% !important;
        height: 200px !important;
    }

    #warta article.card.news > div:not(.thumb) {
        grid-column: 1;
        grid-row: 2;
    }
}



/* =========================================================
   REDESAIN MODERN SCHOOL WEBSITE — SDN CIKUYA 3
   Override visual saja; struktur Blade dan fitur lama dipertahankan.
   ========================================================= */
:root {
  --maroon: #8b1020;
  --maroon-d: #4f0712;
  --maroon-s: #fff0f2;
  --gold: #c08a2c;
  --gold-s: #fff5dc;
  --blue: #3157a4;
  --blue-s: #edf3ff;
  --ink: #182235;
  --mute: #687386;
  --bg: #f6f7fb;
  --card: #ffffff;
  --line: #e4e8f0;
  --navy: #142033;
}

html { scroll-padding-top: 88px; }
body {
  max-width: none;
  width: 100%;
  margin: 0;
  background: #f6f7fb;
  color: var(--ink);
  font-size: 15px;
}
.topbar {
  padding: 7px 24px;
  font-size: 12px;
  letter-spacing: .02em;
  text-align: left;
}
.header {
  min-height: 82px;
  padding: 14px clamp(18px, 5vw, 76px);
  gap: 24px;
  border-bottom: 1px solid rgba(228,232,240,.8);
  box-shadow: 0 8px 28px rgba(20,32,51,.06);
}
.brand { gap: 12px; min-width: max-content; }
.brand strong { font-size: 16px; letter-spacing: -.02em; }
.brand small { margin-top: 4px; font-size: 11px; }
.logo { width: 48px; height: 48px; box-shadow: 0 0 0 4px #fff0f2; }
.desktop-nav { margin-left: auto; }
.desktop-nav a {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  transition: color .2s ease, background .2s ease;
}
.desktop-nav a:hover, .desktop-nav a.active { background: var(--maroon-s); color: var(--maroon); }
.icon-btn { width: 44px; height: 44px; background: var(--maroon-s); color: var(--maroon); }
.hero {
  min-height: 560px;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(31,5,12,.88) 0%, rgba(52,8,17,.68) 48%, rgba(35,8,13,.18) 100%),
    linear-gradient(0deg, rgba(25,5,10,.28), rgba(25,5,10,.08)),
    url("../images/foto-sekolah.jpg") center 48% / cover no-repeat;
}
.hero-body {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 78px clamp(22px, 6vw, 84px);
}
.hero .chips { gap: 9px; margin-bottom: 18px; }
.chip { padding: 7px 13px; font-size: 11px; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.hero h1 {
  max-width: 760px;
  font-size: clamp(42px, 5.5vw, 72px);
  line-height: 1.03;
  letter-spacing: -.055em;
  margin: 14px 0 18px;
}
.hero p { max-width: 650px; font-size: clamp(16px, 1.6vw, 20px); line-height: 1.75; margin-bottom: 28px; }
.btn {
  border-radius: 10px;
  padding: 14px 21px;
  box-shadow: 0 10px 24px rgba(75,5,17,.2);
  transition: transform .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); background: #a71b2d; }
.sheet {
  width: min(1240px, 100%);
  margin: -34px auto 0;
  padding: 34px clamp(18px, 4vw, 48px) 54px;
  border-radius: 28px 28px 0 0;
  background: var(--bg);
}
.card {
  padding: 22px;
  border: 1px solid rgba(228,232,240,.85);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(20,32,51,.045);
  transition: box-shadow .2s ease, transform .2s ease;
}
.sec {
  align-items: center;
  gap: 12px;
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.25;
  margin: 36px 0 18px;
  padding: 4px 0 4px 14px;
  border-left-width: 5px;
}
.sec small { font-size: 12px; }
.welcome { align-items: center; gap: 18px; padding: 24px; }
.welcome .tile { width: 54px; height: 54px; border-radius: 16px; font-size: 21px; }
.welcome .label { font-size: 12px; letter-spacing: .05em; }
.welcome p { font-size: 15px; line-height: 1.7; color: #384357; }
.stats { gap: 16px; }
.stat { padding: 22px; min-height: 150px; border-radius: 18px; }
.stat:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(20,32,51,.09); }
.stat > small { font-size: 12px; }
.stat b { font-size: clamp(24px, 3vw, 34px); color: var(--maroon); }
.stat .foot { margin-top: auto; font-size: 11px; padding: 7px 9px; }
.more { font-size: 13px; white-space: nowrap; }
.scroller { gap: 16px; padding: 3px 2px 14px; }
.gal-scroll .gal { flex: 0 0 280px; }
.gal .photo { height: 180px; }
.gal b { font-size: 14px; margin: 12px 12px 4px; padding: 0; }
.gal small { padding: 0 12px 14px; line-height: 1.5; }
.mini { padding-bottom: 14px; }
.mini b { font-size: 14px; }
.mini small { font-size: 12px; }
.mini-photo { height: 160px; }
.news { border-radius: 18px; }
#galeri .gal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.page-top {
  padding: 56px clamp(22px, 6vw, 84px) 76px;
  background:
    radial-gradient(circle at 85% 20%, rgba(255,255,255,.16), transparent 25%),
    linear-gradient(125deg, #8b1020, #4f0712);
}
.page-top h1 { font-size: clamp(32px, 4vw, 48px); }
.page-top p { font-size: 16px; }
.view > .sheet { margin-top: -28px; }
.photo-hero { height: 400px; border-radius: 22px; }
.prose { max-width: 950px; font-size: 16px; }
.text-card { padding: 26px; }
.text-card p, .text-card li { font-size: 15px; }
.idlist { border: 1px solid var(--line); }
.idrow { padding: 16px 18px; }
.idrow span { font-size: 14px; }
.akr { padding: 24px; }
.contact { padding: 16px; transition: background .2s ease; }
.contact:hover { background: var(--maroon-s); }
.map { height: 340px; }
.cta { padding: 26px; }
.cta b { font-size: 18px; }
.cta small { margin-top: 5px; font-size: 13px; }
.footer {
  padding: 48px max(24px, calc((100vw - 1140px) / 2)) 26px;
  background: #142033;
}
.footer > p { max-width: 720px; line-height: 1.8; }
.footer h4 { letter-spacing: .08em; }
.footer .social a { width: 40px; height: 40px; transition: background .2s ease, transform .2s ease; }
.footer .social a:hover { background: var(--maroon); transform: translateY(-2px); }
.footer .copy { display: block; border-top: 1px solid rgba(255,255,255,.12); padding-top: 18px; }
#data .stats .stat:nth-child(3) { background: linear-gradient(145deg, #fff, #fff8e8); }
#data .stats .stat:nth-child(3) .gold-t { color: #9a6817; }
#kontak .card { padding: 22px; }
#legalitas .note { font-size: 13px; line-height: 1.8; }
#page-siswa .card, #page-guru .card { overflow: hidden; }
table th, table td { padding: 13px 14px !important; }
table tbody tr:hover { background: #fff7f8; }
.detail-box { box-shadow: 0 24px 70px rgba(0,0,0,.22); }
.detail-body { padding: 26px; }

@media (min-width: 992px) {
  .header .icon-btn { display: none; }
  .desktop-nav { display: flex; gap: 4px; }
  .hero-body { padding-top: 100px; padding-bottom: 110px; }
  .sheet { padding-top: 38px; }
  .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2.gal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scroller .mini { flex: 0 0 calc(25% - 12px); }
  .gal-scroll .gal { flex: 0 0 calc(25% - 12px); }
  .mini-photo { height: 175px; }
  .gal .photo { height: 210px; }
  .page-top { padding-top: 62px; padding-bottom: 88px; }
  .idlist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1400px) {
  .hero { min-height: 620px; }
  .hero-body { padding-left: 0; padding-right: 0; }
}
@media (max-width: 991px) {
  .header { min-height: 72px; padding: 12px 18px; }
  .brand strong { font-size: 14px; }
  .hero { min-height: 440px; }
  .hero-body { padding: 60px 24px 76px; }
  .hero h1 { font-size: clamp(38px, 8vw, 56px); }
  .sheet { width: 100%; padding: 24px 18px 40px; }
  #galeri .gal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-top { padding: 38px 24px 62px; }
  .photo-hero { height: 300px; }
}
@media (max-width: 600px) {
  .topbar { text-align: center; padding: 6px 12px; font-size: 10px; }
  .header { padding: 10px 14px; }
  .logo { width: 42px; height: 42px; }
  .brand strong { font-size: 12px; }
  .brand small { font-size: 10px; }
  .hero { min-height: 440px; background-position: 58% center; }
  .hero-body { padding: 46px 20px 68px; }
  .hero h1 { font-size: 40px; }
  .hero p { font-size: 15px; }
  .sheet { margin-top: -22px; border-radius: 22px 22px 0 0; padding: 22px 14px 36px; }
  .card { padding: 16px; border-radius: 16px; }
  .welcome { padding: 18px; align-items: flex-start; }
  .welcome .tile { width: 44px; height: 44px; }
  .sec { font-size: 19px; margin-top: 30px; }
  .sec small { font-size: 10px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat { min-width: 0; padding: 12px 9px; min-height: 128px; }
  .stat > small { font-size: 10px; line-height: 1.4; }
  .stat b { font-size: 21px; }
  .stat em { font-size: 9px; display: block; }
  .stat .foot { font-size: 9px; padding: 5px 4px; }
  .gal-scroll .gal { flex: 0 0 72%; }
  #galeri .gal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  #galeri .gal .photo { height: 130px; }
  .gal b { font-size: 12px; margin: 9px 10px 3px; }
  .gal small { font-size: 10px; padding: 0 10px 12px; }
  .page-top { padding: 32px 18px 52px; }
  .page-top h1 { font-size: 29px; }
  .page-top p { font-size: 13px; }
  .photo-hero { height: 220px; }
  .prose { font-size: 14px; }
  .text-card { padding: 18px; }
  .text-card p, .text-card li { font-size: 13px; }
  .idrow { padding: 12px 14px; }
  .map { height: 250px; }
  .coord { font-size: 9px; }
  .coord a { padding: 5px 7px; }
  .footer { padding: 32px 18px 20px; }
  .footer .brand { min-width: 0; }
  #warta article.card.news { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  #warta article.card.news .thumb { width: 100% !important; height: 190px !important; }
  #warta article.card.news > div:not(.thumb) { grid-column: 1; grid-row: 2; }
  #warta article.card.news h3 { font-size: 16px; }
  #warta article.announce { padding: 16px; }
  #page-siswa .card, #page-guru .card { padding: 14px !important; }
  #page-siswa h2, #page-guru h2 { font-size: 17px !important; }
  #page-siswa button, #page-guru button { font-size: 12px !important; padding: 9px 10px !important; }
}



/* =========================================================
   FINISHING POLISH — SDN CIKUYA 3
   Penyempurnaan spacing, hero, navbar, kartu, dan responsif.
   Ditambahkan di bagian akhir agar tidak mengganggu fitur lama.
   ========================================================= */

:root {
  --maroon: #8b1020;
  --maroon-d: #4f0712;
  --gold: #c08a2c;
  --ink: #182235;
  --mute: #687386;
  --bg: #f5f6fa;
  --line: #e5e8ef;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  overflow-x: hidden;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  min-height: 30px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  padding: 6px clamp(18px, 4.7vw, 72px);
  line-height: 1.4;
}

.header {
  position: relative;
  z-index: 20;
  box-sizing: border-box;
  width: 100%;
  min-height: 82px;
  padding: 13px clamp(18px, 4.7vw, 72px);
}

.brand {
  text-decoration: none;
}

.brand .logo,
.drawer-head .logo {
  flex: 0 0 auto;
  overflow: hidden;
}

.brand .logo img,
.drawer-head .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(3px, .6vw, 10px);
}

.desktop-nav a {
  padding: 12px 13px;
  border-radius: 12px;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.desktop-nav a:hover,
.desktop-nav a:focus-visible {
  color: var(--maroon);
  background: #fff0f2;
  transform: translateY(-1px);
  outline: none;
}

.hero {
  min-height: clamp(500px, 39vw, 620px);
  background:
    linear-gradient(90deg, rgba(35, 5, 12, .78) 0%, rgba(48, 8, 16, .60) 47%, rgba(25, 8, 12, .18) 100%),
    linear-gradient(0deg, rgba(25, 5, 10, .20), rgba(25, 5, 10, .04)),
    url("../images/foto-sekolah.jpg") center 48% / cover no-repeat;
}

.hero-body {
  box-sizing: border-box;
  width: min(1240px, 100%);
  padding-top: clamp(64px, 8vw, 112px);
  padding-bottom: clamp(70px, 8vw, 112px);
}

.hero h1 {
  text-wrap: balance;
}

.hero p {
  text-wrap: pretty;
}

.sheet {
  box-sizing: border-box;
  width: min(1240px, 100%);
  padding-top: 28px;
  padding-bottom: 56px;
}

.card {
  min-width: 0;
  box-sizing: border-box;
}

.card:hover {
  box-shadow: 0 12px 30px rgba(20, 32, 51, .075);
}

.welcome {
  align-items: center;
}

.welcome p {
  margin-top: 5px;
  margin-bottom: 0;
}

.sec {
  color: var(--ink);
}

.stat,
.quick,
article.card,
.gallery-item,
.news-item {
  min-width: 0;
}

img {
  max-width: 100%;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(139, 16, 32, .28);
  outline-offset: 3px;
}

@media (min-width: 1500px) {
  .hero-body {
    width: min(1240px, calc(100% - 80px));
  }
}

@media (max-width: 1100px) {
  .header {
    gap: 16px;
    padding-left: 28px;
    padding-right: 28px;
  }

  .desktop-nav {
    gap: 2px;
  }

  .desktop-nav a {
    padding: 10px 9px;
    font-size: 12px;
  }

  .hero {
    min-height: 520px;
  }
}

@media (max-width: 800px) {
  .topbar {
    padding: 7px 18px;
    font-size: 11px;
  }

  .header {
    min-height: 72px;
    padding: 11px 18px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand small {
    font-size: 10px;
  }

  .hero {
    min-height: 500px;
    background-position: center center;
  }

  .hero-body {
    padding: 72px 24px 90px;
  }

  .hero h1 {
    font-size: clamp(40px, 8vw, 58px);
  }

  .hero p {
    max-width: 580px;
    font-size: 16px;
  }

  .sheet {
    margin-top: -26px;
    padding: 24px 18px 42px;
    border-radius: 24px 24px 0 0;
  }

  .welcome {
    padding: 20px;
  }
}

@media (max-width: 600px) {
  .topbar {
    min-height: 28px;
    font-size: 10px;
  }

  .header {
    min-height: 68px;
    padding: 10px 15px;
  }

  .brand {
    gap: 9px;
  }

  .brand .logo {
    width: 42px;
    height: 42px;
  }

  .brand strong {
    font-size: 12px;
  }

  .brand small {
    font-size: 9px;
  }

  .hero {
    min-height: 460px;
    background:
      linear-gradient(90deg, rgba(35, 5, 12, .78), rgba(35, 5, 12, .43)),
      linear-gradient(0deg, rgba(25, 5, 10, .18), rgba(25, 5, 10, .04)),
      url("../images/foto-sekolah.jpg") center / cover no-repeat;
  }

  .hero-body {
    padding: 62px 20px 82px;
  }

  .hero h1 {
    font-size: clamp(36px, 10vw, 46px);
    line-height: 1.06;
    margin-top: 14px;
    margin-bottom: 14px;
  }

  .hero p {
    font-size: 14px;
    line-height: 1.75;
    margin-bottom: 22px;
  }

  .hero .chips {
    gap: 7px;
  }

  .chip {
    font-size: 10px;
    padding: 6px 10px;
  }

  .btn {
    padding: 12px 17px;
    border-radius: 10px;
    font-size: 13px;
  }

  .sheet {
    padding: 18px 13px 34px;
    margin-top: -20px;
    border-radius: 20px 20px 0 0;
  }

  .welcome {
    gap: 12px;
    padding: 16px;
    border-radius: 16px;
  }

  .welcome .tile {
    width: 44px;
    height: 44px;
    font-size: 17px;
  }

  .welcome .label {
    font-size: 10px;
  }

  .welcome p {
    font-size: 12px;
    line-height: 1.65;
  }

  .sec {
    margin-top: 28px;
    margin-bottom: 14px;
    font-size: 19px;
  }

  .stats {
    gap: 8px;
  }

  .stat {
    padding: 13px 10px;
  }

  .stat b {
    font-size: 21px;
  }

  .stat em,
  .stat .foot {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}



/* Hero content refinement */
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: rgba(255,255,255,.9);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}

.hero-eyebrow-line {
  display: inline-block;
  width: 30px;
  height: 2px;
  background: #e6bd72;
  border-radius: 10px;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-ghost {
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.55);
  color: #fff;
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: rgba(255,255,255,.2);
  color: #fff;
}

@media (max-width: 600px) {
  .hero-eyebrow {
    font-size: 9px;
    letter-spacing: .12em;
    margin-bottom: 18px;
  }

  .hero-actions {
    align-items: stretch;
    gap: 9px;
  }

  .hero-actions .btn {
    text-align: center;
  }
}



/* =========================================================
   RESPONSIVE NAVBAR — HAMBURGER MENU FOR TABLET & MOBILE
   Menggunakan tombol #openMenu, drawer #drawer, dan overlay #overlay
   yang sudah tersedia di Blade + script.js.
   ========================================================= */

.icon-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid #eee0e3;
  border-radius: 12px;
  background: #fff7f8;
  color: var(--maroon);
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(20, 32, 51, .05);
}

.icon-btn:hover {
  background: #ffecef;
}

@media (max-width: 980px) {
  .header {
    justify-content: space-between;
    gap: 12px;
  }

  .desktop-nav {
    display: none !important;
  }

  .icon-btn {
    display: inline-flex !important;
  }
}

/* Drawer mobile */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 20, 32, .48);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
}

.overlay.show,
.overlay.active,
.overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  width: min(360px, 88vw);
  height: 100dvh;
  overflow-y: auto;
  padding: 22px 18px;
  box-sizing: border-box;
  background: #fff;
  box-shadow: -16px 0 48px rgba(15, 20, 32, .18);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform .25s ease, visibility .25s ease;
}

.drawer.open,
.drawer.active,
.drawer.show {
  transform: translateX(0);
  visibility: visible;
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 20px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.drawer-head > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.drawer-head strong {
  display: block;
  color: var(--maroon);
  font-size: 13px;
}

.drawer-head small {
  display: block;
  margin-top: 4px;
  color: var(--mute);
  font-size: 10px;
}

.drawer-head .logo {
  width: 44px;
  height: 44px;
}

.close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: #fff0f2;
  color: var(--maroon);
  font-size: 19px;
  cursor: pointer;
}

.drawer nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 12px;
  border-radius: 11px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background .18s ease, color .18s ease;
}

.drawer nav a i {
  width: 20px;
  text-align: center;
  color: var(--maroon);
}

.drawer nav a:hover,
.drawer nav a:focus-visible {
  background: #fff0f2;
  color: var(--maroon);
}

body.menu-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .drawer,
  .overlay {
    transition: none;
  }
}


/* Perbaikan kontras teks pada header drawer mobile */
.drawer-head,
.drawer-head strong,
.drawer-head small,
.drawer-head span {
  color: #fff;
}

.drawer-head {
  background: var(--maroon);
  border-radius: 0;
}

.drawer-head strong,
.drawer-head small {
  color: #fff !important;
}

.drawer-head .logo {
  background: #fff;
  border-radius: 50%;
  padding: 3px;
  box-sizing: border-box;
}

.drawer-head .logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.drawer-head .close-btn {
  color: var(--maroon);
  background: #fff;
}



/* =========================================================
   FIX GALERI: foto upload tampil utuh dan konsisten di modal
   ========================================================= */

/* Thumbnail kartu galeri: gambar memenuhi area tanpa merusak rasio kartu */
.gallery-item img,
.gallery-card img,
.gallery-thumb img,
.gallery-grid img,
.galeri-item img,
.galeri-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Kontainer foto utama pada popup/modal */
#lightbox img,
.lightbox img,
.gallery-modal img,
.modal-gallery img,
#galleryModal img,
.photo-modal img,
.photo-viewer img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  margin: auto;
}

/* Cegah gambar modal terpotong oleh ukuran kontainer */
#lightbox .lightbox-content,
.lightbox .lightbox-content,
.gallery-modal .modal-content,
.modal-gallery .modal-content,
#galleryModal .modal-content,
.photo-modal .modal-content,
.photo-viewer .photo-content {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

/* Foto upload dengan ukuran/rasio berbeda tetap terlihat utuh */
.gallery-item .gallery-image,
.gallery-card .gallery-image,
.gallery-thumb,
.gallery-item .thumb,
.gallery-card .thumb {
  overflow: hidden;
}

@media (max-width: 600px) {
  #lightbox img,
  .lightbox img,
  .gallery-modal img,
  .modal-gallery img,
  #galleryModal img,
  .photo-modal img,
  .photo-viewer img {
    max-width: 100%;
    max-height: 72dvh;
    object-fit: contain;
  }
}



/* =========================================================
   FINAL FIX DETAIL GALERI / EKSTRAKURIKULER
   Mencegah gambar tinggi (poster/portrait) meluber ke area
   judul dan deskripsi. Isi gambar tetap utuh.
   ========================================================= */

.detail-box {
  isolation: isolate;
}

.detail-media {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100%;
  height: 240px !important;
  min-height: 0 !important;
  max-height: 240px !important;
  overflow: hidden !important;
  box-sizing: border-box;
  background: #f3f4f6;
  flex: 0 0 auto;
}

.detail-media img {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  object-fit: contain !important;
  object-position: center center !important;
}

.detail-body {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
}

.detail-body .badge {
  display: inline-block;
}

.detail-body h3,
.detail-body p,
.detail-meta {
  position: relative;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.detail-meta {
  display: grid;
}

@media (min-width: 700px) {
  .detail {
    align-items: center;
  }

  .detail-box {
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 24px;
  }

  .detail-media {
    height: 340px !important;
    max-height: min(340px, 42vh) !important;
  }
}

@media (max-width: 699px) {
  .detail {
    padding: 0;
  }

  .detail-box {
    max-height: 90dvh;
    overflow-y: auto;
  }

  .detail-media {
    height: 240px !important;
    max-height: 32dvh !important;
    min-height: 180px !important;
  }

  .detail-body {
    padding: 18px 18px 22px;
  }

  .detail-body h3 {
    font-size: 20px;
  }
}



/* =========================================================
   TYPOGRAPHY + NAVIGATION MOTION — SDN CIKUYA 3
   DM Sans untuk teks, Outfit untuk heading, Lora untuk aksen.
   ========================================================= */

:root {
  --font-body: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Outfit", "DM Sans", system-ui, sans-serif;
  --font-editorial: "Lora", Georgia, serif;
}

body {
  font-family: var(--font-body);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: .005em;
}

button,
input,
textarea,
select {
  font: inherit;
}

h1, h2, h3, h4,
.brand strong,
.desktop-nav a,
.drawer nav a,
.btn,
.chip,
.badge,
.label,
.sec,
.stat b,
.quick b,
.page-top h1,
.detail-body h3,
.modal-box h3,
.footer h4 {
  font-family: var(--font-display);
}

.brand strong {
  font-weight: 700;
  letter-spacing: -.025em;
}

.desktop-nav a,
.drawer nav a {
  letter-spacing: -.01em;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: .98;
}

.hero p {
  font-family: var(--font-body);
  letter-spacing: -.01em;
}

.sec {
  letter-spacing: -.025em;
}

.page-top h1,
.page h1 {
  font-family: var(--font-display);
  letter-spacing: -.04em;
}

.welcome p {
  font-family: var(--font-editorial);
  font-size: clamp(13px, 1.1vw, 15px);
  line-height: 1.8;
  letter-spacing: -.015em;
}

.lead {
  font-family: var(--font-editorial);
  font-size: 15px;
  line-height: 1.8;
}

.detail-body h3,
.modal-box h3 {
  letter-spacing: -.035em;
}

.detail-body p,
.detail-meta b,
.text-card p,
.text-card li,
.prose {
  letter-spacing: -.008em;
}

/* Navigation: clear active state and smooth hover response */
.desktop-nav a {
  position: relative;
  transition:
    background-color .22s ease,
    color .22s ease,
    transform .22s ease,
    box-shadow .22s ease;
}

.desktop-nav a:hover {
  transform: translateY(-2px);
}

.desktop-nav a.active {
  box-shadow: inset 0 0 0 1px rgba(139, 16, 32, .04);
}

.icon-btn,
.close-btn,
.btn,
.quick,
.card,
.drawer nav a {
  transition:
    transform .22s cubic-bezier(.2,.75,.25,1),
    box-shadow .22s ease,
    background-color .22s ease,
    color .22s ease;
}

.btn:hover,
.quick:hover {
  transform: translateY(-2px);
}

/* Each navigation view re-enters softly when its active class changes */
.view.active {
  display: block;
  animation: viewEnter .42s cubic-bezier(.2,.75,.25,1) both;
  transform-origin: top center;
}

.view.active > .hero,
.view.active > .page-top {
  animation: headerEnter .48s cubic-bezier(.2,.75,.25,1) both;
}

.view.active > .sheet {
  animation: contentEnter .52s .04s cubic-bezier(.2,.75,.25,1) both;
}

@keyframes viewEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes headerEnter {
  from {
    opacity: .65;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes contentEnter {
  from {
    opacity: .45;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Low-key feedback on cards without making the page feel overly animated */
#ekskul .mini,
#galeri .gal,
#galeriHome .gal,
.stat,
.contact-card {
  transition:
    transform .22s cubic-bezier(.2,.75,.25,1),
    box-shadow .22s ease,
    border-color .22s ease;
}

#ekskul .mini:active,
#galeri .gal:active,
#galeriHome .gal:active,
.stat:active,
.contact-card:active {
  transform: scale(.985);
}

@media (max-width: 600px) {
  .welcome p {
    font-size: 12px;
    line-height: 1.75;
  }

  .hero h1 {
    letter-spacing: -.045em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .view.active,
  .view.active > .hero,
  .view.active > .page-top,
  .view.active > .sheet {
    animation: none !important;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}



/* =========================================================
   FIX BERITA KATEGORI PENTING
   Kartu pengumuman memakai background krem, jadi teksnya
   harus gelap agar terbaca. Ini hanya memengaruhi #warta.
   ========================================================= */

#warta article.announce {
  color: #202b3c !important;
  background: #fff8e7 !important;
  border-left: 5px solid #a00000;
}

#warta article.announce .news-content,
#warta article.announce h3,
#warta article.announce p,
#warta article.announce .isi-berita,
#warta article.announce details,
#warta article.announce details[open] {
  color: #202b3c !important;
}

#warta article.announce h3 {
  font-weight: 800;
  line-height: 1.5;
}

#warta article.announce p,
#warta article.announce .isi-berita {
  opacity: 1;
  line-height: 1.75;
}

#warta article.announce .detail-berita summary {
  color: #8b1020 !important;
  font-weight: 700;
}

#warta article.announce small {
  color: #7b4f56 !important;
}

#warta article.announce .badge {
  color: #92400e !important;
  background: #fef3c7;
}

/* FIX KONTRAS TEKS BERITA KATEGORI PENTING — TEMPEL DI PALING AKHIR style.css */
#page-berita #warta article.announce {
  background: #fff8e7 !important;
  color: #243044 !important;
}

#page-berita #warta article.announce .news-content,
#page-berita #warta article.announce .news-content h3,
#page-berita #warta article.announce .news-content p,
#page-berita #warta article.announce .news-content .isi-berita,
#page-berita #warta article.announce .news-content details {
  color: #243044 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

#page-berita #warta article.announce .news-content h3 {
  font-weight: 800 !important;
}

#page-berita #warta article.announce .news-content .detail-berita summary {
  color: #8b1020 !important;
}

#page-berita #warta article.announce .news-content small,
#page-berita #warta article.announce .news-content small i {
  color: #8a5960 !important;
}

#page-berita #warta article.announce .news-content .badge {
  color: #92400e !important;
  background: #fef3c7 !important;
}

/* =====================================
   VISI & MISI — CLEAN SCHOOL PROFILE
   Hanya berlaku untuk bagian Visi Misi
===================================== */

.visi-misi-section {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 56px;
    align-items: start;
    margin: 38px 0 46px;
    padding: 12px 22px;
}

.visi-misi-item {
    min-width: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.visi-misi-heading {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 22px;
}

.visi-misi-heading i {
    font-size: 31px;
    color: #397748;
    flex-shrink: 0;
}

.visi-misi-heading h2 {
    margin: 0;
    padding: 0;
    border: none;
    color: #172033;
    font-size: 27px;
    font-weight: 800;
    line-height: 1.3;
}

.visi-text {
    margin: 0 0 0 46px;
    color: #647084;
    font-size: 16px;
    line-height: 1.8;
}

.visi-text strong {
    color: #397748;
}

.misi-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.misi-list li {
    position: relative;
    padding-left: 27px;
    margin-bottom: 12px;
    color: #647084;
    font-size: 15px;
    line-height: 1.65;
}

.misi-list li::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 3px;
    color: #397748;
    font-size: 14px;
}

.misi-list li:last-child {
    margin-bottom: 0;
}

/* Tampilan HP */
@media (max-width: 768px) {
    .visi-misi-section {
        grid-template-columns: 1fr;
        gap: 36px;
        margin: 28px 0 36px;
        padding: 0;
    }

    .visi-misi-heading {
        gap: 12px;
        margin-bottom: 16px;
    }

    .visi-misi-heading i {
        font-size: 26px;
    }

    .visi-misi-heading h2 {
        font-size: 23px;
    }

    .visi-text {
        margin-left: 38px;
        font-size: 14px;
        line-height: 1.8;
    }

    .misi-list li {
        font-size: 14px;
        padding-left: 25px;
        margin-bottom: 11px;
    }
}