/* ================================================================
   styles.css — Futures Market Weekly
   Mobile-first, print-ready, component library
   ================================================================ */
:root {
  --amber:       #d4922a;
  --amber-light: #f0b84a;
  --void:        #0a0a0f;
  --off-white:   #faf9f7;
  --muted:       #6b6b80;
  --rule:        #e2ddd5;
  --font-display:"DM Serif Display", serif;
  --font-body:   "DM Sans", system-ui, sans-serif;
  --font-mono:   "IBM Plex Mono", monospace;
}

hr { border: none; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
::selection { background: rgba(212,146,42,0.18); }

/* ── Amber gradient bar ─────────────────────────────────────── */
.amber-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--amber) 0%, var(--amber-light) 45%, transparent 100%);
  border: none;
  margin: 0;
}

/* ── Hero (shared) ──────────────────────────────────────────── */
.site-hero {
  background: var(--void);
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2rem) clamp(2rem, 5vw, 3.5rem);
  position: relative;
  overflow: hidden;
}
.site-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 70% at 78% 45%, rgba(212,146,42,0.08) 0%, transparent 65%),
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,0.016) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(255,255,255,0.01) 60px);
  pointer-events: none;
}
.site-hero-inner { max-width: 1080px; margin: 0 auto; position: relative; }
.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 4.6rem);
  font-style: italic;
  color: #fff;
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.hero-title em { color: var(--amber); font-style: normal; }
.hero-sub {
  font-family: var(--font-body);
  font-size: clamp(0.88rem, 2.5vw, 1rem);
  font-weight: 300;
  color: rgba(200,195,185,0.72);
  max-width: 500px;
  line-height: 1.7;
  margin-bottom: 2rem;
}
.hero-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.hero-chip {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(180,170,155,0.55);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0.3em 0.85em;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
}
.hero-chip:hover { border-color: var(--amber); color: var(--amber); }

/* ── Market tiles ───────────────────────────────────────────── */
.market-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  margin-bottom: 3rem;
}
.market-tile {
  background: #fff;
  padding: clamp(1.1rem, 3vw, 1.6rem) clamp(1rem, 2.5vw, 1.5rem);
  display: block;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: background 0.2s;
}
.market-tile::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--amber);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.25s;
}
.market-tile:hover { background: #fffdf7; }
.market-tile:hover::before { transform: scaleY(1); }
.tile-label {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  display: block;
  margin-bottom: 0.3rem;
}
.tile-name {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-style: italic;
  color: var(--void);
  display: block;
  margin-bottom: 0.4rem;
}
.tile-desc {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.55;
}

/* ── Section heading ────────────────────────────────────────── */
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.6rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}
.sec-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  font-style: italic;
  color: var(--void);
  margin: 0; border: none; padding: 0;
}
.sec-head a {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-left: auto;
  text-decoration: none;
  white-space: nowrap;
}

/* ── Home body wrapper ──────────────────────────────────────── */
.home-body {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem) 4rem;
}

/* ── Listing hero (commodity pages) ────────────────────────── */
.listing-hero {
  background: var(--void);
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem) clamp(1.5rem, 4vw, 2.8rem);
  border-bottom: 3px solid var(--amber);
  position: relative;
  overflow: hidden;
}
.listing-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,0.015) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(255,255,255,0.01) 60px);
  pointer-events: none;
}
.listing-hero-inner { max-width: 1080px; margin: 0 auto; position: relative; }
.listing-hero .hero-eyebrow { color: var(--amber); margin-bottom: 0.6rem; }
.listing-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-style: italic;
  color: #fff;
  margin-bottom: 0.5rem;
}
.listing-hero p {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 300;
  color: rgba(200,195,185,0.65);
  max-width: 500px;
  line-height: 1.65;
  margin: 0;
}

/* ── PDF Toolbar ────────────────────────────────────────────── */
#pdf-toolbar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 0.7rem 1rem;
  background: #faf9f7;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--amber);
}
#pdf-toolbar .toolbar-label {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.3rem;
}
.pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: none;
  padding: 0.45em 1.1em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}
.pdf-btn-primary {
  background: var(--void);
  color: #fff;
}
.pdf-btn-primary:hover { background: var(--amber); color: #fff; }
.pdf-btn-secondary {
  background: none;
  color: var(--void);
  border: 1px solid #ccc;
}
.pdf-btn-secondary:hover { border-color: var(--amber); color: var(--amber); }

/* ── Article components ─────────────────────────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid rgba(212,146,42,0.35);
  padding: 0.22em 0.75em;
  margin-bottom: 1.2rem;
}
.section-label::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
}

.lead-paragraph {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.5vw, 1.22rem);
  font-style: italic;
  line-height: 1.62;
  color: #2a2a3a;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.4rem;
  margin-bottom: 2rem;
}

.pull-quote {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.38rem);
  font-style: italic;
  line-height: 1.45;
  color: var(--void);
  border-left: 4px solid var(--amber);
  padding: 0.4rem 0 0.4rem 1.4rem;
  margin: 2.5rem 0;
}

/* ── Scenario boxes ─────────────────────────────────────────── */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin: 1.5rem 0;
}
.scenario-box {
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  font-family: var(--font-body);
  font-size: 0.83rem;
  font-weight: 300;
  color: #444;
  line-height: 1.6;
}
.scenario-box .sc-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.45rem;
}
.bull { border-top: 3px solid #166534; }
.bull .sc-label { color: #166534; }
.base { border-top: 3px solid var(--amber); }
.base .sc-label { color: var(--amber); }
.bear { border-top: 3px solid #991b1b; }
.bear .sc-label { color: #991b1b; }

/* ── Ticker chip ────────────────────────────────────────────── */
.ticker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78em;
  font-weight: 500;
  background: var(--void);
  color: var(--amber-light);
  padding: 0.1em 0.45em;
  border-radius: 2px;
  letter-spacing: 0.04em;
}
.pos { color: #166534; font-weight: 500; }
.neg { color: #991b1b; font-weight: 500; }
.neu { color: var(--muted); }

/* ── Source note ────────────────────────────────────────────── */
.source-note {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
  padding-top: 0.8rem;
  font-style: italic;
  line-height: 1.6;
}

/* ── Tables ─────────────────────────────────────────────────── */
table {
  font-family: var(--font-body);
  font-size: 0.88rem;
  width: 100%;
  border-collapse: collapse;
  margin: 1.4rem 0;
}
thead { border-bottom: 2px solid var(--void); }
thead th {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.55rem 0.85rem;
  background: #faf9f7;
  border-bottom: 2px solid var(--void);
}
tbody td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 0.84rem;
}
tbody td:first-child { font-family: var(--font-body); font-size: 0.88rem; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(212,146,42,0.03); }
.table-striped tbody tr:nth-of-type(odd) { background: rgba(0,0,0,0.015); }

/* ── Code ───────────────────────────────────────────────────── */
pre {
  border-radius: 0 !important;
  border-left: 3px solid var(--amber);
  background: #f7f4ee !important;
  font-size: 0.82rem !important;
  overflow-x: auto;
}
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: #2a2a3a;
  background: #f0ede6;
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

/* ── Live Markets page ──────────────────────────────────────── */
.lm-body { max-width: 1080px; margin: 0 auto; padding: 2.5rem clamp(1rem, 3vw, 2rem); }

.quote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  margin-bottom: 2.5rem;
}
.quote-card {
  background: #fff;
  padding: 1.3rem 1.4rem;
  position: relative;
}
.quote-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--amber);
}
.qc-label {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 0.3rem;
}
.qc-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--void);
  display: block;
  margin-bottom: 0.4rem;
}
.qc-price {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--void);
  display: block;
  line-height: 1.1;
  margin-bottom: 0.2rem;
}
.qc-change {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.qc-time {
  font-family: var(--font-body);
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.5rem;
  display: block;
}

.chart-section { margin-bottom: 3rem; }
.chart-header {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
}
.chart-header h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-style: italic;
  color: var(--void);
  margin: 0; padding: 0; border: none;
}
.chart-header .chart-ticker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--amber);
  background: var(--void);
  padding: 0.15em 0.5em;
}
.chart-wrap {
  width: 100%;
  border: 1px solid var(--rule);
  background: #fff;
  overflow: hidden;
}

/* Ticker bar */
.ticker-bar {
  background: #111118;
  border-bottom: 1px solid #1e1e2a;
  padding: 0.5rem 1.5rem;
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ticker-bar::-webkit-scrollbar { display: none; }
.tk-item { display: flex; align-items: center; gap: 0.5rem; }
.tk-sym   { color: var(--amber); font-weight: 500; letter-spacing: 0.04em; }
.tk-price { color: #e8e2d6; }
.tk-up    { color: #4ade80; }
.tk-down  { color: #f87171; }
.tk-flat  { color: #888; }

/* ── Report image ───────────────────────────────────────────── */
.report-cover {
  width: 100%;
  aspect-ratio: 16 / 5;
  object-fit: cover;
  display: block;
  margin-bottom: 1.5rem;
  filter: brightness(0.93) saturate(0.88);
}

/* ── Mobile responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .market-tiles { grid-template-columns: 1fr; }
  .quote-grid   { grid-template-columns: 1fr; }
  .scenario-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  table     { font-size: 0.78rem; }
  thead th  { padding: 0.45rem 0.6rem; }
  tbody td  { padding: 0.45rem 0.6rem; }
  .pull-quote { font-size: 1.05rem; }
  .qc-price   { font-size: 1.3rem; }
}

/* ── Print ──────────────────────────────────────────────────── */
@media print {
  .site-hero, .listing-hero, .ticker-bar,
  .navbar, .nav-footer, #quarto-margin-sidebar,
  #pdf-toolbar, .no-print,
  .quarto-title-meta { display: none !important; }

  body { font-size: 11pt; color: #000; background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  h1, h2, h3 { page-break-after: avoid; }
  h1.title { font-size: 22pt; border-bottom: 2pt solid #d4922a; padding-bottom: 6pt; margin-bottom: 14pt; }
  h2 { font-size: 14pt; border-bottom: 1pt solid #ccc; margin-top: 18pt; }
  .report-cover { max-height: 160pt; object-fit: cover; }
  .source-note { border-top: 1pt solid #ccc; font-size: 8pt; margin-top: 18pt; }
  .scenario-grid { grid-template-columns: repeat(3,1fr) !important; break-inside: avoid; }
  .scenario-box { break-inside: avoid; }
  a[href]::after { content: none !important; }
  table { page-break-inside: avoid; font-size: 9pt; }
  thead th { background: #eee !important; }
  @page { margin: 1.8cm 2cm; size: A4; }
  @page :first { margin-top: 2.5cm; }
}
