/* Alteram: the site-wide look.
 *
 * Paper and ink: a warm off-white page, near-black text, one deep pine green
 * for actions and a thin bronze rule as the only ornament. Serif for
 * headings, the system sans for everything else. No web fonts are loaded,
 * so no request leaves the site for typefaces (it matters for school
 * privacy reviews) and pages draw instantly.
 *
 * This file styles the home page, sign-in, legal pages and /admin, plus the
 * thin site bar and footer that sit on every page. The three sections keep
 * their own stylesheets; their colour tokens are set to these same values.
 */

:root {
  --paper: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #faf9f5;
  --ink: #1a1d1a;
  --ink-2: #4a514b;
  --ink-3: #737a74;
  --rule: #dedad0;
  --rule-strong: #c9c4b6;
  --pine: #1f3a2c;
  --pine-2: #2c5240;
  --pine-soft: #e7eee9;
  --bronze: #9a7438;
  --danger: #a3321f;
  --ok: #2f6b3f;

  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 4px;
  --measure: 68ch;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body.site {
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.site main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 56px 24px 72px; }
a { color: var(--pine); text-underline-offset: 3px; }
a:hover { color: var(--pine-2); }
:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---- site bar: on every page, above each section's own header ---- */

.site-bar {
  background: var(--pine);
  color: #eef2ee;
  font: 500 14px/1 var(--sans);
  border-bottom: 1px solid var(--bronze);
  position: relative;
  z-index: 50;
}
.site-bar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  height: 44px; display: flex; align-items: center; gap: 28px;
}
.site-bar a { color: inherit; text-decoration: none; }
.site-bar a:hover { color: #fff; text-decoration: underline; }
.site-bar-brand {
  font: 600 18px/1 var(--serif);
  letter-spacing: 0.02em;
  display: inline-flex; align-items: center; gap: 9px;
}
.site-bar-brand:hover { text-decoration: none !important; }
.brand-mark {
  width: 22px; height: 22px; display: inline-grid; place-items: center;
  border: 1px solid currentColor; border-radius: 50%;
  font: 600 13px/1 var(--serif);
}
.site-bar-sections { display: flex; gap: 22px; }
.site-bar-sections a { opacity: 0.82; padding: 14px 0 12px; border-bottom: 2px solid transparent; }
.site-bar-sections a[aria-current="page"] { opacity: 1; border-bottom-color: var(--bronze); }
.site-bar-account { margin-left: auto; display: flex; gap: 18px; align-items: center; }
@media (max-width: 640px) {
  .site-bar-inner { gap: 16px; padding: 0 14px; }
  .site-bar-sections { gap: 14px; }
  .site-bar-brand .brand-word { display: none; }
}

/* ---- footer ---- */

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-3);
  font-size: 13px;
}
.site-footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 22px 20px 28px;
  display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: baseline;
}
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .motto { font-family: var(--serif); font-style: italic; margin-right: auto; }

/* ---- type ---- */

.eyebrow {
  font: 600 12px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bronze); margin-bottom: 14px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; color: var(--ink); }
h1 { font-size: clamp(36px, 5vw, 56px); letter-spacing: -0.01em; }
h2 { font-size: 28px; margin-bottom: 12px; }
h3 { font-size: 20px; margin-bottom: 6px; }
.lede { font-size: 19px; color: var(--ink-2); max-width: 56ch; margin-top: 18px; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 14px; }
p + p { margin-top: 12px; }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 48px 0; }

/* ---- home ---- */

.hero { padding: 24px 0 8px; max-width: 760px; }
.sections {
  margin-top: 56px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--ink);
}
.section-link {
  display: block; text-decoration: none; color: inherit;
  padding: 22px 24px 26px 0; margin-right: 24px;
  border-bottom: 1px solid var(--rule);
}
.section-link:hover h3 { color: var(--pine); text-decoration: underline; text-underline-offset: 4px; }
.section-link .num { font: 500 13px/1 var(--mono); color: var(--ink-3); display: block; margin-bottom: 16px; }
.section-link p { color: var(--ink-2); font-size: 15px; }
.section-link .go { display: inline-block; margin-top: 14px; color: var(--pine); font-weight: 600; font-size: 14px; }
@media (max-width: 760px) {
  .sections { grid-template-columns: 1fr; }
  .section-link { margin-right: 0; }
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; gap: 24px; } }
.name-note { font-family: var(--serif); font-size: 18px; color: var(--ink-2); }
.name-note em { color: var(--ink); }

/* ---- prose (legal pages) ---- */

.prose { max-width: var(--measure); }
.prose h1 { font-size: 40px; margin-bottom: 8px; }
.prose h2 { font-size: 22px; margin: 36px 0 10px; }
.prose h3 { font-size: 17px; margin: 22px 0 6px; font-family: var(--sans); }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { padding-left: 22px; margin: 10px 0; }
.prose li + li { margin-top: 6px; }
.prose table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 14px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.prose th { font-weight: 600; background: var(--surface-2); }
.draft-banner {
  border: 1px solid var(--bronze); background: #fbf6ec; color: #5c4520;
  padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin: 18px 0 28px;
}
.legal-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; margin-bottom: 28px; }
.legal-nav a { text-decoration: none; color: var(--ink-2); }
.legal-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--bronze); }

/* ---- forms ---- */

.panel {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 28px;
}
.narrow { max-width: 420px; margin: 0 auto; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 5px; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; }
.field-row a { font-weight: 400; font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], select, textarea {
  width: 100%; font: inherit; color: inherit; background: var(--surface);
  border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 9px 11px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pine); outline-offset: -1px; border-color: var(--pine); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 var(--sans); padding: 11px 18px; border-radius: var(--radius);
  background: var(--pine); color: #fff; border: 1px solid var(--pine); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--pine-2); color: #fff; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.secondary { background: transparent; color: var(--pine); }
.btn.secondary:hover { background: var(--pine-soft); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.small { padding: 7px 11px; font-size: 13px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--pine); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.form-error { color: var(--danger); background: #fbeeec; border: 1px solid #ecc9c2; padding: 9px 12px; border-radius: var(--radius); font-size: 14px; margin-bottom: 14px; }
.form-ok { color: var(--ok); background: #edf5ef; border: 1px solid #cfe3d4; padding: 9px 12px; border-radius: var(--radius); font-size: 14px; margin-bottom: 14px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.tabs { display: flex; border-bottom: 1px solid var(--rule); margin-bottom: 20px; }
.tabs button { background: none; border: 0; font: 600 15px/1 var(--sans); padding: 10px 14px 12px; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--pine); }
.fine { font-size: 13px; color: var(--ink-3); margin-top: 14px; }

/* ---- admin ---- */

.admin-grid { display: grid; gap: 28px; }
.admin-section h2 { font-size: 22px; }
.admin-section > p { color: var(--ink-2); margin-bottom: 14px; max-width: 70ch; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 220px; }
.list { list-style: none; border-top: 1px solid var(--rule); margin-top: 16px; }
.list li { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.list .grow { flex: 1; min-width: 0; }
.tag { display: inline-block; font: 600 11px/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 6px; border-radius: 3px; background: var(--pine-soft); color: var(--pine); }
.tag.off { background: #efede7; color: var(--ink-3); }
.req { border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); }
.req + .req { margin-top: 10px; }
.req pre { white-space: pre-wrap; font: inherit; margin: 8px 0; }
details.school { border-top: 1px solid var(--rule); padding: 10px 0; }
details.school summary { cursor: pointer; display: flex; gap: 10px; align-items: center; list-style: none; }
details.school summary::-webkit-details-marker { display: none; }
