/* =========================================================
   TRUMP v. 1776 — SHARED STYLES
   Common CSS used across all investigation pages.
   ========================================================= */

/* ===== CSS VARIABLES ===== */
:root {
  --parchment: #f5f0e8;
  --parchment-dark: #e8e0d0;
  --ink: #1a1a2e;
  --ink-light: #2d2d44;
  --colonial-red: #8b2500;
  --colonial-red-light: #a83220;
  --colonial-blue: #1e3a5f;
  --colonial-blue-light: #2a5082;
  --gold: #b8860b;
  --gold-light: #daa520;
  --separator: #c4b99a;
  --shadow: rgba(26, 26, 46, 0.12);
  --section-bg: #faf8f3;
  --alert-red: #9b1b30;
  --dem-blue: #2166ac;
  --rep-red: #b2182b;
  --swing-green: #1b9e20;
}

/* ===== BASE RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--parchment);
  color: var(--ink);
  line-height: 1.6;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, var(--colonial-red), var(--gold-light), var(--colonial-red));
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ===== NAVIGATION BAR ===== */
.nav-outer {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ink);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nav-brand {
  text-align: center;
  padding: 8px 20px 0;
  font-family: 'Playfair Display', serif;
  font-size: 0.75em;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
}

.nav-brand a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-brand a:hover {
  color: var(--gold-light);
}

.nav-updated {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.7em;
  font-weight: 500;
  color: rgba(245, 240, 232, 0.4);
  letter-spacing: 0.5px;
  margin-left: 12px;
  position: relative;
  top: -1px;
}

.nav-updated::before {
  content: '•';
  margin-right: 6px;
  color: rgba(184, 134, 11, 0.4);
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 16px 10px;
}

.nav-btn {
  padding: 5px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.75em;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
}

.nav-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(245, 240, 232, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--parchment);
}

.nav-btn.active {
  background: var(--gold);
  color: var(--ink);
  border: 1px solid var(--gold);
}

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--parchment);
  font-size: 1.4em;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.nav-mobile-header {
  display: none;
}

@media (max-width: 768px) {
  .nav-brand {
    display: none;
  }

  .nav-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
  }

  .nav-mobile-title {
    font-family: 'Playfair Display', serif;
    font-size: 0.85em;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 1px;
    text-decoration: none;
  }

  .nav-hamburger {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .nav-mobile-updated {
    font-family: 'Inter', sans-serif;
    font-size: 0.55em;
    font-weight: 500;
    color: rgba(245, 240, 232, 0.35);
    letter-spacing: 0.3px;
    white-space: nowrap;
  }

  .nav-updated {
    display: none;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-btn {
    font-size: 0.85em;
    padding: 10px 14px;
    border-radius: 6px;
    text-align: left;
  }

  .nav-btn.secondary {
    background: rgba(255, 255, 255, 0.04);
  }
}

/* ===== HERO SECTION ===== */
.hero {
  background: linear-gradient(135deg, var(--ink) 0%, var(--colonial-blue) 40%, var(--ink-light) 100%);
  color: var(--parchment);
  padding: 60px 24px 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.hero::after {
  content: '★';
  position: absolute;
  bottom: 20px;
  right: 40px;
  font-size: 3em;
  opacity: 0.08;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2em, 5vw, 3.6em);
  font-weight: 900;
  margin-bottom: 12px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero .subtitle {
  font-family: 'EB Garamond', serif;
  font-size: clamp(1.1em, 2.2vw, 1.5em);
  font-style: italic;
  margin-bottom: 40px;
  color: var(--gold-light);
}

.hero .epoch-line {
  font-family: 'EB Garamond', serif;
  font-size: 0.95em;
  letter-spacing: 0.5px;
  color: rgba(245, 240, 232, 0.4);
  margin-bottom: 20px;
}

/* Hero stat cards */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.stat-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.stat-card .big-number {
  font-family: 'Playfair Display', serif;
  font-size: 2.2em;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.stat-card .stat-label {
  font-size: 0.9em;
  color: var(--parchment);
  line-height: 1.3;
}

/* ===== VIEW TOGGLE ===== */
.view-toggle-wrap {
  text-align: center;
  padding: 24px 20px 8px;
  background: var(--parchment);
}

.view-toggle {
  display: inline-flex;
  background: var(--ink);
  border-radius: 30px;
  padding: 4px;
  gap: 4px;
  box-shadow: 0 2px 8px var(--shadow);
}

.view-toggle-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 26px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  color: rgba(255, 255, 255, 0.5);
  background: transparent;
  position: relative;
}

.view-toggle-btn:hover {
  color: rgba(255, 255, 255, 0.8);
}

.view-toggle-btn.active {
  background: var(--colonial-red);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139, 37, 0, 0.4);
}

.view-toggle-hint {
  display: block;
  margin-top: 8px;
  font-size: 0.78em;
  color: #888;
  font-style: italic;
  transition: opacity 0.3s ease;
}

/* Tooltip on hover */
.view-toggle-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--parchment);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.75em;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 10;
}

.view-toggle-btn[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.view-toggle-btn[data-tooltip]:hover::after,
.view-toggle-btn[data-tooltip]:hover::before {
  opacity: 1;
}

/* Deep-only elements: hidden when body has .view-glance */
.deep-only {
  transition: opacity 0.4s ease, max-height 0.5s ease;
  overflow: hidden;
}

body.view-glance .deep-only {
  opacity: 0;
  max-height: 0 !important;
  margin: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  pointer-events: none;
}

body.view-deep .deep-only {
  opacity: 1;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--colonial-red);
  color: white;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  z-index: 40;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px var(--shadow);
}

.back-to-top:hover {
  background: var(--colonial-red-light);
  transform: translateY(-3px);
}

.back-to-top.show {
  display: flex;
}

/* ===== EMOJI (Twemoji) ===== */
img.emoji {
  height: 1em;
  width: auto;
  vertical-align: -0.1em;
  margin: 0 1px;
}

/* ===== MOBILE TOPIC NAV ===== */
.mobile-topic-nav {
  display: none;
  text-align: center;
  padding: 28px 20px;
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.mobile-topic-nav-label {
  font-size: 0.7em;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(245,240,232,0.35);
  margin-bottom: 12px;
}

.next-topic-btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--gold);
  color: var(--ink);
  text-decoration: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.95em;
  transition: background 0.2s;
}

.next-topic-btn:hover {
  background: var(--gold-light);
}

@media (max-width: 768px) {
  .mobile-topic-nav {
    display: block;
  }
}

/* ===== STANDARDIZED SITE FOOTER ===== */
.site-footer {
  text-align: center;
  padding: 40px 32px;
  background: var(--ink);
  color: var(--parchment);
  font-size: 0.85em;
}

.footer-disclaimers p {
  opacity: 0.55;
  margin-bottom: 8px;
  line-height: 1.6;
}

.footer-columns {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.footer-col { flex: 1; }
.footer-projects { text-align: left; }
.footer-branding { text-align: center; }
.footer-share { text-align: center; }

.footer-col-label {
  font-size: 0.85em;
  letter-spacing: 1px;
  color: rgba(245,240,232,0.5);
  margin-bottom: 10px;
}

.footer-project-link {
  display: block;
  width: fit-content;
  color: var(--gold-light);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.12);
  padding: 6px 14px;
  border-radius: 5px;
  font-size: 0.9em;
  margin-bottom: 6px;
  transition: border-color 0.2s;
}

.footer-project-link:hover { border-color: rgba(255,255,255,0.3); }
.footer-project-link span { color: rgba(245,240,232,0.35); }

.footer-brand-tagline {
  font-size: 0.95em;
  letter-spacing: 0.5px;
  color: rgba(245,240,232,0.45);
  margin-bottom: 6px;
}

.footer-brand-name {
  font-size: 0.95em;
  letter-spacing: 0.5px;
  color: rgba(245,240,232,0.55);
}

.footer-brand-quip {
  margin-top: 4px;
  font-size: 0.82em;
  font-style: italic;
  color: rgba(245,240,232,0.35);
}

.footer-share-icons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.footer-share-icons a,
.footer-share-icons button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--gold-light);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s;
}

.footer-share-icons a:hover,
.footer-share-icons button:hover {
  border-color: rgba(255,255,255,0.35);
}

.footer-share-icons svg { width: 16px; height: 16px; }

/* Mobile footer: stack vertically, hide Projects We Love */
@media (max-width: 600px) {
  .site-footer { padding: 32px 20px; }
  .footer-columns {
    flex-direction: column;
    gap: 20px;
  }
  .footer-projects { display: none; }
  .footer-branding, .footer-share { text-align: center; }
}

/* ===== SHARE NUDGE ===== */
.share-nudge {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: var(--ink);
  color: var(--parchment);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  backdrop-filter: blur(12px);
  max-width: 440px;
  width: calc(100% - 40px);
}

.nudge-text {
  font-size: 0.85em;
  line-height: 1.4;
  flex: 1;
}

.nudge-text strong {
  color: var(--gold-light);
  display: block;
  margin-bottom: 2px;
}

.nudge-icons {
  display: flex;
  gap: 6px;
}

.nudge-icons a,
.nudge-icons button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--gold-light);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s;
}

.nudge-icons a:hover,
.nudge-icons button:hover {
  border-color: rgba(255,255,255,0.35);
}

.nudge-icons svg {
  width: 14px;
  height: 14px;
}

.nudge-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--parchment);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
  transition: background 0.2s;
}

.nudge-close:hover {
  background: rgba(255,255,255,0.15);
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE BREAKPOINTS ===== */
@media (max-width: 1024px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
  .stat-card .big-number {
    font-size: 1.8em;
  }
}
