/* Durham Parents Resource — local stylesheet (works offline) */
:root {
  --bg: #f8fafc;
  --bg-muted: #f1f5f9;
  --fg: #1e293b;
  --muted: #475569;
  --faint: #64748b;
  --card: #ffffff;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-text: #1e40af;
  --header: #0f172a;
  --header-fg: #f8fafc;
  --header-muted: #94a3b8;
  --danger-bg: #fffbeb;
  --danger-border: #fde68a;
  --danger-fg: #78350f;
  --ok-bg: #ecfdf5;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --radius: 12px;
  --max: 72rem;
  --narrow: 48rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html.dark {
  --bg: #0f172a;
  --bg-muted: #1e293b;
  --fg: #e2e8f0;
  --muted: #cbd5e1;
  --faint: #94a3b8;
  --card: #1e293b;
  --border: #334155;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft: #1e3a5f;
  --accent-text: #93c5fd;
  --header: #020617;
  --header-fg: #f8fafc;
  --header-muted: #94a3b8;
  --danger-bg: #422006;
  --danger-border: #854d0e;
  --danger-fg: #fde68a;
  --ok-bg: #064e3b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
a { color: var(--accent-text); }
a:hover { color: var(--accent-hover); }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-muted);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
}
.skip-link:focus { top: 0.75rem; color: #fff; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2rem, var(--narrow)); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header);
  color: var(--header-fg);
  border-bottom: 1px solid #1e293b;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.25);
}
.site-header a { color: var(--header-fg); text-decoration: none; }
.site-header a:hover { color: #93c5fd; }
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}
.brand {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
  white-space: nowrap;
}
.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn, .menu-btn {
  background: transparent;
  color: inherit;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.icon-btn:hover, .menu-btn:hover,
.icon-btn:focus-visible, .menu-btn:focus-visible {
  border-color: #60a5fa;
  background: #1e293b;
  outline: none;
}
.icon-btn { width: 2.35rem; height: 2.35rem; justify-content: center; padding: 0; }
.menu-btn[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.chevron { width: 1rem; height: 1rem; transition: transform 0.15s ease; }

.mega {
  display: none;
  padding-bottom: 1rem;
}
.mega.open { display: block; }
.mega-inner {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.15rem;
}
.mega-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .mega-grid { grid-template-columns: repeat(3, 1fr); }
}
.nav-group h2 {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--header-muted);
  font-weight: 700;
}
.nav-group a {
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  font-size: 0.92rem;
}
.nav-group a:hover { background: #334155; }
.nav-group a[aria-current="page"] {
  background: #1d4ed8;
  color: #fff;
}

.search-wrap {
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}
.search-inner { position: relative; max-width: 28rem; margin: 0 auto; }
.search-inner input[type="search"] {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--fg);
  box-shadow: var(--shadow);
}
.search-inner input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.search-results {
  display: none;
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 0.3rem);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  max-height: 18rem;
  overflow: auto;
  z-index: 60;
}
.search-results.open { display: block; }
.search-results a, .search-results .empty {
  display: block;
  padding: 0.55rem 0.8rem;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a:focus { background: var(--accent-soft); }
.search-results .empty { color: var(--faint); }

.site-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--faint);
  background: var(--bg-muted);
  margin: 0;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid var(--border);
}

/* Hero & banners */
.hero {
  background: #1e293b;
  color: #f8fafc;
  padding: 3rem 0;
  text-align: center;
}
html.dark .hero { background: #020617; }
.hero h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.hero p { margin: 0 auto 1.4rem; max-width: 40rem; color: #cbd5e1; font-size: 1.05rem; }
.hero-actions, .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}
.actions { justify-content: flex-start; margin-top: 1.5rem; }

.page {
  padding: 2.4rem 0 3rem;
}
.page h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.lede { color: var(--muted); margin: 0 0 1.6rem; font-size: 1.05rem; }
.updated { font-size: 0.8rem; color: var(--faint); margin: 0 0 0.35rem; }

.this-month {
  background: linear-gradient(180deg, #1d4ed8, #1e3a8a);
  color: #fff;
  padding: 1.35rem 0;
}
.this-month h2 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.this-month p, .this-month li { margin: 0; color: #dbeafe; }
.this-month a { color: #fff; font-weight: 600; }
.this-month ol { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.countdown {
  display: inline-block;
  font-weight: 700;
  font-size: 0.85rem;
  margin-left: 0.2rem;
}
.this-month .countdown {
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
}

/* Cards / doors */
.doors {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin: 1.5rem 0 2rem;
}
@media (min-width: 800px) {
  .doors { grid-template-columns: repeat(3, 1fr); }
}
.door, .card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
  box-shadow: var(--shadow);
}
.door {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.door:hover { box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1); border-color: #93c5fd; color: inherit; }
.door .kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 0.35rem;
}
.door h2, .door h3, .card h2, .card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.door p, .card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card + .card, .stack > * + * { margin-top: 1rem; }
.stack { margin: 0; }
.card h2 { font-size: 1.2rem; }
.card ul, .card ol, .prose ul, .prose ol { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.card li + li, .prose li + li { margin-top: 0.35rem; }

.section {
  padding: 2.4rem 0;
}
.section-muted {
  background: var(--card);
  border-block: 1px solid var(--border);
}
.section h2 { margin: 0 0 1rem; font-size: 1.35rem; }

.more-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .more-grid { grid-template-columns: repeat(3, 1fr); }
}
.more-grid h3 {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--faint);
}
.more-grid a { display: block; padding: 0.15rem 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  background: #475569;
  color: #fff;
}
.btn:hover { background: #334155; color: #fff; }
.btn:focus-visible, .icon-btn:focus-visible, .menu-btn:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}
.btn-primary { background: #2563eb; }
.btn-primary:hover { background: #1d4ed8; color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-muted); color: var(--fg); }
.btn-sm { font-size: 0.82rem; padding: 0.35rem 0.7rem; }

.callout {
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin: 0 0 1.1rem;
  font-size: 0.92rem;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--fg);
}
.callout-amber {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-fg);
}
.callout strong { display: inline; }

.checklist { list-style: none; padding-left: 0; }
.checklist li { padding-left: 1.5rem; position: relative; }
.checklist li::before {
  content: "☐";
  position: absolute;
  left: 0;
  color: var(--faint);
}

/* Templates */
.template {
  border-left: 4px solid var(--accent);
  padding-left: 0.9rem;
  margin: 1.1rem 0;
}
.template-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.template-head p { margin: 0; font-weight: 650; }
.template-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.template pre, pre.letter {
  margin: 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  background: var(--bg-muted);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  overflow-x: auto;
}

/* Tables */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--card);
}
th, td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
th { background: var(--bg-muted); font-weight: 650; }
thead th { background: #1e293b; color: #fff; border-color: #334155; }
html.dark thead th { background: #020617; }
.table-plain th { background: var(--bg-muted); color: var(--fg); }

@media (max-width: 720px) {
  table.compare thead { display: none; }
  table.compare, table.compare tbody, table.compare tr, table.compare td {
    display: block;
    width: 100%;
  }
  table.compare tr {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--card);
  }
  table.compare td {
    border: 0;
    border-bottom: 1px solid var(--border);
  }
  table.compare td:last-child { border-bottom: 0; }
  table.compare td::before {
    content: attr(data-label);
    display: block;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--faint);
    margin-bottom: 0.25rem;
  }
}

/* Finder */
.finder {
  display: grid;
  gap: 0.75rem;
}
.finder-row {
  display: grid;
  gap: 0.6rem;
}
@media (min-width: 600px) {
  .finder-row { grid-template-columns: 1fr 1fr; }
}
.finder label {
  display: block;
  font-size: 0.8rem;
  font-weight: 650;
  margin-bottom: 0.25rem;
}
.finder select {
  width: 100%;
  font: inherit;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
}
.finder-result {
  margin-top: 0.4rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
}
.finder-result[hidden] { display: none; }
.finder-result h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.finder-result ul { margin: 0.3rem 0 0; padding-left: 1.1rem; }

/* Footer */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 2rem 0;
  font-size: 0.9rem;
  margin-top: 2rem;
}
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}
.site-footer strong { color: #e2e8f0; }

.prose h2 { margin: 1.6rem 0 0.5rem; font-size: 1.25rem; }
.prose h3 { margin: 1.1rem 0 0.35rem; font-size: 1.05rem; }
.prose p { margin: 0 0 0.85rem; }
.source {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.7rem;
}

.log-table input, .log-table textarea {
  width: 100%;
  font: inherit;
  font-size: 0.85rem;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--fg);
  min-height: 2.4rem;
}

@media print {
  .skip-link, .site-header, .search-wrap, .site-note, .site-footer,
  .no-print, .template-actions, .hero-actions, .actions, .icon-btn, .menu-btn {
    display: none !important;
  }
  body { background: #fff; color: #111; font-size: 11pt; }
  a { color: #111; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #444; }
  .card, .door, .callout, .template pre { break-inside: avoid; box-shadow: none; }
  .page, .section { padding: 0.4rem 0; }
  .hero { background: none; color: #111; text-align: left; padding: 0 0 0.6rem; }
  .hero p { color: #333; }
  body[data-page="quick-start"] .page { padding-top: 0; }
  body[data-page="quick-start"] h1 { font-size: 18pt; }
  thead th { background: #eee !important; color: #111 !important; }
}
