/* California Data — /california-data and its chart pages.
   The chart itself is inline SVG from CaliforniaChartHelper; its classes are
   the .ca-chart__* rules below, so its colours follow the tokens. */

.ca-page {
  padding: 1.25rem var(--gutter) 4rem;
  max-width: 56rem;
}
.ca-page__header { margin-bottom: 1.75rem; max-width: 60ch; }
.ca-page__lead { margin-inline: 0; font-size: var(--fs-18); }

.ca-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .75;
  margin: 0 0 .5rem;
}

.ca-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  font-family: var(--font-educating);
  font-size: var(--fs-14);
  margin-bottom: 1.5rem;
}
.ca-crumbs span { opacity: .5; }

.ca-section-title {
  font-family: var(--font-display);
  font-size: var(--fs-24);
  margin: 2.5rem 0 1rem;
}

/* --- Landing page: find your school ------------------------------------- */
.ca-search { margin: 0 0 1.75rem; max-width: 40rem; font-family: var(--font-educating); }
.ca-search__label {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-22);
  font-weight: 600;
  margin-bottom: .5rem;
}
.ca-search__row { display: flex; gap: .5rem; }
.ca-search__input {
  flex: 1;
  min-width: 0;
  font: var(--fs-18) var(--font-educating);
  padding: .6rem .85rem;
  border: 1.5px solid rgba(28, 28, 28, .35);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
}
.ca-search__input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; border-color: var(--ink-blue); }
.ca-search__submit {
  font: 600 var(--fs-16) var(--font-educating);
  padding: .6rem 1.1rem;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--ink-blue);
  color: var(--paper);
  cursor: pointer;
}
.ca-search__hint { font-size: var(--fs-14); opacity: .7; margin: .4rem 0 0; }
.ca-search__results {
  list-style: none;
  padding: 0;
  margin: .9rem 0 0;
  border-top: 1px solid rgba(28, 28, 28, .12);
}
.ca-search__results li { padding: .55rem 0; border-bottom: 1px solid rgba(28, 28, 28, .12); }
.ca-search__name { font-weight: 600; font-size: var(--fs-18); }
.ca-search__where { display: block; font-size: var(--fs-14); opacity: .75; margin-top: .1rem; }
.ca-search__none { margin: .9rem 0 0; }

/* --- Landing page: the annotated example chart -------------------------- */
.ca-example-figure { margin: 1.25rem 0; }
.ca-example {
  display: block;
  width: 100%;
  max-width: 440px;
  height: auto;
  background: var(--paper);
  border-radius: var(--radius-md);
}
.ca-example text { font-family: var(--font-educating); fill: var(--ink); }
.ca-example__note { font-size: 14px; }
.ca-example__lead { font-weight: 700; }
.ca-example__tick { font-family: var(--font-mono); font-size: 11px; fill: rgba(28, 28, 28, .55); }
.ca-example__year { font-family: var(--font-mono); font-size: 11px; fill: rgba(28, 28, 28, .6); }
.ca-example__ceiling { stroke: var(--terracotta); stroke-width: 3; }
.ca-example__arrow { stroke: var(--ink-blue); stroke-width: 2; }
.ca-example__arrowhead { fill: var(--ink-blue); }
.ca-example-figure figcaption { font-size: var(--fs-14); opacity: .75; margin-top: .4rem; }

/* --- Landing page: the two reveal buttons ------------------------------- */
/* Quiet outline buttons, deliberately not the ink-blue CTA pill: they open
   reading, they don't lead anywhere. The chevron turns when open. */
.ca-reveal { margin: 0 0 .5rem; }
.ca-reveal__buttons { display: flex; flex-wrap: wrap; gap: .6rem; }
.ca-reveal__button {
  font: 600 var(--fs-16) var(--font-educating);
  color: var(--ink-blue);
  background: var(--paper);
  border: 1.5px solid var(--ink-blue);
  border-radius: var(--radius-md);
  padding: .55rem 1rem;
  cursor: pointer;
}
.ca-reveal__button::after {
  content: "▾";
  display: inline-block;
  margin-left: .5rem;
  transition: transform .15s ease;
}
.ca-reveal__button[aria-expanded="true"] { background: var(--ink-blue); color: var(--paper); }
.ca-reveal__button[aria-expanded="true"]::after { transform: rotate(180deg); }
.ca-reveal__button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.ca-reveal__panel {
  margin: 1rem 0 0;
  padding: 1rem 1.25rem;
  background: var(--linen);
  border-radius: var(--radius-md);
  max-width: 62ch;
  line-height: var(--lh-body);
}
.ca-reveal__panel.prose { margin-inline: 0; }
/* The workings carry wide tables; let that panel use the column. */
.ca-reveal__panel--wide { max-width: none; }
.ca-reveal--chart { margin: 0 0 2rem; }

/* Previous / next: two small labelled cards under the breadcrumb, so they
   read as "step to the neighbour", not as more of the breadcrumb trail. */
.ca-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .6rem 1rem;
  margin: -.75rem 0 1.5rem;
  font-family: var(--font-educating);
}
.ca-steps__link {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  max-width: 48%;
  padding: .45rem .8rem;
  border: 1px solid rgba(31, 58, 99, .3);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.ca-steps__link:hover,
.ca-steps__link:focus-visible { border-color: var(--ink-blue); background: #fff; }
.ca-steps__link--next { margin-left: auto; text-align: right; align-items: flex-end; }
.ca-steps__label {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-blue);
}
.ca-steps__name { font-weight: 600; font-size: var(--fs-14); line-height: 1.3; }
.ca-reveal__panel .ca-explainer .prose { margin: 0; }
.ca-reveal__panel p:first-child { margin-top: 0; }
.ca-reveal__panel p:last-child { margin-bottom: 0; }

/* --- Subject tabs ------------------------------------------------------- */
.ca-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0 0 1.25rem;
  font-family: var(--font-educating);
}
.ca-tabs__tab {
  padding: .35rem .9rem;
  border: 1px solid rgba(28, 28, 28, .18);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-size: var(--fs-14);
  font-weight: 600;
}
.ca-tabs__tab:hover { border-color: var(--ink-blue); color: var(--ink-blue); }
.ca-tabs__tab.is-active { background: var(--ink-blue); border-color: var(--ink-blue); color: var(--paper); }

/* --- Subject intro (English learners) ----------------------------------- */
.ca-intro {
  max-width: 62ch;
  margin: 0 0 1.5rem;
  font-family: var(--font-educating);
  line-height: var(--lh-normal);
}
.ca-intro > p { margin: 0 0 .5rem; }
.ca-intro__more summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-blue);
}
.ca-intro__more .prose { margin-inline: 0; padding: .25rem 0 .5rem; }
.ca-intro__more h3 {
  font-family: var(--font-display);
  font-size: var(--fs-18);
  margin: 1.1rem 0 .3rem;
}
.ca-intro__more ol, .ca-intro__more ul { padding-left: 1.25rem; margin: .3rem 0; }

/* --- Lists of counties, districts, schools ------------------------------- */
.ca-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--font-educating);
}
.ca-list--columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: .45rem 1.5rem;
}
.ca-list a { text-decoration-color: var(--link-underline); }
.ca-tag {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--linen);
  border-radius: 999px;
  padding: .05rem .5rem;
  margin-left: .35rem;
  white-space: nowrap;
}

/* --- The chart ----------------------------------------------------------- */
.ca-figure { margin: 0 0 1.5rem; }
/* Below ~600px the labels would shrink past reading size, so the chart keeps
   a minimum width and this box scrolls sideways instead. The page itself
   never does. */
.ca-figure__scroll {
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid rgba(28, 28, 28, .12);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-paper);
}
.ca-chart { display: block; width: 100%; min-width: 600px; height: auto; }
.ca-figure__caption {
  font-family: var(--font-educating);
  font-size: var(--fs-16);
  line-height: var(--lh-normal);
  margin-top: .85rem;
  max-width: 62ch;
}

.ca-chart text { font-family: var(--font-mono); font-size: 13px; fill: var(--ink); }
.ca-chart__grid    { stroke: rgba(28, 28, 28, .08); stroke-width: 1; }
.ca-chart__zero    { stroke: var(--ink); stroke-width: 1.5; }
.ca-chart__band    { fill: var(--sage); opacity: .85; }
.ca-chart__limit   { stroke: #7f8f78; stroke-width: 2; }
.ca-chart__average { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 6 5; }
.ca-chart__point   { fill: var(--ink-blue); stroke: var(--paper); stroke-width: 2; }
.ca-chart__point--signal { fill: var(--terracotta); stroke: var(--ink); }
.ca-chart text.ca-chart__tick  { fill: rgba(28, 28, 28, .6); font-size: 12px; }
/* A paper-coloured outline keeps a value legible where it crosses the zero
   line or a limit. */
.ca-chart text.ca-chart__value {
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.ca-chart text.ca-chart__year  { font-size: 13px; }
.ca-chart text.ca-chart__gap {
  fill: rgba(28, 28, 28, .6); font-size: 12px; font-style: italic;
  paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round;
}
.ca-chart text.ca-chart__zero-label { font-weight: 600; font-size: 12px; }
.ca-chart text.ca-chart__edge-label { font-size: 12px; fill: rgba(28, 28, 28, .75); }
.ca-chart text.ca-chart__meal-heading { font-size: 12px; fill: rgba(28, 28, 28, .7); }
.ca-chart text.ca-chart__meal  { font-size: 11px; fill: var(--chalkboard); font-weight: 600; }
.ca-chart__house { opacity: .9; }
.ca-chart__house-group { cursor: help; }
/* Student counts: present for whoever looks, quiet for whoever doesn't. */
.ca-chart text.ca-chart__count       { font-size: 11px; fill: rgba(28, 28, 28, .55); }
.ca-chart text.ca-chart__count-label { font-size: 10px; fill: rgba(28, 28, 28, .5);
                                       text-transform: uppercase; letter-spacing: .05em; }

/* --- Explainer and workings ---------------------------------------------- */
.ca-explainer .prose { margin-inline: 0; line-height: var(--lh-body); }
.ca-explainer ul { padding-left: 1.25rem; }

.ca-workings { font-family: var(--font-educating); line-height: var(--lh-normal); }
.ca-workings h3 {
  font-family: var(--font-display);
  font-size: var(--fs-20);
  margin: 1.5rem 0 .5rem;
}
.ca-workings > h3:first-child { margin-top: 0; }
.ca-workings h4 { margin: 1.1rem 0 .4rem; font-size: var(--fs-16); }
.ca-workings__source { font-weight: 400; font-size: var(--fs-14); opacity: .8; margin-left: .4rem; }
.ca-workings__scroll { overflow-x: auto; }
.ca-workings__steps { padding-left: 1.25rem; }
.ca-workings__steps li { margin-bottom: .5rem; }
.ca-workings__note { font-size: var(--fs-14); }

.ca-table {
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: var(--fs-14);
  min-width: 34rem;
}
.ca-table th, .ca-table td {
  padding: .3rem .7rem;
  text-align: right;
  border-bottom: 1px solid rgba(28, 28, 28, .12);
  white-space: nowrap;
}
.ca-table thead th {
  font-family: var(--font-educating);
  font-size: var(--fs-12);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ca-table tfoot th { text-align: right; font-weight: 400; }

@media (max-width: 640px) {
  .ca-reveal__panel { padding: .8rem 1rem; }
}

/* --- Attendance page (/california-data/attendance/…) --------------------
   Charts drawn by attendance_story_controller.js. The two data colours were
   checked with the dataviz palette validator against --paper (2026-10-11):
   in school vs absent pass colour-blind separation (ΔE 15.2) and 3:1
   contrast. The ink blue itself is too dark for a data fill. The scatter's
   three low-income shares are one blue ramp, also validated. */
.at-page {
  --at-in: #3F6EA8;
  --at-absent: #C25A48;
  --at-frpm-1: #6da7ec;
  --at-frpm-2: #256abf;
  --at-frpm-3: #0d366b;
  --at-rule: rgba(28, 28, 28, .14);
}

.at-lede { font-family: var(--font-display); font-size: clamp(1.2rem, 2.4vw, 1.45rem); line-height: 1.45; margin: 0; }
.at-small { font-size: var(--fs-14); max-width: 65ch; opacity: .85; }
.at-h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 3.6vw, 2.1rem); line-height: 1.15; margin: 3.5rem 0 .75rem; }
.at-h3 { font-family: var(--font-display); font-size: var(--fs-20); margin: 2.25rem 0 .5rem; }

.at-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .75rem; margin: 1.75rem 0 .5rem; }
.at-stat { background: var(--paper-2); border-radius: 10px; padding: 1rem 1.1rem; }
.at-stat b { display: block; font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.05; }
.at-stat span { display: block; font-size: var(--fs-14); line-height: 1.35; margin-top: .4rem; }
.at-stat--money b, .at-money { color: var(--at-absent); }

.at-legend { display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; font-size: var(--fs-14); margin: .5rem 0; }
.at-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; }
.at-swatch--in { background: var(--at-in); }
.at-swatch--absent { background: var(--at-absent); }
.at-swatch--dot { border-radius: 50%; }
.at-swatch--ring { border-radius: 50%; border: 2px solid var(--at-frpm-2); }
.at-swatch--diamond { border: 2px solid var(--ink); transform: rotate(45deg) scale(.8); border-radius: 2px; }
.at-swatch--dash { border: 1.5px dashed var(--ink); }
.at-swatch.at-frpm-1 { background: var(--at-frpm-1); }
.at-swatch.at-frpm-2 { background: var(--at-frpm-2); }
.at-swatch.at-frpm-3 { background: var(--at-frpm-3); }

.at-figure { margin: 1.25rem 0 .5rem; }
.at-figure figcaption { font-size: var(--fs-14); max-width: 65ch; margin-top: .6rem; opacity: .85; }
.at-chart { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-mono); }
.at-chart text { font-size: 12px; fill: var(--ink); opacity: .85; }
.at-chart .at-axis { font-size: 11px; opacity: .6; }
.at-chart .at-value { font-weight: 600; opacity: 1; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.at-chart .at-annot { font-family: var(--font-educating); font-size: 13px; opacity: 1; }
.at-chart .at-row-label { font-family: var(--font-educating); font-size: 14px; opacity: 1; }
.at-grid { stroke: var(--at-rule); stroke-width: 1; }
.at-baseline { stroke: var(--ink); stroke-width: 1; opacity: .7; }
.at-reference { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 3; }
.at-hit { fill: transparent; }
.at-fill-in { fill: var(--at-in); }
.at-fill-absent { fill: var(--at-absent); }
.at-hatch-ground { fill: var(--at-absent); opacity: .35; }
.at-hatch-line { stroke: var(--at-absent); stroke-width: 2.5; }
.at-ring-paper { stroke: var(--paper); stroke-width: 2; }
.at-line-ours { fill: none; stroke: var(--at-in); stroke-width: 2.5; }
.at-line-state { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 5 4; opacity: .7; }
.at-mark-dot { stroke: var(--paper); stroke-width: 2; }
.at-mark-dot.at-frpm-1 { fill: var(--at-frpm-1); }
.at-mark-dot.at-frpm-2 { fill: var(--at-frpm-2); }
.at-mark-dot.at-frpm-3 { fill: var(--at-frpm-3); }
.at-mark-ring { fill: var(--paper); stroke-width: 2.5; }
.at-mark-ring.at-frpm-1 { stroke: var(--at-frpm-1); }
.at-mark-ring.at-frpm-2 { stroke: var(--at-frpm-2); }
.at-mark-ring.at-frpm-3 { stroke: var(--at-frpm-3); }

.at-slider { background: var(--paper-2); border-radius: 12px; padding: 1.25rem; margin: 1.25rem 0; }
.at-slider__label { display: block; font-weight: 700; margin-bottom: .5rem; }
.at-slider input[type=range] { width: 100%; accent-color: var(--ink-blue); }
.at-slider__ticks { position: relative; height: 3.6rem; font-size: 13px; }
.at-slider__ticks span { position: absolute; transform: translateX(-50%); text-align: center; line-height: 1.2; white-space: nowrap; }
.at-slider__ticks button { font: inherit; color: var(--ink-blue); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.at-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .75rem; margin-top: .75rem; }
.at-results > div { background: var(--paper); border-radius: 10px; padding: .9rem 1rem; }
.at-results b { display: block; font-family: var(--font-display); font-size: 2rem; line-height: 1.1; }
.at-results span { font-size: var(--fs-14); }
.at-cost { font: inherit; width: 8.5em; padding: 2px 6px; border: 1px solid rgba(28, 28, 28, .4); border-radius: 6px; background: var(--paper); }

.at-callout { border-left: 3px solid var(--ink-blue); padding: .25rem 0 .25rem 1rem; margin: 1.25rem 0; max-width: 65ch; }
.at-notes li { margin-bottom: .5rem; max-width: 65ch; }
.at-details { margin: 1rem 0; }
.at-details summary { cursor: pointer; color: var(--ink-blue); font-weight: 600; }

.at-tip { position: fixed; pointer-events: none; background: var(--ink); color: var(--paper); font: 14px/1.4 var(--font-educating);
          padding: .5rem .65rem; border-radius: 8px; max-width: 280px; opacity: 0; transition: opacity .08s; z-index: 50; }
.at-page .prose { margin-inline: 0; }
.at-swatch--highlight { border-radius: 50%; border: 3px solid var(--ink); }
.at-mark-highlight { fill: none; stroke: var(--ink); stroke-width: 3; }
.at-slider__below { font-size: var(--fs-14); margin: .25rem 0 0; opacity: .85; }
.at-header { margin: 1.75rem 0 0; }
.at-headline { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08; margin: 0 0 .75rem; max-width: 22ch; }
.at-cost-field { display: block; margin-top: .6rem; }
.at-cost-field__label { display: block; font-size: var(--fs-14); font-weight: 600; margin-bottom: .2rem; }
.at-cost-field__input { display: inline-flex; align-items: center; gap: .3rem; font-size: var(--fs-16); }
.at-cost-field .at-cost { width: 100%; max-width: 9em; }
.at-results > div > span { display: block; line-height: 1.35; margin-top: .25rem; }
