:root {
  --bg: #f3f7f2;
  --bg-accent: #dcefe2;
  --surface: #ffffff;
  --text: #1e2b24;
  --muted: #4a5e53;
  --primary: #0d6b4f;
  --primary-2: #0a4f3b;
  --line: #c8dbd0;
  --warning: #9d3c00;
  --shadow: 0 10px 25px rgba(24, 53, 40, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Source Sans 3", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(165deg, var(--bg) 0%, var(--bg-accent) 100%);
}

.site-frame {
  max-width: 1120px;
  margin: 1.5rem auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  padding: 1.2rem 1.4rem;
}

header h1, header h2 {
  margin: 0;
  font-family: "Merriweather", Georgia, serif;
}

header p { margin: .4rem 0 0; opacity: .92; }

main { padding: 1.1rem 1.4rem 1.5rem; }

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: .8rem 0 1rem;
}

.btn {
  display: inline-block;
  text-decoration: none;
  border: 1px solid var(--primary);
  background: #fff;
  color: var(--primary-2);
  padding: .52rem .8rem;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #88c6ad;
  outline-offset: 1px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: .9rem;
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .9rem;
  background: #fcfffd;
}

h3 { margin: 0 0 .55rem; font-family: "Merriweather", Georgia, serif; }

.search-box {
  border: 1px solid var(--line);
  background: #f8fcf9;
  border-radius: 12px;
  padding: .85rem;
  margin: 0 0 1rem;
}

.search-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

input[type="search"], textarea {
  width: 100%;
  border: 1px solid #b7cbc0;
  border-radius: 10px;
  padding: .6rem .65rem;
  font: inherit;
  color: var(--text);
}

select {
  border: 1px solid #b7cbc0;
  border-radius: 10px;
  padding: .58rem .62rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.search-row input[type="search"] { flex: 1 1 360px; }

ul { margin: .3rem 0 .7rem 1.2rem; }

.notice {
  border-left: 4px solid var(--warning);
  background: #fff4ec;
  border-radius: 8px;
  padding: .65rem .75rem;
}

.section-title {
  border-bottom: 1px solid var(--line);
  padding-bottom: .3rem;
  margin-top: 1.1rem;
}

.context-note {
  margin: .35rem 0 .6rem;
  color: var(--muted);
  font-size: .9rem;
}

.results a {
  color: var(--primary-2);
  font-weight: 700;
}

.hero-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .9rem;
}

.stack > *:first-child {
  margin-top: 0;
}

.stack > *:last-child {
  margin-bottom: 0;
}

.eyebrow {
  margin: 0 0 .25rem;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .7rem 0;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef7f1;
  color: var(--primary-2);
  padding: .38rem .7rem;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
}

.chip.active,
.chip:hover {
  border-color: var(--primary);
  background: #dff1e7;
}

.chip.static {
  cursor: default;
}

.chip.static:hover {
  border-color: var(--line);
  background: #eef7f1;
}

.stat-card h3,
.result-card h3 {
  margin-bottom: .35rem;
}

.result-card {
  margin-bottom: .8rem;
}

.result-card p {
  margin-top: .35rem;
  margin-bottom: .35rem;
}

.lead {
  font-size: 1.04rem;
  color: var(--muted);
}

footer {
  border-top: 1px solid var(--line);
  background: #f7fbf8;
  color: var(--muted);
  padding: .8rem 1.4rem;
  font-size: .93rem;
}

.asset-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: .4rem;
}

.asset-table th,
.asset-table td {
  border: 1px solid var(--line);
  padding: .55rem .6rem;
  text-align: left;
  vertical-align: top;
}

.asset-table th {
  background: #eef7f1;
}

/* ══ Vertical alignment (grade above / below) ═══════════════════════════

   Shown on every support page in the Related Pathways section.
   Two-column grid: left = Remediation (grade below), right = Enrichment (grade above).
   ═══════════════════════════════════════════════════════════════════════ */

.vert-align-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: .85rem;
  margin-top: .5rem;
  margin-bottom: 1.2rem;
}

.vert-card {
  padding: .85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

/* Remediation (grade below) — warm gold accent */
.vert-card.vert-below {
  background: #fffbee;
  border-left: 4px solid #c89a00;
}

/* Enrichment (grade above) — site teal accent */
.vert-card.vert-above {
  background: #eaf7f2;
  border-left: 4px solid var(--primary);
}

/* Empty state (no parallel standard found) */
.vert-card.vert-empty {
  opacity: .75;
}

/* Standard code inside the card */
.vert-code {
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
  color: var(--primary-2);
}

/* Short description inside the card */
.vert-desc {
  font-size: .9rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

.vert-desc.muted {
  font-style: italic;
}

/* Push audience buttons to the bottom of the card */
.vert-card > .button-row {
  margin-top: auto;
  padding-top: .5rem;
}

/* ══ Collapsible subject-area sections ══════════════════════════════════
   Used in two ways:
   1. Native <details>/<summary> — baked into grade explorer + hub pages
   2. JS-driven section.card with .is-open — used on dynamically rendered
      audience hub pages (educators.html, families.html, administrators.html)
   Both share the same .collapsible-section / .section-toggle class names
   and the same visual language.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Shared: count badge ─────────────────────────────────────────────── */
.section-count {
  font-size: .78em;
  font-weight: 400;
  font-family: "Source Sans 3", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--muted);
  margin-left: .25em;
}

/* ── 1. Native <details>/<summary> ──────────────────────────────────── */

details.card.collapsible-section {
  /* Inherits all .card styles — just set collapsed background */
  background: #f4faf6;
}

details[open].card.collapsible-section {
  background: #fcfffd; /* matches open .card background */
}

/* Remove the browser's default triangle on all engines */
details.card.collapsible-section > summary.section-toggle {
  list-style: none;
}
details.card.collapsible-section > summary.section-toggle::-webkit-details-marker {
  display: none;
}

/* Style the summary to look/feel like the h3 section headings */
details.card.collapsible-section > summary.section-toggle {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem;
  font-family: "Merriweather", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  padding: .35rem .5rem .35rem 0;
  border-radius: 6px;
  transition: background .12s;
}

details.card.collapsible-section > summary.section-toggle:hover {
  background: #eef7f1;
}

/* Arrow indicator */
details.card.collapsible-section > summary.section-toggle::after {
  content: '▶';
  font-size: .7em;
  font-family: sans-serif;
  font-weight: 400;
  color: var(--primary);
  flex-shrink: 0;
  transition: transform .18s ease;
  margin-left: auto;
}

details[open].card.collapsible-section > summary.section-toggle::after {
  transform: rotate(90deg);
}

/* Content wrapper revealed when open */
details.card.collapsible-section > .section-body {
  margin-top: .5rem;
}

/* ── 2. JS-driven section.card (dynamic hub pages) ───────────────────── */

section.collapsible-section > h3.section-toggle {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem;
  padding: .35rem .5rem .35rem 0;
  border-radius: 6px;
  transition: background .12s;
}

section.collapsible-section > h3.section-toggle:hover {
  background: #eef7f1;
}

section.collapsible-section > h3.section-toggle::after {
  content: '▶';
  font-size: .72em;
  font-family: sans-serif;
  color: var(--primary);
  flex-shrink: 0;
  transition: transform .18s ease;
  margin-left: auto;
}

section.collapsible-section.is-open > h3.section-toggle::after {
  transform: rotate(90deg);
}

section.collapsible-section > .section-body {
  display: none;
}

section.collapsible-section.is-open > .section-body {
  display: block;
}

section.collapsible-section:not(.is-open) {
  background: #f4faf6;
}

@media (max-width: 640px) {
  .site-frame { margin: .55rem; }
  header, main, footer { padding-left: .9rem; padding-right: .9rem; }
  .asset-table,
  .asset-table thead,
  .asset-table tbody,
  .asset-table th,
  .asset-table td,
  .asset-table tr {
    display: block;
  }
  .asset-table thead {
    display: none;
  }
  .asset-table tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: .7rem;
    padding: .2rem;
    background: #fff;
  }
  .asset-table td {
    border: none;
    padding: .3rem .35rem;
  }
  .chip-row {
    gap: .35rem;
  }
}
