/* ============================================================
   The Raj Report — Shared Stylesheet
   All pages link to this file. Page-specific styles remain
   inline in each HTML file.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=IBM+Plex+Mono:wght@300;400;500&family=UnifrakturMaguntia&family=Outfit:wght@300;400;700&display=swap');

/* ── RESET & ROOT ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:    #0d0d0d;
  --paper:  #f5f2ed;
  --accent: #b8860b;
  --muted:  #7a7060;
  --rule:   rgba(0,0,0,0.13);
}

html, body { min-height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 300;
  overflow-x: hidden;
}

/* ── GRAIN TEXTURE ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 100; opacity: 0.4;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.4; transform:scale(1.4); }
}
@keyframes growBar {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ── MASTHEAD ── */
.masthead-wrap {
  border-bottom: 3px double var(--ink);
  padding: 2rem 2.5rem 1.5rem;
  text-align: center;
  opacity: 0; animation: fadeUp .7s ease forwards .1s;
}
.pub-name {
  font-family: 'UnifrakturMaguntia', cursive;
  font-size: clamp(3rem, 10vw, 6.5rem);
  font-weight: 400;
  letter-spacing: .02em;
  line-height: 1.1;
}
.pub-tagline {
  font-size: .62rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 1.4rem;
}
.pub-rule { display: none; }

/* ── DATE BAR ── */
.date-bar {
  border-bottom: 1px solid var(--rule);
  padding: .55rem 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  opacity: 0; animation: fadeUp .7s ease forwards .22s;
}
.date-bar span {
  font-size: .58rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── HERO (article pages) ── */
.hero {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.2rem 2rem 2rem;
  border-bottom: 1px solid var(--rule);
  opacity: 0; animation: fadeUp .7s ease forwards .34s;
}
.category-tag {
  display: inline-block;
  background: var(--accent);
  color: var(--paper);
  font-size: .55rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  padding: .22rem .6rem;
  margin-bottom: .8rem;
}
h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: clamp(1.6rem, 4.2vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: .01em;
  margin-bottom: .9rem;
}
h1 em { font-family: 'IBM Plex Mono', monospace; font-style: italic; font-weight: 300; font-size: .45em; display: block; margin-top: .5rem; letter-spacing: .04em; }
.byline {
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
}

/* ── ARTICLE BODY ── */
.article-body {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 2rem 0;
}
.body-text {
  font-size: .74rem;
  line-height: 1.9;
  margin-bottom: 1.4rem;
}
.section-label {
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: #ffffff;
  font-weight: 500;
  background: var(--accent);
  margin-bottom: 1.2rem;
  padding: .4rem .7rem;
  opacity: 1;
}

/* ── TIMELINE ── */
.timeline {
  margin: 2rem 0;
  opacity: 0; animation: fadeUp .7s ease forwards .48s;
}
.tl-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--rule);
}
.tl-item:last-child { border-bottom: none; }
.tl-date {
  padding: 1rem .8rem 1rem 0;
  font-size: .58rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
  border-right: 2px solid var(--accent);
  display: flex;
  align-items: flex-start;
  padding-top: 1.1rem;
}
.tl-content { padding: 1rem 0 1rem 1.2rem; }
.tl-price {
  font-family: 'UnifrakturMaguntia', cursive;
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: .25rem;
}
.tl-price .move-up   { color: #2d6a4f; font-size: .75rem; font-family: 'IBM Plex Mono', monospace; font-weight: 500; margin-left: .4rem; }
.tl-price .move-down { color: #c0392b; font-size: .75rem; font-family: 'IBM Plex Mono', monospace; font-weight: 500; margin-left: .4rem; }
.tl-event { font-size: .68rem; line-height: 1.75; color: var(--ink); }
.tl-tag {
  display: inline-block;
  font-size: .5rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: .1rem .3rem;
  margin-right: .3rem;
  margin-bottom: .3rem;
}
.tl-tag.geo    { background: #1a3a5c; color: white; }
.tl-tag.econ   { background: var(--accent); color: white; }
.tl-tag.policy { background: #c0392b; color: white; }
.tl-tag.cb     { background: #2d6a4f; color: white; }

/* ── STAT BLOCKS ── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 2rem 0;
  opacity: 0; animation: fadeUp .7s ease forwards .62s;
}
.stat-cell {
  padding: 1.2rem 1.4rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stat-cell:nth-child(3n) { border-right: none; }
.stat-cell:nth-child(n+4) { border-bottom: none; }
.stat-num {
  font-family: 'UnifrakturMaguntia', cursive;
  font-weight: 400;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--accent);
  line-height: 1.1;
}
.stat-lbl {
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin: .25rem 0 .4rem;
}
.stat-sub { font-size: .62rem; line-height: 1.7; }

/* ── BAR CHART ── */
.bar-section {
  margin: 2rem 0;
  opacity: 0; animation: fadeUp .7s ease forwards .76s;
}
.bar-row {
  display: grid;
  grid-template-columns: 160px 1fr 80px;
  align-items: center;
  gap: .8rem;
  margin-bottom: .8rem;
}
.bar-name { font-size: .6rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); text-align: right; }
.bar-track { background: rgba(0,0,0,.08); height: 10px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; animation: growBar .9s ease forwards; }
.bar-val { font-size: .62rem; font-weight: 500; color: var(--ink); }

/* ── BANK TARGETS TABLE ── */
.bank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .64rem;
  margin: 2rem 0;
  opacity: 0; animation: fadeUp .7s ease forwards .9s;
}
.bank-table th {
  text-align: left;
  padding: .55rem .8rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 500;
  border-bottom: 2px solid var(--ink);
}
.bank-table td {
  padding: .65rem .8rem;
  border-bottom: 1px solid var(--rule);
  line-height: 1.6;
  vertical-align: top;
}
.bank-table tr:last-child td { border-bottom: none; }
.bank-table tr:hover td { background: rgba(184,134,11,.04); }
.bank-name { font-weight: 500; color: var(--ink); }
.target-num {
  font-family: 'UnifrakturMaguntia', cursive;
  font-weight: 400;
  font-size: .9rem;
  color: var(--accent);
}
.stance-bull { color: #2d6a4f; font-weight: 500; text-transform: uppercase; font-size: .55rem; letter-spacing: .1em; }
.stance-caut { color: #c0392b; font-weight: 500; text-transform: uppercase; font-size: .55rem; letter-spacing: .1em; }

/* ── SOURCE BADGE ── */
.source-badge, a.source-badge {
  display: inline-block;
  font-size: .54rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
  padding: .14rem .38rem;
  color: var(--muted);
  margin-top: .5rem;
  text-decoration: none;
  transition: background .2s, color .2s, border-color .2s;
}
a.source-badge:hover {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}

/* ── VERDICT / PULL QUOTE ── */
.verdict {
  max-width: 860px;
  margin: 2rem auto 0;
  padding: 2rem 2rem;
  border-top: 1px solid var(--rule);
  border-bottom: 3px double var(--ink);
  position: relative;
  overflow: hidden;
  opacity: 0; animation: fadeUp .7s ease forwards 1.05s;
}
.verdict::before {
  content: '❝';
  position: absolute; right: -10px; top: -20px;
  font-size: 8rem; opacity: .04;
  font-family: 'UnifrakturMaguntia', cursive;
}
.verdict-label {
  font-size: .62rem; text-transform: uppercase;
  letter-spacing: .2em; color: var(--muted); margin-bottom: .8rem;
}
.verdict-text {
  font-family: 'UnifrakturMaguntia', cursive;
  font-size: clamp(1rem, 2.4vw, 1.45rem);
  line-height: 1.6; max-width: 72ch;
}
.hl { background: linear-gradient(to bottom, transparent 55%, rgba(184,134,11,.22) 55%); }

/* ── CONTEXT STRIP ── */
.context-strip {
  max-width: 860px;
  margin: 0 auto;
  display: flex; gap: 2.5rem; flex-wrap: wrap;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--rule);
  opacity: 0; animation: fadeUp .7s ease forwards 1.1s;
}
.ctx-item { display: flex; flex-direction: column; gap: .3rem; }
.ctx-label { font-size: .54rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
.ctx-val { font-size: .7rem; font-weight: 500; }
.ctx-tag { font-size: .5rem; text-transform: uppercase; letter-spacing: .12em; padding: .12rem .35rem; margin-left: .3rem; }
.ctx-tag.accent { background: var(--accent); color: var(--paper); }
.ctx-tag.red    { background: #c0392b; color: var(--paper); }
.ctx-tag.green  { background: #2d6a4f; color: var(--paper); }

/* ── SOURCES ── */
.sources-section {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.8rem 2rem 2rem;
  border-bottom: 1px solid var(--rule);
}
.sources-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.sources-list li { font-size: .62rem; line-height: 1.6; }
.sources-list li::before { content: '→ '; color: var(--accent); }
.sources-list a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(184,134,11,.3); }
.sources-list a:hover { border-color: var(--accent); }

/* ── FOOTER ── */
footer {
  border-top: 3px double var(--ink);
  padding: 1.2rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: .7rem;
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  opacity: 0; animation: fadeUp .7s ease forwards 1.2s;
}
.live-mark { display: flex; align-items: center; gap: .5rem; }
.live-mark::before {
  content: ''; display: inline-block;
  width: 7px; height: 7px;
  background: var(--accent); border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
.back-link {
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}
.back-link:hover { opacity: .6; }

/* ── NIGHT MODE ── */
body.night {
  --ink:    #e8e4dc;
  --paper:  #1a1814;
  --accent: #c99a1a;
  --muted:  #8a8070;
  --rule:   rgba(255,255,255,0.10);
}
body.night .card-dek,
body.night .lead-dek,
body.night .intro-text { color: #e8e4dc; }

/* ── THEME TOGGLE ── */
#theme-toggle {
  position: fixed; bottom: 1.2rem; right: 1.2rem;
  z-index: 999;
  background: var(--paper);
  color: var(--muted);
  border: 1px solid var(--rule);
  font-family: 'IBM Plex Mono', monospace;
  font-size: .52rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .35rem .7rem; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
#theme-toggle:hover { background: var(--accent); color: var(--paper); border-color: var(--accent); }

/* ── RESPONSIVE ── */
@media (max-width: 680px) {
  .masthead-wrap, .date-bar { padding-left: 1.2rem; padding-right: 1.2rem; }
  .hero, .article-body, .verdict, .context-strip, .sources-section { padding-left: 1.2rem; padding-right: 1.2rem; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat-cell:nth-child(3n) { border-right: 1px solid var(--rule); }
  .stat-cell:nth-child(2n) { border-right: none; }
  .bar-row { grid-template-columns: 100px 1fr 60px; }
  .tl-item { grid-template-columns: 70px 1fr; }
}
