/* Styles for the generated /formations pages (see tools/).
   ═══════════════════════════════════════════════════════════════════════
   THESIS: the matchday programme's inside pages. The landing page is the
   cover, printed on canary card; this is the paper inside it, where you
   actually read. Same ink, same rules, same condensed caps — different
   stock, because comprehension leads on a Read surface.
   OWN-WORLD: paper ground, bottle-green ink, canary reserved for markers
   and the active link, the pitch drawn in the app's own grass. Square
   corners, hard rules, no shadows, no gradients.
   MODE: Read. Prose sits at ~68ch, headings carry rules rather than
   colour, and wayfinding (breadcrumbs, hub, footer) is always visible.
   ═══════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --bg: #efe9d8;          /* the paper the programme is printed on */
  --surface: #f7f3e6;     /* a laid-on panel, one shade up */
  --surface-2: #e7e0cb;
  --border: rgba(11, 59, 30, 0.26);
  --rule: #0b3b1e;
  --text: #0b3b1e;        /* bottle-green ink */
  --muted: rgba(11, 59, 30, 0.78);
  --canary: #ffd100;
  --blue: #0057b8;
  --grass: #2e7d32;       /* frontend/field.js grassColor */
  --display: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--display);
  font-variation-settings: "wdth" 92;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* the paper's own tooth */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle at 50% 50%, rgba(11, 59, 30, 0.05) 0.6px, transparent 0.7px);
  background-size: 4px 4px;
  mix-blend-mode: multiply;
}

a { color: var(--text); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--rule);
  color: var(--canary);
  padding: 10px 18px;
  z-index: 200;
}
.skip-link:focus { left: 0; }

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

/* ── Header / footer chrome ─────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  background: var(--canary);
  border-bottom: 2px solid var(--rule);
  z-index: 100;
}

.site-header .container {
  height: 56px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  padding-left: 0;
  padding-right: 0;
}

.site-header nav { display: flex; align-items: stretch; }

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 0 22px 0 32px;
  border-right: 2px solid var(--rule);
  text-decoration: none;
  color: var(--text);
  font-variation-settings: "wdth" 62, "wght" 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  font-size: 18px;
  white-space: nowrap;
}
.logo img { width: 19px; height: 19px; object-fit: contain; }

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-left: 2px solid var(--rule);
  font-variation-settings: "wdth" 70, "wght" 700;
  text-transform: uppercase;
  letter-spacing: 0.085em;
  font-size: 11px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.13s, color 0.13s;
}
.nav-link:hover { background: var(--rule); color: var(--canary); }

.cta {
  display: inline-flex;
  align-items: center;
  padding: 0 22px;
  margin-right: 32px;
  border-left: 2px solid var(--rule);
  font-variation-settings: "wdth" 66, "wght" 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
  color: var(--canary);
  background: var(--rule);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.13s, color 0.13s;
}
.cta:hover { background: #fffbe8; color: var(--rule); }

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px;
}

main.container { padding-top: 36px; padding-bottom: 80px; }

.site-footer {
  padding-top: 24px;
  padding-bottom: 52px;
  border-top: 2px solid var(--rule);
  font-variation-settings: "wdth" 74, "wght" 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.site-footer a {
  display: inline-block;
  padding: 6px 2px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer a:hover { color: var(--text); }
.site-footer nav { margin-bottom: 8px; }

/* ── Content ────────────────────────────────────────────────────── */
.breadcrumbs {
  font-variation-settings: "wdth" 74, "wght" 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.breadcrumbs a {
  display: inline-block;
  padding: 6px 2px;
  color: var(--muted);
  text-decoration: none;
}
.breadcrumbs a:hover { color: var(--text); text-decoration: underline; }

h1 {
  font-family: var(--display);
  font-variation-settings: "wdth" 62, "wght" 900;
  text-transform: uppercase;
  font-size: clamp(34px, 6.2vw, 62px);
  letter-spacing: -0.025em;
  line-height: 0.9;
  margin-bottom: 14px;
}

.lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 34px;
  max-width: 62ch;
  padding-bottom: 18px;
  border-bottom: 5px solid var(--rule);
}

section { margin: 40px 0; }

h2 {
  font-family: var(--display);
  font-variation-settings: "wdth" 62, "wght" 900;
  text-transform: uppercase;
  font-size: clamp(20px, 2.6vw, 28px);
  letter-spacing: -0.015em;
  line-height: 1;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 9px;
  border-bottom: 2px solid var(--rule);
}

h3 {
  font-family: var(--display);
  font-variation-settings: "wdth" 70, "wght" 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 14px;
  margin-bottom: 4px;
}

section p { margin-bottom: 15px; max-width: 68ch; }

/* Diagram + intro split */
.formationLayout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 34px;
  align-items: start;
  margin: 8px 0 12px;
}

.diagram {
  background: var(--rule);
  border: 2px solid var(--rule);
  padding: 12px 12px 8px;
}

.diagram svg { width: 100%; height: auto; display: block; }

.diagram figcaption {
  font-variation-settings: "wdth" 74, "wght" 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--canary);
  text-align: center;
  padding-top: 9px;
}

.btn {
  display: inline-block;
  background: var(--rule);
  color: var(--canary);
  border: 2px solid var(--rule);
  font-variation-settings: "wdth" 66, "wght" 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  padding: 14px 28px;
  transition: background 0.13s, color 0.13s;
}
.btn:hover { background: var(--canary); color: var(--rule); }

.btnNote {
  font-variation-settings: "wdth" 78, "wght" 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-top: 11px;
}

/* A ruled list, not a stack of accent-bordered cards. */
.pointList {
  list-style: none;
  display: grid;
  gap: 0;
  max-width: 68ch;
  border-top: 2px solid var(--rule);
}

.pointList li {
  border-bottom: 1px solid var(--border);
  padding: 13px 2px;
}

.pointList a { text-decoration: underline; text-underline-offset: 2px; }

.roleGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0;
  border-top: 2px solid var(--rule);
  border-left: 1px solid var(--border);
}

.roleCard {
  display: flex;
  gap: 13px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 15px;
}

.roleCard p { font-size: 14px; color: var(--muted); margin: 0; }

.roleNum {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--rule);
  color: var(--canary);
  font-variation-settings: "wdth" 74, "wght" 900;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: center;
}

details.faq {
  background: transparent;
  border-bottom: 2px solid var(--rule);
  padding: 0;
  margin-bottom: 0;
  max-width: 68ch;
}

/* Padding rather than a min-height on a flex box: `display:flex` on a
   <summary> drops the disclosure triangle in Chrome. */
details.faq summary {
  padding: 14px 0;
  cursor: pointer;
  font-variation-settings: "wdth" 70, "wght" 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 14px;
}

details.faq p { margin: 0 0 15px; color: var(--muted); max-width: 66ch; }

.ctaBlock {
  background: var(--canary);
  border: 3px solid var(--rule);
  padding: 30px;
}
.ctaBlock h2 { border-bottom-color: var(--rule); }

/* Hub */
.hubGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0;
  margin-top: 30px;
  border-top: 2px solid var(--rule);
  border-left: 2px solid var(--rule);
}

.hubCard {
  display: block;
  background: var(--surface);
  border-right: 2px solid var(--rule);
  border-bottom: 2px solid var(--rule);
  padding: 18px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
}

.hubCard:hover { background: var(--canary); }

.hubCard h2 {
  margin: 12px 0 4px;
  font-size: 19px;
  color: var(--text);
  border-bottom: 0;
  padding-bottom: 0;
}
.hubCard p { font-size: 13px; color: var(--muted); }
.hubDiagram svg { width: 100%; height: auto; }

@media (max-width: 720px) {
  .formationLayout { grid-template-columns: 1fr; }
  .diagram { max-width: 340px; }
  .container { padding-left: 20px; padding-right: 20px; }
  .logo { padding-left: 20px; }
  .cta { margin-right: 20px; }
}

/* ── Phone ──────────────────────────────────────────────────────────
   The header is one non-wrapping row: logo + two nav links + the CTA.
   Below ~600px that is wider than the screen, and it pushed the row a
   couple of pixels past the viewport — enough to give every one of these
   pages a horizontal scroll. The two text links come out rather than
   wrapping the header onto a second row, because the header is sticky and
   a phone can't spare 60 more pixels of it. Nothing is lost: the same two
   links sit in the footer of every page, and every page carries
   breadcrumbs. */
@media (max-width: 600px) {
  .site-header .nav-link { display: none; }

  .site-header .container { gap: 10px; }

  .cta {
    min-height: 44px;
    padding: 0 18px;
  }

  /* Enough room between footer links that a thumb can't hit two at once. */
  .site-footer nav { line-height: 2.4; }
  .site-footer a { padding: 8px 4px; }

  main.container { padding-top: 26px; }

  .ctaBlock { padding: 22px 20px; }

  .diagram { padding: 10px 10px 6px; }
}

/* ── Cookie banner (injected by cookie-consent.js) ──────────────────────
   Not in the generated markup, so it needs styling here or it keeps its
   dark-navy chrome. The accept/decline rules are ID-scoped on purpose:
   `#tb-cookie-banner *` is (1,0,1) and outranks a bare class however late
   it appears, which otherwise paints ink on ink at 1.0:1. */
#tb-cookie-banner {
  background: var(--canary) !important;
  border-top: 3px solid var(--rule) !important;
  backdrop-filter: none !important;
}
#tb-cookie-banner * { color: var(--rule) !important; font-family: var(--display); }
#tb-cookie-banner a { text-decoration: underline; }
.tb-btn {
  border-radius: 0 !important;
  border: 2px solid var(--rule) !important;
  background-image: none !important;
  font-variation-settings: "wdth" 70, "wght" 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
#tb-cookie-banner .tb-btn-accept,
#tb-cookie-banner .tb-btn-accept * { background: var(--rule) !important; color: var(--canary) !important; }
#tb-cookie-banner .tb-btn-decline,
#tb-cookie-banner .tb-btn-decline * { background: transparent !important; color: var(--rule) !important; }
