/* Willamette Ledger — stylesheet
   Daily-newspaper look: off-white paper, navy, oxblood accent,
   classic serif headlines, mono figures. Plain CSS, no build step. */

:root {
  --paper: #f8f8f5;
  --paper-2: #eeefea;
  --card: #ffffff;
  --ink: #10151d;
  --ink-2: #252b35;
  --text: #2e333b;
  --muted: #646b76;
  --rule: #dcddd8;
  --rule-strong: #10151d;
  --accent: #7a1f2b;
  --accent-2: #5c1520;
  --accent-soft: #f2e2e4;
  --up: #157347;
  --down: #b42318;
  --tape: #0e1d33;
  --tape-text: #e6ebf3;
  --ph-bg: #fff3bf;
  --ph-ink: #7a5b00;
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --serif: "Lora", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 50; }
.ph { background: var(--ph-bg); color: var(--ph-ink); padding: 0 4px; border-radius: 3px; font-style: normal; font-weight: 500; }

/* ---------- top strip ---------- */
.topbar { border-bottom: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
.topbar .container { display: flex; justify-content: space-between; gap: 12px; padding-top: 7px; padding-bottom: 7px; flex-wrap: wrap; }
.topbar a { color: var(--muted); text-decoration: none; margin-left: 16px; }
.topbar a:hover { color: var(--ink); }

/* ---------- ticker tape ---------- */
.tape { background: var(--tape); color: var(--tape-text); font-family: var(--mono); font-size: 13px; overflow: hidden; position: relative; }
.tape-label { position: absolute; left: 0; top: 0; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 0 14px; background: var(--accent); color: #fff; font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.tape-label .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.tape-track { display: flex; width: max-content; animation: tape 70s linear infinite; padding-left: 110px; }
.tape:hover .tape-track { animation-play-state: paused; }
.tape-item { white-space: nowrap; padding: 9px 22px; border-right: 1px solid #22344f; }
.tape-item b { font-weight: 600; color: #fff; margin-right: 6px; }
.tape-item .up { color: #5fd38d; } .tape-item .down { color: #ff8a7a; }
.tape-item .note { color: #8d9ab0; }
@keyframes tape { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .tape-track { animation: none; overflow-x: auto; } }

/* ---------- masthead ---------- */
.masthead { text-align: center; padding: 26px 0 14px; border-bottom: 3px double var(--rule-strong); }
.masthead .brand { font-family: var(--display); font-weight: 800; font-size: clamp(40px, 7vw, 76px); line-height: 1; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.masthead .tagline { margin: 8px 0 0; font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 16px; }
.edition { display: flex; justify-content: space-between; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 1px solid var(--rule-strong); padding: 6px 0; }

/* ---------- nav ---------- */
.nav { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; }
.nav a { display: block; padding: 11px 14px; font-size: 13px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; text-decoration: none; color: var(--ink-2); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }
.nav-toggle { display: none; }
@media (max-width: 760px) {
  .nav ul { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .nav a { padding: 11px 10px; white-space: nowrap; }
  .edition span:last-child { display: none; }
}

/* ---------- generic ---------- */
main { padding: 28px 0 56px; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--rule-strong); padding-top: 8px; margin: 40px 0 18px; }
.section-head h2 { margin: 0; font-family: var(--display); font-size: 24px; color: var(--ink); }
.section-head a { font-size: 13px; font-weight: 600; }
.meta { font-size: 13px; color: var(--muted); }
.btn { display: inline-block; background: var(--ink); color: #fff; border: 0; border-radius: 4px; padding: 10px 16px; font: 600 14px var(--sans); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent); color: #fff; }
.note-box { background: var(--paper-2); border-left: 3px solid var(--accent); padding: 14px 16px; font-size: 14px; border-radius: 0 4px 4px 0; }

/* ---------- home ---------- */
.front { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 36px; }
.lead h1 { font-family: var(--display); font-size: clamp(30px, 4.2vw, 46px); line-height: 1.1; margin: 8px 0 12px; color: var(--ink); }
.lead h1 a { text-decoration: none; }
.lead .dek { font-family: var(--serif); font-size: 19px; color: var(--ink-2); margin: 0 0 12px; }
.lead-figure { margin: 20px 0 0; border: 1px solid var(--rule); background: var(--card); padding: 16px; border-radius: 4px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
.stat { background: var(--card); padding: 12px 14px; }
.stat .label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-family: var(--mono); font-size: 20px; font-weight: 600; color: var(--ink); }
.stat .chg { font-family: var(--mono); font-size: 13px; }
.up { color: var(--up); } .down { color: var(--down); }
.briefing { border-left: 1px solid var(--rule); padding-left: 28px; }
.lead-excerpt { margin-top: 20px; font-size: 17px; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.mini-list .kicker { display: block; font-size: 11px; }
.mini-list a { font-family: var(--serif); font-size: 17px; text-decoration: none; color: var(--ink); }
.mini-list a:hover { color: var(--accent-2); }
.briefing h2 { font-family: var(--display); font-size: 22px; margin: 0 0 2px; color: var(--ink); }
.briefing ol { list-style: none; margin: 14px 0 0; padding: 0; counter-reset: b; }
.briefing li { counter-increment: b; padding: 12px 0 12px 34px; border-top: 1px solid var(--rule); position: relative; }
.briefing li::before { content: counter(b); position: absolute; left: 0; top: 10px; font-family: var(--display); font-size: 22px; font-weight: 800; color: var(--accent); }
.briefing h3 { font-family: var(--serif); font-size: 16px; line-height: 1.35; margin: 0 0 4px; color: var(--ink); }
.briefing p { margin: 0 0 4px; font-size: 14px; }
.briefing .src { font-size: 12px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 18px; display: flex; flex-direction: column; }
.card h3 { font-family: var(--display); font-size: 20px; line-height: 1.25; margin: 6px 0 8px; }
.card h3 a { text-decoration: none; }
.card p { margin: 0 0 10px; font-size: 15px; flex: 1; }
.tools-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tool-link { display: block; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 4px; background: var(--card); text-decoration: none; }
.tool-link strong { display: block; font-family: var(--serif); font-size: 17px; color: var(--ink); }
.tool-link span { font-size: 13px; color: var(--muted); }
.tool-link:hover { border-color: var(--accent); }
.two-col { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px; }
@media (max-width: 900px) {
  .front, .two-col { grid-template-columns: 1fr; }
  .briefing { border-left: 0; padding-left: 0; border-top: 2px solid var(--rule-strong); padding-top: 12px; }
  .cards, .tools-strip { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) { .cards, .tools-strip { grid-template-columns: 1fr; } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 4px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--rule); }
th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: var(--paper-2); }
td.num, th.num { text-align: right; font-family: var(--mono); }
tr:last-child td { border-bottom: 0; }
.gauge { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 18px; }
.gauge-bar { height: 10px; border-radius: 5px; background: linear-gradient(90deg, #b42318, #e8a33d 50%, #157347); position: relative; margin: 14px 0 6px; }
.gauge-pin { position: absolute; top: -5px; width: 4px; height: 20px; background: var(--ink); border-radius: 2px; transform: translateX(-2px); }
.gauge-value { font-family: var(--mono); font-size: 34px; font-weight: 600; color: var(--ink); }

/* ---------- article ---------- */
.article { max-width: 720px; margin: 0 auto; }
.article h1 { font-family: var(--display); font-size: clamp(30px, 4.5vw, 44px); line-height: 1.12; margin: 8px 0 12px; color: var(--ink); }
.article .dek { font-family: var(--serif); font-size: 20px; color: var(--ink-2); margin: 0 0 16px; }
.byline { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 10px 0; margin-bottom: 24px; }
.byline strong { color: var(--ink); }
.prose { font-family: var(--serif); font-size: 18px; line-height: 1.75; color: var(--ink-2); }
.prose h2 { font-family: var(--display); font-size: 26px; line-height: 1.25; margin: 34px 0 10px; color: var(--ink); }
.prose h3 { font-family: var(--sans); font-size: 18px; margin: 26px 0 8px; color: var(--ink); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose blockquote { margin: 20px 0; padding: 4px 18px; border-left: 3px solid var(--accent); font-style: italic; }
.prose table { font-family: var(--sans); font-size: 15px; margin: 18px 0; }
.sources { margin-top: 32px; font-size: 14px; border-top: 1px solid var(--rule); padding-top: 14px; }
.sources h2 { font-family: var(--sans); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.sources ol { padding-left: 20px; margin: 0; }
.risk { margin-top: 24px; font-size: 14px; }
.page-head { border-bottom: 3px double var(--rule-strong); margin-bottom: 26px; padding-bottom: 14px; }
.page-head h1 { font-family: var(--display); font-size: clamp(32px, 5vw, 46px); margin: 6px 0 6px; color: var(--ink); line-height: 1.1; }
.page-head p { margin: 0; font-family: var(--serif); font-size: 18px; color: var(--muted); }
.legal { max-width: 780px; }
.legal h2 { font-family: var(--display); font-size: 24px; margin: 30px 0 8px; color: var(--ink); }
.legal table { margin: 14px 0; }
.list-row { display: grid; grid-template-columns: 140px 1fr; gap: 20px; padding: 18px 0; border-top: 1px solid var(--rule); }
.list-row h3 { font-family: var(--display); font-size: 22px; margin: 4px 0 6px; line-height: 1.25; }
.list-row h3 a { text-decoration: none; }
.list-row p { margin: 0; }
@media (max-width: 560px) { .list-row { grid-template-columns: 1fr; gap: 4px; } }
.team { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.person { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 18px; }
.person h3 { margin: 0 0 2px; font-family: var(--display); }
@media (max-width: 640px) { .team { grid-template-columns: 1fr; } }

/* ---------- glossary ---------- */
.glossary dt { font-family: var(--display); font-size: 20px; font-weight: 700; color: var(--ink); margin-top: 22px; }
.glossary dd { margin: 4px 0 0; font-family: var(--serif); font-size: 17px; border-bottom: 1px solid var(--rule); padding-bottom: 16px; }
.az { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.az a { font-family: var(--mono); font-size: 14px; padding: 2px 8px; border: 1px solid var(--rule); border-radius: 3px; text-decoration: none; }

/* ---------- calculators ---------- */
.calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.calc { background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 20px; scroll-margin-top: 60px; }
.calc h2 { font-family: var(--display); font-size: 22px; margin: 0 0 4px; color: var(--ink); }
.calc > p { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 3px; }
.field input, .field select { width: 100%; padding: 9px 10px; border: 1px solid #c8cbd1; border-radius: 4px; background: #fff; font: 15px var(--mono); color: var(--ink); }
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.result { margin-top: 14px; background: var(--paper-2); border-radius: 4px; padding: 12px 14px; font-size: 14px; }
.result .big { font-family: var(--mono); font-size: 24px; font-weight: 600; color: var(--ink); display: block; }
.result-row { display: flex; justify-content: space-between; gap: 12px; border-top: 1px dashed var(--rule); padding: 5px 0; font-family: var(--mono); font-size: 13px; }
.result-row:first-of-type { border-top: 0; }
@media (max-width: 800px) { .calc-grid { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .fields { grid-template-columns: 1fr; } }

/* ---------- privacy notice & choices ---------- */
.privacy-notice { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40; max-width: 760px; margin: 0 auto; display: flex; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--rule); border-top: 3px solid var(--tape); border-radius: 6px; box-shadow: 0 8px 30px rgba(16, 21, 29, .16); padding: 14px 16px; font-size: 14px; }
.privacy-notice p { margin: 0; flex: 1; }
@media (max-width: 560px) { .privacy-notice { flex-direction: column; align-items: stretch; } }
.choice { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--rule); border-radius: 6px; padding: 18px; margin: 18px 0; }
.choice label { font-weight: 600; color: var(--ink); cursor: pointer; }
.switch { position: relative; flex: 0 0 auto; width: 46px; height: 26px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #c8cbd1; border-radius: 13px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--tape); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + span { opacity: .6; }

/* ---------- footer ---------- */
.footer { background: var(--tape); color: #c3cad6; font-size: 14px; padding: 40px 0 26px; }
.footer a { color: #eef2f8; text-decoration-color: #4a5d7a; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.footer .brand { font-family: var(--display); font-size: 28px; font-weight: 800; color: #fff; margin: 0 0 6px; }
.footer h3 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #8d9ab0; margin: 4px 0 10px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 6px; }
.footer .ph { background: #4a3d10; color: #ffe08a; }
.footer-disclaimer { border-top: 1px solid #22344f; margin-top: 28px; padding-top: 16px; font-size: 12.5px; line-height: 1.6; color: #9aa6b8; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* Key economic indicators */
.eco-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule, #d9d9d2); }
.eco-row:last-of-type { border-bottom: 0; }
.eco-val { font-family: var(--mono, monospace); font-weight: 600; white-space: nowrap; text-align: right; }
.eco-val a { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }
