/* BestPair hub, on the Data Ink design system. No green anywhere, including charts.
   Sora for anything short or numeric, Source Serif 4 for the argument.
   Desktop first; the single breakpoint at 900px stacks the layout for mobile. */

:root {
  /* Data Ink tokens, exact values from the system. Do not approximate these. */
  --petrol: #0F2A3D;          /* dark hero and stat sections on light pages */
  --petrol-raised: #143850;   /* a tile a step lighter than the panel it sits on */
  --surface: #EAF2F7;         /* fog: the page ground */
  --surface-raised: #FFFFFF;  /* cards, panels, stat tiles */
  --ink: #10222E;             /* headlines and primary text */
  --ink-secondary: #33475A;   /* body copy and long-form text */
  --ink-muted: #43596A;       /* labels and captions, 12px and up only */
  --cyan: #38BDF8;            /* ACTS: buttons, key actions. Not a text colour on light */
  --cyan-bright: #7DD3FC;     /* large stat numbers on petrol only */
  --on-cyan: #06263B;         /* text on cyan fills. Never white: white fails contrast */
  --link: #0E6BA8;            /* links on light surfaces, where cyan would fail */
  --link-strong: #0A5280;
  --border: #C8D8E3;

  --sans: 'Sora', 'Segoe UI', system-ui, sans-serif;
  --serif: 'Source Serif 4', Georgia, serif;

  --radius-sm: 8px;           /* chips, inputs */
  --radius-md: 10px;          /* buttons */
  --radius-lg: 14px;          /* cards and stat tiles */
  --radius-xl: 18px;          /* hero panels and dark sections */

  /* Older names, kept so the rules below and hub-additions.css resolve without
     a sweep of every selector. New work should use the Data Ink names above. */
  --navy: var(--petrol);
  --navy-2: var(--petrol-raised);
  --blue: var(--link);
  --blue-dark: var(--link-strong);
  --blue-soft: var(--surface);
  --muted: var(--ink-muted);
  --line: var(--border);
  --bg: var(--surface);
  --white: var(--surface-raised);
  --wrap: 1180px;
}

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

body {
  font-family: var(--serif);       /* Source Serif 4 carries the argument */
  font-size: 16px;                 /* body 16/26 */
  line-height: 26px;
  color: var(--ink-secondary);     /* body copy, not headline ink */
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
a:focus-visible, .hub-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.hub-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 40px; }

/* Header and footer */
.hub-nav { background: var(--navy); color: var(--white); }
.hub-nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
/* The wordmark is Sora Bold, white on petrol. Never recoloured in cyan. */
.hub-logo { font-family: var(--sans); font-size: 24px; font-weight: 700; color: var(--surface-raised); text-decoration: none; }
.hub-logo span { color: var(--cyan-bright); }
.hub-logo:hover { color: var(--white); }

.hub-footer { border-top: 1px solid var(--border); margin-top: 96px; padding: 28px 0;
              color: var(--ink-muted); font-family: var(--sans); font-size: 14px; line-height: 20px; }
.hub-footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.hub-footer nav { display: flex; gap: 24px; flex-wrap: wrap; }
.hub-footer a { color: var(--muted); text-decoration: none; }
.hub-footer a:hover { color: var(--link); }

/* Buttons */
.hub-btn {
  display: inline-block; background: var(--cyan); color: var(--on-cyan); text-decoration: none;
  font-family: var(--sans); font-size: 16px; line-height: 20px; font-weight: 700;
  padding: 15px 30px; border-radius: var(--radius-md); transition: background 0.2s;
}
.hub-btn:hover { background: var(--cyan-bright); color: var(--on-cyan); }
.hub-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.hub-btn-small { padding: 10px 20px; font-size: 15px; }

/* Shared type */
.hub-eyebrow { font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: 0.12em;
              text-transform: uppercase; color: var(--link); margin-bottom: 12px; }
/* Sora for anything short or numeric. display-xl 52/56, heading 24/32. */
h1, h2 { font-family: var(--sans); font-weight: 700; color: var(--ink); line-height: 1.12; }
h1 { font-size: 52px; line-height: 56px; margin-bottom: 28px; }
h2 { font-size: 24px; line-height: 32px; }
.hub-num { font-family: var(--sans); font-variant-numeric: tabular-nums;
           color: var(--link); font-weight: 700; }

/* Index */
.hub-hero { padding: 80px 0 48px; max-width: 760px; }
.hub-lede { font-size: 18px; line-height: 30px; color: var(--ink-secondary); }
.hub-grid { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.hub-card {
  display: block; height: 100%; background: var(--surface-raised); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px; text-decoration: none; color: var(--ink); transition: border-color 0.2s;
}
.hub-card:hover { border-color: var(--cyan); color: var(--ink); }
.hub-card h2 { font-size: 24px; line-height: 32px; margin: 8px 0 6px; }
.hub-card p { color: var(--ink-secondary); font-size: 16px; }

/* Topic page */
.hub-topic { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 64px; padding-top: 64px; }
.hub-toc { position: sticky; top: 32px; align-self: start; }
.hub-toc ol { list-style: none; }
/* Sidebar navigation: nav 14/20 in Sora. */
.hub-toc li a { display: flex; gap: 12px; padding: 7px 0; color: var(--ink-secondary); text-decoration: none;
                font-family: var(--sans); font-size: 14px; font-weight: 500; line-height: 20px; }
.hub-toc li a:hover { color: var(--link); }
.hub-toc li[aria-current="page"] a { color: var(--ink); font-weight: 700; }
.hub-article { max-width: 780px; }
.hub-body { margin-top: 36px; }
.hub-body p, .hub-body ul, .hub-body ol { margin-bottom: 20px; }
.hub-body ul, .hub-body ol { padding-left: 22px; }
.hub-body li { margin-bottom: 8px; }

/* Video slot: a fixed 16:9 box. A player replaces .hub-video-fallback later. */
.hub-video { margin: 0; }
.hub-video-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--navy);
  border-radius: 12px; overflow: hidden;
}
@supports not (aspect-ratio: 16 / 9) {
  .hub-video-frame { height: 0; padding-top: 56.25%; }
}
.hub-video-frame > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.hub-video-poster { object-fit: cover; display: block; }
.hub-video-fallback { display: flex; align-items: flex-end; justify-content: flex-end; padding: 18px 22px; }
.hub-video-fallback span {
  background: rgba(255, 255, 255, 0.14); color: var(--white); font-size: 14px; font-weight: 500;
  padding: 6px 12px; border-radius: 999px;
}

/* Video player (hub-video.js). Plyr fills the same 16:9 frame as the poster.
   Brand: navy and blue, Inter for the controls. */
.hub-video-play {
  position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border: none; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding-left: 4px;
  background: var(--cyan); color: var(--on-cyan); box-shadow: 0 8px 24px rgba(15, 42, 61, 0.35);
  transition: background 0.2s;
}
.hub-video-play:hover { background: var(--cyan-bright); }
.hub-video-play:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
.hub-video-play:disabled { cursor: progress; }
.hub-video-frame .plyr {
  --plyr-color-main: var(--cyan);
  --plyr-video-background: var(--petrol);
  --plyr-font-family: var(--sans);
  --plyr-video-control-background-hover: var(--blue);
  --plyr-captions-background: rgba(11, 27, 51, 0.85);
  --plyr-menu-color: var(--ink);
  --plyr-tooltip-color: var(--ink);
  --plyr-focus-visible-color: var(--cyan-bright);
  height: 100%;
}
.hub-video-frame .plyr__poster { background-size: cover; }

.hub-cta {
  margin-top: 48px; background: var(--petrol); border-radius: var(--radius-xl); padding: 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.hub-cta p { max-width: 520px; color: var(--surface); }
.hub-cta h2 { color: var(--surface-raised); }
.hub-next { display: inline-block; margin-top: 32px; font-family: var(--sans); font-size: 16px;
             font-weight: 700; text-decoration: none; }
.hub-next::after { content: " \2192"; }

@media (max-width: 900px) {
  body { font-size: 16px; line-height: 26px; }
  .hub-wrap { padding: 0 20px; }
  h1 { font-size: 34px; line-height: 40px; margin-bottom: 20px; }
  .hub-hero { padding: 48px 0 32px; }
    .hub-lede { font-size: 17px; line-height: 28px; }
  .hub-grid { grid-template-columns: 1fr; gap: 14px; }
  .hub-topic { grid-template-columns: 1fr; gap: 40px; padding-top: 36px; }
  .hub-toc { position: static; order: 2; border-top: 1px solid var(--line); padding-top: 24px; }
  .hub-cta { flex-direction: column; align-items: flex-start; padding: 22px; }
  .hub-footer { margin-top: 56px; }
}

/* Tracking notice under the header */
.hub-notice { background: var(--surface-raised); border-bottom: 1px solid var(--border);
              color: var(--ink-muted); font-size: 13px; padding: 8px 0; }
.hub-notice .hub-wrap { display: block; }

/* Cookie banner injected by /consent.js (hub pages do not load styles.css). */
#cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999;
  background: var(--navy); border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 40px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--surface);
  transform: translateY(100%); transition: transform 0.3s ease;
}
#cookie-banner.visible { transform: translateY(0); }
#cookie-banner p { flex: 1; min-width: 200px; line-height: 1.5; }
#cookie-banner a { color: var(--cyan-bright); text-decoration: underline; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
#cookie-accept, #cookie-decline {
  font: 700 14px/20px var(--sans); padding: 8px 20px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
#cookie-accept { background: var(--cyan); color: var(--on-cyan); border: none; font-weight: 700; }
#cookie-accept:hover { background: var(--cyan-bright); }
#cookie-decline { background: transparent; color: var(--surface); border: 1px solid rgba(255, 255, 255, 0.28); }
#cookie-decline:hover { color: var(--white); border-color: rgba(255, 255, 255, 0.4); }
@media (max-width: 900px) { #cookie-banner { padding: 14px 20px; } }
/* Append to /hub/assets/hub.css.
   Four additions, needed because the hub grew from 10 flat topics to 38 grouped ones. */

/* Grouped index */
.hub-section { padding: 40px 0 8px; }
.hub-section-title { font-size: 26px; margin-bottom: 6px; }
.hub-section-blurb { color: var(--muted); font-size: 16px; max-width: 640px; margin-bottom: 20px; }
.hub-card-for { display: block; margin-top: 12px; font-family: var(--sans); font-size: 13px;
                font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--link); }

/* Grouped sidebar */
.hub-toc-section { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
                   text-transform: uppercase; color: var(--ink); margin: 20px 0 4px; }
.hub-toc-section:first-child { margin-top: 0; }
.hub-toc ol + .hub-toc-section { margin-top: 20px; }

/* Video slot with no video in it yet. A slim note, not an empty 16:9 box:
   hub-video.js replaces the whole figure once the topic has a video. */
.hub-video-pending { background: rgba(15, 42, 61, 0.04); border: 1px dashed var(--border);
                     border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 28px; }
.hub-video-pending p { color: var(--muted); font-size: 15px; margin: 0; }

/* Index filter bar */
.hub-filter { margin: 8px 0 8px; padding: 22px 24px; border: 1px solid var(--border);
              border-radius: var(--radius-lg); background: var(--surface-raised); }
.hub-filter-label { font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: 0.1em;
                    text-transform: uppercase; color: var(--link); margin-bottom: 12px; }
.hub-filter-roles { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-filter-roles button { font-family: var(--sans); font-size: 13px; font-weight: 500;
                           line-height: 16px; cursor: pointer; padding: 8px 14px;
                           border: 1px solid var(--border); border-radius: 999px;
                           background: var(--surface-raised); color: var(--ink-secondary); }
.hub-filter-roles button:hover { border-color: var(--cyan); color: var(--link); }
.hub-filter-roles button[aria-pressed="true"] { background: var(--petrol); border-color: var(--petrol);
                                                color: var(--surface-raised); }
.hub-filter-search { display: block; margin-top: 16px; }
.hub-filter-search span { display: block; font-size: 13px; font-weight: 600; letter-spacing: 0.1em;
                          text-transform: uppercase; color: var(--blue); margin-bottom: 8px; }
.hub-filter-search input { font-family: var(--sans); font-size: 15px; width: 100%; max-width: 420px;
                           padding: 10px 12px; border: 1px solid var(--border);
                           border-radius: var(--radius-sm); color: var(--ink); }
.hub-filter-search input:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.hub-filter-count { margin-top: 14px; font-size: 14px; color: var(--muted); }
.hub-empty { padding: 32px 0; color: var(--muted); }
.hub-empty button { font: inherit; color: var(--blue); background: none; border: 0;
                    padding: 0; cursor: pointer; text-decoration: underline; }

/* Sidebar: one section open at a time */
.hub-toc-all { margin-bottom: 14px; }
.hub-toc-all a { font-size: 13px; font-weight: 600; letter-spacing: 0.1em;
                 text-transform: uppercase; color: var(--blue); text-decoration: none; }
.hub-toc-group summary { cursor: pointer; list-style: none; padding: 7px 0;
                         font-family: var(--sans); font-size: 13px; font-weight: 700;
                         letter-spacing: 0.06em;
                         text-transform: uppercase; color: var(--ink); }
.hub-toc-group summary::-webkit-details-marker { display: none; }
.hub-toc-group summary::before { content: "+"; display: inline-block; width: 14px; color: var(--muted); }
.hub-toc-group[open] summary::before { content: "\2013"; }
.hub-toc-group ol { padding-left: 14px; padding-bottom: 6px; }

/* Who a topic page is for */
.hub-for { font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
           text-transform: uppercase; color: var(--ink-muted); margin: -8px 0 22px; }

/* "See also" on the original ten pages: navigation, so it sits with the Next link
   rather than inside the body copy. */
.hub-seealso { margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--line);
               color: var(--muted); font-size: 16px; }

/* Section headings inside a topic body. Only topic 00 uses these: it is the one
   reference-length page on the hub. */
.hub-body h2 { font-size: 22px; margin: 34px 0 10px; }
.hub-body h2:first-child { margin-top: 0; }
