/* =========================================================
   Web Sekolah — desain ulang (mobile-first)
   Identitas: buku tulis bergaris, tinta biru, stabilo, kartu pelajar
   ========================================================= */

/* ===== Token ===== */
:root {
  --paper: #fafbfd;
  --grey: #eef1f6;
  --ink: #101b3d;
  --muted: #55627f;
  --line: #d9dfea;
  --blue: #1d3a8f;
  --blue-dark: #142a6b;
  --blue-tint: #e8edfb;
  --red: #d8453b;
  --hl: #ffe14d;
  --ok: #17794a;
  --ok-bg: #e5f5ec;
  --bad: #b3261e;
  --bad-bg: #fdecea;
  --radius: 14px;
  --radius-sm: 8px;
  --max: 1180px;
  --tabbar: 64px;
  --head: "Gabarito", "Plus Jakarta Sans", system-ui, sans-serif;
  --body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.7 var(--body); -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
}
img, svg, iframe { max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--head); line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
ul, ol, dl { margin: 0; padding: 0; list-style: none; }
dd { margin: 0; }
button { font: inherit; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* ===== Header ===== */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(250,251,253,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-family: var(--head); font-weight: 800; font-size: 1.1rem; min-width: 0; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--blue); color: #fff; font-weight: 800; font-size: 1.05rem; box-shadow: inset 0 -4px 0 var(--hl); }

.nav { display: none; align-items: center; gap: .15rem; }
.nav a:not(.btn) { position: relative; padding: .5rem .8rem; font-size: .95rem; font-weight: 600; color: var(--muted); border-radius: var(--radius-sm); transition: color .15s; }
.nav a:not(.btn):hover { color: var(--ink); }
.nav a.active { color: var(--blue-dark); }
.nav a.active::after { content: ""; position: absolute; left: .8rem; right: .8rem; bottom: .2rem; height: 5px; background: var(--hl); border-radius: 3px; z-index: -1; }
.nav-cta { margin-left: .6rem; }
.head-cta { padding: .5rem 1rem; font-size: .9rem; }

/* ===== Tab bar & sheet (ponsel) ===== */
.tabbar { position: fixed; inset: auto 0 0 0; z-index: 60; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: var(--tabbar); padding: .4rem .2rem; background: none; border: 0; font: 600 .72rem/1.2 var(--body); color: var(--muted); cursor: pointer; }
.tabbar svg { width: 24px; height: 24px; }
.tabbar [aria-current="page"], .tabbar button[aria-expanded="true"] { color: var(--blue); }
.tabbar [aria-current="page"] svg { background: var(--hl); border-radius: 10px; padding: 2px 8px; width: 44px; box-sizing: content-box; margin-block: -2px; }

.sheet { position: fixed; inset: 0; z-index: 70; }
.sheet-bg { position: absolute; inset: 0; background: rgba(16,27,61,.55); }
.sheet-panel { position: absolute; inset: auto 0 0 0; max-height: 88vh; overflow: auto; background: #fff; border-radius: 22px 22px 0 0; padding: .6rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom)); animation: up .22s ease-out; }
.sheet-grip { width: 42px; height: 4px; background: var(--line); border-radius: 2px; margin: 0 auto .75rem; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.sheet-top strong { font-family: var(--head); font-size: 1.2rem; }
.sheet-close { width: 44px; height: 44px; display: grid; place-items: center; background: var(--grey); border: 0; border-radius: 50%; cursor: pointer; color: var(--ink); }
.sheet-links a { display: flex; align-items: center; justify-content: space-between; padding: 1rem .25rem; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 1.05rem; }
.sheet-links a[aria-current="page"] { color: var(--blue); }
.sheet-links a[aria-current="page"]::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--hl); box-shadow: 0 0 0 2px var(--blue); }
.sheet-actions { display: grid; gap: .75rem; margin-top: 1.25rem; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (min-width: 961px) {
  .nav { display: flex; }
  .head-cta, .tabbar, .sheet { display: none !important; }
  body { padding-bottom: 0; }
}

/* ===== Tombol ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 46px; padding: .65rem 1.3rem; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); font: 700 .95rem var(--body); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.btn:hover { background: var(--ink); color: #fff; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn.hl { background: var(--hl); border-color: var(--hl); color: var(--ink); }
.btn.hl:hover { background: #ffd51a; border-color: #ffd51a; color: var(--ink); }
.btn.wa { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.btn.wa:hover { background: #17794a; border-color: #17794a; }
.btn.block { width: 100%; }
.btn.disabled { opacity: .4; pointer-events: none; }
.link { color: var(--blue); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; text-decoration-color: var(--hl); }
.link:hover { text-decoration-color: currentColor; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

/* ===== Hero: kertas bergaris + kartu pelajar ===== */
.hero {
  position: relative; overflow: hidden; border-bottom: 1px solid var(--line);
  padding: clamp(2rem, 8vw, 5.5rem) 0;
  background-color: #fff;
  background-image: repeating-linear-gradient(to bottom, transparent 0 35px, #e2e8f5 35px 36px);
}
.hero::before { content: ""; position: absolute; top: 0; bottom: 0; left: clamp(.35rem, 2.2vw, 2rem); width: 2px; background: rgba(216,69,59,.6); }
.hero-grid { position: relative; display: grid; gap: 2rem; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: .55rem; padding: .4rem .95rem .4rem .75rem; border-radius: 18px; line-height: 1.4; background: var(--hl); font-weight: 700; font-size: .88rem; margin-bottom: 1.25rem; }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.hero h1 { font-size: clamp(2.3rem, 8.5vw, 4.6rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.02; background: rgba(255,255,255,.7); }
.lead { font-size: clamp(1.05rem, 2.4vw, 1.25rem); color: var(--muted); max-width: 34em; margin-top: 1.1rem; background: rgba(255,255,255,.7); }

.idcard { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: 0 22px 44px -22px rgba(20,42,107,.45); }
.idcard-top { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.25rem; background: var(--blue); color: #fff; font-family: var(--head); font-weight: 700; font-size: 1.05rem; }
.idcard-top .brand-mark { background: #fff; color: var(--blue); box-shadow: inset 0 -4px 0 var(--hl); }
.idcard-body { padding: 1.25rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; }
.idcard dt { font-size: .82rem; color: var(--muted); }
.idcard dd { font-weight: 700; }
.idcard .wide { grid-column: 1 / -1; padding-top: 1rem; border-top: 1px dashed var(--line); }
.idcard .wide dd { font-weight: 500; font-size: .95rem; line-height: 1.5; }
.idcard::after { content: ""; display: block; height: 8px; background: repeating-linear-gradient(135deg, var(--hl) 0 10px, var(--ink) 10px 20px); }

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.3fr 1fr; gap: 4rem; }
  .idcard { justify-self: end; transform: rotate(1.8deg); }
}

/* ===== Page head ===== */
.page-head { padding: clamp(2rem, 6vw, 3.75rem) 0 clamp(1.5rem, 4vw, 2.5rem); background: var(--grey); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(1.9rem, 5.5vw, 3.1rem); font-weight: 800; max-width: 18em; }

/* ===== Seksi ===== */
.section { padding: clamp(2.25rem, 7vw, 4.5rem) 0; }
.section.soft { background: var(--grey); }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.head h2, .greet h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; }
.sub { font-size: 1.35rem; font-weight: 800; margin: 2.5rem 0 1rem; }
.sub.first { margin-top: 0; }
.empty { color: var(--muted); padding: 1.5rem; text-align: center; border: 1.5px dashed var(--line); border-radius: var(--radius); }
.prose { font-size: 1.07rem; max-width: 40em; }

.greet { display: grid; gap: 1.25rem; }
.greet .sign { margin: 0; }
.greet .sign strong { font-family: var(--head); font-size: 1.15rem; }
.greet-text .prose:first-child { font-size: 1.2rem; font-weight: 500; }
@media (min-width: 900px) { .greet { grid-template-columns: 1fr 2fr; gap: 4rem; } .greet-side { position: sticky; top: 90px; align-self: start; } }

/* ===== Berita ===== */
.tag { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--blue-dark); background: var(--blue-tint); padding: .15rem .65rem; border-radius: 999px; white-space: nowrap; }
.tag.Pengumuman { background: var(--hl); color: var(--ink); }
.tag.Prestasi { background: var(--ok-bg); color: var(--ok); }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; font-size: .88rem; color: var(--muted); }

.thumb { display: block; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--grey); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-ph { display: grid; place-items: center; width: 100%; height: 100%; color: hsl(var(--h) 35% 38%); font: 700 1rem var(--head);
  background-color: hsl(var(--h) 55% 93%);
  background-image: repeating-linear-gradient(to bottom, transparent 0 23px, hsl(var(--h) 40% 85%) 23px 24px); }

.card { display: grid; gap: .9rem; align-content: start; }
.card-body { display: grid; gap: .45rem; }
.card strong { font-family: var(--head); font-size: 1.2rem; font-weight: 700; line-height: 1.25; }
.card:hover strong { color: var(--blue); text-decoration: underline; text-decoration-color: var(--hl); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.card .muted { font-size: .96rem; line-height: 1.55; }
.cards { display: grid; gap: 2rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }

.news-split { display: grid; gap: 2rem; }
.news-split .feature strong { font-size: clamp(1.4rem, 3.4vw, 1.9rem); }
.news { border-top: 1px solid var(--line); }
.news li { border-bottom: 1px solid var(--line); }
.news-row { display: grid; gap: .35rem; padding: 1.1rem 0; }
.news-row strong { font-family: var(--head); font-size: 1.12rem; font-weight: 700; line-height: 1.3; }
.news-row:hover strong { color: var(--blue); }
@media (min-width: 900px) {
  .news-split { grid-template-columns: 1.4fr 1fr; gap: 3rem; }
  .news-split .news { border-top: 0; }
  .news-split .news li:first-child .news-row { padding-top: 0; }
}

.pills { display: flex; gap: .5rem; margin: 0 calc(-1 * clamp(1rem, 4vw, 2rem)) 1.75rem; padding: .25rem clamp(1rem, 4vw, 2rem); overflow-x: auto; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pills a { flex: none; padding: .5rem 1.1rem; border: 1.5px solid var(--line); border-radius: 999px; font-size: .94rem; font-weight: 600; color: var(--muted); background: #fff; }
.pills a:hover { border-color: var(--ink); color: var(--ink); }
.pills a.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.post-title { font-size: clamp(1.9rem, 6vw, 3rem); font-weight: 800; margin: 1rem 0 1.5rem; }
.cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); margin-bottom: 2rem; }
/* Isi berita (HTML dari editor admin, sudah dibersihkan di server) */
.post-body { font-size: 1.12rem; line-height: 1.8; overflow-wrap: anywhere; }
.post-body > :first-child { margin-top: 0; }
.post-body p { margin: 0 0 1.15em; }
.post-body h2, .post-body h3, .post-body h4 { margin: 1.9em 0 .6em; line-height: 1.25; }
.post-body h2 { font-size: clamp(1.45rem, 4vw, 1.8rem); font-weight: 800; }
.post-body h3 { font-size: clamp(1.25rem, 3.4vw, 1.4rem); font-weight: 800; }
.post-body h4 { font-size: 1.12rem; font-weight: 700; }
.post-body ul, .post-body ol { margin: 0 0 1.15em; padding-left: 1.5em; }
.post-body li { margin: .3em 0; }
.post-body blockquote { margin: 1.5em 0; padding: .4em 0 .4em 1.1rem; border-left: 4px solid var(--hl); color: var(--muted); font-style: italic; }
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.post-body img { display: block; max-width: 100%; height: auto; margin: 1.5em auto; border-radius: var(--radius); }
.post-body .ta-center { text-align: center; } .post-body .ta-right { text-align: right; } .post-body .ta-justify { text-align: justify; }
.post-foot { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

/* ===== Program / ekskul / fasilitas ===== */
.panels { display: grid; gap: 1rem; }
.panel { padding: 1.5rem; border-radius: var(--radius); background: hsl(var(--h) 70% 95%); border: 1px solid hsl(var(--h) 45% 86%); border-top: 6px solid hsl(var(--h) 55% 45%); }
.panel h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: .5rem; }
.panel p { margin: 0; color: var(--muted); }
.items { display: grid; gap: .85rem 2rem; }
.items li h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .25rem; }
.items li p { margin: 0; font-size: .96rem; color: var(--muted); line-height: 1.6; }
.items.boxed li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.items.rows li { padding: 1rem 0 1rem 1.1rem; border-bottom: 1px solid var(--line); border-left: 4px solid var(--hl); }
@media (min-width: 700px) { .panels { grid-template-columns: repeat(3, 1fr); } .items { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .items.boxed { grid-template-columns: repeat(3, 1fr); } }

/* ===== Guru & staf: kartu pelajar mini ===== */
.people { display: grid; grid-template-columns: repeat(2, 1fr); gap: .85rem; }
.person { display: grid; gap: .75rem; align-content: start; padding: 1.1rem; background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--blue); border-radius: 4px 4px var(--radius) var(--radius); }
.person strong { display: block; font-family: var(--head); font-size: 1.05rem; line-height: 1.25; }
.person .muted { display: block; font-size: .88rem; line-height: 1.45; margin-top: .2rem; }
.avatar { width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center; background: var(--blue-tint); color: var(--blue-dark); font: 800 1.3rem var(--head); object-fit: cover; }
.person.lead-person { border-top-color: var(--red); background: linear-gradient(#fff, #fff) padding-box; }
@media (min-width: 640px) { .people { grid-template-columns: repeat(3, 1fr); gap: 1.1rem; } .person.lead-person { grid-column: span 2; grid-template-columns: auto 1fr; align-items: center; gap: 1.25rem; } .person.lead-person .avatar { width: 84px; height: 84px; } }
@media (min-width: 1000px) { .people { grid-template-columns: repeat(4, 1fr); } }

/* ===== Galeri ===== */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.tile { margin: 0; }
.tile-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--radius); }
.tile img, .tile-ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); display: block; }
.tile-ph { background-color: hsl(var(--h) 45% 90%); background-image: repeating-linear-gradient(to bottom, transparent 0 23px, hsl(var(--h) 35% 83%) 23px 24px); }
.tile figcaption { font-size: .9rem; font-weight: 500; padding-top: .5rem; color: var(--muted); }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); gap: 1.1rem; } }
@media (min-width: 1000px) { .tiles.home { grid-template-columns: repeat(6, 1fr); } .tiles:not(.home) { grid-template-columns: repeat(4, 1fr); } }

.lightbox { padding: 0; border: 0; background: transparent; max-width: min(96vw, 1100px); width: 100%; max-height: 92vh; color: #fff; }
.lightbox::backdrop { background: rgba(10,16,38,.88); }
.lightbox-in { position: relative; display: grid; gap: .75rem; justify-items: center; }
.lightbox img { max-height: 78vh; width: auto; border-radius: var(--radius-sm); }
.lightbox p { margin: 0; font-weight: 600; }
.lightbox-x { position: absolute; top: -.25rem; right: -.25rem; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; color: var(--ink); cursor: pointer; display: grid; place-items: center; }

/* ===== Daftar centang & alur ===== */
.checks li { position: relative; padding: .7rem 0 .7rem 2.1rem; border-bottom: 1px solid var(--line); }
.checks li::before { content: ""; position: absolute; left: .2rem; top: 1.05rem; width: 12px; height: 7px; border-left: 3px solid var(--blue); border-bottom: 3px solid var(--blue); transform: rotate(-45deg); }
.flow { counter-reset: f; position: relative; }
.flow li { counter-increment: f; position: relative; display: flex; gap: 1rem; padding-bottom: 1.4rem; }
.flow li:not(:last-child)::after { content: ""; position: absolute; left: 1.05rem; top: 2.3rem; bottom: .2rem; width: 2px; background: var(--line); }
.flow li::before { content: counter(f); flex: none; width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font: 800 .95rem var(--head); box-shadow: 0 0 0 4px var(--paper); }
.flow li > span { padding-top: .2rem; }

.vision { margin: 0 0 .5rem; padding: .25rem 0 .25rem 1.25rem; border-left: 3px solid var(--red); font: 700 clamp(1.3rem, 3.6vw, 1.8rem)/1.35 var(--head); }
.split { display: grid; gap: 2.5rem; }
@media (min-width: 960px) { .split { grid-template-columns: 1fr 360px; gap: 4rem; align-items: start; } .split aside { position: sticky; top: 90px; } }
.datacard { background: #fff; border: 1px solid var(--line); border-top: 6px solid var(--blue); border-radius: 4px 4px var(--radius) var(--radius); padding: 1.25rem 1.4rem; }
.datacard h2 { font-size: 1.2rem; margin-bottom: .5rem; }
.datacard div { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.datacard div:last-child { border: 0; }
.datacard dt { font-size: .82rem; color: var(--muted); }
.datacard dd { font-weight: 600; }

.banner { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; padding: 1.25rem 1.5rem; border-radius: var(--radius); margin-bottom: 2.5rem; }
.banner strong { font: 800 1.2rem var(--head); }
.banner.open { background: var(--hl); }
.banner.closed { background: var(--bad-bg); color: var(--bad); }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2.5rem; flex-wrap: wrap; }
.pager > span:nth-child(2) { order: 3; width: 100%; text-align: center; font-size: .9rem; }
@media (min-width: 560px) { .pager > span:nth-child(2) { order: 0; width: auto; } }

/* ===== Formulir ===== */
.two { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .two { grid-template-columns: 1fr 360px; gap: 4rem; align-items: start; } }
.field { margin-bottom: 1.15rem; }
.field label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: .4rem; }
input, select, textarea { width: 100%; min-height: 50px; font: inherit; font-size: 1rem; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: .75rem 1rem; transition: border-color .15s, box-shadow .15s; }
input:hover, textarea:hover { border-color: #aab5cc; }
input:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-tint); }
[aria-invalid="true"] { border-color: var(--bad); }
textarea { resize: vertical; min-height: 150px; }
.err { display: block; color: var(--bad); margin-top: .35rem; font-size: .88rem; font-weight: 500; }
.alert { padding: .9rem 1.1rem; border-radius: 12px; margin-bottom: 1.5rem; font-weight: 600; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.info { background: #fff; border: 1px solid var(--line); border-top: 6px solid var(--hl); border-radius: 4px 4px var(--radius) var(--radius); padding: 1.4rem; }
.info h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.info p { margin-bottom: 1rem; }
.info .muted { font-size: .85rem; }
.info .actions { margin-top: 1.25rem; flex-direction: column; }

/* ===== CTA ===== */
.cta { background: var(--blue); color: #fff; }
.cta-in { display: grid; gap: 1.25rem; align-items: center; }
.cta h2 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); font-weight: 800; }
.cta p { margin: .5rem 0 0; color: #cdd8f6; }
.cta .btn { border-color: #fff; color: #fff; }
.cta .btn:hover { background: #fff; color: var(--blue); }
.cta .btn.hl { border-color: var(--hl); color: var(--ink); }
.cta .actions { margin: 0; }
@media (min-width: 800px) { .cta-in { grid-template-columns: 1fr auto; gap: 3rem; } }

/* ===== Footer ===== */
.site-footer { background: var(--ink); color: #c5cee6; padding-top: 3rem; }
.foot { display: grid; gap: 2rem; }
.foot-name { font: 800 1.25rem var(--head); color: #fff; }
.foot p { font-size: .95rem; margin: .5rem 0 0; line-height: 1.7; }
.foot h2 { font: 700 1rem var(--head); color: #fff; margin-bottom: .75rem; }
.foot nav { display: grid; grid-template-columns: 1fr 1fr; gap: .1rem 1rem; }
.foot nav a, .foot p a { display: inline-block; padding: .35rem 0; font-size: .95rem; }
.foot a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--hl); text-underline-offset: 4px; }
.copy { padding-block: 2rem 1.5rem; font-size: .85rem; border-top: 1px solid rgba(255,255,255,.12); margin-top: 2rem; color: #8f9bbd; }
@media (min-width: 800px) { .foot { grid-template-columns: 1.4fr 1.1fr 1fr; gap: 3rem; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .tabbar, .sheet, .site-footer, .cta { display: none !important; }
  body { padding: 0; }
  .hero { background-image: none; }
}

/* ===== Gambar yang diatur dari admin ===== */
.brand-mark.has-logo { background: transparent; box-shadow: none; overflow: hidden; }
.brand-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; }
.hero-side { display: grid; gap: 1rem; align-content: center; min-width: 0; }
.hero-photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.greet-photo { width: 100%; max-width: 220px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 1rem; }

/* ===== Menu dropdown (Prestasi) ===== */
.has-sub { position: relative; }
.has-sub > a .caret { display: inline-block; width: 6px; height: 6px; margin-left: .4rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.sub-menu { display: none; position: absolute; top: 100%; left: 0; z-index: 60; min-width: 210px; padding: .4rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 32px -16px rgba(16,27,61,.35); }
.has-sub:hover .sub-menu, .has-sub:focus-within .sub-menu { display: block; }
.nav .sub-menu a:not(.btn) { display: block; padding: .55rem .8rem; white-space: nowrap; }
.nav .sub-menu a:not(.btn):hover { background: var(--blue-tint); color: var(--blue-dark); }
.sheet-links a.sub { padding-left: 1.5rem; font-size: .98rem; font-weight: 500; color: var(--muted); }

/* ===== Prestasi ===== */
.head.spaced { margin-top: 3rem; }
.ach-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.ach { display: grid; align-content: start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ach-media { position: relative; aspect-ratio: 16 / 10; background: var(--grey); }
.ach-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ach-ph { display: grid; place-items: center; width: 100%; height: 100%; color: hsl(var(--h) 40% 36%);
  background-color: hsl(var(--h) 55% 93%);
  background-image: repeating-linear-gradient(to bottom, transparent 0 23px, hsl(var(--h) 40% 85%) 23px 24px); }
.ach-ph svg { width: 54px; height: 54px; }
.ach-award { position: absolute; left: .75rem; top: .75rem; padding: .2rem .8rem; border-radius: 999px; background: var(--hl); color: #101b3d; font: 800 .82rem var(--head); box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.ach-body { display: grid; gap: .4rem; padding: 1rem 1.15rem 1.25rem; }
.ach-body .tag { justify-self: start; }
.ach-body h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.ach-body p { margin: 0; }
.ach-who { font-size: .98rem; }
.ach-desc { font-size: .92rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== Teks merek (tagline di bawah nama; hanya tampil di template tertentu) ===== */
.brand-text { display: grid; min-width: 0; line-height: 1.15; }
.brand-tag { display: none; }

/* ===== Sambutan kepala sekolah di halaman Profil ===== */
.principal { display: grid; gap: 1.5rem; padding-bottom: 1rem; margin-bottom: .5rem; border-bottom: 1px solid var(--line); }
.principal-fig { margin: 0; display: grid; gap: .75rem; justify-items: start; }
.principal-fig img, .principal-ph { width: 100%; max-width: 240px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); background: var(--blue-tint); }
.principal-ph { display: grid; place-items: center; font: 800 4rem var(--head); color: var(--blue); }
.principal-fig figcaption { display: grid; line-height: 1.35; }
.principal-fig figcaption strong { font: 700 1.05rem var(--head); }
.principal-text .prose:first-of-type { font-size: 1.15rem; font-weight: 500; }
@media (min-width: 700px) { .principal { grid-template-columns: 240px 1fr; gap: 2rem; align-items: start; } }
