/* ==========================================================================
   Sam Williams: site stylesheet
   One file for the whole site. Colours, fonts and widths are set once, below.
   Style: risk consultancy research publication. No images, gradients,
   heavy shadows, rounded cards, animations or dark mode.
   ========================================================================== */

/* ---------- Self-hosted fonts (files in /fonts, SIL Open Font License) ---------- */

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f2efe7;          /* warm off-white page */
  --text: #1e2430;        /* body text */
  --navy: #14213d;        /* primary: header/footer bands, headings, links */
  --gold: #a8823a;        /* accent: kickers, thin rules, active nav. Never large areas */
  --panel: #eceae3;       /* featured items, scorecard stats */
  --line: #d9d5ca;        /* panel borders and section rules */
  --link-line: #a8a49a;   /* faint underline on links in running text */
  --muted: #565d6b;       /* dates and secondary text */
  --measure: 720px;       /* reading column */
  --container: 960px;     /* header, footer, scorecard tables */
  --serif: "Source Serif 4", Charter, Georgia, "Times New Roman", serif;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.measure { max-width: var(--measure); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Header band ---------- */

.masthead {
  background: var(--navy);
  border-bottom: 2px solid var(--gold);
  color: #fff;
}

.masthead-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-top: 1.5rem;
  padding-bottom: 1.4rem;
}

.site-name {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  text-decoration: none;
}

.site-subtitle {
  margin: 0.2rem 0 0;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.78);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
}

.site-nav a {
  display: inline-block;
  padding: 0.2rem 0;
  color: #fff;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover { border-bottom-color: rgba(255, 255, 255, 0.6); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--gold); }

/* ---------- Main text ---------- */

main.container {
  padding-top: 3rem;
  padding-bottom: 4rem;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy);
}

h1 { font-size: 40px; margin: 0 0 1.25rem; }
h2 { font-size: 26px; margin: 0 0 1rem; }
h3 { font-size: 1.2rem; margin: 0 0 0.4rem; }

p { margin: 0 0 1.15rem; }

.lede { font-size: 1.3rem; line-height: 1.55; }

/* Kicker label above headings, e.g. PUBLISHED ANALYSIS */
.kicker {
  margin: 0 0 0.5rem;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Sections are separated by thin rules and generous space */
.section {
  margin-top: 3.25rem;
  padding-top: 2.75rem;
  border-top: 1px solid var(--line);
}

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.15em; }

/* Links inside running text get a faint 1px underline that turns navy on hover */
main p a,
main li a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--link-line);
  text-underline-offset: 0.18em;
}

main p a:hover,
main li a:hover { text-decoration-color: var(--navy); }

a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.muted { color: var(--muted); }

.meta {
  margin: 0 0 0.75rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

ul.plain { padding-left: 1.2rem; }
ul.plain li { margin-bottom: 0.5rem; }

/* ---------- Panels (featured items, notices) ---------- */

.panel {
  margin: 0 0 1.5rem;
  padding: 1.5rem 1.6rem;
  background: var(--panel);
  border: 1px solid var(--line);
}

.panel-featured { border-left: 3px solid var(--gold); }

.panel h3 a { font-weight: inherit; }

.pickup {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.pickup-label {
  margin: 0 0 0.5rem;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pickup ul { margin: 0; padding-left: 1.1rem; }
.pickup li { margin-bottom: 0.3rem; font-size: 1rem; }
.pickup li:last-child { margin-bottom: 0; }

.notice {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 1rem;
}

.notice.sample { border-left: 3px solid var(--gold); }

/* ---------- Tool / entry blocks ---------- */

.entry { margin: 0 0 2.25rem; }
.entry:last-child { margin-bottom: 0; }

/* ---------- Dated list (weekly briefs) ---------- */

.dated-list { margin: 0; padding: 0; list-style: none; }

.dated-list li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.dated-list li:first-child { border-top: 1px solid var(--line); }

.dated-list .date {
  display: block;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Scorecard ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 0 0 1.25rem;
}

.stat {
  padding: 1.25rem 1.4rem;
  background: var(--panel);
  border: 1px solid var(--line);
}

.stat-value {
  display: block;
  font-family: var(--sans);
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-note {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.forecast-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.forecast-table th {
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--navy);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.forecast-table td {
  padding: 0.85rem 0.75rem 0.85rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.forecast-table th:last-child,
.forecast-table td:last-child { padding-right: 0; }

.forecast-table td.num,
.forecast-table td.date-cell {
  font-family: var(--sans);
  font-size: 0.9rem;
  white-space: nowrap;
}

.forecast-table .num { text-align: right; }

.forecast-table .question { width: 50%; }

.outcome { font-family: var(--sans); font-size: 0.9rem; font-weight: 600; white-space: nowrap; }

/* ---------- Buttons ---------- */

.button {
  display: inline-block;
  padding: 0.65rem 1.2rem;
  background: var(--navy);
  border: 1px solid var(--navy);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

main p a.button { text-decoration: none; }
.button:hover { background: #0c1528; text-decoration: none; }

/* ---------- Footer band ---------- */

.footband {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--sans);
  font-size: 0.8rem;
}

.footband .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
}

.footband p { margin: 0; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footband a { color: #fff; }

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .container { padding: 0 1.25rem; }
  .masthead-inner { padding-top: 1.25rem; padding-bottom: 1.1rem; }
  .site-nav ul { gap: 0.3rem 1.1rem; }
  main.container { padding-top: 2.25rem; padding-bottom: 3rem; }
  h1 { font-size: 32px; }
  h2 { font-size: 23px; }
  .lede { font-size: 1.2rem; }
  .section { margin-top: 2.5rem; padding-top: 2.25rem; }
  .panel { padding: 1.25rem 1.2rem; }
  .stat-value { font-size: 2rem; }

  /* Tables become stacked rows so nothing scrolls sideways */
  .forecast-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .forecast-table, .forecast-table tbody, .forecast-table tr, .forecast-table td { display: block; width: 100%; }
  .forecast-table tr { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
  .forecast-table tr:first-child { border-top: 1px solid var(--navy); }
  .forecast-table td { padding: 0.1rem 0; border: 0; }
  .forecast-table .question { width: 100%; margin: 0.15rem 0 0.35rem; }
  .forecast-table .num { text-align: left; }
  .forecast-table td[data-label]:not(.question)::before {
    content: attr(data-label) ": ";
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }
}

/* ---------- Print ---------- */

@media print {
  .site-nav, .footband { display: none; }
  .masthead { background: none; color: var(--text); border-bottom: 1px solid var(--line); }
  .site-name { color: var(--navy); }
  .site-subtitle { color: var(--muted); }
  body { background: #fff; }
}
