/* ==========================================================================
   Ability Beyond Vision — shared site chrome
   Loaded AFTER assets/a11y.css on every page. Uses only the shared custom
   properties from that file — never a hard-coded colour — so all five
   colour schemes keep working.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Page shell
   -------------------------------------------------------------------------- */

/* Horizontal padding is deliberately in px, not rem. At 200% text plus 200%
   zoom the effective viewport is 160px wide, and rem padding would eat most
   of it — breaking reflow (1.4.10). Vertical padding may scale freely. */
.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem 16px 4rem;
}

.wrap--wide { max-width: 60rem; }

a { color: var(--accent); }
a:hover { text-decoration-thickness: 3px; }

/* Long unbroken strings — email addresses, domains — must never force the
   page wide at small effective viewports. */
a { overflow-wrap: anywhere; }

/* Logo panel — the artwork has a black background, so it sits in its own
   black panel to look deliberate in every colour scheme. Used by the
   coming-soon landing and the site home. */
.logo-panel {
  background: var(--logo-panel);
  border: 2px solid var(--rule);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 0 0 2.5rem;
  display: flex;
  justify-content: center;
}
.logo-panel img {
  display: block;
  width: 100%;
  max-width: 18rem;
  height: auto;
}

/* 1.4.10 Reflow — nothing may force a horizontal scrollbar at 320px. */
img, svg, video, table { max-width: 100%; }
img { height: auto; }

/* --------------------------------------------------------------------------
   2. Masthead and navigation
   The nav is plain markup repeated on every page rather than injected by
   script, so it survives with JavaScript switched off.
   -------------------------------------------------------------------------- */

.masthead {
  border-bottom: 2px solid var(--rule);
  background: var(--surface);
}

.masthead__inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.masthead__brand {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  max-width: 100%;
  color: var(--fg);
  text-decoration: none;
  font-weight: bold;
  /* 2.5.8 Target size */
  min-height: 44px;
}
.masthead__brand:hover { text-decoration: underline; }

.masthead__mark {
  background: var(--logo-panel);
  border: 2px solid var(--rule);
  border-radius: 0.25rem;
  padding: 0.2rem;
  flex: none;
}
.masthead__mark img {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
}

.masthead__name { line-height: 1.2; min-width: 0; }
.masthead__tag {
  display: block;
  font-weight: normal;
  color: var(--muted);
  font-size: 0.85rem;
}

.sitenav { max-width: 100%; }

.sitenav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}

.sitenav li { max-width: 100%; }

.sitenav a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  /* 2.5.8 Target size — 44px minimum on every navigation target. */
  min-height: 44px;
  max-width: 100%;
  padding: 0.4rem 12px;
  border: 2px solid transparent;
  border-radius: 0.25rem;
  color: var(--accent);
  text-decoration: underline;
}
.sitenav a:hover {
  background: var(--bg);
  border-color: var(--rule);
}

/* 2.4.8 Location — the current page is marked for sighted users with a
   border, and for screen readers with aria-current="page". */
.sitenav a[aria-current="page"] {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  font-weight: bold;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */

h1 { font-size: 2rem; line-height: 1.25; margin: 0 0 0.75rem; }
h2 { font-size: 1.45rem; line-height: 1.3; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.15rem; line-height: 1.35; margin: 2rem 0 0.5rem; }

.lede {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 0 2rem;
}

ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.5rem; }

blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 0 0.5rem 1.25rem;
  border-left: 4px solid var(--rule);
  color: var(--fg);
}
blockquote cite {
  display: block;
  margin-top: 0.75rem;
  color: var(--muted);
  font-style: normal;
}

/* --------------------------------------------------------------------------
   4. Breadcrumbs
   -------------------------------------------------------------------------- */

.breadcrumb { margin: 0 0 1.5rem; font-size: 0.95rem; }
.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   5. Panels, cards and lists
   -------------------------------------------------------------------------- */

.panel {
  border: 2px solid var(--rule);
  border-radius: 0.5rem;
  padding: 1.25rem 16px;
  margin: 1.5rem 0;
  background: var(--surface);
}
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }

.cards {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  /* min() keeps a card from insisting on 15rem when the viewport is narrower
     than that — at 200% text, 15rem is wider than the whole screen. */
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
}
.card {
  border: 2px solid var(--rule);
  border-radius: 0.5rem;
  padding: 1.25rem 16px;
  margin: 0;
  min-width: 0;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h2, .card h3 { margin-top: 0; font-size: 1.15rem; }

/* Stacked entries — news items, stories, policy rows. */
.entries { list-style: none; margin: 1.5rem 0; padding: 0; }
.entries > li {
  border-top: 2px solid var(--rule);
  padding: 1.25rem 0;
  margin: 0;
}
.entries > li:last-child { border-bottom: 2px solid var(--rule); }
.entries h2, .entries h3 { margin-top: 0; }

.meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

/* --------------------------------------------------------------------------
   6. Status labels
   Never colour alone (1.4.1) — every label carries its own word.
   -------------------------------------------------------------------------- */

.label {
  display: inline-block;
  border: 2px solid var(--rule);
  border-radius: 0.25rem;
  padding: 0.1rem 0.5rem;
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--fg);
}
.label--done { background: var(--surface); }
.label--wip { background: var(--bg); }

/* Draft flag — visible on every page carrying unapproved placeholder copy. */
.draft-flag {
  border: 3px dashed var(--rule);
  border-radius: 0.25rem;
  padding: 0.75rem 1rem;
  margin: 0 0 1.5rem;
  font-weight: bold;
  background: var(--surface);
}

/* --------------------------------------------------------------------------
   7. Tables
   -------------------------------------------------------------------------- */

/* Wide tables scroll inside their own box so the PAGE never scrolls
   sideways (1.4.10). tabindex and a label make that box reachable by
   keyboard, since a scrollable region must be scrollable without a mouse. */
.table-scroll {
  overflow-x: auto;
  margin: 1.5rem 0;
  max-width: 100%;
}
.table-scroll:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

table {
  border-collapse: collapse;
  width: 100%;
}
caption {
  text-align: left;
  font-weight: bold;
  padding-bottom: 0.5rem;
}
th, td {
  border: 2px solid var(--rule);
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
th { background: var(--surface); }

/* --------------------------------------------------------------------------
   8. Buttons and calls to action
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 100%;
  min-height: 44px;
  padding: 0.6rem 16px;
  border: 2px solid var(--accent);
  border-radius: 0.25rem;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { text-decoration: underline; }

.btn--secondary {
  background: var(--bg);
  color: var(--accent);
  border-color: var(--rule);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

/* --------------------------------------------------------------------------
   9. Forms
   -------------------------------------------------------------------------- */

.field { margin: 0 0 1.25rem; }
.field label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.25rem;
}
.field .hint {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 2px solid var(--rule);
  border-radius: 0.25rem;
}

/* --------------------------------------------------------------------------
   10. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 2px solid var(--rule);
  margin-top: 3rem;
  background: var(--surface);
}
.site-footer__inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.5rem 16px 2.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.site-footer h2 { font-size: 1rem; margin: 0 0 0.5rem; }
.site-footer ul {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}
.site-footer li { margin: 0; }
.site-footer a {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   11. In-page contents list
   -------------------------------------------------------------------------- */

.contents { margin: 1.5rem 0 2.5rem; }
.contents ol { margin: 0; }
.contents li { margin-bottom: 0.4rem; }

/* Back-to-contents links sit at the end of each long section. */
.backlink { font-size: 0.95rem; }
