/* Built for Cedar Hollow Union Elementary School District. */
:root {
  --paper: #faf8f3;
  --surface: #ffffff;
  --mist: #e9f0eb;
  --notice: #fbecc9;
  --ink: #1b2420;
  --muted: #4c5751;
  --brand: #1d5346;
  --brandDark: #123a31;
  --accent: #e7b14c;
  --accentInk: #8a4a10;
  --onBrand: #ffffff;
  --onBrandMuted: #cfe0d8;
  --focus: #0a56c2;
  --focusOnDark: #ffd166;
  --line: #d8d3c6;
}

/* Shared district site stylesheet.
   Color tokens (--paper, --ink, --brand, ...) are written above this file by
   build.mjs from site.json "colors", after the contrast check has passed. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: 1.65;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, .brand-name, caption {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, Cambria, serif;
  color: var(--brandDark);
  line-height: 1.2;
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.5rem + 2.2vw, 3.1rem); margin: 0 0 0.4em; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.45rem, 1.25rem + 0.9vw, 1.95rem); margin: 2.2em 0 0.6em; }
h3 { font-size: clamp(1.15rem, 1.08rem + 0.4vw, 1.35rem); margin: 1.6em 0 0.4em; }
h4 { font-size: 1.05rem; margin: 1.4em 0 0.3em; }

p, ul, ol, dl, figure, table, address { margin: 0 0 1em; }
address { font-style: normal; }
img { max-width: 100%; height: auto; display: block; }
strong { font-weight: 700; }

a {
  color: var(--brand);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 3px; }
/* Visited links in page content get a different color, so people can see
   which documents and posts they already opened. */
.content a:not(.button):visited { color: var(--accentInk); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}
main:focus { outline: none; }
::selection { background: var(--accent); color: var(--ink); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: 74rem;
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 40rem) { .wrap { padding-inline: 1.5rem; } }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 10;
  padding: 0.75rem 1.1rem;
  background: var(--brandDark);
  color: var(--onBrand);
  font-weight: 700;
  border-radius: 0 0 0.5rem 0.5rem;
  --focus: var(--focusOnDark);
}
.skip-link:focus { top: 0; }

/* ---------- Header ---------- */
.sample-notice {
  margin: 0;
  padding: 0.45rem 1rem;
  background: var(--notice);
  color: var(--ink);
  font-size: 0.9rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--brand);
  text-decoration: none;
}
.brand .logo { flex: none; width: 3rem; height: 3rem; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.75rem); line-height: 1.1; }
.brand-sub { color: var(--muted); font-size: 0.92rem; letter-spacing: 0.01em; }
.brand:hover .brand-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.15em; }

.utility {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}
.utility a { color: var(--ink); }

/* Main navigation: a plain list. No hidden menu, so it works with keyboard,
   with zoom and without JavaScript. */
.site-nav {
  background: var(--brandDark);
  --focus: var(--focusOnDark);
}
.site-nav ul {
  list-style: none;
  margin-block: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: 0;
  padding-block: 0.35rem;
}
.site-nav a {
  display: block;
  padding: 0.7rem 0.75rem;
  min-height: 2.75rem;
  color: var(--onBrand);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.35rem;
}
.site-nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
/* "page" marks the page itself; "true" marks its section (for example News on a post). */
.site-nav a[aria-current] {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 4px;
  text-underline-offset: 0.45em;
  font-weight: 700;
}
@media (min-width: 60rem) {
  .site-nav ul { display: flex; flex-wrap: wrap; gap: 0.15rem; padding-block: 0.25rem; padding-inline: 0.65rem; }
  .site-nav a { padding: 0.75rem 0.85rem; }
}

/* ---------- Page head ---------- */
.page-head {
  background: var(--mist);
  border-bottom: 1px solid var(--line);
  padding-block: 2rem 2.25rem;
}
.page-head-inner { display: grid; gap: 2rem; align-items: center; }
.page-head h1 { max-width: 24ch; }
.lead { font-size: clamp(1.08rem, 1rem + 0.45vw, 1.3rem); color: var(--ink); max-width: 60ch; margin-bottom: 0; }
.post-meta { color: var(--muted); margin: -0.2em 0 0.6em; }
.page-head-figure { margin: 0; }
.page-head-figure img { border-radius: 1rem; border: 1px solid var(--line); width: 100%; }
.page-head--home { padding-block: 2.5rem 3rem; }
@media (min-width: 56rem) {
  .page-head--figure .page-head-inner { grid-template-columns: 1.1fr 1fr; }
  .page-head--home { padding-block: 3.5rem 4rem; }
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0;
  margin: 0 0 1rem;
  padding: 0;
  font-size: 0.95rem;
}
.breadcrumbs li + li::before { content: "/"; margin-inline: 0.55rem; color: var(--muted); }
.breadcrumbs [aria-current] { color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.button {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  min-height: 2.75rem;
  border-radius: 0.5rem;
  border: 2px solid var(--brand);
  background: var(--brand);
  color: var(--onBrand);
  font-weight: 700;
  text-decoration: none;
}
.button:hover { background: var(--brandDark); border-color: var(--brandDark); text-decoration: underline; }
.button--quiet { background: transparent; color: var(--brand); }
.button--quiet:hover { background: var(--surface); color: var(--brandDark); }

/* ---------- Content ---------- */
.content { padding-block: 1rem 2.5rem; }
.content > :first-child { margin-top: 1.5rem; }
.content > p, .content > ul:not(.grid):not(.news-list):not(.events), .content > ol, .content > figure, .content > dl { max-width: 68ch; }
.nowrap { white-space: nowrap; }
.content li + li { margin-top: 0.35em; }
.content figure img { border-radius: 0.75rem; border: 1px solid var(--line); }
figcaption { color: var(--muted); font-size: 0.95rem; margin-top: 0.5rem; }
.doc-meta { color: var(--muted); font-size: 0.92em; white-space: nowrap; }

.eyebrow {
  color: var(--accentInk);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.35rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 1px 2px rgb(18 58 49 / 0.06);
}
.card > :last-child { margin-bottom: 0; }
.card h3 { margin-top: 0; }

.grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}
.grid > li + li { margin-top: 0; }
/* Narrower cards for people, so a board of five fits on one row on wide screens. */
.grid--people { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.5rem), 1fr)); }

/* Quick links */
.quick-links { margin-top: -1.5rem; position: relative; }
.quick-link {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  height: 100%;
  color: var(--ink);
  text-decoration: none;
}
.quick-link .icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 3rem; height: 3rem;
  border-radius: 0.75rem;
  background: var(--mist);
  color: var(--brand);
}
.quick-link-title { display: block; color: var(--brand); font-weight: 700; font-size: 1.1rem; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.quick-link-text { display: block; color: var(--muted); font-size: 0.95rem; margin-top: 0.15rem; }
.quick-link:hover .quick-link-title { text-decoration-thickness: 3px; }

/* Home: news and events side by side on wide screens */
.split { display: grid; gap: 1rem 3rem; }
@media (min-width: 60rem) { .split { grid-template-columns: 1.4fr 1fr; } }
.split h2 { margin-top: 1.5em; }

.news-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 1rem; }
.news-list li + li { margin-top: 0; }
.news-item h3, .news-item h2 { margin: 0 0 0.3rem; font-size: 1.25rem; }
.news-item p { margin: 0; }
.news-item .post-meta { margin: 0 0 0.4rem; font-size: 0.95rem; }
.news-item--figure { display: grid; gap: 1rem; }
@media (min-width: 40rem) {
  .news-item--figure { grid-template-columns: 9rem 1fr; align-items: start; }
}
.news-item--figure img { border-radius: 0.6rem; border: 1px solid var(--line); }

/* Events */
.events { list-style: none; padding: 0; margin: 0 0 1rem; }
.events > li { display: grid; grid-template-columns: 4.25rem 1fr; gap: 1rem; align-items: start; padding-block: 0.9rem; border-bottom: 1px solid var(--line); }
.events > li + li { margin-top: 0; }
.events > li:first-child { padding-top: 0.25rem; }
.date-badge {
  display: grid;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand);
  border-radius: 0.5rem;
  padding: 0.3rem 0.2rem 0.4rem;
  line-height: 1.1;
}
.date-badge .m { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accentInk); }
.date-badge .d { font-size: 1.5rem; font-weight: 700; color: var(--brandDark); font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; }
.event-title { display: block; font-weight: 700; color: var(--ink); }
.event-meta { display: block; color: var(--muted); font-size: 0.95rem; }

/* Superintendent message */
.message {
  margin-top: 3rem;
  display: grid;
  gap: 0.5rem 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1.5rem 1.5rem 1.25rem;
}
.message h2 { margin: 0; }
.message figure { margin: 0; }
.message blockquote { margin: 0; font-size: 1.12rem; max-width: 60ch; }
@media (min-width: 56rem) {
  /* Heading on the left, message on the right: uses the full card width. */
  .message { grid-template-columns: minmax(12rem, 1fr) 2.2fr; padding: 2rem 2.25rem; }
}
.message blockquote p { margin: 0 0 0.75rem; }
.message figcaption { color: var(--muted); font-size: 1rem; margin: 0; }

/* Schools */
.school { display: grid; gap: 1.5rem; padding-block: 1rem 1.5rem; border-bottom: 1px solid var(--line); }
.school h2 { margin-top: 0.5rem; }
@media (min-width: 56rem) { .school { grid-template-columns: 1fr 1.2fr; align-items: start; } .school figure { margin-top: 1.25rem; } }
.school figure { margin: 0; }
.school img { border-radius: 0.9rem; border: 1px solid var(--line); }

.facts { display: grid; grid-template-columns: minmax(7rem, max-content) 1fr; gap: 0.35rem 1.25rem; margin: 0 0 1rem; }
.facts dt { font-weight: 700; color: var(--ink); }
.facts dd { margin: 0; }
@media (max-width: 30rem) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: 0.5rem; } }

/* Board members */
.member .role { color: var(--accentInk); font-weight: 700; margin: 0 0 0.2rem; }
.member h3 { margin: 0 0 0.25rem; }
.member p { margin: 0; color: var(--muted); }

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; margin: 0; font-size: 0.98rem; }
caption {
  text-align: left;
  font-size: 1.15rem;
  padding: 0.9rem 1rem 0.6rem;
}
th, td { text-align: left; vertical-align: top; padding: 0.7rem 1rem; border-top: 1px solid var(--line); }
thead th { background: var(--mist); color: var(--ink); font-weight: 700; }
tbody th { font-weight: 700; }
td a { overflow-wrap: anywhere; }
/* A phone number must not break in the middle: "(530) 555-" / "0110". */
a[href^="tel:"] { white-space: nowrap; overflow-wrap: normal; }
/* On wide screens the table has room: keep an email address on one line. */
@media (min-width: 60rem) { td a[href^="mailto:"] { white-space: nowrap; overflow-wrap: normal; } }
.table-hint { display: none; color: var(--muted); font-size: 0.95rem; margin-bottom: 0.5rem; }
@media (max-width: 48rem) {
  .table-hint { display: block; }
  table { min-width: 40rem; }
}

/* Documents */
.doc-list { list-style: none; padding: 0; margin: 0 0 1.5rem; max-width: 52rem; }
.doc-list > li { padding: 0.85rem 0 0.85rem 2.4rem; border-bottom: 1px solid var(--line); position: relative; }
.doc-list > li + li { margin-top: 0; }
.doc-list > li::before {
  content: "";
  position: absolute;
  left: 0.2rem; top: 0.95rem;
  width: 1.4rem; height: 1.75rem;
  border: 2px solid var(--brand);
  border-radius: 0.2rem 0.6rem 0.2rem 0.2rem;
}
.doc-list a { font-weight: 600; }
.doc-note { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.95rem; }
.badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--mist);
  color: var(--brandDark);
  vertical-align: 0.1em;
}
.badge--warn { background: var(--notice); color: var(--ink); }

.contact-card { max-width: 40rem; }
.contact-card p { margin: 0 0 0.35rem; }

.callout {
  max-width: 68ch;
  background: var(--notice);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.callout > :last-child { margin-bottom: 0; }

.back-link { margin-top: 2.5rem; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 1rem; }
.footer-art { width: 100%; height: 4.5rem; object-fit: fill; }
.footer-body {
  background: var(--brandDark);
  color: var(--onBrand);
  padding-block: 1.5rem 2rem;
  --focus: var(--focusOnDark);
}
.footer-grid { display: grid; gap: 1.5rem 3rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.site-footer h2 { color: var(--onBrand); font-size: 1.15rem; margin: 0 0 0.6rem; }
.site-footer a { color: var(--onBrand); }
.site-footer p { margin: 0 0 0.6rem; }
.footer-muted { color: var(--onBrandMuted); font-size: 0.95rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li + li { margin-top: 0; }
/* Taller tap area (about 44 px) for the stacked footer links. */
.footer-links a { display: inline-block; padding-block: 0.55rem; }
.footer-links { margin-top: -0.55rem; }
.footer-base {
  margin-top: 1.75rem;
  color: var(--onBrandMuted);
  font-size: 0.92rem;
}
.footer-base::before { content: ""; display: block; border-top: 1px solid rgb(255 255 255 / 0.25); margin-bottom: 1rem; }
.footer-base p { margin: 0 0 0.25rem; }

/* ---------- Motion, forced colors, print ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  a, .button { transition: text-decoration-thickness 120ms ease, background-color 120ms ease; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .site-nav a[aria-current] { text-decoration-color: LinkText; }
  .button { border-color: ButtonText; }
  .card, .table-wrap, .message { border-color: CanvasText; }
}

@media print {
  .site-nav, .skip-link, .footer-art, .utility { display: none; }
  body { background: #fff; font-size: 11pt; }
  .page-head, .footer-body { background: #fff; color: #000; }
  .site-footer h2, .site-footer a, .footer-base, .footer-muted { color: #000; }
  /* Backgrounds do not print: a filled button would be white text on white paper. */
  .button { background: #fff; color: #000; border-color: #000; }
  .page-head-figure img { max-width: 60%; }
  a[href^="http"]::after { content: " (" attr(href) ")"; }
}
