/* =========================================================================
   The Olsen Tribune — site stylesheet
   A single-author newsletter on the business of pharmacy benefits.
   ========================================================================= */


/* ---- 1. Reset & base ---------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "kern", "liga";
}

img, svg { display: block; max-width: 100%; height: auto; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease, color 120ms ease;
}
a:hover { border-bottom-color: var(--accent); }

button { font: inherit; cursor: pointer; }

p { margin: 0 0 1em; }


/* ---- 2. Design tokens --------------------------------------------------- */

:root {
  /* Color */
  --paper:     #faf7f0;
  --paper-2:   #ffffff;
  --ink:       #1a1a1a;
  --ink-2:     #4a4a4a;
  --ink-3:     #8a8a8a;
  --rule:      #d8d4cc;
  --rule-soft: #ece8de;
  --accent:    #b8431a;
  --accent-2:  #2c5d8f;
  --highlight: #f5e9c8;

  /* Type */
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body:  Georgia, "Times New Roman", serif;
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --content-w: 720px;
  --wide-w:   880px;
}

html[data-theme="dark"] {
  --paper:     #161310;
  --paper-2:   #1f1c18;
  --ink:       #e8e4dd;
  --ink-2:     #a8a39a;
  --ink-3:     #6e6a62;
  --rule:      #2e2a25;
  --rule-soft: #25221d;
  --accent:    #d96a3f;
  --accent-2:  #6f9bc7;
  --highlight: #3a2f1a;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --paper:     #161310;
    --paper-2:   #1f1c18;
    --ink:       #e8e4dd;
    --ink-2:     #a8a39a;
    --ink-3:     #6e6a62;
    --rule:      #2e2a25;
    --rule-soft: #25221d;
    --accent:    #d96a3f;
    --accent-2:  #6f9bc7;
    --highlight: #3a2f1a;
  }
}


/* ---- 3. Layout primitives ---------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 24px;
}

.container.wide {
  max-width: var(--wide-w);
}

.divider {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 48px 0;
}


/* ---- 4. Site chrome ---------------------------------------------------- */

.site-header {
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--ink);
}

.site-header .topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--ink-2);
  margin-bottom: 14px;
}

.site-header .topline .date {
  font-weight: 500;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  padding: 0;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.theme-toggle:hover {
  background: var(--rule-soft);
  color: var(--ink);
  border-color: var(--ink-3);
}

.masthead {
  text-align: center;
  border-top: 4px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 16px 0 18px;
  margin-top: 4px;
}

.masthead-name {
  font-family: var(--font-serif);
  font-size: clamp(40px, 7vw, 64px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--ink);
  text-decoration: none;
  border: 0;
  display: inline-block;
}

.masthead-tagline {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--ink-2);
  font-size: 14px;
  margin-top: 8px;
}

.site-nav {
  border-bottom: 1px solid var(--rule);
}

.nav-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 28px;
}

.nav-list a {
  display: inline-block;
  padding: 14px 0;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-2);
  border: 0;
}
.nav-list a:hover { color: var(--accent); }
.nav-list a.is-active { color: var(--ink); }


/* ---- 5. Footer --------------------------------------------------------- */

.site-footer {
  margin-top: 96px;
  padding: 40px 0 32px;
  border-top: 4px solid var(--ink);
  font-family: var(--font-sans);
  color: var(--ink-2);
  font-size: 13px;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 18px;
  color: var(--ink);
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--ink-2);
  border: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.footer-links a:hover { color: var(--accent); }

.footer-bottom {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-3);
}

.footer-social {
  display: inline-flex;
  gap: 14px;
}
.footer-social a {
  color: var(--ink-3);
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.footer-social a:hover { color: var(--accent); }
.footer-social svg { width: 16px; height: 16px; }


/* ---- 6. Homepage components -------------------------------------------- */

main {
  padding: 56px 0 32px;
}

/* Eyebrow / kicker — sans-serif, all caps, tracked out */
.kicker, .eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 10px;
}

/* Hero issue card */
.hero-issue {
  margin-bottom: 56px;
}

.hero-issue h1 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin: 0 0 14px;
  color: var(--ink);
}
.hero-issue h1 a {
  color: inherit;
  border: 0;
}
.hero-issue h1 a:hover {
  color: var(--accent);
}

.hero-issue .deck {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--ink-2);
  font-size: 19px;
  line-height: 1.45;
  margin: 0 0 16px;
  max-width: 60ch;
}

.hero-issue .byline {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 18px;
}
.hero-issue .byline strong { color: var(--ink); font-weight: 500; }
.hero-issue .byline .dot { margin: 0 8px; color: var(--rule); }

.read-issue {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}
.read-issue:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* Section headings on homepage */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 56px 0 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.section-head h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.2px;
  color: var(--ink);
}
.section-head a {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-2);
  border: 0;
}
.section-head a:hover { color: var(--accent); }

/* Recent issues list */
.issue-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.issue-list .issue {
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}
.issue-list .issue:first-child { padding-top: 4px; }
.issue-list .issue:last-child  { border-bottom: 0; }

.issue .issue-meta {
  font-family: var(--font-sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.issue .issue-meta .num { color: var(--accent); font-weight: 700; }

.issue h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.2px;
}
.issue h3 a { color: var(--ink); border: 0; }
.issue h3 a:hover { color: var(--accent); }

.issue .deck {
  font-family: var(--font-body);
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
  font-style: italic;
}

/* Subscribe block */
.subscribe-block {
  margin: 64px 0 0;
  padding: 36px 32px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  text-align: center;
}

.subscribe-block .eyebrow {
  margin-bottom: 8px;
}

.subscribe-block h2 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 8px;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.subscribe-block p {
  color: var(--ink-2);
  font-size: 15px;
  margin: 0 auto 20px;
  max-width: 50ch;
}

.subscribe-form {
  display: flex;
  gap: 0;
  max-width: 440px;
  margin: 0 auto 12px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  overflow: hidden;
  background: var(--paper);
}

.subscribe-form input {
  flex: 1;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
}
.subscribe-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.subscribe-form input::placeholder { color: var(--ink-3); }

.subscribe-form button {
  padding: 12px 22px;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: background 120ms ease;
}
.subscribe-form button:hover { background: var(--accent); }

.subscribe-trust {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-3);
  margin: 0;
}
.subscribe-trust .dot { margin: 0 8px; color: var(--rule); }

/* Compact about preview on the homepage */
.about-preview {
  margin: 64px 0 0;
}
.about-preview h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.2px;
}
.about-preview p {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.7;
  max-width: 60ch;
}
.about-preview a {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}


/* ---- 7. Article page --------------------------------------------------- */

.article-page main { padding: 48px 0 32px; }

.article-meta {
  font-family: var(--font-sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 12px;
}

h1.article-headline {
  font-family: var(--font-serif);
  font-size: clamp(34px, 5.5vw, 48px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin: 0 0 16px;
  color: var(--ink);
}

.article-deck {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--ink-2);
  font-size: 19px;
  line-height: 1.45;
  margin: 0 0 28px;
}

.article-byline {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 12px 0;
  margin: 0 0 36px;
}
.article-byline strong { color: var(--ink); font-weight: 500; }
.article-byline .dot { margin: 0 8px; color: var(--rule); }

.article-body p { margin: 0 0 18px; }

.article-body p.lead::first-letter {
  font-family: var(--font-serif);
  font-size: 64px;
  float: left;
  line-height: 0.85;
  margin: 6px 8px 0 0;
  font-weight: 900;
  color: var(--ink);
}

.article-body h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 800;
  margin: 36px 0 14px;
  line-height: 1.2;
  letter-spacing: -0.2px;
  color: var(--ink);
}

.article-body strong { font-weight: 700; }
.article-body em { font-style: italic; }

/* Pull quote */
.pullquote {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.3;
  font-style: italic;
  color: var(--ink);
  border-left: 3px solid var(--accent);
  padding: 12px 0 12px 22px;
  margin: 28px 0;
}

/* Bottom kicker box */
.article-kicker {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
}
.article-kicker .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}

.end-mark {
  text-align: center;
  margin: 36px 0 0;
  color: var(--ink-3);
  letter-spacing: 12px;
  font-size: 14px;
}

.article-colophon {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.6;
}


/* ---- 8. Chart blocks (used inside articles) --------------------------- */

/* Charts use baked-in colors in their SVGs, so we lock chart-blocks to the
   light palette regardless of theme. They render as a small editorial card
   that always looks like printed paper. */
.chart-block {
  --paper:     #faf7f0;
  --paper-2:   #ffffff;
  --ink:       #1a1a1a;
  --ink-2:     #4a4a4a;
  --ink-3:     #8a8a8a;
  --rule:      #d8d4cc;
  --rule-soft: #ece8de;
  --accent:    #b8431a;
  --accent-2:  #2c5d8f;

  margin: 36px -8px;
  padding: 24px 16px 18px;
  background: var(--paper-2);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 2px;
}

.chart-eyebrow {
  font-family: var(--font-sans);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
}

.chart-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 800;
  margin: 4px 0;
  line-height: 1.25;
  color: var(--ink);
}

.chart-sub {
  color: var(--ink-2);
  font-size: 13px;
  font-style: italic;
  margin-bottom: 14px;
  font-family: var(--font-body);
}

.chart-source {
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 10px;
  line-height: 1.5;
}

.footnote {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 8px;
  border-left: 3px solid var(--rule);
  padding: 6px 12px;
  line-height: 1.5;
}

/* Chart legends */
.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-family: var(--font-sans);
  font-size: 11px;
}
.legend .swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: middle;
  border-radius: 2px;
}

/* Matrix / data tables inside chart blocks */
table.matrix {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 12px;
}
table.matrix th, table.matrix td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
table.matrix th {
  background: var(--ink);
  color: var(--paper);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
table.matrix td.section { font-weight: 700; width: 50px; }

/* Status pills */
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.pill.locked { background: var(--accent-2); color: var(--paper); }
.pill.optout { background: #d4a574; color: #412402; }


/* ---- 9. Archive / About utility pages --------------------------------- */

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 42px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin: 0 0 12px;
  color: var(--ink);
}

.page-deck {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.5;
  margin: 0 0 36px;
  max-width: 60ch;
}

.prose {
  font-family: var(--font-body);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.7;
  max-width: 60ch;
}
.prose h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 800;
  margin: 32px 0 12px;
}
.prose p { margin: 0 0 18px; }


/* ---- 10. Responsive --------------------------------------------------- */

@media (max-width: 600px) {
  body { font-size: 16px; }

  .nav-list { gap: 18px; }
  .nav-list a { font-size: 11px; padding: 12px 0; }

  .subscribe-block { padding: 28px 20px; }
  .subscribe-form { flex-direction: column; border: 0; background: transparent; }
  .subscribe-form input {
    border: 1px solid var(--ink);
    border-radius: 2px;
    background: var(--paper);
    margin-bottom: 8px;
  }
  .subscribe-form button {
    border-radius: 2px;
  }

  .footer-row { flex-direction: column; align-items: flex-start; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .chart-block { margin: 32px -16px; padding: 20px 14px 16px; border-left: 0; border-right: 0; border-radius: 0; }
}


/* ---- 11. Print --------------------------------------------------------- */

@media print {
  .site-nav, .subscribe-block, .footer-social, .theme-toggle { display: none; }
  body { background: white; color: black; }
  a { color: black; border: 0; }
}
