/* Williams Compass — editorial design system.
   Off-white paper, black ink, thin gray rules, Geist type. Adapted from the
   William Lodge reference site's base.css / home.css / notes-article.css
   patterns, trimmed to what this site needs. */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #0a0a0a;
  --muted: #5f5f5f;
  --faint: #8a8a8a;
  --line: #dcdcd6;
  --line-strong: #0a0a0a;
  --paper: #fbfbf9;
  --soft: #f3f3f0;
  --danger: #8a2b2b;
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max: 74rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body.wc-page {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: .25em; }
h1, h2, h3, h4 { line-height: 1.08; letter-spacing: -0.03em; font-weight: 700; }
p { max-width: 68ch; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.skip-link {
  position: fixed; top: -4rem; left: 1rem; z-index: 1000;
  padding: .75rem 1.1rem; background: var(--ink); color: var(--paper);
}
.skip-link:focus { top: 1rem; }

/* ── Header / nav ─────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 4.25rem; padding: 0 clamp(1.1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 251, 249, .96);
  backdrop-filter: blur(6px);
}
.site-brand { font-weight: 700; font-size: 1.05rem; letter-spacing: -.03em; text-decoration: none; }
.site-nav-desktop { display: flex; flex-wrap: wrap; gap: clamp(.9rem, 1.6vw, 1.5rem); }
.site-nav-desktop a { font-size: .82rem; text-decoration: none; padding-bottom: .2rem; border-bottom: 1px solid transparent; }
.site-nav-desktop a:hover, .site-nav-desktop a[aria-current="page"] { border-bottom-color: var(--ink); }

.menu-toggle, .menu-close { display: none; }
.mobile-menu[hidden] { display: none; }

@media (max-width: 900px) {
  .site-nav-desktop { display: none; }
  .menu-toggle {
    display: grid; place-content: center; gap: .3rem;
    width: 2.75rem; height: 2.75rem; border: 0; background: transparent; cursor: pointer;
  }
  .menu-toggle span { width: 1.4rem; height: 1.5px; background: var(--ink); }
  .mobile-menu {
    position: fixed; inset: 0; z-index: 100;
    display: flex; flex-direction: column;
    padding: 1.25rem 1.25rem 2rem; background: var(--paper);
  }
  .mobile-menu-head { display: flex; align-items: center; justify-content: space-between; }
  .menu-close { position: relative; width: 2.75rem; height: 2.75rem; border: 0; background: transparent; cursor: pointer; }
  .menu-close span { position: absolute; left: .6rem; top: 1.3rem; width: 1.5rem; height: 1.5px; background: var(--ink); }
  .menu-close span:first-child { transform: rotate(45deg); }
  .menu-close span:last-child { transform: rotate(-45deg); }
  .mobile-menu ul { margin-top: 2.5rem; list-style: none; border-top: 1px solid var(--ink); }
  .mobile-menu li { border-bottom: 1px solid var(--line); }
  .mobile-menu li a { display: block; padding: 1.05rem 0; font-size: 1.2rem; text-decoration: none; min-height: 44px; }
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding: 3rem clamp(1.1rem, 4vw, 3rem) 2rem; }
.footer-top { display: flex; flex-wrap: wrap; gap: 2.5rem 4rem; justify-content: space-between; max-width: var(--max); margin: 0 auto; }
.footer-wordmark { display: block; font-weight: 700; font-size: 1.1rem; letter-spacing: -.03em; margin-bottom: .6rem; }
.footer-brand p { color: var(--muted); font-size: .88rem; max-width: 24rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; max-width: 28rem; }
.footer-nav a { font-size: .82rem; text-decoration: underline; text-decoration-color: var(--line); }
.footer-bottom { max-width: var(--max); margin: 2rem auto 0; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--faint); font-size: .76rem; font-family: var(--font-mono); }
.footer-bottom p + p { margin-top: .4rem; }

/* ── Generic layout helpers ───────────────────────────────── */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 3rem); }
.section { padding: clamp(2.75rem, 6vw, 4.5rem) 0; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }
.eyebrow { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .9rem; }
.section-title { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin-bottom: .75rem; }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 62ch; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 2.9rem; padding: .8rem 1.4rem;
  font-size: .88rem; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid var(--ink); border-radius: 0; transition: background .15s, color .15s, gap .15s;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #2a2a2a; gap: .85rem; }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: var(--soft); }
.btn-text { border: 0; padding: 0; min-height: auto; text-decoration: underline; text-underline-offset: .3em; }

/* ── Homepage: numbered rail layout ───────────────────────── */
.home-shell {
  display: grid; grid-template-columns: 200px minmax(0, 1fr) 280px;
  grid-template-areas: "left main context";
  max-width: 1440px; margin: 0 auto;
}
.home-left-rail {
  grid-area: left; position: sticky; top: 4.25rem; align-self: start;
  min-height: calc(100vh - 4.25rem); padding: 2rem 1.25rem;
  border-right: 1px solid var(--line);
}
.home-nav ol { list-style: none; }
.home-nav li + li { margin-top: .1rem; }
.home-nav a {
  display: grid; grid-template-columns: 1.9rem 1fr; align-items: center;
  min-height: 2.6rem; font-size: .82rem; text-decoration: none; color: #303030;
}
.home-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.home-nav-index { font-family: var(--font-mono); font-size: .68rem; color: #999; }

.home-main { grid-area: main; min-width: 0; padding: 2.75rem clamp(1.25rem, 3vw, 3rem) 0; }
.home-context { grid-area: context; min-width: 0; padding: 2.75rem 1.75rem; border-left: 1px solid var(--line); }
.home-context section + section { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.home-context h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .8rem; }
.home-context p { font-size: .85rem; color: var(--muted); }
.home-context .home-text-link { display: inline-block; margin-top: .8rem; font-size: .82rem; font-weight: 600; }

.hero-kicker { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.4rem; }
.hero-title { font-size: clamp(3.2rem, 7vw, 6.2rem); line-height: .95; letter-spacing: -.05em; }
.hero-tagline { margin-top: 1.1rem; font-size: clamp(1.1rem, 1.8vw, 1.4rem); font-weight: 600; letter-spacing: -.02em; }
.hero-tagline span { display: block; color: var(--muted); font-weight: 500; }
.hero-intro { margin-top: 1.1rem; max-width: 40rem; font-size: 1.02rem; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.75rem; }
.hero-values { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: .78rem; color: var(--muted); }
.hero-values b { color: var(--ink); margin-right: .4rem; }

.explore-list { margin-top: 1rem; border-top: 1px solid var(--line); }
.explore-row { display: grid; grid-template-columns: 2.2rem minmax(0,1fr) auto; align-items: start; gap: 1rem; padding: 1.35rem 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.explore-row .num { font-family: var(--font-mono); color: var(--faint); font-size: .82rem; padding-top: .15rem; }
.explore-row h3 { font-size: 1.15rem; margin-bottom: .3rem; }
.explore-row p { color: var(--muted); font-size: .9rem; }
.explore-row .go { align-self: center; font-size: 1.1rem; color: var(--faint); }
.explore-row:hover .go { color: var(--ink); }

@media (max-width: 1180px) {
  .home-shell { grid-template-columns: minmax(0, 1fr) 260px; grid-template-areas: "main context"; }
  .home-left-rail { display: none; }
}
@media (max-width: 760px) {
  .home-shell { display: block; }
  .home-main { padding: 2rem 1.1rem 0; }
  .home-context { padding: 2.5rem 1.1rem; border-left: 0; border-top: 1px solid var(--line); }
  .hero-title { font-size: clamp(3rem, 15vw, 4.5rem); }
}

/* ── Interior page hero (non-home pages) ──────────────────── */
.page-hero { padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.page-hero .lead { margin-top: 1rem; }

/* ── Card grids (writing/reports/incidents listings) ─────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 1.5rem; }
.content-card { background: var(--paper); padding: 1.5rem; display: flex; flex-direction: column; min-height: 100%; }
.content-card .kind { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.content-card h3 { font-size: 1.15rem; margin-bottom: .55rem; }
.content-card h3 a { text-decoration: none; }
.content-card h3 a:hover { text-decoration: underline; }
.content-card p { color: var(--muted); font-size: .88rem; flex: 1; }
.content-card .meta { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); font-size: .74rem; color: var(--faint); display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.empty-state { padding: 3rem 0; color: var(--muted); border-top: 1px solid var(--line); margin-top: 1.5rem; }

/* ── Filter bar ───────────────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1.5rem; }
.filter-bar input[type="search"], .filter-bar select {
  min-height: 2.7rem; padding: 0 .9rem; border: 1px solid var(--line-strong); background: var(--paper);
  font-family: inherit; font-size: .88rem; color: var(--ink);
}
.filter-bar input[type="search"] { flex: 1; min-width: 12rem; }

/* ── Article / note page ─────────────────────────────────── */
.article { max-width: 42rem; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4rem) clamp(1.1rem, 4vw, 0) clamp(3rem, 6vw, 5rem); }
.article-kicker { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.article h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); }
.article-dek { margin-top: 1.1rem; font-size: 1.15rem; color: var(--muted); max-width: 36rem; }
.article-meta { display: flex; flex-wrap: wrap; gap: .7rem 1.25rem; margin-top: 1.6rem; padding: 1rem 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: .78rem; color: var(--muted); }
.article-body { margin-top: 2.25rem; }
.article-body p { margin: 0 0 1.25rem; line-height: 1.7; }
.article-body ul, .article-body ol { margin: 0 0 1.25rem 1.25rem; }
.article-body li { margin: .35rem 0; }
.article-body h2 { font-size: 1.45rem; margin: 2.25rem 0 .8rem; }
.article-body h3 { font-size: 1.15rem; margin: 1.75rem 0 .6rem; }
.article-body blockquote { margin: 1.5rem 0; padding: .1rem 0 .1rem 1.15rem; border-left: 2px solid var(--ink); font-weight: 600; font-size: 1.1rem; }
.article-body img { border: 1px solid var(--line); margin: 1.5rem 0; }
.article-body a { text-decoration: underline; }
.article-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2.5rem; }
.article-tags a { font-size: .74rem; font-family: var(--font-mono); border: 1px solid var(--line); padding: .3rem .6rem; text-decoration: none; }
.article-attachments { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.article-attachments h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .9rem; }
.attachment-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.attachment-row .size { color: var(--faint); font-size: .78rem; font-family: var(--font-mono); }
.article-related { margin-top: 3rem; padding-top: 1.75rem; border-top: 2px solid var(--ink); }
.article-related h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 1rem; }
.related-list { list-style: none; }
.related-list li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.article-back { display: inline-block; margin-bottom: 2rem; font-size: .85rem; text-decoration: none; color: var(--muted); }
.article-back:hover { color: var(--ink); }

/* ── Case file timeline ──────────────────────────────────── */
.timeline { margin: 1.5rem 0; border-top: 1px solid var(--line); }
.timeline-event { display: grid; grid-template-columns: 8rem 1fr; gap: 1.25rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.timeline-event time { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); padding-top: .15rem; }
.timeline-event h3 { font-size: 1rem; margin-bottom: .35rem; }
.timeline-event p { font-size: .9rem; color: var(--muted); }
.entry-kind { display: inline-block; margin-bottom: .5rem; font-family: var(--font-mono); font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; padding: .2rem .5rem; border: 1px solid var(--line-strong); }
.entry-kind.account { color: #2a4d8f; border-color: #2a4d8f; }
.entry-kind.allegation { color: #8a5a12; border-color: #8a5a12; }
.entry-kind.evidence { color: #1c6b3d; border-color: #1c6b3d; }
.entry-kind.finding { color: var(--ink); }
@media (max-width: 560px) { .timeline-event { grid-template-columns: 1fr; gap: .3rem; } }

/* ── Forms ────────────────────────────────────────────────── */
.field { margin-bottom: 1.4rem; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .4rem; }
.field .req { color: var(--danger); }
.field .hint { font-size: .78rem; color: var(--faint); margin-top: .4rem; }
.field input, .field select, .field textarea {
  width: 100%; font-family: inherit; font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-strong); padding: .8rem .9rem; min-height: 3rem;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.form-note .aside { font-size: .78rem; color: var(--faint); }
.banner { display: flex; gap: .8rem; padding: 1.1rem 1.3rem; border: 1px solid var(--line-strong); margin-bottom: 1.5rem; font-size: .92rem; }
.banner.ok { background: #eef6f0; border-color: #2f6b46; }
.banner.err { background: #f8eeee; border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .82rem; margin-top: .35rem; }
.assurance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 1.75rem; }
.assurance-grid .item { background: var(--paper); padding: 1.1rem 1.25rem; }
.assurance-grid h4 { font-size: .92rem; margin-bottom: .4rem; }
.assurance-grid p { font-size: .82rem; color: var(--muted); }
@media (max-width: 760px) { .assurance-grid { grid-template-columns: 1fr; } }

/* ── Resource / region cards ─────────────────────────────── */
.region-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 1.5rem; }
.region-card { background: var(--paper); padding: 1.75rem; display: flex; flex-direction: column; }
.region-card h3 { font-size: 1.3rem; margin-bottom: .6rem; }
.region-card p { color: var(--muted); font-size: .9rem; flex: 1; }
.region-card .btn { margin-top: 1.25rem; align-self: flex-start; }
@media (max-width: 820px) { .region-grid { grid-template-columns: 1fr; } }

.resource-list { margin-top: 1.5rem; border-top: 1px solid var(--line); }
.resource-row { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.resource-row h4 { font-size: 1rem; }
.resource-row .cat { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.resource-row p { font-size: .88rem; color: var(--muted); margin-top: .3rem; }
.resource-row .meta { margin-top: .4rem; font-size: .78rem; color: var(--faint); display: flex; flex-wrap: wrap; gap: .3rem 1rem; }

/* ── Outreach feature grid ───────────────────────────────── */
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem 2.5rem; margin-top: 2rem; }
.feature-item { padding-top: 1.1rem; border-top: 1px solid var(--line); }
.feature-item h3 { font-size: 1.05rem; margin-bottom: .5rem; }
.feature-item p { color: var(--muted); font-size: .9rem; }
.feature-item .status { display: inline-block; margin-bottom: .6rem; font-family: var(--font-mono); font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; padding: .2rem .5rem; border: 1px solid var(--line-strong); }
.feature-item .status.planned { color: var(--muted); }
@media (max-width: 700px) { .feature-grid { grid-template-columns: 1fr; } }

/* ── Admin ────────────────────────────────────────────────── */
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem clamp(1.1rem,4vw,2rem); border-bottom: 1px solid var(--line); background: var(--soft); font-size: .85rem; }
.admin-bar a { text-decoration: underline; }
.admin-shell { max-width: 64rem; margin: 0 auto; padding: 2rem clamp(1.1rem,4vw,2rem) 4rem; }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.type-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.type-tabs a, .type-tabs button { padding: .5rem 1rem; border: 1px solid var(--line-strong); background: var(--paper); font-size: .82rem; text-decoration: none; cursor: pointer; font-family: inherit; }
.type-tabs a[aria-current="page"], .type-tabs button.active { background: var(--ink); color: var(--paper); }
table.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.admin-table th, table.admin-table td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.admin-table th { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.status-pill { display: inline-block; padding: .2rem .55rem; font-size: .7rem; font-family: var(--font-mono); border: 1px solid var(--line-strong); text-transform: uppercase; }
.status-pill.published { background: #eef6f0; border-color: #2f6b46; color: #2f6b46; }
.status-pill.draft { color: var(--muted); }
.status-pill.unpublished { color: var(--danger); border-color: var(--danger); }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: .4rem; border: 1px solid var(--line-strong); border-bottom: 0; padding: .5rem; background: var(--soft); }
.editor-toolbar button { min-width: 2.4rem; min-height: 2.4rem; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-family: inherit; font-size: .85rem; }
.editor-toolbar button:hover { background: var(--soft); }
#editor-content { min-height: 20rem; border: 1px solid var(--line-strong); padding: 1rem; font-size: 1rem; line-height: 1.6; outline: none; }
.upload-drop { border: 1px dashed var(--line-strong); padding: 1.5rem; text-align: center; margin-bottom: 1rem; }
.attachment-admin-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.attachment-admin-row select { font-size: .8rem; padding: .3rem; }
.preview-banner { background: var(--ink); color: var(--paper); padding: .75rem clamp(1.1rem,4vw,2rem); font-size: .82rem; text-align: center; }
.related-picker { border: 1px solid var(--line); max-height: 14rem; overflow-y: auto; padding: .5rem; }
.related-picker label { display: flex; gap: .5rem; align-items: center; padding: .35rem 0; font-weight: 400; font-size: .85rem; }

/* ── Utility ──────────────────────────────────────────────── */
.pagination { display: flex; gap: .6rem; margin-top: 2.5rem; }
.pagination a, .pagination span { min-width: 2.6rem; min-height: 2.6rem; display: grid; place-content: center; border: 1px solid var(--line); text-decoration: none; font-size: .85rem; }
.pagination a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

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