/* UChicago Charter School — WCAG 2.1 AA stylesheet
   Contrast (checked): maroon #800000 on white 10.9:1; white on maroon 10.9:1;
   body #1a1a1a on white 17.4:1; muted #595959 on white 7.0:1; maroon on #f5f1ec 9.6:1. */

:root {
  --maroon: #800000;
  --maroon-dark: #5c0000;
  --ink: #1a1a1a;
  --muted: #595959;
  --paper: #ffffff;
  --stone: #f5f1ec;
  --line: #d6d0c8;
  --focus: #005fcc;
  --radius: 6px;
  --max: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

h1, h2, h3 { line-height: 1.25; color: var(--maroon); }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin: 0 0 1rem; }
h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }

a { color: var(--maroon); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--maroon-dark); text-decoration-thickness: 2px; }

/* Visible focus ring for every interactive element (WCAG 2.4.7) */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip link (WCAG 2.4.1) */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--paper);
  color: var(--maroon);
  font-weight: 700;
  border: 2px solid var(--maroon);
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* Header and navigation */
.site-header { background: var(--maroon); color: #fff; }
.site-header .container {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: .75rem; padding-top: .9rem; padding-bottom: .9rem;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.2rem; }
.brand:hover { color: #fff; text-decoration: underline; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.site-nav a {
  display: block; padding: .5rem .75rem; color: #fff; text-decoration: none; border-radius: var(--radius);
}
.site-nav a:hover { background: var(--maroon-dark); text-decoration: underline; color: #fff; }
.site-nav a[aria-current="page"] { background: var(--maroon-dark); text-decoration: underline; }
.site-header :focus-visible { outline-color: #fff; }

main { padding: 2rem 0 3rem; }

/* Hero */
.hero { background: var(--stone); border-bottom: 1px solid var(--line); padding: 2.5rem 0; }
.hero p { font-size: 1.2rem; max-width: 46rem; margin: 0 0 1.25rem; }

/* Buttons */
.button {
  display: inline-block; padding: .7rem 1.2rem; border-radius: var(--radius);
  background: var(--maroon); color: #fff; font-weight: 700; text-decoration: none;
  border: 2px solid var(--maroon); cursor: pointer; font: inherit; font-weight: 700;
}
.button:hover { background: var(--maroon-dark); border-color: var(--maroon-dark); color: #fff; }
.button.secondary { background: var(--paper); color: var(--maroon); }
.button.secondary:hover { background: var(--stone); color: var(--maroon-dark); }
.button[disabled] { opacity: .7; cursor: wait; }

/* Grids and cards */
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; background: var(--paper);
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin: 0; }
.stats div { background: var(--stone); border-radius: var(--radius); padding: 1rem 1.25rem; }
.stats dt { color: var(--muted); font-weight: 600; }
.stats dd { margin: 0; font-size: 2rem; font-weight: 800; color: var(--maroon); }

/* Tables (WCAG 1.3.1) */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
caption { text-align: left; font-weight: 700; padding-bottom: .5rem; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--stone); color: var(--ink); }

/* Forms (WCAG 1.3.1, 3.3.2) */
.form { max-width: 40rem; }
.field { margin-bottom: 1.1rem; }
label { display: block; font-weight: 600; margin-bottom: .3rem; }
.hint { color: var(--muted); font-size: .95rem; margin: .2rem 0 .4rem; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  padding: .6rem .7rem; border: 2px solid var(--muted); border-radius: var(--radius);
}
textarea { min-height: 9rem; resize: vertical; }
.required { color: var(--maroon); }
.hp-field { position: absolute; left: -9999px; }

.status { margin-top: 1rem; padding: .9rem 1rem; border-radius: var(--radius); border: 2px solid; }
.status.success { border-color: #1e6b2f; color: #1e6b2f; background: #eef7f0; }
.status.error { border-color: var(--maroon); color: var(--maroon); background: #fbeeee; }
.status:empty { display: none; }

/* Footer */
.site-footer { background: var(--stone); border-top: 1px solid var(--line); padding: 2rem 0; font-size: .95rem; }
.site-footer ul { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
