/* K12IQ platform for Cuyama Joint USD: shared structure for every page and every theme.
   Colors and home-page presentation live in theme-a.css ... theme-d.css (one is loaded per page). */

:root {
  --line: #e5e7eb; --ink: #1f2933; --muted: #5f6b76; --faint: #8a939c;
  --good: #3f8f4f; --fair: #d39b24; --poor: #c8553d;
  --head: "Bricolage Grotesque", Figtree, system-ui, sans-serif;
  --body: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 14px; --shadow: 0 8px 26px rgba(17, 24, 39, .07);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--body); -webkit-font-smoothing: antialiased; top: 0 !important; position: static !important; overflow-x: hidden; }
h1, h2, h3, .num { font-family: var(--head); color: var(--brand); line-height: 1.12; letter-spacing: -.01em; margin: 0 0 .45em; }
h1 { font-weight: 800; font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-weight: 800; font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-weight: 600; font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.tm { font-size: .5em; vertical-align: super; line-height: 0; margin-left: 1px; font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.header-in { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brand); flex: none; }
.brand img { height: 46px; width: auto; }
.brand .wm { font: 800 17px/1.1 var(--head); color: var(--brand); }
.brand .wm small { display: block; font: 600 11.5px/1.3 var(--body); color: var(--muted); letter-spacing: .02em; }
.header-tools { margin-left: auto; }
/* Second header row: the same nav bar on every page and every theme */
.navbar { background: var(--navbar); }
.main-nav { display: flex; gap: 2px; align-items: stretch; min-height: 46px; }
.main-nav a, .more-btn { color: #fff; text-decoration: none; font: 600 14.5px var(--body); padding: 13px 12px 11px; white-space: nowrap; border-bottom: 3px solid transparent; background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; }
.main-nav a:hover, .more-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.main-nav a[aria-current="page"], .more-btn[aria-current="page"] { border-bottom-color: var(--gold); }
.more { position: relative; display: flex; }
.more-menu { display: none; position: absolute; top: 100%; right: 0; min-width: 240px; background: #fff; border: 1px solid var(--line); border-radius: 0 0 12px 12px; box-shadow: var(--shadow); padding: 6px 0; z-index: 60; }
.more.open .more-menu { display: block; }
.more-menu a { display: block; color: var(--ink); padding: 9px 16px; border: 0; font-weight: 500; }
.more-menu a:hover { background: var(--soft); color: var(--ink); }
.more-menu a[aria-current="page"] { font-weight: 700; border: 0; box-shadow: inset 3px 0 0 var(--gold); }
.header-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.btn { display: inline-flex; align-items: center; gap: 6px; font: 700 14px/1 var(--body); padding: 12px 18px; border-radius: 10px; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(.93); color: #fff; }
.btn-ghost { background: #fff; color: var(--brand); border-color: var(--line); padding: 9px 14px; font-size: 13.5px; }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.campus-cards, .home-hero .sun, .home-hero .peaks .p3 { display: none; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: 700 13px var(--body); color: var(--brand); }

/* Tags and sources */
.tag { display: inline-block; font: 700 10.5px/1 var(--body); text-transform: uppercase; letter-spacing: .08em; padding: 4px 7px; border-radius: 6px; background: #fff4d6; color: #8a5a00; border: 1px solid #f1d68a; vertical-align: middle; }
.src { display: block; margin-top: 8px; font-size: 12px; color: var(--faint); line-height: 1.35; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font: 700 12.5px/1.4 var(--body); color: var(--accent); margin: 0 0 12px; }

/* Hero (base; home options override) */
.hero { background: var(--hero-bg); color: var(--hero-ink); }
.hero h1 { color: var(--hero-ink); max-width: 800px; }
.hero .sub { font-size: 1.15rem; max-width: 640px; color: inherit; opacity: .85; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .num { font-size: 2rem; font-weight: 800; margin: 0; color: var(--brand); }
.stat .lbl { font-size: 14px; color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.pill { background: var(--tint); color: var(--tint-ink); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 13.5px; text-decoration: none; }

/* Sections, cards, panels */
section.block { padding: 56px 0; border-bottom: 1px solid var(--line); }
.lead { color: var(--muted); max-width: 720px; margin: 0 0 26px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.card { display: block; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; background: #fff; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.card .ic { width: 42px; height: 42px; border-radius: 10px; background: var(--tint); display: grid; place-items: center; margin-bottom: 12px; color: var(--accent); }
.card .ic svg { width: 22px; height: 22px; }
.card h3 { margin: 0 0 4px; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }
.card .go { display: inline-block; margin-top: 10px; font-weight: 700; font-size: 14px; color: var(--accent); }
.panel { border: 1px solid var(--line); border-radius: var(--r); padding: 20px; background: #fff; min-width: 0; }
.panel h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
.two > *, .halves > *, .grid > * { min-width: 0; }
.halves { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

/* Bars */
.bars .row { display: grid; grid-template-columns: minmax(110px, 190px) 1fr 76px; gap: 10px; align-items: center; margin: 9px 0; font-size: 14px; }
.bars .row b { text-align: right; font-variant-numeric: tabular-nums; }
.track { background: var(--soft); border-radius: 6px; height: 14px; overflow: hidden; position: relative; }
.fill { background: var(--accent); height: 100%; border-radius: 6px; }
.track .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--brand); }

/* Ranked list */
.rank { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rank li { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rank li:last-child { border-bottom: 0; }
.rank .pos { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 800 14px var(--head); color: #fff; background: var(--brand); }
.rank .nm { font-weight: 700; }
.rank .nm small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.score { font: 800 20px var(--head); color: var(--brand); text-align: right; }
.score small { display: block; font: 600 11px var(--body); color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }

/* Tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { background: var(--soft); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tbl td.n, .tbl th.n { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl a { font-weight: 700; text-decoration: none; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.chip.good { background: #e6f3e8; color: #2d6b39; } .chip.fair { background: #fbf0d6; color: #85600c; } .chip.poor { background: #f9e1dc; color: #9b3a26; }
.chip.yes { background: var(--tint); color: var(--tint-ink); } .chip.no { background: #f1f2f4; color: var(--muted); }

/* Inner page head and glance facts */
.page-head { background: var(--soft); border-bottom: 1px solid var(--line); padding: 38px 0 30px; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.page-head .sub { color: var(--muted); max-width: 720px; font-size: 1.05rem; margin: 0; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { text-decoration: none; }
.glance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.glance div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.glance b { display: block; font: 800 1.55rem/1.1 var(--head); color: var(--brand); }
.glance span { font-size: 13.5px; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.filters button { font: 700 13.5px var(--body); border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.callout { border-left: 4px solid var(--gold); background: var(--tint); border-radius: 0 var(--r) var(--r) 0; padding: 16px 18px; }
.callout h3 { margin-bottom: 6px; }
.callout ul { margin: 0; padding-left: 18px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.map { height: 420px; border-radius: var(--r); border: 1px solid var(--line); z-index: 0; }
.chart svg { width: 100%; height: auto; display: block; }
.scheme-pick { display: inline-flex; gap: 4px; align-items: center; font-size: 12.5px; color: var(--muted); }
.scheme-pick button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.scheme-pick button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--brand); }

/* Footer */
.site-footer { background: var(--foot); color: rgba(255, 255, 255, .82); padding: 36px 0 90px; font-size: 14px; }
.site-footer b { color: #fff; }
.site-footer a { color: #fff; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; margin-top: 18px; }
.site-footer h4 { color: #fff; margin: 0 0 8px; font: 700 13px var(--body); text-transform: uppercase; letter-spacing: .08em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 4px 0; }
.site-footer .srcs { font-size: 12.5px; opacity: .8; }

/* K12AI */
.ask-btn { position: fixed; right: 18px; bottom: 18px; z-index: 60; background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 13px 18px; font: 700 14.5px var(--body); box-shadow: 0 10px 24px rgba(0, 0, 0, .2); cursor: pointer; display: flex; align-items: center; gap: 8px; }
.ask-btn svg { width: 20px; height: 20px; flex: none; }
.ask-panel { position: fixed; right: 18px; bottom: 76px; z-index: 61; width: min(380px, calc(100vw - 36px)); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .2); display: none; overflow: hidden; }
.ask-panel.open { display: block; }
.ask-panel header { background: var(--brand); color: #fff; padding: 12px 16px; font: 700 15px var(--head); display: flex; justify-content: space-between; align-items: center; }
.ask-panel header button { background: none; border: 0; color: #fff; font-size: 20px; cursor: pointer; }
.ask-log { padding: 14px 16px; max-height: 300px; overflow-y: auto; font-size: 14.5px; }
.ask-log .q { font-weight: 700; color: var(--brand); margin-top: 10px; }
.ask-sugs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 14px; }
.ask-sugs button { font: 600 12.5px var(--body); border: 1px solid var(--line); background: var(--soft); border-radius: 999px; padding: 6px 11px; cursor: pointer; color: var(--ink); }

@media (max-width: 960px) {
  .navbar { display: none; }
  .navbar.open { display: block; }
  .main-nav { flex-direction: column; padding: 6px 0 10px; }
  .main-nav a, .more-btn { padding: 10px 4px; border-bottom: 0; text-align: left; }
  .main-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--gold); padding-left: 12px; }
  .more { display: block; }
  .more-btn { display: none; }
  .more-menu { display: block; position: static; background: none; border: 0; box-shadow: none; padding: 0; min-width: 0; }
  .more-menu a { color: #fff; padding: 10px 4px; }
  .more-menu a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
  .menu-btn { display: inline-block; }
  .stats, .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { --cols: 2 !important; }
  .two, .halves { grid-template-columns: 1fr; }
  .site-footer .cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .header-in { gap: 8px; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand img { height: 38px; }
  .brand img + .wm { display: none; }
  .menu-btn { padding: 8px; }
  .k12-lang select { max-width: 112px !important; padding-right: 22px !important; }
  .brand .wm { font-size: 15px; }
  .brand .wm small { display: none; }
  .header-tools .btn-ghost { display: none; }
  .grid { --cols: 1 !important; }
  .stat .num { font-size: 1.6rem; }
  .bars .row { grid-template-columns: 96px 1fr 62px; font-size: 13px; }
  .glance b { font-size: 1.3rem; }
  .map { height: 320px; }
  section.block { padding: 40px 0; }
  .ask-btn span { display: none; }
}

/* ---------- Home (structure shared by every theme; themes restyle it) ---------- */
.home-hero { background: var(--hero-bg); color: var(--hero-ink); position: relative; overflow: hidden; }
.home-hero .hero-in { display: grid; gap: 32px; align-items: center; position: relative; z-index: 1; }
.home-hero h1 { color: var(--hero-ink); max-width: 800px; }
.home-hero h1 em { font-style: italic; }
.home-hero .sub { font-size: 1.15rem; max-width: 640px; }
.home-hero .ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.home-hero .peaks { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 120px; z-index: 0; }
.home-hero .sun { position: absolute; right: 12%; bottom: 96px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, #f3c477 0%, #e0a04a 55%, rgba(224, 160, 74, 0) 72%); opacity: .75; z-index: 0; }
.campus-cards { gap: 14px; }
.campus-card { background: #fff; color: var(--ink); border-radius: 16px; padding: 18px 20px; box-shadow: 0 14px 30px rgba(47, 74, 52, .12); border: 1px solid var(--line); }
.campus-card h3 { margin: 0 0 2px; font-size: 1.05rem; }
.campus-card .kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.campus-card .kpis b { display: block; font: 800 1.25rem/1.1 var(--head); color: var(--brand); }
.campus-card .kpis span { font-size: 12px; color: var(--muted); }
.campus-card .links { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.campus-card .links a { font-size: 12.5px; font-weight: 700; background: var(--tint); color: var(--tint-ink); border-radius: 999px; padding: 4px 10px; text-decoration: none; }
.home-stats { position: relative; z-index: 2; }
.home-stats .stats { padding: 0; }

/* ---------- Shared components ---------- */
.est { display: inline-block; font: 700 10px/1 var(--body); text-transform: uppercase; letter-spacing: .07em; padding: 3px 6px; border-radius: 5px; background: var(--soft); color: var(--muted); border: 1px solid var(--line); vertical-align: middle; margin-left: 4px; }
.na { color: var(--faint); }
.placeholder { border: 1px dashed #cfd5db; border-radius: var(--r); padding: 22px; background: var(--soft); color: var(--muted); text-align: center; }
.placeholder b { display: block; color: var(--ink); font-family: var(--head); font-size: 1.05rem; margin-bottom: 4px; }
.kv { display: grid; grid-template-columns: minmax(130px, 40%) 1fr; gap: 0; font-size: 14.5px; margin: 0; }
.kv dt, .kv dd { padding: 8px 0; border-top: 1px solid var(--line); margin: 0; }
.kv dt { color: var(--muted); padding-right: 12px; }
.kv dd { font-weight: 600; }
.tl { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.tl li { position: relative; padding: 0 0 14px 14px; font-size: 14.5px; }
.tl li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 3px solid var(--tint); }
.tl b { display: block; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.steps { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 14px; counter-reset: st; }
.steps .step { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; background: #fff; text-decoration: none; color: inherit; display: block; }
.steps .step::before { counter-increment: st; content: counter(st); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font: 800 14px var(--head); margin-bottom: 10px; }
.steps .step h3 { margin: 0 0 4px; font-size: 1.02rem; }
.steps .step p { margin: 0; font-size: 14px; color: var(--muted); }
a.step:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.gantt .g-row { display: grid; grid-template-columns: minmax(150px, 260px) 1fr; gap: 12px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.gantt .g-track { position: relative; height: 18px; background: var(--soft); border-radius: 6px; }
.gantt .g-bar { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: var(--accent); }
.gantt .g-head { display: grid; grid-template-columns: minmax(150px, 260px) 1fr; gap: 12px; font-size: 12px; color: var(--faint); }
.gantt .g-head div:last-child { display: flex; justify-content: space-between; }
.people { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 14px; }
.person { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; background: #fff; }
.person .av { width: 46px; height: 46px; border-radius: 50%; background: var(--tint); color: var(--tint-ink); display: grid; place-items: center; font: 800 16px var(--head); margin-bottom: 10px; }
.person h3 { margin: 0; font-size: 1.05rem; }
.person .role { font-weight: 700; color: var(--accent); font-size: 14px; }
.person p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.find { width: 100%; max-width: 420px; font: 500 15px var(--body); padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; }
.theme-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; font-size: 13px; }
.theme-pick a { display: inline-flex; align-items: center; gap: 6px; color: #fff; text-decoration: none; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: 4px 10px 4px 5px; }
.theme-pick a i { width: 16px; height: 16px; border-radius: 50%; display: inline-block; }
.theme-pick a[aria-current="true"] { background: rgba(255, 255, 255, .15); border-color: #fff; }
.layer-ctl { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 12px; font-size: 14px; }
.layer-ctl select { font: 500 14px var(--body); padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 960px) { .steps { --cols: 2 !important; } .people { --cols: 2 !important; } .home-hero .hero-in { grid-template-columns: 1fr !important; } .home-stats .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps, .people { --cols: 1 !important; } .gantt .g-row, .gantt .g-head { grid-template-columns: 110px 1fr; } .kv { grid-template-columns: 1fr 1.2fr; } }
.tbl td.wrap, .tbl th.wrap { white-space: normal; min-width: 180px; }
