/*
Theme Name: SMAN 22 Bandung Modern
Theme URI: https://sman22bdg.sch.id
Author: SMAN 22 Bandung
Description: Tema modern & ringan untuk SMA Negeri 22 Bandung. Fokus pada kecepatan muat (tanpa font/library eksternal), tampilan bento-grid masa kini, dark mode, dan fitur interaktif lengkap.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sman22m
*/

/* =========================================================
   0. DESIGN TOKENS (light & dark)
   ========================================================= */
:root {
  --primary: #1E5631;
  --primary-soft: #E9F3EC;
  --accent: #F2B705;
  --bg: #FBFBF8;
  --surface: #FFFFFF;
  --surface-2: #F3F4EF;
  --text: #14181A;
  --text-muted: #5C6560;
  --border: #E7E9E3;
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --shadow: 0 8px 30px rgba(20,24,26,.06);
  --shadow-lg: 0 20px 60px rgba(20,24,26,.14);
  --container: 1200px;
  --ease: cubic-bezier(.16,1,.3,1);
}
html[data-theme="dark"] {
  --primary: #4CAF6D;
  --primary-soft: rgba(76,175,109,.12);
  --accent: #F5C518;
  --bg: #10141A;
  --surface: #171C22;
  --surface-2: #1D232B;
  --text: #F2F4F1;
  --text-muted: #9BA5A0;
  --border: #2A3038;
  --shadow: 0 8px 30px rgba(0,0,0,.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.55);
}

/* =========================================================
   1. RESET / BASE — pakai system font stack: nol request font
   eksternal = load lebih cepat & tidak ada layout shift (FOUT).
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  transition: background .3s var(--ease), color .3s var(--ease);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--primary); color: #fff;
  padding: 12px 20px; z-index: 10000; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary); color: #fff; font-weight: 600; font-size: .95rem;
  padding: 13px 26px; border-radius: 100px; border: none; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color:#fff; }
.btn-ghost {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-accent { background: var(--accent); color: #14181A; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: .78rem;
  letter-spacing: .04em; text-transform: uppercase; padding: 7px 16px; border-radius: 100px;
}
.section { padding: 88px 0; }
.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.section-head p { color: var(--text-muted); }

/* =========================================================
   2. ANNOUNCEMENT BAR (PPDB / pengumuman)
   ========================================================= */
.announce-bar {
  background: var(--primary); color: #fff; text-align: center; font-size: .86rem;
  padding: 10px 20px; position: relative;
}
.announce-bar a { text-decoration: underline; font-weight: 700; }
.announce-close {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; color: #fff; cursor: pointer; font-size: 1.1rem; opacity: .8;
}
.announce-close:hover { opacity: 1; }

/* =========================================================
   3. HEADER — sticky, auto-hide saat scroll ke bawah
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 999; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
  transition: transform .35s var(--ease), background .3s var(--ease);
}
.site-header.header-hidden { transform: translateY(-100%); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; }
.site-branding { display: flex; align-items: center; gap: 12px; }
.site-branding img.custom-logo { height: 46px; width: auto; border-radius: 8px; }
.site-branding .site-title { font-weight: 800; font-size: 1rem; }
.site-branding .site-tagline { font-size: .72rem; color: var(--text-muted); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1.05rem; transition: background .2s, transform .2s;
}
.icon-btn:hover { background: var(--surface-2); transform: translateY(-2px); }

.primary-menu { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.primary-menu li { position: relative; }
.primary-menu > li > a {
  display: block; padding: 10px 14px; font-weight: 600; font-size: .9rem; border-radius: 10px; color: var(--text);
}
.primary-menu > li > a:hover { background: var(--surface-2); color: var(--primary); }
.primary-menu ul {
  display: none; position: absolute; top: 100%; left: 0; min-width: 230px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 8px; margin: 8px 0 0; z-index: 30;
}
.primary-menu li:hover > ul { display: block; }
.primary-menu ul li a { padding: 9px 12px; font-size: .86rem; border-radius: 8px; display: block; }
.primary-menu ul li a:hover { background: var(--surface-2); }
.nav-toggle { display: none; }

@media (max-width: 960px) {
  .nav-toggle {
    display: flex; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface); align-items: center; justify-content: center; cursor: pointer; font-size: 1.2rem;
  }
  .primary-menu {
    display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--surface); border-top: 1px solid var(--border); padding: 10px 20px 20px; box-shadow: var(--shadow-lg);
  }
  .primary-menu.is-open { display: flex; }
  .primary-menu ul { position: static; box-shadow: none; display: none; }
  .primary-menu li.submenu-open > ul { display: block; }
}

/* Search modal */
.search-modal {
  position: fixed; inset: 0; background: rgba(15,18,20,.55); backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center; padding: 90px 20px; z-index: 1200;
}
.search-modal.is-open { display: flex; }
.search-modal-box { background: var(--surface); border-radius: var(--radius); padding: 22px; width: 100%; max-width: 600px; box-shadow: var(--shadow-lg); }
.search-modal-box form { display: flex; gap: 10px; }
.search-modal-box input[type="search"] {
  flex: 1; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font-size: 1rem;
}
.search-modal-box .close-search { background: transparent; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-muted); float: right; }

/* =========================================================
   4. HERO — bento grid
   ========================================================= */
.hero { padding: 60px 0 20px; }
.bento { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 120px; gap: 18px; }
.bento .b-hero {
  grid-column: span 4; grid-row: span 3;
  background: linear-gradient(150deg, var(--primary), color-mix(in srgb, var(--primary) 70%, black));
  border-radius: var(--radius-lg); color: #fff; padding: 44px; display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.bento .b-hero::after {
  content: ""; position: absolute; right: -60px; bottom: -60px; width: 260px; height: 260px; border-radius: 50%;
  background: rgba(242,183,5,.18);
}
.bento .b-hero h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); color: #fff; position: relative; }
.bento .b-hero p { color: rgba(255,255,255,.85); max-width: 460px; margin-bottom: 22px; position: relative; }
.bento .b-hero .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; position: relative; }

.bento .b-image {
  grid-column: span 2; grid-row: span 3; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2);
}
.bento .b-image img { width: 100%; height: 100%; object-fit: cover; }

.bento .b-stat {
  grid-column: span 2; grid-row: span 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 22px; display: flex; flex-direction: column; justify-content: center;
  box-shadow: var(--shadow);
}
.bento .b-stat .num { font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.bento .b-stat.counted .num::after { content: attr(data-suffix); }
.bento .b-stat .label { font-size: .8rem; color: var(--text-muted); }

@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: auto; }
  .bento .b-hero, .bento .b-image, .bento .b-stat { grid-column: span 2; }
  .bento .b-hero { grid-row: auto; padding: 32px; }
  .bento .b-image { grid-row: auto; aspect-ratio: 16/9; }
}

/* =========================================================
   5. KEPSEK / SAMBUTAN
   ========================================================= */
.kepsek-grid { display: grid; grid-template-columns: .75fr 1.25fr; gap: 50px; align-items: center; }
.kepsek-photo {
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); background: var(--surface-2);
  aspect-ratio: 4/5; display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.kepsek-name { font-size: 1.4rem; color: var(--primary); }
.kepsek-role { color: var(--text-muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin-bottom: 16px; }
.kepsek blockquote { margin: 0; padding-left: 22px; border-left: 3px solid var(--accent); font-size: 1.05rem; color: var(--text); }
@media (max-width: 860px) { .kepsek-grid { grid-template-columns: 1fr; } }

/* =========================================================
   6. CARDS GRID (nilai sekolah)
   ========================================================= */
.cards-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.value-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 22px;
  box-shadow: var(--shadow); transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.value-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.value-card .icon {
  width: 52px; height: 52px; border-radius: 14px; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: 16px;
}
.value-card h3 { font-size: 1.02rem; }
.value-card p { color: var(--text-muted); font-size: .9rem; margin: 0; }
@media (max-width: 900px) { .cards-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .cards-4 { grid-template-columns: 1fr; } }

/* =========================================================
   7. BERITA
   ========================================================= */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.news-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .3s var(--ease);
}
.news-card:hover { transform: translateY(-5px); }
.news-card .thumb { aspect-ratio: 16/10; background: var(--surface-2); overflow: hidden; }
.news-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-card .body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.news-card .date { color: var(--primary); font-size: .76rem; font-weight: 700; text-transform: uppercase; margin-bottom: 8px; }
.news-card h3 { font-size: 1.05rem; }
.news-card p { color: var(--text-muted); font-size: .88rem; flex: 1; }
.news-card .readmore { font-weight: 700; font-size: .84rem; color: var(--primary); margin-top: 10px; }
.news-empty { text-align: center; color: var(--text-muted); padding: 40px; border: 1px dashed var(--border); border-radius: var(--radius); }
@media (max-width: 900px) { .news-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .news-grid { grid-template-columns: 1fr; } }
.section-footer-link { text-align: center; margin-top: 36px; }

/* =========================================================
   8. TESTIMONI / ALUMNI (scroll-snap slider, tanpa JS berat)
   ========================================================= */
.testi-track {
  display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px;
  scrollbar-width: thin;
}
.testi-card {
  flex: 0 0 320px; scroll-snap-align: start; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.testi-card p { color: var(--text); font-style: italic; margin-bottom: 16px; }
.testi-card .who { display: flex; align-items: center; gap: 10px; }
.testi-card .avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.testi-card .name { font-weight: 700; font-size: .9rem; }
.testi-card .role { font-size: .78rem; color: var(--text-muted); }

/* =========================================================
   9. FAQ ACCORDION
   ========================================================= */
.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 18px 20px; font-weight: 700; display: flex;
  align-items: center; justify-content: space-between; font-size: .96rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--primary); transition: transform .25s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 20px 18px; color: var(--text-muted); font-size: .9rem; }

/* =========================================================
   10. STATS BAND
   ========================================================= */
.stats-band { background: var(--surface-2); border-radius: var(--radius-lg); padding: 40px; display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; text-align: center; }
.stats-band .num { font-size: 2.2rem; font-weight: 800; color: var(--primary); }
.stats-band .label { color: var(--text-muted); font-size: .9rem; }
@media (max-width: 700px) { .stats-band { grid-template-columns: 1fr; } }

/* =========================================================
   11. FOOTER
   ========================================================= */
.site-footer { background: var(--surface-2); border-top: 1px solid var(--border); padding: 60px 0 0; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; padding-bottom: 36px; }
.footer-grid h4 { font-size: .98rem; }
.footer-grid p, .footer-grid a { color: var(--text-muted); font-size: .88rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid ul li { margin-bottom: 8px; }
.footer-grid ul li a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding: 18px 0; text-align: center; font-size: .8rem; color: var(--text-muted); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* Floating buttons */
.fab-stack { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 12px; z-index: 900; }
.fab {
  width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); font-size: 1.3rem; cursor: pointer; border: none; transition: transform .25s var(--ease);
}
.fab:hover { transform: translateY(-4px) scale(1.05); }
.fab-whatsapp { background: #25D366; color: #fff; }
.fab-top { background: var(--surface); color: var(--text); border: 1px solid var(--border); opacity: 0; pointer-events: none; }
.fab-top.visible { opacity: 1; pointer-events: auto; }

/* =========================================================
   12. HALAMAN DALAM & POST
   ========================================================= */
.page-hero { padding: 50px 0 30px; }
.breadcrumb { color: var(--text-muted); font-size: .85rem; margin-bottom: 10px; }
.breadcrumb a:hover { color: var(--primary); }
.entry-wrap { max-width: 840px; margin: 0 auto; padding: 20px 24px 70px; }
.entry-content h2 { font-size: 1.4rem; margin-top: 1.4em; color: var(--primary); }
.entry-content h3 { font-size: 1.15rem; margin-top: 1.2em; }
.entry-content p { margin-bottom: 1.1em; }
.entry-content table {
  width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: .86rem;
  display: block; overflow-x: auto;
}
.entry-content table th { background: var(--primary); color: #fff; text-align: left; padding: 10px 12px; }
.entry-content table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.entry-content table tr:nth-child(even) td { background: var(--surface-2); }
.entry-content blockquote { border-left: 3px solid var(--accent); margin: 1.4em 0; padding: 4px 0 4px 18px; color: var(--text-muted); font-style: italic; }
.entry-content img { border-radius: var(--radius); margin: 1em 0; }
.entry-meta { color: var(--text-muted); font-size: .85rem; margin-bottom: 20px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.post-thumb { border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 30px; }

/* Reading progress bar */
.reading-progress {
  position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); width: 0%; z-index: 1300;
  transition: width .1s linear;
}

/* Share buttons */
.share-row { display: flex; gap: 10px; margin: 30px 0; flex-wrap: wrap; }
.share-row a, .share-row button {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 100px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .85rem; cursor: pointer;
}
.share-row a:hover, .share-row button:hover { background: var(--surface-2); }

/* Related posts */
.related-posts { margin-top: 50px; padding-top: 40px; border-top: 1px solid var(--border); }
.related-posts h3 { font-size: 1.1rem; margin-bottom: 18px; }
.related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
@media (max-width: 700px) { .related-grid { grid-template-columns: 1fr; } }

/* Archive */
.archive-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 22px; max-width: var(--container); margin: 0 auto; padding: 40px 24px 60px; }
@media (max-width: 700px) { .archive-grid { grid-template-columns: 1fr; } }
.pagination { text-align: center; padding: 0 0 60px; }
.pagination a, .pagination span { display: inline-block; padding: 8px 14px; margin: 0 4px; border-radius: 10px; border: 1px solid var(--border); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.not-found { text-align: center; padding: 100px 24px; }
.not-found form { max-width: 420px; margin: 20px auto 0; display: flex; gap: 8px; }
.not-found input[type="search"] { flex: 1; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }

/* =========================================================
   13. PRINT — khusus rapi saat mencetak Tata Tertib dsb.
   ========================================================= */
@media print {
  .site-header, .announce-bar, .fab-stack, .site-footer, .share-row, .search-modal, .reading-progress { display: none !important; }
  body { background: #fff; color: #000; }
  .entry-wrap { max-width: 100%; padding: 0; }
}

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