/* ==================================================================
   site-chrome.css — shared header + footer for Sathara Vidhyapeetaya
   Used on every page that has the site header/footer.
   Self-contained: works with or without Bootstrap / modern.css.
   Markup is generated by tools/site-chrome.py — edit there, re-run.
   ================================================================== */

:root{
  --sv-blue:#0ea5e9;
  --sv-blue2:#0369a1;
  --sv-purple:#6d28d9;
  --sv-gold:#b45309;
  --sv-ink:#0f172a;
  --sv-muted:#64748b;
  --sv-line:rgba(15,23,42,.08);
  --sv-head-bg:rgba(255,255,255,.88);
  --sv-head-h:76px;
}
html.dark{
  --sv-ink:#e2e8f0;
  --sv-muted:#94a3b8;
  --sv-line:rgba(148,163,184,.18);
  --sv-head-bg:rgba(15,23,42,.86);
}

/* ── Utility top bar (desktop only, scrolls away) ─────────────── */
.sv-topbar{
  background:linear-gradient(90deg,#0b1f33,#0c2c4a); color:rgba(226,232,240,.85);
  font-family:"Open Sans","Noto Sans Sinhala","Iskoola Pota","Nirmala UI",system-ui,sans-serif; font-size:12.5px; line-height:1;
}
.sv-topbar *{ box-sizing:border-box; }
.sv-topbar .sv-topbar__inner{ max-width:1320px; height:38px; margin:0 auto; padding:0 28px;
  display:flex; align-items:center; justify-content:space-between; gap:16px; }
.sv-topbar .sv-topbar__info, .sv-topbar .sv-topbar__links{ display:flex; align-items:center; gap:18px; min-width:0; }
.sv-topbar a{ color:rgba(226,232,240,.85) !important; text-decoration:none !important; white-space:nowrap; font-weight:600; }
.sv-topbar a:hover{ color:#7dd3fc !important; }
.sv-topbar .sv-topbar__loc{ white-space:nowrap; color:rgba(226,232,240,.6); }
.sv-topbar a.sv-chip{ display:inline-flex; align-items:center; gap:6px; height:26px; padding:0 12px; border-radius:999px; font-weight:800; }
.sv-topbar a.sv-chip--gold{ background:linear-gradient(135deg,#fbbf24,#f59e0b); color:#3b1d00 !important; }
.sv-topbar a.sv-chip--gold:hover{ filter:brightness(1.06); color:#3b1d00 !important; }
.sv-topbar a.sv-chip b{ font-weight:700; opacity:.8; }
.sv-topbar a.sv-tsocial{ display:inline-flex; width:26px; height:26px; align-items:center; justify-content:center; border-radius:8px; background:rgba(255,255,255,.08); }
.sv-topbar a.sv-tsocial:hover{ background:#0ea5e9; color:#fff !important; }
.sv-topbar svg{ width:14px; height:14px; fill:currentColor; }
@media (max-width:1199px){ .sv-topbar .sv-topbar__loc{ display:none; } }
@media (max-width:991px){ .sv-topbar{ display:none; } }

/* ── Header shell ─────────────────────────────────────────────── */
header.sv-header{
  position:sticky; top:0; z-index:1000; width:100%; margin:0; padding:0;
  background:var(--sv-head-bg); -webkit-backdrop-filter:saturate(170%) blur(14px); backdrop-filter:saturate(170%) blur(14px);
  border-bottom:1px solid var(--sv-line);
  box-shadow:0 4px 24px rgba(15,23,42,.06);
  font-family:"Open Sans","Noto Sans Sinhala","Iskoola Pota","Nirmala UI",system-ui,-apple-system,"Segoe UI",sans-serif;
  transition:box-shadow .25s ease, background .3s ease;
}
header.sv-header.is-scrolled{ box-shadow:0 10px 30px rgba(15,23,42,.12); }
header.sv-header *, aside.sv-drawer *, footer.sv-footer *{ box-sizing:border-box; }

header.sv-header .sv-header__inner{
  max-width:1320px; height:var(--sv-head-h); margin:0 auto; padding:0 28px;
  display:flex; align-items:center; gap:20px;
}

/* brand */
header.sv-header a.sv-brand{
  display:flex; align-items:center; gap:12px; flex-shrink:0;
  text-decoration:none !important; color:var(--sv-ink) !important; margin:0; padding:0; float:none;
}
header.sv-header a.sv-brand img{
  width:48px; height:48px; object-fit:cover; border-radius:12px; background:#fff;
  box-shadow:0 4px 14px rgba(3,105,161,.22); margin:0; max-width:none;
}
header.sv-header .sv-brand__text{ display:flex; flex-direction:column; line-height:1.15; }
header.sv-header .sv-brand__text b{ font-size:17px; font-weight:800; color:var(--sv-blue2); letter-spacing:.2px; }
header.sv-header .sv-brand__text small{ font-size:11.5px; font-weight:700; color:var(--sv-muted); letter-spacing:.6px; text-transform:uppercase; }
html.dark header.sv-header .sv-brand__text b{ color:#7dd3fc; }

/* main links — centred, equal-height, underline indicator */
header.sv-header nav.sv-nav{
  flex:1 1 auto; display:flex; align-items:center; justify-content:center; gap:2px; min-width:0; margin:0;
}
header.sv-header nav.sv-nav > a{
  position:relative; display:inline-flex; align-items:center; height:40px; padding:0 13px; margin:0;
  font-size:14.5px; font-weight:700; letter-spacing:.1px; white-space:nowrap; text-transform:none;
  color:var(--sv-ink) !important; text-decoration:none !important; border-radius:10px;
  transition:color .18s ease, background .18s ease;
}
header.sv-header nav.sv-nav > a::after{
  content:""; position:absolute; left:13px; right:13px; bottom:5px; height:2.5px; border-radius:2px;
  background:linear-gradient(90deg,var(--sv-blue),var(--sv-purple));
  transform:scaleX(0); transform-origin:center; transition:transform .22s ease;
}
header.sv-header nav.sv-nav > a:hover,
header.sv-header nav.sv-nav > a:focus-visible{ color:var(--sv-blue2) !important; background:rgba(14,165,233,.08); }
html.dark header.sv-header nav.sv-nav > a:hover{ color:#7dd3fc !important; background:rgba(125,211,252,.08); }
header.sv-header nav.sv-nav > a:hover::after,
header.sv-header nav.sv-nav > a.is-active::after{ transform:scaleX(1); }
header.sv-header nav.sv-nav > a.is-active{ color:var(--sv-blue2) !important; }
html.dark header.sv-header nav.sv-nav > a.is-active{ color:#7dd3fc !important; }
header.sv-header nav.sv-nav > a.sv-si{ font-family:"Noto Sans Sinhala","Iskoola Pota","Nirmala UI",sans-serif; }

/* right-hand action pills */
header.sv-header .sv-actions{ display:flex; align-items:center; gap:8px; flex-shrink:0; }
header.sv-header a.sv-pill{
  display:inline-flex; align-items:center; gap:6px; height:40px; padding:0 15px; margin:0;
  border-radius:999px; font-size:13.5px; font-weight:800; white-space:nowrap; line-height:1;
  text-decoration:none !important; border:1.5px solid transparent;
  transition:transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
header.sv-header a.sv-pill:hover{ transform:translateY(-1px); }
header.sv-header a.sv-pill .sv-ic{ font-size:15px; line-height:1; }
header.sv-header a.sv-pill em{
  font-style:normal; font-size:10px; font-weight:900; letter-spacing:.6px; padding:3px 6px; border-radius:6px;
  background:#dcfce7; color:#15803d;
}
/* results — soft gold outline */
header.sv-header a.sv-pill--results{ color:var(--sv-gold) !important; background:#fffbeb; border-color:#fde68a; }
header.sv-header a.sv-pill--results:hover{ background:#fef3c7; }
/* olympiad — soft purple outline */
header.sv-header a.sv-pill--olympiad{ color:var(--sv-purple) !important; background:#f5f3ff; border-color:#ddd6fe; }
header.sv-header a.sv-pill--olympiad:hover{ background:#ede9fe; }
/* games hub — primary CTA */
header.sv-header a.sv-pill--hub{
  color:#fff !important; background:linear-gradient(135deg,var(--sv-blue),var(--sv-blue2));
  box-shadow:0 8px 20px rgba(14,165,233,.35);
}
header.sv-header a.sv-pill--hub:hover{ box-shadow:0 12px 26px rgba(14,165,233,.45); color:#fff !important; }
header.sv-header a.sv-pill--olympiad.is-active{ background:#ede9fe; border-color:#a78bfa; }
header.sv-header a.sv-pill--hub.is-active{ box-shadow:0 0 0 3px rgba(14,165,233,.25), 0 8px 20px rgba(14,165,233,.35); }
html.dark header.sv-header a.sv-pill--results{ background:rgba(251,191,36,.10); border-color:rgba(251,191,36,.35); color:#fcd34d !important; }
html.dark header.sv-header a.sv-pill--olympiad{ background:rgba(167,139,250,.12); border-color:rgba(167,139,250,.35); color:#c4b5fd !important; }

/* icon buttons (theme / menu) */
header.sv-header button.sv-icon-btn{
  width:40px; height:40px; margin:0; padding:0; border-radius:12px; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; font-size:18px; line-height:1;
  background:transparent; color:var(--sv-ink); border:1.5px solid var(--sv-line);
  transition:background .18s ease, transform .18s ease;
}
header.sv-header button.sv-icon-btn:hover{ background:rgba(14,165,233,.08); transform:translateY(-1px); }
header.sv-header button.sv-theme[hidden]{ display:none; }
header.sv-header button.sv-burger{ display:none; }
header.sv-header button.sv-burger span,
header.sv-header button.sv-burger span::before,
header.sv-header button.sv-burger span::after{
  display:block; width:18px; height:2px; border-radius:2px; background:currentColor; position:relative;
}
header.sv-header button.sv-burger span::before,
header.sv-header button.sv-burger span::after{ content:""; position:absolute; left:0; }
header.sv-header button.sv-burger span::before{ top:-6px; }
header.sv-header button.sv-burger span::after{ top:6px; }

/* optional context links row (e.g. "← Grade 10") under the header */
.sv-crumbs{
  max-width:1320px; margin:0 auto; padding:10px 28px 0; display:flex; flex-wrap:wrap; gap:8px;
  font-family:"Open Sans","Noto Sans Sinhala",system-ui,sans-serif;
}
.sv-crumbs a{
  display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:999px; font-size:13px; font-weight:700;
  color:var(--sv-blue2) !important; background:rgba(14,165,233,.08); border:1px solid rgba(14,165,233,.2); text-decoration:none !important;
}
.sv-crumbs a:hover{ background:rgba(14,165,233,.15); }

/* ── Responsive header ────────────────────────────────────────── */
@media (max-width:1299px){
  header.sv-header .sv-header__inner{ padding:0 22px; gap:14px; }
  .sv-topbar .sv-topbar__inner, .sv-crumbs{ padding-left:22px; padding-right:22px; }
}
@media (max-width:1199px){ header.sv-header .sv-brand__text{ display:none; } }
@media (max-width:1139px){
  header.sv-header nav.sv-nav > a{ padding:0 9px; font-size:13.5px; }
  header.sv-header nav.sv-nav > a::after{ left:9px; right:9px; }
  header.sv-header a.sv-pill{ padding:0 12px; font-size:13px; }
  header.sv-header a.sv-pill em{ display:none; }
}
/* tablets & phones: compact bar + slide-in drawer */
@media (max-width:991px){
  :root{ --sv-head-h:62px; }
  header.sv-header .sv-header__inner{ padding:0 14px; gap:10px; }
  header.sv-header nav.sv-nav,
  header.sv-header a.sv-pill--olympiad{ display:none; }
  header.sv-header .sv-actions{ margin-left:auto; }
  header.sv-header .sv-brand__text{ display:flex; }
  header.sv-header .sv-brand__text b{ font-size:15px; }
  header.sv-header .sv-brand__text small{ font-size:10px; }
  header.sv-header a.sv-brand img{ width:40px; height:40px; border-radius:10px; }
  header.sv-header button.sv-burger{ display:inline-flex; }
  header.sv-header a.sv-pill--hub{ height:38px; padding:0 13px; }
  .sv-crumbs{ padding:10px 14px 0; }
  #mobileHubFab{ display:none !important; } /* header already shows Games Hub */
}
@media (max-width:420px){
  header.sv-header .sv-brand__text{ display:none; }
  header.sv-header a.sv-pill--hub .sv-txt{ display:none; }
  header.sv-header a.sv-pill--hub{ width:40px; padding:0; justify-content:center; }
}

/* ── Drawer (mobile / tablet menu) ────────────────────────────── */
.sv-backdrop{
  position:fixed; inset:0; z-index:1490; background:rgba(2,6,23,.5); -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px);
  opacity:0; visibility:hidden; transition:opacity .3s ease, visibility .3s ease;
}
.sv-backdrop.open{ opacity:1; visibility:visible; }
aside.sv-drawer{
  position:fixed; top:0; right:0; z-index:1500; height:100%; width:min(320px,86vw);
  display:flex; flex-direction:column; padding:18px 16px; overflow-y:auto;
  background:#fff; color:#0f172a; visibility:hidden; transform:translateX(100%);
  transition:transform .32s cubic-bezier(.5,.05,.25,1), visibility 0s linear .32s;
  font-family:"Open Sans","Noto Sans Sinhala",system-ui,sans-serif;
}
html.dark aside.sv-drawer{ background:#111827; color:#e2e8f0; }
aside.sv-drawer.open{ transform:translateX(0); visibility:visible; box-shadow:-18px 0 50px rgba(2,6,23,.35);
  transition:transform .32s cubic-bezier(.5,.05,.25,1), visibility 0s; }
aside.sv-drawer .sv-drawer__head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
aside.sv-drawer .sv-drawer__brand{ display:flex; align-items:center; gap:10px; font-weight:900; font-size:16px; }
aside.sv-drawer .sv-drawer__brand img{ width:36px; height:36px; border-radius:9px; }
aside.sv-drawer button.sv-close{
  width:38px; height:38px; border-radius:11px; border:1px solid rgba(100,116,139,.25);
  background:transparent; color:inherit; font-size:18px; cursor:pointer;
}
aside.sv-drawer nav{ display:flex; flex-direction:column; gap:4px; }
aside.sv-drawer a.sv-dlink{
  display:flex; align-items:center; gap:12px; padding:12px 14px; border-radius:12px;
  font-size:15px; font-weight:700; color:inherit !important; text-decoration:none !important;
  transition:background .18s ease, transform .18s ease;
}
aside.sv-drawer a.sv-dlink .sv-ic{ width:24px; text-align:center; font-size:18px; }
aside.sv-drawer a.sv-dlink:hover{ background:rgba(14,165,233,.10); transform:translateX(3px); }
aside.sv-drawer a.sv-dlink.is-active{ background:rgba(14,165,233,.12); color:#0369a1 !important; }
html.dark aside.sv-drawer a.sv-dlink.is-active{ color:#7dd3fc !important; }
aside.sv-drawer a.sv-dlink.sv-cta{ justify-content:center; color:#fff !important; margin-top:6px;
  background:linear-gradient(135deg,var(--sv-blue),var(--sv-blue2)); box-shadow:0 10px 22px rgba(14,165,233,.35); }
aside.sv-drawer a.sv-dlink.sv-cta.alt{ background:linear-gradient(135deg,#4c1d95,var(--sv-purple)); box-shadow:0 10px 22px rgba(109,40,217,.35); }
aside.sv-drawer a.sv-dlink.sv-cta.gold{ background:linear-gradient(135deg,#d97706,#b45309); box-shadow:0 10px 22px rgba(217,119,6,.3); }
aside.sv-drawer .sv-drawer__foot{ margin-top:auto; padding-top:16px; border-top:1px solid rgba(100,116,139,.2);
  display:flex; align-items:center; justify-content:space-between; font-size:13px; font-weight:700; color:#64748b; }
aside.sv-drawer .sv-drawer__foot[hidden]{ display:none; }
aside.sv-drawer button.sv-switch{ width:52px; height:28px; border-radius:999px; border:none; cursor:pointer; position:relative; background:#cbd5e1; }
aside.sv-drawer button.sv-switch::after{ content:""; position:absolute; top:3px; left:3px; width:22px; height:22px; border-radius:50%;
  background:#fff; box-shadow:0 2px 6px rgba(0,0,0,.3); transition:transform .25s ease; }
html.dark aside.sv-drawer button.sv-switch{ background:linear-gradient(135deg,var(--sv-purple),var(--sv-blue)); }
html.dark aside.sv-drawer button.sv-switch::after{ transform:translateX(24px); }

/* ── Footer ───────────────────────────────────────────────────── */
html body footer.sv-footer{
  display:block; margin:0; padding:0; clear:both; text-align:left;
  background:linear-gradient(180deg,#0b1f33 0%,#081726 100%) !important; color:rgba(226,232,240,.78) !important;
  font-family:"Open Sans","Noto Sans Sinhala",system-ui,-apple-system,"Segoe UI",sans-serif; font-size:14px; line-height:1.65;
  border-top:4px solid; border-image:linear-gradient(90deg,var(--sv-blue),var(--sv-purple),#f59e0b) 1;
}
html body footer.sv-footer .sv-footer__inner{
  max-width:1320px; margin:0 auto; padding:56px 28px 36px;
  display:grid; grid-template-columns:1.5fr 1fr 1fr 1fr 1fr; gap:36px;
}
html body footer.sv-footer h4{
  margin:0 0 16px; padding:0 0 10px; font-size:15px; font-weight:800; letter-spacing:.3px; color:#fff !important;
  position:relative; text-transform:none; -webkit-text-fill-color:#fff;
}
html body footer.sv-footer h4::after{ content:""; position:absolute; left:0; bottom:0; width:32px; height:3px; border-radius:2px; background:var(--sv-blue); }
html body footer.sv-footer p,
html body footer.sv-footer address,
html body footer.sv-footer li,
html body footer.sv-footer span{ color:rgba(226,232,240,.78) !important; font-style:normal; margin:0; }
html body footer.sv-footer a{ color:rgba(226,232,240,.85) !important; text-decoration:none !important; transition:color .18s ease, padding .18s ease; }
html body footer.sv-footer a:hover{ color:#7dd3fc !important; }
html body footer.sv-footer ul{ list-style:none; margin:0; padding:0; }
html body footer.sv-footer ul li{ padding:4px 0; }
html body footer.sv-footer ul li a:hover{ padding-left:4px; }

html body footer.sv-footer .sv-fbrand{ display:flex; align-items:center; gap:12px; margin-bottom:14px; }
html body footer.sv-footer .sv-fbrand img{ width:52px; height:52px; border-radius:12px; background:#fff; }
html body footer.sv-footer .sv-fbrand b{ display:block; color:#fff !important; font-size:17px; font-weight:800; line-height:1.2; }
html body footer.sv-footer .sv-fbrand small{ display:block; color:#7dd3fc !important; font-size:11.5px; font-weight:700; letter-spacing:.6px; text-transform:uppercase; }
html body footer.sv-footer .sv-ftag{ margin-bottom:16px; max-width:330px; }
html body footer.sv-footer .sv-fcontact li{ display:flex; gap:10px; align-items:flex-start; padding:3px 0; }
html body footer.sv-footer .sv-fcontact .sv-ic{ width:18px; flex-shrink:0; text-align:center; }
html body footer.sv-footer .sv-fplace{ margin-bottom:14px; }
html body footer.sv-footer .sv-fplace strong{ display:block; color:#fff !important; font-weight:700; }

html body footer.sv-footer .sv-social{ display:flex; gap:10px; margin-top:18px; }
html body footer.sv-footer .sv-social a{
  width:38px; height:38px; border-radius:11px; display:inline-flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.08); color:#fff !important; padding:0 !important;
  transition:background .18s ease, transform .18s ease;
}
html body footer.sv-footer .sv-social a:hover{ background:var(--sv-blue); transform:translateY(-3px); }
html body footer.sv-footer .sv-social svg{ width:18px; height:18px; fill:currentColor; }

html body footer.sv-footer .sv-footer__bottom{ border-top:1px solid rgba(148,163,184,.15); background:rgba(0,0,0,.18); }
html body footer.sv-footer .sv-footer__bottom-inner{
  max-width:1320px; margin:0 auto; padding:16px 28px; display:flex; flex-wrap:wrap; gap:8px 20px;
  align-items:center; justify-content:space-between; font-size:13px;
}
html body footer.sv-footer .sv-footer__bottom-inner p{ color:rgba(226,232,240,.6) !important; }

@media (max-width:1099px){
  html body footer.sv-footer .sv-footer__inner{ grid-template-columns:repeat(3,1fr); }
  html body footer.sv-footer .sv-fcol--brand{ grid-column:1 / -1; }
}
@media (max-width:640px){
  html body footer.sv-footer .sv-footer__inner{ grid-template-columns:1fr 1fr; gap:28px 20px; padding:40px 18px 28px; }
  html body footer.sv-footer .sv-footer__bottom-inner{ padding:14px 18px; justify-content:center; text-align:center; }
}

/* old modern.js dock is not used on pages with this header */
body.sv-chrome .mn-dock, body.sv-chrome .mn-appbar{ display:none !important; }

@media (prefers-reduced-motion:reduce){
  header.sv-header *, aside.sv-drawer, .sv-backdrop, footer.sv-footer *{ transition:none !important; }
}
