/* =========================================================
   Board Briefing (bb) – shared template styles, scoped to .bb
   One "paper" document on a warm desk, numbered sections beside
   a contents rail, exhibits with captions.
   Change the look here (tokens), not in single rules.
   ========================================================= */
.bb {
  --bb-ink: #101B2D;            /* text */
  --bb-muted: #3F4852;          /* secondary text, labels (>= 7:1 on paper) */
  --bb-rule: #D9D1C1;           /* hairlines */
  --bb-paper: #FBF8F2;          /* document surface (site cream) */
  --bb-desk: #EEE7D9;           /* page background */
  --bb-tint: #F3EDE1;           /* quiet fills */
  --bb-accent: #0B1F3A;         /* brand navy */
  --bb-on-accent: #FBF8F2;
  --bb-on-accent-muted: #C9D3E0;
  --bb-action: #0E6E75;         /* site action colour (petrol) */
  --bb-action-hover: #0B5860;
  --bb-gold: #C9972B;
  --bb-green: #17683F;  --bb-green-bg: #E3EFE6;
  --bb-amber: #7A4900;  --bb-amber-bg: #F8EBD2;
  --bb-red:   #A1241B;  --bb-red-bg:   #F7E4E0;
  --bb-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --bb-sans: 'Source Sans 3', 'Segoe UI', Helvetica, Arial, sans-serif;
  --bb-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --bb-nav-h: 70px;             /* height of the fixed site menu */

  background: var(--bb-desk);
  color: var(--bb-ink);
  font-family: var(--bb-sans);
  font-size: 17px;
  line-height: 1.58;
  padding-top: var(--bb-nav-h);
}
.bb *, .bb *::before, .bb *::after { box-sizing: border-box; }
.bb p, .bb h1, .bb h2, .bb h3, .bb ol, .bb ul, .bb dl, .bb dd { margin: 0; padding: 0; }
.bb h1, .bb h2, .bb h3 { color: inherit; letter-spacing: 0; }
.bb ol, .bb ul { list-style: none; }
.bb a { color: var(--bb-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.bb a:hover { color: var(--bb-action); }
.bb a:focus-visible, .bb button:focus-visible, .bb summary:focus-visible { outline: 2px solid var(--bb-action); outline-offset: 2px; }
.bb strong { font-weight: 600; }

/* ---------- Frame ---------- */
.bb-wrap { max-width: 1160px; margin: 0 auto; padding: 24px 16px 56px; }
.bb-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 16px; font-size: 15px; color: var(--bb-muted); }
.bb .bb-breadcrumb a { color: var(--bb-muted); text-decoration: none; }
.bb .bb-breadcrumb a:hover { color: var(--bb-action); text-decoration: underline; }
.bb-doc {
  background: var(--bb-paper);
  border-top: 6px solid var(--bb-accent);
  padding: clamp(20px, 5vw, 56px);
  display: flex; flex-direction: column; gap: 40px;
  box-shadow: 0 1px 0 var(--bb-rule);
}

/* ---------- Shared type ---------- */
.bb-label {
  font-family: var(--bb-mono); font-size: 12.5px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--bb-muted); line-height: 1.5;
}
.bb-h2 { font-family: var(--bb-serif); font-weight: 600; font-size: 28px; line-height: 1.2; text-wrap: balance; }
.bb-lead { font-size: 17.5px; max-width: 700px; }
.bb-sub { font-size: 15px; color: var(--bb-muted); }
.bb .bb-pull {
  font-family: var(--bb-serif); font-size: 21px; line-height: 1.38; max-width: 700px;
  border-left: 3px solid var(--bb-gold); padding-left: 18px; text-wrap: pretty;
}
.bb-anchor { position: absolute; width: 0; height: 0; scroll-margin-top: calc(var(--bb-nav-h) + 24px); }

/* ---------- Document strip, title, control row ---------- */
.bb-strip {
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
  border-bottom: 1px solid var(--bb-rule); padding-bottom: 14px;
}
.bb-titleblock { display: flex; flex-direction: column; gap: 18px; }
.bb-eyebrow { font-family: var(--bb-mono); font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.bb-title {
  font-family: var(--bb-serif); font-weight: 600; font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.14; letter-spacing: -0.005em; text-wrap: balance; max-width: 920px;
}
.bb-standfirst { font-size: 21px; line-height: 1.45; color: var(--bb-muted); max-width: 740px; }

.bb-control {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 20px 28px;
  border-top: 1px solid var(--bb-rule); border-bottom: 1px solid var(--bb-rule); padding: 20px 0;
}
.bb-control__item { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.bb-control__value { font-size: 16.5px; }

/* ---------- RAG chip: word + shape, never colour alone ---------- */
.bb-rag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--bb-mono); font-size: 13px; font-weight: 500; letter-spacing: 0.08em;
}
.bb-rag::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid currentColor; flex: none;
}
.bb-rag--green { color: var(--bb-green); }
.bb-rag--green::before { background: currentColor; }                                   /* solid  */
.bb-rag--amber { color: var(--bb-amber); }
.bb-rag--amber::before { background: linear-gradient(90deg, transparent 50%, currentColor 50%); } /* half */
.bb-rag--red { color: var(--bb-red); }                                                 /* ring   */
.bb-rag--chip { padding: 4px 10px; background: var(--bb-green-bg); margin: 2px 0; }

/* ---------- Actions ---------- */
.bb-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: -12px; position: relative; }
.bb-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 18px;
  background: var(--bb-paper); color: var(--bb-ink); border: 1px solid var(--bb-ink); border-radius: 0;
  font: inherit; font-weight: 600; font-size: 16px; line-height: 1.2; text-decoration: none; cursor: pointer;
}
.bb a.bb-btn { color: var(--bb-ink); text-decoration: none; }
.bb-btn:hover, .bb a.bb-btn:hover { background: var(--bb-tint); color: var(--bb-ink); }
.bb a.bb-btn--primary { background: var(--bb-action); border-color: var(--bb-action); color: var(--bb-on-accent); }
.bb a.bb-btn--primary:hover { background: var(--bb-action-hover); border-color: var(--bb-action-hover); color: var(--bb-on-accent); }
.bb-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; flex: none; }
.bb-btn em { font-style: normal; font-weight: 400; }

.bb-share > summary { list-style: none; }
.bb-share > summary::-webkit-details-marker { display: none; }
.bb-share[open] > summary { background: var(--bb-tint); }
.bb-share__panel {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 5; max-width: 100%;
  display: flex; flex-wrap: wrap; gap: 8px; padding: 12px;
  background: var(--bb-paper); border: 1px solid var(--bb-ink); box-shadow: 0 10px 28px rgba(11, 31, 58, 0.16);
}
.bb .bb-share__panel .sh {
  display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px; padding: 8px 14px;
  background: var(--bb-paper); color: var(--bb-ink); border: 1px solid var(--bb-rule); border-radius: 0;
  font: inherit; font-size: 15.5px; font-weight: 500; text-decoration: none; cursor: pointer; transform: none;
}
.bb .bb-share__panel .sh span { display: inline; font-size: inherit; white-space: nowrap; }
.bb .bb-share__panel .sh svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.bb .bb-share__panel .sh:hover, .bb .bb-share__panel .sh.ok { background: var(--bb-accent); border-color: var(--bb-accent); color: var(--bb-on-accent); }

/* ---------- Board summary ---------- */
.bb-summary {
  background: var(--bb-accent); color: var(--bb-on-accent);
  padding: clamp(20px, 4vw, 40px); display: flex; flex-direction: column; gap: 24px;
}
.bb-summary .bb-label { color: var(--bb-on-accent-muted); }
.bb-summary__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 32px 48px; }
.bb-summary__ask { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.bb-summary__question { font-family: var(--bb-serif); font-size: clamp(23px, 2.6vw, 29px); line-height: 1.28; text-wrap: pretty; }
.bb-summary__ask2 { font-family: var(--bb-serif); font-size: 19px; line-height: 1.42; text-wrap: pretty; }
.bb-summary__ask .bb-label + .bb-summary__ask2, .bb-summary__ask p + .bb-label { margin-top: 6px; }
.bb .bb-summary a, .bb .bb-summary a:hover { color: var(--bb-on-accent); padding: 10px 0; font-size: 16px; font-weight: 600; }
.bb .bb-summary a:hover { text-decoration-color: var(--bb-gold); text-decoration-thickness: 2px; }
.bb .bb-summary a:focus-visible { outline-color: #E3C16A; }
.bb-summary__row { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-top: 1px solid rgba(251, 248, 242, 0.26); }
.bb-summary__row dd { font-size: 16.5px; }

/* ---------- Contents rail + main column ---------- */
.bb-body { display: flex; flex-wrap: wrap; gap: 40px 56px; align-items: flex-start; margin-top: 16px; }
.bb-toc { flex: 1 1 200px; display: flex; flex-direction: column; gap: 14px; font-size: 15.5px; }
.bb-toc__head { border-bottom: 1px solid var(--bb-rule); padding-bottom: 10px; }
.bb-toc ol { display: flex; flex-direction: column; gap: 10px; }
.bb-toc ol + ol { border-top: 1px solid var(--bb-rule); padding-top: 12px; }
.bb-toc li { display: flex; gap: 10px; }
.bb-toc li span { font-family: var(--bb-mono); font-size: 13px; color: var(--bb-muted); min-width: 20px; padding-top: 2px; }
.bb .bb-toc a { text-decoration: none; }
.bb .bb-toc a:hover { text-decoration: underline; }
.bb-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 64px; }
@media (min-width: 960px) {
  .bb-toc { position: sticky; top: calc(var(--bb-nav-h) + 24px); }
}

/* ---------- Sections ---------- */
.bb-section { display: flex; flex-direction: column; gap: 20px; scroll-margin-top: calc(var(--bb-nav-h) + 24px); }
.bb-section__head {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline;
  border-top: 2px solid var(--bb-ink); padding-top: 14px;
}
.bb-section__no { font-family: var(--bb-mono); font-size: 13.5px; font-weight: 500; color: var(--bb-muted); }
.bb-section--annex .bb-h2 { font-size: 24px; }
.bb-section__meta { font-size: 15px; color: var(--bb-muted); }

.bb-numlist { counter-reset: bb-n; max-width: 700px; }
.bb-numlist li { display: flex; gap: 14px; padding: 10px 0; border-top: 1px solid var(--bb-rule); counter-increment: bb-n; }
.bb-numlist li:last-child { border-bottom: 1px solid var(--bb-rule); }
.bb-numlist li::before { content: counter(bb-n, decimal-leading-zero); font-family: var(--bb-mono); font-size: 13px; color: var(--bb-muted); padding-top: 3px; }

.bb-rules li { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--bb-rule); font-weight: 500; }
.bb-rules li:last-child { border-bottom: 1px solid var(--bb-rule); }
.bb-rules li::before { content: "≠"; font-family: var(--bb-mono); color: var(--bb-muted); font-weight: 400; }

.bb-scroll { overflow-x: auto; }

/* Exhibit 1: framework stack */
.bb-stack { min-width: 640px; display: flex; flex-direction: column; gap: 6px; }
.bb-stack__row, .bb-stack__cols {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1.7fr) minmax(0, 1.1fr);
  gap: 16px; align-items: center; padding-right: 16px;
}
.bb-stack__cols { padding-bottom: 4px; }
.bb-stack__row { background: var(--bb-tint); border: 1px solid var(--bb-rule); }
.bb-stack__no {
  align-self: stretch; display: flex; align-items: center; justify-content: center; padding: 20px 0;
  background: var(--bb-accent); color: var(--bb-on-accent); font-family: var(--bb-mono); font-size: 14.5px;
}
.bb-stack__layer { font-weight: 600; }
.bb-stack__question { font-family: var(--bb-serif); font-size: 18px; line-height: 1.38; padding: 10px 0; }
.bb-stack__ref { font-size: 15px; color: var(--bb-muted); }

.bb-key {
  display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--bb-ink); border-bottom: 1px solid var(--bb-ink); padding: 18px 0;
}
.bb-key p { font-family: var(--bb-serif); font-size: 21px; line-height: 1.38; max-width: 700px; }

/* Exhibit 2: calibration table */
.bb-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 15.5px; line-height: 1.45; border-bottom: 1px solid var(--bb-rule); }
.bb-table th, .bb-table td { text-align: left; vertical-align: top; padding: 14px; color: var(--bb-ink); }
.bb-table thead th { font-weight: 400; padding: 12px 14px; }
.bb-table thead th:first-child { vertical-align: bottom; width: 17%; padding-left: 0; color: var(--bb-muted); }
.bb-table thead span:last-child { display: block; font-size: 14.5px; color: var(--bb-ink); padding-top: 2px; }
.bb-table tbody th, .bb-table tbody td { border-top: 1px solid var(--bb-rule); }
.bb-table tbody th { font-weight: 600; padding-left: 0; }
.bb-table__green { background: var(--bb-green-bg); }
.bb-table__amber { background: var(--bb-amber-bg); }
.bb-table__red { background: var(--bb-red-bg); }
.bb-table td:last-child { font-family: var(--bb-serif); font-size: 16.5px; }

/* Lists in ruled columns */
.bb-cols { display: grid; gap: 0 32px; }
.bb-cols li { padding: 12px 0; border-top: 1px solid var(--bb-rule); }
.bb-cols--functions { grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 0 24px; font-size: 16px; }
.bb-cols--evidence { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); font-size: 16.5px; counter-reset: bb-e; }
.bb-cols--evidence li { display: flex; gap: 14px; counter-increment: bb-e; }
.bb-cols--evidence li::before {
  content: "E" counter(bb-e, decimal-leading-zero);
  font-family: var(--bb-mono); font-size: 13px; color: var(--bb-muted); padding-top: 3px;
}
.bb-cols--signals { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); font-family: var(--bb-serif); font-size: 19px; }

.bb-note { display: flex; flex-direction: column; gap: 6px; background: var(--bb-tint); padding: 16px 20px; }
.bb-note strong, .bb-note li { font-weight: 600; }
.bb-note ul { display: flex; flex-direction: column; gap: 6px; }

/* Exhibit 4: path to green */
.bb-path { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 28px 24px; counter-reset: bb-m; }
.bb-path li { display: flex; flex-direction: column; gap: 8px; border-top: 3px solid var(--bb-green); padding-top: 12px; counter-increment: bb-m; }
.bb-path li::before { content: "M" counter(bb-m); font-family: var(--bb-mono); font-size: 13px; font-weight: 500; color: var(--bb-green); }
.bb-path strong { font-weight: 600; font-size: 17.5px; line-height: 1.3; }
.bb-path span { font-size: 15.5px; color: var(--bb-muted); }

/* Next question */
.bb-question { border: 1px solid var(--bb-ink); padding: clamp(18px, 3vw, 28px); display: flex; flex-direction: column; gap: 12px; }
.bb-question p { font-family: var(--bb-serif); font-size: clamp(19px, 2.2vw, 22px); line-height: 1.42; text-wrap: pretty; }

/* Annex A: collapsible expert commentary */
.bb-annex { display: flex; flex-direction: column; }
.bb-annex details { border-top: 1px solid var(--bb-rule); }
.bb-annex li:last-child details { border-bottom: 1px solid var(--bb-rule); }
.bb-annex summary {
  display: flex; gap: 16px; justify-content: space-between; align-items: center;
  min-height: 44px; padding: 14px 0; cursor: pointer; list-style: none;
}
.bb-annex summary::-webkit-details-marker { display: none; }
.bb-annex__h { font-family: var(--bb-sans); font-size: 17.5px; font-weight: 600; line-height: 1.35; }
.bb-annex__h span { font-family: var(--bb-mono); font-size: 13px; font-weight: 500; color: var(--bb-muted); margin-right: 10px; }
.bb-annex summary:hover .bb-annex__h { text-decoration: underline; text-underline-offset: 0.18em; }
.bb-annex summary svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; transition: transform 0.15s; }
.bb-annex details[open] summary svg { transform: rotate(90deg); }
.bb-annex__body { display: flex; flex-direction: column; gap: 14px; padding: 4px 0 26px; max-width: 700px; }
.bb-annex__body ul { display: flex; flex-direction: column; gap: 6px; }
.bb-annex__body ul li { display: flex; gap: 12px; }
.bb-annex__body ul li::before { content: "–"; color: var(--bb-muted); }
.bb-annex__body .bb-pull { margin: 6px 0; }

/* Annex B: sources */
.bb-sources { counter-reset: bb-src; display: flex; flex-direction: column; font-size: 16px; }
.bb-sources li { display: flex; gap: 14px; padding: 10px 0; border-top: 1px solid var(--bb-rule); counter-increment: bb-src; overflow-wrap: anywhere; }
.bb-sources li:last-child { border-bottom: 1px solid var(--bb-rule); }
.bb-sources li::before { content: counter(bb-src, decimal-leading-zero); font-family: var(--bb-mono); font-size: 13px; color: var(--bb-muted); padding-top: 3px; }

/* Sign-off, related, document footer */
.bb-end {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 40px 56px;
  border-top: 1px solid var(--bb-rule); padding-top: 32px; margin-top: 16px;
}
.bb-author { display: flex; flex-direction: column; gap: 14px; }
.bb-author__id { display: flex; gap: 16px; align-items: center; }
.bb-author__photo {
  width: 64px; height: 64px; flex: none; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--bb-accent); color: var(--bb-on-accent); font-family: var(--bb-serif); font-size: 20px;
}
.bb-author__photo img { width: 64px; height: 64px; object-fit: cover; display: block; }
.bb-author__name { display: block; font-family: var(--bb-serif); font-weight: 600; font-size: 21px; }
.bb-author__role { font-size: 15.5px; color: var(--bb-muted); }
.bb-author p { font-size: 16px; max-width: 480px; }
.bb-author__links { display: flex; flex-wrap: wrap; gap: 4px 24px; font-size: 16px; }
.bb-author__links a { padding: 10px 0; }
.bb-related { display: flex; flex-direction: column; }
.bb-related .bb-label { padding-bottom: 14px; }
.bb .bb-related a { display: block; padding: 12px 0; border-top: 1px solid var(--bb-rule); text-decoration: none; font-weight: 500; }
.bb .bb-related li:last-child a { border-bottom: 1px solid var(--bb-rule); }
.bb .bb-related a:hover { text-decoration: underline; }
.bb .bb-related .bb-back a { border: 0; padding: 16px 0 0; font-weight: 600; }
.bb-docfoot {
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
  border-top: 1px solid var(--bb-rule); padding-top: 14px;
}

/* Site integration: no light strip between the desk and the site footer */
main:has(> .bb) + .site-footer { margin-top: 0; }

/* ---------- Print / PDF (also overrides the site's global print reset) ---------- */
@media print {
  .bb { background: #fff !important; font-size: 11pt; padding-top: 0; }
  .bb-wrap { max-width: none; padding: 0; }
  .bb-doc { padding: 0; border-top: 0; box-shadow: none; }
  .bb-breadcrumb, .bb-actions, .bb-toc, .bb-related, .bb-author__links, .bb-annex summary svg { display: none !important; }
  .bb-summary, .bb-stack__no, .bb-table thead th, .bb-note, .bb-stack__row, .bb-rag--chip, .bb-author__photo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bb .bb-summary { background: var(--bb-accent) !important; }
  .bb .bb-summary, .bb .bb-summary * { color: var(--bb-on-accent) !important; }
  .bb .bb-summary * { background: transparent !important; }
  .bb .bb-summary .bb-label { color: var(--bb-on-accent-muted) !important; }
  .bb .bb-stack__no, .bb .bb-author__photo { background: var(--bb-accent) !important; color: var(--bb-on-accent) !important; }
  .bb .bb-stack__row, .bb .bb-note { background: var(--bb-tint) !important; }
  .bb .bb-stack__row > span:not(.bb-stack__no), .bb .bb-note * { background: transparent !important; }
  .bb .bb-table__green, .bb .bb-rag--chip { background: var(--bb-green-bg) !important; }
  .bb .bb-table__amber { background: var(--bb-amber-bg) !important; }
  .bb .bb-table__red { background: var(--bb-red-bg) !important; }
  .bb .bb-table thead th * { background: transparent !important; }
  .bb .bb-rag--green, .bb .bb-path li::before { color: var(--bb-green) !important; }
  .bb .bb-rag--amber { color: var(--bb-amber) !important; }
  .bb .bb-rag--red { color: var(--bb-red) !important; }
  .bb .bb-rag--green::before { background: var(--bb-green) !important; }
  .bb-section__head, .bb-h2 { break-after: avoid; }
  .bb-summary, .bb-stack__row, .bb-table tr, .bb-path li, .bb-question, .bb-key, .bb-note, .bb-pull { break-inside: avoid; }
  .bb-scroll { overflow: visible; }
  .bb-stack, .bb-table { min-width: 0; }
  .bb-annex details::details-content { content-visibility: visible !important; display: block !important; height: auto !important; }
}
