/* ═══════════════════════════════════════════════════════════════
   TSP — Shared Article Stylesheet
   Usage: <link rel="stylesheet" href="tsp-styles.css">
   ═══════════════════════════════════════════════════════════════ */

/* ── TOKENS ──────────────────────────────────────────────────── */
:root {
  --bg:            #f5f2ed;
  --bg-2:          #eeeae3;
  --bg-dark:       #1a1917;
  --obsidian:      #1a1917;
  --obsidian-soft: #2e2c29;
  --obsidian-mid:  #3d3b38;
  --obsidian-muted:#4a4844;
  --obsidian-faint:#7a7774;
  --rule:          #c8c3bb;
  --rule-light:    #dedad3;
  --off-white:     #f5f2ed;

  /* Category accent colours — one per type */
  --tag-news:        #2e5c8a;
  --tag-editorial:   #7a4a2e;
  --tag-satire:      #3a6b3a;
  --tag-invest:      #5a3a7a;
}

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--obsidian);
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ─────────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

/* Scroll progress bar — sits flush along the bottom edge of the nav */
#scroll-progress {
  position: fixed;
  top: 56px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--obsidian);
  z-index: 101;
  transition: width 0.05s linear;
}

.nav-name {
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--obsidian);
  text-decoration: none;
}
.nav-links { display: flex; gap: 2.5rem; list-style: none; }
.nav-links a {
  font-family: 'Raleway', sans-serif;
  font-weight: 400;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--obsidian-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--obsidian); }

/* ── CATEGORY TAG ─────────────────────────────────────────────── */
.cat-tag {
  display: inline-block;
  font-family: 'Raleway', sans-serif;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.3em 0.75em;
  border-radius: 2px;
}
.cat-tag[data-cat="News"]                    { background: #1b2e40; color: #7ab0d8; }
.cat-tag[data-cat="Editorial"]               { background: #3b2215; color: #d8906a; }
.cat-tag[data-cat="Satire"]                  { background: #162b16; color: #7abd7a; }
.cat-tag[data-cat="Investigative Editorial"] { background: #271535; color: #b07ad8; }

/* ── ARTICLE HEADER ──────────────────────────────────────────── */
.article-header {
  padding: 9rem 5rem 5rem;
  border-bottom: 1px solid #2e2c29;
  background: var(--bg-dark);
}
.article-header-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.article-header-inner > * {
  max-width: 860px;
}

.article-eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.75rem 1.2rem;
  margin-bottom: 2rem;
}
.article-pub {
  font-family: 'Raleway', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #5a5855;
}
.article-pub-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #3a3835;
  flex-shrink: 0;
}

h1.article-title {
  font-family: 'Merriweather', serif;
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--off-white);
  margin-bottom: 1.6rem;
}
.article-dek {
  font-family: 'Merriweather', serif;
  font-weight: 300;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.75;
  color: #9a9590;
  margin-bottom: 2.5rem;
}
.article-byline {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.article-byline-name {
  font-family: 'Raleway', sans-serif;
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7a7774;
}
.article-byline-date {
  font-family: 'Raleway', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5a5855;
}

/* ── LAYOUT ──────────────────────────────────────────────────── */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 5rem;
  padding: 2.5rem 5rem 7rem;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}

/* ── ARTICLE BODY ─────────────────────────────────────────────── */
.article-body p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--obsidian-soft);
  margin-bottom: 1.5rem;
}
.article-body h2 {
  font-family: 'Merriweather', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--obsidian);
  margin-top: 3rem;
  margin-bottom: 0.9rem;
}
.article-body blockquote {
  margin: 2.8rem 0;
  padding: 0 0 0 1.8rem;
  border-left: 2px solid var(--obsidian);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--obsidian-muted);
}

/* Lists — included from tsp-budget, sensible default for all articles */
.article-body ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}
.article-body li {
  margin-bottom: 0.6rem;
  line-height: 1.7;
}

/* Links */
.article-body a         { color: #5a8fd8; text-decoration: underline; }
.article-body a:visited { color: #b05a3a; }
.article-body a:hover   { color: #3d6fb3; }

/* Pull quote — a standalone callout, visually stronger than blockquote */
.pull-quote {
  margin: 3rem -1rem;
  padding: 2rem 2.4rem;
  background: var(--bg-2);
  border-top: 2px solid var(--obsidian);
  border-bottom: 1px solid var(--rule-light);
  font-family: 'Merriweather', serif;
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--obsidian);
  font-style: italic;
}

.references-heading { text-align: center; }

/* ── IMAGES ──────────────────────────────────────────────────── */
/*
  Usage:
    <figure class="article-figure">
      <img src="images/photo.jpg" alt="Description">
      <figcaption>Caption text. <span class="fig-credit">Credit: Name</span></figcaption>
    </figure>

    Add class "article-figure--wide" to break into the margin on wide screens.
    Add class "article-figure--half" to float right alongside text.
*/
.article-figure {
  margin: 2.5rem 0;
  display: block;
}
.article-figure img {
  width: 100%;
  display: block;
  border: 1px solid var(--rule-light);
}
figcaption {
  margin-top: 0.7rem;
  font-family: 'Raleway', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  line-height: 1.65;
  color: var(--obsidian-faint);
}
.fig-credit { font-style: italic; opacity: 0.75; }
.article-figure--wide  { margin-left: -2rem; margin-right: -2rem; }
.article-figure--half  {
  float: right;
  width: 44%;
  margin: 0.5rem 0 1.5rem 2rem;
}
.article-figure--half::after { content: ''; display: table; clear: both; }

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.article-sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.sidebar-block {
  border-top: 1px solid var(--rule-light);
  padding: 1.4rem 0;
}
.sidebar-block:last-child { border-bottom: 1px solid var(--rule-light); }
.sidebar-label {
  font-family: 'Raleway', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--obsidian-faint);
  margin-bottom: 0.65rem;
}
.sidebar-text {
  font-family: 'Merriweather', serif;
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--obsidian-muted);
}

/* Key findings */
.sidebar-findings { display: flex; flex-direction: column; margin-top: 0.4rem; }
.sidebar-finding {
  font-family: 'Merriweather', serif;
  font-weight: 300;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--obsidian-muted);
  padding: 0.8rem 0 0.8rem 1rem;
  border-bottom: 1px solid var(--rule-light);
  position: relative;
}
.sidebar-finding:last-child { border-bottom: none; }
.sidebar-finding::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--rule);
  font-size: 0.7rem;
}

/* Related articles */
.related-list { display: flex; flex-direction: column; gap: 0; margin-top: 0.4rem; }
.related-item {
  display: block;
  text-decoration: none;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule-light);
  transition: opacity 0.2s;
}
.related-item:first-child { border-top: 1px solid var(--rule-light); }
.related-item:last-child  { border-bottom: none; }
.related-item:hover       { opacity: 0.65; }
.related-item-meta {
  font-family: 'Raleway', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--obsidian-faint);
  margin-bottom: 0.35rem;
}
.related-item-title {
  font-family: 'Merriweather', serif;
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--obsidian);
}

/* ── BOTTOM NAV BAR ──────────────────────────────────────────── */
.article-bottom-bar {
  border-top: 1px solid var(--rule-light);
  padding: 2rem 5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.back-link, .next-link {
  font-family: 'Raleway', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--obsidian-faint);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: color 0.2s;
}
.back-link:hover, .next-link:hover { color: var(--obsidian); }
.bottom-bar-center {
  font-family: 'Raleway', sans-serif;
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rule);
}

/* ── FOOTER ──────────────────────────────────────────────────── */
footer {
  padding: 1.6rem 5rem;
  border-top: 1px solid var(--rule-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
footer span {
  font-family: 'Raleway', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--obsidian-faint);
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 860px) {
  nav, .article-header, .article-layout, .article-bottom-bar, footer {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  .article-layout        { grid-template-columns: 1fr; gap: 3rem; }
  .article-sidebar       { position: static; }
  .article-figure--half  { float: none; width: 100%; margin: 2rem 0; }
  .article-figure--wide  { margin-left: 0; margin-right: 0; }
  .pull-quote            { margin-left: 0; margin-right: 0; }
}