/* Baseline design tokens — WCAG AAA on every surface, public and admin.
 * Text contrast ≥ 7:1 against its background; targets ≥ 44px; visible focus;
 * motion respects prefers-reduced-motion.
 * Georgetown theme: royal blue and white (the town's colors). */

:root {
  /* Georgetown's colors: royal blue and white. True royal (#4169e1) is
   * decorative only — it can't carry AAA text; text-bearing blues below
   * all clear 7:1 on their backgrounds. */
  --ink: #1b1c1f;          /* on --paper ~16:1 */
  --ink-soft: #3e4046;     /* on --paper ~9.6:1 */
  --paper: #ffffff;
  --panel: #eef2fb;
  --card: #ffffff;
  --line: #cdd7ee;
  --brand: #1e40af;        /* links/accent text — 8.4:1 on white */
  --brand-deep: #1e3a8a;   /* header/hero/footer bg — white on it 10.4:1 */
  --brand-wash: #e8eefc;
  --accent: #4169e1;       /* royal blue — decorative borders only, never text */
  --danger: #8b1a1a;
  --focus: #1e3a8a;
  --max-width: 72rem;
  --serif: "Palatino", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}

h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.15; color: var(--ink); }
nav, button, .button, label, th, .badge, .meta, .site-name, .eyebrow { font-family: var(--sans); }

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--brand-deep); color: #fff;
  padding: 0.75rem 1.25rem; z-index: 10;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.top-strip { background: #16295f; color: #fff; font-family: var(--sans); font-size: 0.95rem; }
.top-strip .wrap { display: flex; flex-wrap: wrap; gap: 0.25rem 2rem; padding-top: 0.45rem; padding-bottom: 0.45rem; }
.top-strip p { margin: 0; }

.site-header { background: var(--brand-deep); color: #fff; border-bottom: 4px solid var(--accent); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 2.5rem; padding-top: 1rem; padding-bottom: 0.75rem; }
.site-name { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; margin: 0; letter-spacing: 0.01em; }
.site-name a { color: #fff; text-decoration: none; }
.site-name a:hover { text-decoration: underline; text-underline-offset: 5px; }
.site-header nav ul { display: flex; flex-wrap: wrap; gap: 0.15rem; list-style: none; margin: 0; padding: 0; }
.site-header nav a {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 1rem;
  color: #fff; text-decoration: none; font-weight: 600; font-size: 1rem;
  border-bottom: 3px solid transparent;
}
.site-header nav a:hover, .site-header nav a[aria-current] { border-bottom-color: var(--accent); }
.site-header :focus-visible { outline-color: #fff; }
.site-header .button-quiet { color: #fff; border-color: #fff; background: transparent; }
.site-header .button-quiet:hover { background: var(--brand); }

/* ---------- Hero (home) ---------- */
.hero { background: var(--brand-deep); color: #fff; padding: 3.5rem 0 3rem; border-bottom: 4px solid var(--accent); }
.hero .eyebrow { color: #d7e0f7; margin: 0 0 0.5rem; font-size: 0.95rem; letter-spacing: 0.14em; text-transform: uppercase; }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 5vw, 3.2rem); margin: 0 0 0.5rem; }
.hero .tagline { color: #e6ecfa; font-size: 1.3rem; margin: 0 0 1.75rem; max-width: 40rem; }
.hero-search { display: flex; flex-wrap: wrap; gap: 0.75rem; max-width: 38rem; }
.hero-search input[type="search"] {
  flex: 1 1 16rem; min-height: 52px; font-size: 1.1rem;
  border: 2px solid #fff; border-radius: 6px; padding: 0.5rem 1rem;
}
.hero-search button { min-height: 52px; background: #fff; border-color: #fff; color: var(--brand-deep); font-size: 1.05rem; }
.hero-search button:hover { background: var(--brand-wash); border-color: var(--brand-wash); }
.hero :focus-visible { outline-color: #fff; }

.quick-links { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem; padding: 0; margin: 1.75rem 0 0; }
.quick-links a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 1.1rem; border: 2px solid #ffffff88; border-radius: 999px;
  color: #fff; text-decoration: none; font-family: var(--sans); font-weight: 600; font-size: 0.98rem;
}
.quick-links a:hover { border-color: #fff; background: var(--brand); }

/* ---------- Page header band (interior pages) ---------- */
.page-head { background: var(--panel); border-bottom: 4px solid var(--accent); padding: 1.75rem 0 1.9rem; }
.page-head .wrap { max-width: 60rem; }
.page-head h1 { margin: 0; border-bottom: 0; padding-bottom: 0; font-size: clamp(1.9rem, 4vw, 2.5rem); }
.page-head .lede { margin: 0.6rem 0 0; }
.crumbs { font-family: var(--sans); font-size: 0.92rem; margin-bottom: 0.75rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; color: var(--ink-soft); padding: 0 0.45rem; }
.crumbs a { color: var(--brand); }
.crumbs [aria-current] { color: var(--ink-soft); }

/* ---------- Main content ---------- */
main { padding: 2.5rem 1.5rem 4rem; }
main.wrap { padding-left: 1.5rem; padding-right: 1.5rem; }
main.content-main { max-width: 60rem; margin-left: auto; margin-right: auto; }
main.content-wide { max-width: var(--max-width); }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2.5px; }

h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 1.25rem; padding-bottom: 0.6rem; border-bottom: 3px solid var(--accent); display: inline-block; }
h2 { font-size: 1.55rem; margin: 2.25rem 0 0.75rem; }
h3 { font-size: 1.22rem; }
p, ul, ol { max-width: 46rem; }
.lede { font-size: 1.28rem; color: var(--ink-soft); max-width: 44rem; }

.section-head { display: flex; align-items: baseline; gap: 1.5rem; flex-wrap: wrap; margin-top: 2.5rem; }
.section-head h2 { margin: 0; }
.section-head .more { font-family: var(--sans); font-weight: 600; }

.alert {
  border-left: 6px solid var(--accent);
  background: var(--panel);
  padding: 1.1rem 1.4rem; margin: 1.75rem 0; max-width: 46rem;
  border-radius: 0 6px 6px 0;
}
.alert p { margin: 0.25rem 0; }

.contact-card {
  background: var(--brand-wash); border: 1px solid var(--line);
  border-radius: 6px; padding: 1.1rem 1.4rem; margin: 1.25rem 0; max-width: 30rem;
}
.contact-card p { margin: 0.25rem 0; }

figure.content-image { margin: 2rem 0; max-width: 46rem; }
figure.content-image img { max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); }
figure.content-image figcaption { font-family: var(--sans); font-size: 0.95rem; color: var(--ink-soft); margin-top: 0.5rem; }
figure.content-image .credit { font-style: italic; }

.table-scroll { overflow-x: auto; margin: 1.75rem 0; }
table { border-collapse: collapse; width: 100%; background: var(--card); }
caption { text-align: left; font-weight: 700; font-family: var(--sans); padding-bottom: 0.6rem; font-size: 1.05rem; }
th, td { border: 1px solid var(--line); padding: 0.7rem 0.9rem; text-align: left; vertical-align: top; }
th { background: var(--brand-deep); color: #fff; font-size: 0.98rem; }
tbody tr:nth-child(even) { background: var(--panel); }

/* ---------- Cards ---------- */
.card-list { list-style: none; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--brand);
  border-radius: 6px; padding: 1.25rem 1.4rem;
}
.card h2, .card h3 { margin: 0 0 0.4rem; font-size: 1.18rem; }
.card p { margin: 0.35rem 0; }
.media-card img { max-width: 100%; height: auto; border-radius: 4px; }
.meta { color: var(--ink-soft); font-size: 0.95rem; font-family: var(--sans); }

.date-chip {
  display: inline-block; font-family: var(--sans); font-weight: 700; font-size: 0.9rem;
  background: var(--brand-wash); color: var(--brand); border: 1px solid var(--brand);
  border-radius: 4px; padding: 0.1rem 0.55rem; margin-bottom: 0.4rem;
}

/* ---------- Events ---------- */
.cal-filters { font-family: var(--sans); margin: 0 0 1.5rem; }
.cal-filters ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0; }
.cal-filters a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem;
  border: 2px solid var(--brand); border-radius: 999px; text-decoration: none;
  color: var(--brand); font-weight: 600; font-size: 0.95rem;
}
.cal-filters a.is-active, .cal-filters a:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }

.upcoming-list { list-style: none; padding: 0; max-width: 46rem; }
.upcoming-list li { border-bottom: 1px solid var(--line); padding: 0.9rem 0; }
.upcoming-list .date-chip { margin-bottom: 0.2rem; }

/* ---------- Forms & buttons ---------- */
label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
input[type="text"], input[type="email"], input[type="search"], input[type="datetime-local"],
input[type="url"], input[type="file"], select, textarea {
  font: inherit; color: var(--ink);
  width: 100%; max-width: 34rem;
  min-height: 44px; padding: 0.5rem 0.75rem;
  border: 2px solid var(--ink-soft); border-radius: 6px; background: #fff;
}
textarea { min-height: 8rem; }
.field { margin-bottom: 1.3rem; }
.field .meta { margin-top: 0.3rem; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; min-width: 44px; padding: 0 1.4rem;
  font: inherit; font-family: var(--sans); font-weight: 700;
  color: #fff; background: var(--brand); border: 2px solid var(--brand);
  border-radius: 6px; cursor: pointer; text-decoration: none;
}
button:hover, .button:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.button-quiet { color: var(--brand); background: transparent; }
.button-quiet:hover { color: #fff; }
.button-danger { background: var(--danger); border-color: var(--danger); }
.button-small { font-size: 0.95rem; }

.flash { background: var(--panel); border-left: 6px solid var(--brand); padding: 1rem 1.4rem; border-radius: 0 6px 6px 0; }
.flash-alert { border-left-color: var(--danger); }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-deep); color: #fff; margin-top: 4rem; border-top: 4px solid var(--accent); padding: 2.5rem 0 2rem; }
.site-footer a { color: #fff; }
.footer-cols { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.site-footer h2 { color: #fff; font-family: var(--sans); font-size: 1.05rem; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 0.6rem; }
.site-footer p, .site-footer li { color: #e9efe9; margin: 0.25rem 0; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li a { display: inline-flex; min-height: 40px; align-items: center; }
.site-footer :focus-visible { outline-color: #fff; }
.powered-by { font-size: 0.95rem; margin-top: 2rem; border-top: 1px solid #ffffff44; padding-top: 1rem; font-family: var(--sans); }

/* ---------- Admin chrome ---------- */
.admin-bar { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: baseline; margin-bottom: 1.5rem; border-bottom: 2px solid var(--panel); padding-bottom: 0.75rem; }
.admin-bar h1 { margin: 0; border-bottom: 0; padding-bottom: 0; }
.stat-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); margin: 1.5rem 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: 6px; padding: 1rem 1.25rem; font-family: var(--sans); }
.stat .num { font-size: 1.9rem; font-weight: 700; display: block; font-family: var(--serif); }

.badge {
  display: inline-block; font-family: var(--sans);
  font-size: 0.85rem; font-weight: 700;
  padding: 0.15rem 0.6rem; border-radius: 999px; border: 2px solid var(--ink-soft);
  color: var(--ink); background: #fff;
}
.badge-ai { border-color: var(--brand); color: var(--brand); }
.badge-state { border-color: var(--accent); }

.block-row { display: flex; gap: 1rem; align-items: flex-start; border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.25rem; margin-bottom: 0.75rem; background: var(--card); }
.block-row .block-body { flex: 1 1 auto; min-width: 0; }
.block-row .block-tools { display: flex; flex-direction: column; gap: 0.4rem; }
.block-row .block-tools form { margin: 0; }
.block-preview :first-child { margin-top: 0; }
.block-preview h1 { border-bottom: 0; }
.workflow-note { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.4rem; margin: 1rem 0; }

table.admin-table th, table.admin-table td { font-size: 1rem; }

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