/* ===== MIDWAY MONEY — PUBLICATION STYLESHEET ===== */

:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(3rem, 0.5rem + 7vw, 8rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem; --space-20: 5rem; --space-24: 6rem;
  --space-32: 8rem;

  --color-bg: #F5F2EB;
  --color-surface: #FFFEF9;
  --color-surface-2: #EFEAE0;
  --color-surface-offset: #E8E2D6;
  --color-border: #D9D2C5;
  --color-divider: #E0D9CC;

  --color-text: #1A1A1A;
  --color-text-muted: #6B6B6B;
  --color-text-faint: #9B9B9B;

  --color-navy: #0C2D5E;
  --color-navy-light: #1A4275;
  --color-orange: #D6633A;
  --color-orange-light: #E8855F;
  --color-orange-dark: #B84A28;
  --color-green: #2D6B2D;
  --color-gold: #D4A017;

  --radius-sm: 0.375rem; --radius-md: 0.5rem; --radius-lg: 0.75rem;
  --radius-xl: 1rem; --radius-full: 9999px;

  --font-display: 'Boska', Georgia, serif;
  --font-body: 'General Sans', 'Helvetica Neue', sans-serif;

  --shadow-sm: 0 1px 3px rgba(12,45,94,0.08);
  --shadow-md: 0 4px 16px rgba(12,45,94,0.10);
  --shadow-lg: 0 12px 40px rgba(12,45,94,0.15);

  --content-narrow: 680px;
  --content-default: 960px;
  --content-wide: 1200px;
}

[data-theme="dark"] {
  --color-bg: #0F0E0C;
  --color-surface: #1A1816;
  --color-surface-2: #232220;
  --color-surface-offset: #2A2826;
  --color-border: #3A3835;
  --color-divider: #2D2B29;
  --color-text: #E8E5E0;
  --color-text-muted: #A09D98;
  --color-text-faint: #6B6865;
  --color-navy: #4A7BB0;
  --color-navy-light: #6A9BD0;
  --color-orange: #E8855F;
  --color-orange-light: #F0A080;
  --color-orange-dark: #D6633A;
  --color-green: #5AAA5A;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
}

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

html {
  -webkit-text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  min-height: 100dvh;
  line-height: 1.65;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

img, picture, svg { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; }
p, li { text-wrap: pretty; max-width: 72ch; }

a { color: var(--color-navy); transition: color 180ms cubic-bezier(0.16,1,0.3,1); text-decoration: none; }
a:hover { color: var(--color-orange); }

::selection { background: var(--color-orange); color: #fff; }
:focus-visible { outline: 2px solid var(--color-orange); outline-offset: 3px; border-radius: var(--radius-sm); }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }

/* ===== HEADER ===== */
.header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in oklab, var(--color-bg) 90%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow 300ms ease;
}
.header.scrolled { box-shadow: var(--shadow-sm); }
.header-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-6);
  gap: var(--space-4);
}
.logo-mark { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; }
.logo-text { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); color: var(--color-navy); letter-spacing: -0.02em; }
.logo-text span { color: var(--color-orange); }
.nav-links { display: flex; gap: var(--space-6); align-items: center; }
.nav-links a { font-size: var(--text-sm); font-weight: 500; }
.nav-links a.active { color: var(--color-orange); font-weight: 600; }
.theme-toggle { display: flex; align-items: center; justify-content: center; padding: var(--space-2); border-radius: var(--radius-full); transition: background 180ms; }
.theme-toggle:hover { background: var(--color-surface-2); }
.mobile-nav-toggle { display: none; padding: var(--space-2); }

/* ===== HERO ===== */
.hero { position: relative; min-height: 80vh; display: flex; align-items: flex-end; overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(12,45,94,0.35) 0%, rgba(12,45,94,0.55) 40%, rgba(12,45,94,0.92) 100%);
  z-index: 1;
}
.hero-content { position: relative; z-index: 2; max-width: var(--content-wide); margin: 0 auto; width: 100%; padding: var(--space-12) var(--space-6) var(--space-16); color: #fff; }
.hero-volume { font-size: var(--text-sm); font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; color: var(--color-orange-light); margin-bottom: var(--space-4); }
.hero-title { font-family: var(--font-display); font-weight: 700; font-size: var(--text-hero); line-height: 0.95; letter-spacing: -0.03em; margin-bottom: var(--space-4); text-shadow: 0 4px 24px rgba(0,0,0,0.3); }
.hero-subtitle { font-family: var(--font-display); font-size: var(--text-xl); color: rgba(255,255,255,0.95); margin-bottom: var(--space-6); max-width: 600px; }
.hero-tagline { font-size: var(--text-base); color: rgba(255,255,255,0.85); font-style: italic; max-width: 480px; }

/* ===== GB STICKER ===== */
.gb-sticker {
  position: absolute; top: 120px; right: 40px; z-index: 3;
  background: var(--color-green); color: #FFD700; font-family: var(--font-display);
  font-weight: 700; padding: var(--space-2) var(--space-5); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); font-size: var(--text-sm); text-transform: uppercase;
  letter-spacing: 0.1em; border: 2px solid #FFD700;
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: rotate(8deg) translateY(0); }
  50% { transform: rotate(8deg) translateY(-8px); }
}

/* ===== SECTIONS ===== */
.section { max-width: var(--content-wide); margin: 0 auto; padding: clamp(var(--space-12), 6vw, var(--space-24)) var(--space-6); }
.section-narrow { max-width: var(--content-narrow); }

.section-label {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--color-orange); margin-bottom: var(--space-3);
}
.section-label::before { content: ''; width: 24px; height: 2px; background: var(--color-orange); border-radius: 1px; }
.section-title { font-size: var(--text-2xl); font-weight: 700; margin-bottom: var(--space-6); color: var(--color-navy); letter-spacing: -0.02em; }
.section-lead { font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.5; color: var(--color-text-muted); margin-bottom: var(--space-8); font-weight: 400; }

.prose { font-size: var(--text-base); line-height: 1.7; }
.prose p { margin-bottom: var(--space-4); }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--color-navy); }

/* ===== EDITOR'S NOTE ===== */
.editors-note { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: clamp(var(--space-8), 4vw, var(--space-12)); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.editors-note::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(to right, var(--color-navy), var(--color-orange), var(--color-navy)); }
.editors-note-header { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-6); }
.editors-avatar { width: 56px; height: 56px; border-radius: var(--radius-full); background: var(--color-navy); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); color: var(--color-orange-light); flex-shrink: 0; }
.editors-name { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); color: var(--color-navy); }
.editors-role { font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.editors-body { font-size: var(--text-base); line-height: 1.7; }
.editors-body p { margin-bottom: var(--space-4); }
.editors-body p:last-child { margin-bottom: 0; }

/* ===== DONUT CHART ===== */
.chart-container { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); align-items: center; margin: var(--space-8) 0; }
@media (max-width: 768px) { .chart-container { grid-template-columns: 1fr; } }
.donut-wrap { display: flex; justify-content: center; align-items: center; }
.donut-legend { display: flex; flex-direction: column; gap: var(--space-3); }
.legend-item { display: flex; align-items: center; gap: var(--space-3); }
.legend-swatch { width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0; }
.legend-label { font-size: var(--text-sm); font-weight: 500; }
.legend-pct { font-size: var(--text-sm); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

/* ===== TABLES ===== */
.data-table-wrap { overflow-x: auto; margin: var(--space-6) 0; border-radius: var(--radius-lg); border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: var(--space-3) var(--space-4); text-align: left; }
thead th { background: var(--color-navy); color: #fff; font-weight: 600; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; }
tbody tr { border-bottom: 1px solid var(--color-divider); }
tbody tr:last-child { border-bottom: none; }
tbody tr:nth-child(even) { background: var(--color-surface-2); }
td { font-size: var(--text-sm); }

/* ===== CARDS ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-6); margin: var(--space-8) 0; }
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-sm); transition: transform 200ms ease, box-shadow 200ms ease; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-icon { width: 48px; height: 48px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-4); }
.card-title { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); color: var(--color-navy); margin-bottom: var(--space-2); }
.card-body { font-size: var(--text-sm); line-height: 1.6; color: var(--color-text-muted); }

/* ===== PLAYER CARDS ===== */
.player-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); transition: transform 200ms ease, box-shadow 200ms ease; }
.player-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.player-card-header { background: var(--color-navy); padding: var(--space-6); color: #fff; }
.player-name { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); margin-bottom: var(--space-1); }
.player-team { font-size: var(--text-sm); color: rgba(255,255,255,0.7); }
.player-card-body { padding: var(--space-6); }
.player-stat { display: flex; justify-content: space-between; align-items: baseline; padding: var(--space-2) 0; border-bottom: 1px solid var(--color-divider); }
.player-stat:last-child { border-bottom: none; }
.player-stat-label { font-size: var(--text-sm); color: var(--color-text-muted); }
.player-stat-value { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); color: var(--color-navy); }

/* ===== SALARY METER ===== */
.salary-meter-wrap { margin: var(--space-8) 0; }
.salary-meter-bar { height: 48px; border-radius: var(--radius-md); background: linear-gradient(to right, #E8453C 0%, #E8453C 15%, #F0A030 15%, #F0A030 45%, #4CAF50 45%, #4CAF50 70%, #F0A030 70%, #F0A030 88%, #E8453C 88%, #E8453C 100%); position: relative; box-shadow: var(--shadow-sm); }
.salary-marker { position: absolute; top: -8px; width: 4px; height: 64px; background: var(--color-navy); border-radius: 2px; transform: translateX(-50%); }
.salary-marker::after { content: attr(data-label); position: absolute; top: -28px; left: 50%; transform: translateX(-50%); font-size: var(--text-xs); font-weight: 600; white-space: nowrap; color: var(--color-navy); }
.salary-labels { display: flex; justify-content: space-between; margin-top: var(--space-4); font-size: var(--text-xs); color: var(--color-text-muted); }

/* ===== TEAM SPLIT CARDS ===== */
.split-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-4); margin: var(--space-6) 0; }
.split-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-5); text-align: center; transition: border-color 200ms ease; }
.split-card:hover { border-color: var(--color-orange); }
.split-pct { font-family: var(--font-display); font-weight: 700; font-size: var(--text-2xl); color: var(--color-orange); margin-bottom: var(--space-1); }
.split-desc { font-size: var(--text-sm); color: var(--color-text-muted); }

/* ===== PULL QUOTE ===== */
.pull-quote { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.4; color: var(--color-navy); border-left: 4px solid var(--color-orange); padding: var(--space-6) var(--space-8); margin: var(--space-8) 0; font-style: italic; background: var(--color-surface); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; box-shadow: var(--shadow-sm); }
.pull-quote-attr { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-3); font-style: normal; }

/* ===== FULL-BLEED IMAGE ===== */
.full-bleed { width: 100vw; position: relative; margin-left: calc(-50vw + 50%); }
.full-bleed img { width: 100%; height: 50vh; min-height: 300px; object-fit: cover; }
.full-bleed-caption { padding: var(--space-3) var(--space-6); font-size: var(--text-xs); color: var(--color-text-muted); text-align: center; }

/* ===== SIDEBAR ===== */
.sidebar-box { background: var(--color-surface); border: 2px solid var(--color-navy); border-radius: var(--radius-lg); padding: var(--space-8); margin: var(--space-8) 0; position: relative; }
.sidebar-title { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); color: var(--color-navy); margin-bottom: var(--space-6); display: flex; align-items: center; gap: var(--space-3); }
.rule-item { display: flex; gap: var(--space-3); margin-bottom: var(--space-4); }
.rule-num { flex-shrink: 0; width: 32px; height: 32px; border-radius: var(--radius-full); background: var(--color-orange); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm); }
.rule-text { font-size: var(--text-sm); line-height: 1.6; padding-top: var(--space-1); }

/* ===== FLOWCHART ===== */
.flowchart { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); margin: var(--space-8) 0; }
.flow-node { background: var(--color-surface); border: 2px solid var(--color-navy); border-radius: var(--radius-md); padding: var(--space-4) var(--space-6); text-align: center; font-size: var(--text-sm); font-weight: 500; max-width: 400px; box-shadow: var(--shadow-sm); }
.flow-node.start { background: var(--color-navy); color: #fff; border-color: var(--color-navy); }
.flow-node.decision { background: var(--color-surface-2); border-color: var(--color-orange); border-style: dashed; }
.flow-arrow { color: var(--color-text-faint); font-size: var(--text-lg); }

/* ===== ARTICLE PAGE LAYOUT ===== */
.article-header { max-width: var(--content-narrow); margin: 0 auto; padding: var(--space-16) var(--space-6) var(--space-8); }
.article-meta { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-4); font-size: var(--text-xs); color: var(--color-text-muted); }
.article-meta .vol-tag { background: var(--color-navy); color: #fff; padding: 2px var(--space-2); border-radius: var(--radius-sm); font-weight: 600; }
.article-title { font-size: var(--text-3xl); font-weight: 700; color: var(--color-navy); letter-spacing: -0.02em; margin-bottom: var(--space-4); }
.article-deck { font-family: var(--font-display); font-size: var(--text-lg); color: var(--color-text-muted); line-height: 1.5; margin-bottom: var(--space-6); }
.article-body { max-width: var(--content-narrow); margin: 0 auto; padding: 0 var(--space-6) var(--space-16); }

.article-nav { display: flex; justify-content: space-between; align-items: center; max-width: var(--content-narrow); margin: 0 auto; padding: var(--space-8) var(--space-6) var(--space-16); border-top: 1px solid var(--color-border); }
.article-nav a { font-size: var(--text-sm); font-weight: 500; display: flex; align-items: center; gap: var(--space-2); }
.article-nav .nav-label { font-size: var(--text-xs); color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 0.1em; }

/* ===== ISSUE CARD ===== */
.issue-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); transition: transform 200ms ease, box-shadow 200ms ease; }
.issue-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.issue-card-img { width: 100%; height: 280px; object-fit: cover; }
.issue-card-body { padding: var(--space-6); }
.issue-card-vol { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em; color: var(--color-orange); margin-bottom: var(--space-2); }
.issue-card-title { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); color: var(--color-navy); margin-bottom: var(--space-2); }
.issue-card-desc { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.5; margin-bottom: var(--space-4); }

/* ===== DOWNLOAD BUTTONS ===== */
.download-btn { display: inline-flex; align-items: center; gap: var(--space-2); background: var(--color-navy); color: #fff; padding: var(--space-3) var(--space-6); border-radius: var(--radius-md); font-size: var(--text-sm); font-weight: 600; transition: background 180ms; }
.download-btn:hover { background: var(--color-navy-light); color: #fff; }
.download-btn.secondary { background: var(--color-surface-2); color: var(--color-navy); border: 1px solid var(--color-border); }
.download-btn.secondary:hover { background: var(--color-surface-offset); }

/* ===== TOC ===== */
.toc-list { display: flex; flex-direction: column; gap: var(--space-4); }
.toc-item { display: flex; align-items: flex-start; gap: var(--space-4); padding: var(--space-4); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); transition: border-color 200ms; text-decoration: none; }
.toc-item:hover { border-color: var(--color-orange); }
.toc-num { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); color: var(--color-orange); min-width: 32px; }
.toc-content { flex: 1; }
.toc-title { font-family: var(--font-display); font-weight: 700; font-size: var(--text-base); color: var(--color-navy); margin-bottom: var(--space-1); }
.toc-desc { font-size: var(--text-sm); color: var(--color-text-muted); }

/* ===== FOOTER ===== */
.footer { background: var(--color-navy); color: rgba(255,255,255,0.8); padding: var(--space-16) var(--space-6); margin-top: var(--space-16); }
.footer-inner { max-width: var(--content-wide); margin: 0 auto; }
.footer-logo { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-6); }
.footer-logo-text { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); color: #fff; }
.footer-logo-text span { color: var(--color-orange-light); }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-8); margin-bottom: var(--space-8); }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-col h4 { font-size: var(--text-sm); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.7); margin-bottom: var(--space-4); }
.footer-col a { display: block; font-size: var(--text-sm); color: rgba(255,255,255,0.6); margin-bottom: var(--space-2); }
.footer-col a:hover { color: var(--color-orange-light); }
.footer-disclaimer { font-size: var(--text-xs); line-height: 1.6; color: rgba(255,255,255,0.5); border-top: 1px solid rgba(255,255,255,0.15); padding-top: var(--space-6); }
.footer-disclaimer strong { color: rgba(255,255,255,0.7); }
.footer-gb { display: inline-block; background: var(--color-green); color: #FFD700; font-family: var(--font-display); font-weight: 700; padding: var(--space-1) var(--space-4); border-radius: var(--radius-sm); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em; margin-top: var(--space-4); }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--color-bg); padding: var(--space-6); border-bottom: 1px solid var(--color-border); box-shadow: var(--shadow-md); }
  .mobile-nav-toggle { display: flex; }
  .gb-sticker { top: 80px; right: 16px; font-size: var(--text-xs); padding: var(--space-1) var(--space-3); }
  .hero-content { padding-bottom: var(--space-8); }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
