/* Payday-Effect Research Site — Shared Styles */
:root {
  --bg: #fafafa; --bg-card: #ffffff; --text: #1a1a2e; --text-muted: #555;
  --accent: #2563eb; --accent-light: #dbeafe; --accent-dark: #1e40af;
  --green: #16a34a; --red: #dc2626; --orange: #ea580c; --purple: #7c3aed;
  --border: #e2e8f0; --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --nav-width: 260px; --max-content: 960px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.7; }

/* === NAV SIDEBAR === */
#site-nav { position: fixed; top: 0; left: 0; width: var(--nav-width); height: 100vh;
  background: var(--bg-card); border-right: 1px solid var(--border); padding: 1.5rem 1rem;
  overflow-y: auto; z-index: 100; }
#site-nav .nav-title { font-size: 1rem; font-weight: 700; color: var(--accent-dark);
  margin-bottom: 0.25rem; text-decoration: none; display: block; }
#site-nav .nav-subtitle { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 1.5rem; }
#site-nav .nav-step { display: block; padding: 0.5rem 0.75rem; margin: 0.15rem 0;
  border-radius: 6px; font-size: 0.85rem; color: var(--text); text-decoration: none;
  transition: background 0.15s; }
#site-nav .nav-step:hover { background: var(--accent-light); }
#site-nav .nav-step.active { background: var(--accent); color: #fff; font-weight: 600; }
#site-nav .nav-step .step-num { display: inline-block; width: 1.5em; font-weight: 700;
  color: var(--accent); font-size: 0.75rem; }
#site-nav .nav-step.active .step-num { color: rgba(255,255,255,0.7); }
#site-nav .nav-divider { border: none; border-top: 1px solid var(--border); margin: 0.75rem 0; }

/* === MAIN CONTENT === */
#content { margin-left: var(--nav-width); padding: 2rem 3rem 4rem; }
.page-header { max-width: var(--max-content); margin: 0 auto 2rem; }
.page-header h1 { font-size: 2rem; font-weight: 800; color: var(--text); margin-bottom: 0.25rem; }
.page-header .page-subtitle { font-size: 1.1rem; color: var(--text-muted); }
.page-body { max-width: var(--max-content); margin: 0 auto; }

/* === BREADCRUMB / PROGRESS === */
.progress-bar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 2rem;
  padding: 0.75rem 1rem; background: var(--accent-light); border-radius: 8px; font-size: 0.85rem; }
.progress-bar .step-indicator { font-weight: 700; color: var(--accent-dark); }
.progress-bar .prev-next { margin-left: auto; display: flex; gap: 0.75rem; }
.progress-bar .prev-next a { color: var(--accent); text-decoration: none; font-weight: 600; }
.progress-bar .prev-next a:hover { text-decoration: underline; }

/* === TYPOGRAPHY === */
h2 { font-size: 1.5rem; font-weight: 700; margin: 2.5rem 0 1rem; padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-light); }
h3 { font-size: 1.15rem; font-weight: 700; margin: 2rem 0 0.75rem; }
h4 { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
p { margin-bottom: 1rem; }
blockquote { border-left: 4px solid var(--accent); padding: 0.75rem 1.25rem; margin: 1.5rem 0;
  background: var(--accent-light); border-radius: 0 8px 8px 0; font-style: italic; }
code { font-family: var(--mono); font-size: 0.9em; background: #f1f5f9; padding: 0.15em 0.4em;
  border-radius: 4px; }
ul, ol { margin: 0.5rem 0 1rem 1.5rem; }
li { margin-bottom: 0.35rem; }

/* === TABLES === */
table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.9rem; }
th { background: var(--accent-light); color: var(--accent-dark); font-weight: 700;
  padding: 0.6rem 0.75rem; text-align: left; border-bottom: 2px solid var(--accent); }
td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); }
tr:hover td { background: #f8fafc; }

/* === CARDS === */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.5rem; margin: 1.5rem 0; box-shadow: var(--shadow); }
.card h3 { margin-top: 0; }

/* === CALLOUT BOXES === */
.callout { padding: 1.25rem 1.5rem; border-radius: 10px; margin: 1.5rem 0; position: relative; }
.callout::before { font-weight: 800; font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.05em; display: block; margin-bottom: 0.5rem; }
.callout-plain { background: #ecfdf5; border-left: 4px solid var(--green); }
.callout-plain::before { content: "In plain English"; color: var(--green); }
.callout-finding { background: #fef3c7; border-left: 4px solid var(--orange); }
.callout-finding::before { content: "Key finding"; color: var(--orange); }
.callout-warning { background: #fef2f2; border-left: 4px solid var(--red); }
.callout-warning::before { content: "Important caveat"; color: var(--red); }
.callout-method { background: #f5f3ff; border-left: 4px solid var(--purple); }
.callout-method::before { content: "Methodology note"; color: var(--purple); }

/* === VERDICT BADGES === */
.verdict { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 4px;
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase; }
.verdict-pass { background: #dcfce7; color: var(--green); }
.verdict-fail { background: #fee2e2; color: var(--red); }
.verdict-caveat { background: #fef3c7; color: var(--orange); }
.verdict-mixed { background: #e0e7ff; color: var(--purple); }

/* === EXPANDABLE SECTIONS === */
details { margin: 1rem 0; }
summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 0.5rem 0;
  list-style: none; }
summary::before { content: "\25B6\00a0"; font-size: 0.7em; transition: transform 0.2s; display: inline-block; }
details[open] summary::before { transform: rotate(90deg); }
summary:hover { color: var(--accent-dark); }
details .detail-body { padding: 1rem; background: #f8fafc; border-radius: 8px; margin-top: 0.5rem; }

/* === GLOSSARY TOOLTIPS === */
/* Tooltip is rendered as a position:fixed element by glossary.js — never clipped by overflow */
.term { border-bottom: 1.5px dotted var(--accent); cursor: help; }

/* === CITATION LINKS === */
a.citation { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }
a.citation:hover { color: var(--accent-dark); border-bottom-style: solid; }
.ref-list a { color: var(--accent); text-decoration: none; font-size: 0.8rem; margin-left: 0.5rem; }
.ref-list a:hover { text-decoration: underline; }

/* === CHART CONTAINERS === */
.chart-container { margin: 1.5rem 0; }
.chart-container .chart-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.5rem; }
.chart-container .chart-caption { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.5rem;
  font-style: italic; }
.chart-box { border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: #fff; }

/* === STAT HIGHLIGHT === */
.stat-row { display: flex; gap: 1rem; margin: 1.5rem 0; flex-wrap: wrap; }
.stat-card { flex: 1; min-width: 180px; text-align: center; padding: 1.25rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; color: var(--accent-dark); }
.stat-card .stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }
.stat-card.positive .stat-value { color: var(--green); }
.stat-card.negative .stat-value { color: var(--red); }

/* === FOOTER === */
.page-footer { max-width: var(--max-content); margin: 4rem auto 0; padding: 2rem 0;
  border-top: 1px solid var(--border); font-size: 0.8rem; color: var(--text-muted);
  display: flex; justify-content: space-between; }

/* === HAMBURGER MENU BUTTON === */
#menu-toggle { display: none; position: fixed; top: 0.75rem; left: 0.75rem; z-index: 200;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.5rem 0.65rem; cursor: pointer; box-shadow: var(--shadow); font-size: 1.3rem;
  line-height: 1; color: var(--text); }
#nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  z-index: 90; }

/* === TABLE SCROLL WRAPPER === */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1rem 0 1.5rem; }
.table-scroll table { margin: 0; min-width: 600px; }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  #menu-toggle { display: block; }
  #site-nav { transform: translateX(-100%); transition: transform 0.25s ease; }
  #site-nav.open { transform: translateX(0); }
  #nav-overlay.open { display: block; }
  #content { margin-left: 0; padding: 1rem 1rem 3rem; }
  .page-header h1 { font-size: 1.5rem; }
  .page-header .page-subtitle { font-size: 0.95rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.05rem; }
  .stat-row { gap: 0.5rem; }
  .stat-card { min-width: 140px; padding: 0.75rem; }
  .stat-card .stat-value { font-size: 1.4rem; }
  .callout { padding: 1rem; }
  blockquote { padding: 0.5rem 1rem; }
  .progress-bar { flex-wrap: wrap; font-size: 0.8rem; }
  .progress-bar .prev-next { margin-left: 0; width: 100%; justify-content: space-between; margin-top: 0.25rem; }
  .page-footer { flex-direction: column; gap: 0.5rem; }

  /* Tooltips handled entirely by glossary.js with position:fixed — no CSS overrides needed */
}

@media (max-width: 480px) {
  #content { padding: 0.75rem 0.75rem 2rem; }
  .stat-card { min-width: 100%; }
  .card { padding: 1rem; }
  table { font-size: 0.8rem; }
  th, td { padding: 0.4rem 0.5rem; }
}
