/* ==============================
   Cited — Shared Styles
   wearecited.com
   ============================== */

:root {
  --bg: #faf8f5;
  --bg-white: #ffffff;
  --bg-dark: #1a1815;
  --accent: #e84b1c;
  --accent-light: rgba(232, 75, 28, 0.07);
  --accent-hover: #d04218;
  --text-primary: #1a1a1a;
  --text-secondary: #555250;
  --text-muted: #908a84;
  --border: #e0dcd6;
  --border-dark: #c8c3bb;
  --green: #2d8a4e;
  --green-light: rgba(45, 138, 78, 0.08);
}

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

html { overflow-x: hidden; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- NAV ---- */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 72px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
  text-decoration: none;
}
.nav-links {
  display: flex;
  gap: 36px;
  align-items: center;
  list-style: none;
}
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active { color: var(--text-primary); font-weight: 600; }
.nav-cta {
  background: var(--accent) !important;
  color: #fff !important;
  padding: 10px 24px;
  border-radius: 4px;
  font-weight: 600 !important;
  font-size: 13px !important;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--accent-hover) !important; }

/* ---- SHARED UTILITIES ---- */
.section-eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.section-h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 40px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.2;
  color: var(--text-primary);
}
.section-h2 em { color: var(--accent); font-style: italic; }
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 14px 32px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline {
  display: inline-block;
  border: 2px solid var(--text-primary);
  color: var(--text-primary);
  padding: 12px 28px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-outline:hover { background: var(--text-primary); color: #fff; }
.link-accent {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  transition: opacity 0.2s;
}
.link-accent:hover { opacity: 0.8; }
.link-underline {
  color: var(--text-secondary);
  font-size: 14px;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--border-dark);
  padding-bottom: 2px;
  transition: color 0.2s;
}
.link-underline:hover { color: var(--text-primary); }

/* ---- PAGE HERO (subpages) ---- */
.page-hero {
  padding: 80px 72px 64px;
  max-width: 1280px;
  margin: 0 auto;
}
.page-hero h1 {
  font-family: 'Instrument Serif', serif;
  font-size: 52px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.15;
  color: var(--text-primary);
  max-width: 800px;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}
.page-hero h1 em { color: var(--accent); font-style: italic; }
.page-hero-lead {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 640px;
}

/* ---- FINAL CTA (all pages) ---- */
.final-cta {
  padding: 100px 72px;
  text-align: center;
  background: var(--bg);
}
.final-cta h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 48px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.2;
}
.final-cta h2 em { color: var(--accent); font-style: italic; }
.final-cta p {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}
.cta-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
}

/* ---- FOOTER ---- */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 72px;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-logo {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.footer-text {
  font-size: 13px;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}
.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--text-primary); }

/* ---- MOBILE NAV TOGGLE ---- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}
nav.nav-open .nav-toggle span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
nav.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
nav.nav-open .nav-toggle span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ==============================
   RESPONSIVE — SHARED
   ============================== */
/* ---- RESPONSIVE TABLE SCROLL ---- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 32px 0;
}
.table-scroll .data-table,
.table-scroll table {
  margin: 0;
}

/* ---- GLOBAL IMAGE CONSTRAINT ---- */
img { max-width: 100%; height: auto; }

@media (max-width: 768px) {
  /* Nav */
  nav {
    padding: 16px 20px;
    position: sticky;
  }
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 8px 20px 20px;
    gap: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    z-index: 99;
  }
  nav.nav-open .nav-links { display: flex; }
  .nav-links li {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-links li:last-child {
    border-bottom: none;
    padding-top: 18px;
  }
  .nav-cta {
    text-align: center;
    display: block !important;
  }

  /* Page hero */
  .page-hero { padding: 48px 20px 36px; }
  .page-hero h1 { font-size: 32px; }
  .page-hero-lead { font-size: 16px; }

  /* Section utilities */
  .section-h2 { font-size: 28px; }
  .btn-primary { padding: 14px 24px; font-size: 14px; width: 100%; text-align: center; }
  .btn-outline { padding: 12px 24px; font-size: 14px; width: 100%; text-align: center; }

  /* Final CTA */
  .final-cta { padding: 56px 20px; }
  .final-cta h2 { font-size: 30px; }
  .final-cta p { font-size: 15px; margin-bottom: 28px; }
  .cta-actions { flex-direction: column; gap: 12px; }
  .cta-actions .btn-primary,
  .cta-actions .link-underline { width: 100%; text-align: center; }

  /* Footer */
  .footer {
    padding: 32px 20px;
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }

  /* Tables: horizontal scroll within container */
  .data-table,
  .article-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: normal;
  }
  .data-table thead th {
    white-space: nowrap;
  }

  /* Iframes */
  iframe { max-width: 100%; }

  /* Prevent any overflow from inline styles */
  [style*="width"] { max-width: 100% !important; }

  /* Back to top button — mobile only */
  .back-to-top {
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--text-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 90;
    -webkit-tap-highlight-color: transparent;
  }
  .back-to-top.visible {
    opacity: 1;
    visibility: visible;
  }
  .back-to-top svg {
    width: 20px;
    height: 20px;
  }
}
