/* VoteNoYarmouth.com — Clean, professional, moderate-friendly */
:root {
  --navy: #1a2744;
  --navy-light: #253559;
  --red: #c0392b;
  --red-soft: #e74c3c;
  --gold: #d4a843;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #2c3e50;
  --text-light: #5a6c7d;
  --border: #dee2e6;
  --green: #27ae60;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 8px;
  --max-w: 1100px;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--red); }

/* ─── HEADER ─── */
.site-header {
  background: var(--navy);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.logo-accent { color: var(--red-soft); }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  color: rgba(255,255,255,0.8);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}
.main-nav a:hover, .main-nav a.active {
  color: #fff;
  background: rgba(255,255,255,0.1);
}
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }

/* ─── HERO ─── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #fff;
  padding: 80px 0 70px;
  text-align: center;
}
.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 20px;
}
.hero .accent { color: var(--gold); }
.hero-sub {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.85);
  max-width: 700px;
  margin: 0 auto 32px;
  line-height: 1.7;
}
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  cursor: pointer;
  text-align: center;
}
.btn-primary {
  background: var(--red);
  color: #fff;
  border: 2px solid var(--red);
}
.btn-primary:hover { background: #a93226; border-color: #a93226; color: #fff; }
.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.4);
}
.btn-outline:hover { border-color: #fff; color: #fff; }
.btn-text {
  color: var(--navy);
  font-weight: 600;
  padding: 8px 0;
}
.btn-text:hover { color: var(--red); }

/* ─── SECTIONS ─── */
section { padding: 64px 0; }
.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 12px;
  text-align: center;
}
.section-intro {
  text-align: center;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto 40px;
  font-size: 1.05rem;
}

/* ─── FACT CARDS ─── */
.key-facts { background: #fff; }
.fact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}
.fact-grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}
.fact-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition: box-shadow 0.2s;
}
.fact-card:hover { box-shadow: var(--shadow-hover); }
.fact-number {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--red);
  margin-bottom: 8px;
}
.fact-label {
  font-weight: 700;
  color: var(--navy);
  font-size: 1rem;
  margin-bottom: 8px;
}
.fact-detail {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ─── CONTENT CARDS ─── */
.content-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}
.content-card.highlight {
  border-left: 4px solid var(--red);
}
.content-card p { margin-bottom: 16px; }

.check-list { list-style: none; padding: 0; margin: 20px 0; }
.check-list li {
  padding: 10px 0 10px 32px;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.check-list li:last-child { border-bottom: none; }
.check-list li::before {
  content: '→';
  position: absolute;
  left: 8px;
  color: var(--navy);
  font-weight: 700;
}
.check-list.red li::before { color: var(--red); content: '✗'; }

/* ─── ORG CARDS ─── */
.org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.org-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.org-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}
.org-card:hover { box-shadow: var(--shadow-hover); }
.org-card .cost-table { font-size: 0.82rem; margin-top: 12px; }
.org-card .cost-table th { padding: 8px 10px; font-size: 0.78rem; }
.org-card .cost-table td { padding: 8px 10px; font-size: 0.82rem; }
.org-card h3 {
  color: var(--navy);
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.org-stat {
  color: var(--red);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
}
.org-detail {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ─── COST TABLE ─── */
.cost-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}
.cost-table th {
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
}
.cost-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.cost-table tr:nth-child(even) { background: var(--bg); }
.cost-table .amount { text-align: right; font-weight: 600; }

/* ─── SLIDESHOW / ROTATOR ─── */
.slide-container { position: relative; overflow: hidden; }
.slide-track { display: flex; transition: transform 0.5s ease; width: 100%; }
.slide-item { min-width: 100%; flex-shrink: 0; padding: 0; }
.slide-dots { text-align: center; margin-top: 20px; }
.slide-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
  margin: 0 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.slide-dot.active { background: var(--navy); }

/* ─── SPOTLIGHT CARDS (mixed content slideshow) ─── */
.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.spotlight-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--navy);
  transition: all 0.3s;
}
.spotlight-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.spotlight-card .card-category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--red);
  margin-bottom: 8px;
}
.spotlight-card h3 {
  color: var(--navy);
  font-size: 1.1rem;
  margin-bottom: 10px;
}
.spotlight-card p {
  color: var(--text-light);
  font-size: 0.92rem;
  line-height: 1.65;
}
.spotlight-card .card-source {
  font-size: 0.8rem;
  color: #999;
  margin-top: 12px;
  font-style: italic;
}

/* ─── CTA TEXT ─── */
.cta-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  margin-top: 16px;
}

/* ─── BOTTOM LINE ─── */
.bottom-line { background: var(--bg); }

/* ─── Q&A / BALLOT SECTION ─── */
.ballot-text {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.8;
  margin: 24px 0;
  position: relative;
}
.ballot-text::before {
  content: 'OFFICIAL BALLOT LANGUAGE';
  display: block;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-light);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.analysis-block {
  background: var(--bg);
  border-left: 3px solid var(--navy);
  padding: 20px 24px;
  margin: 24px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.analysis-block h4 {
  color: var(--navy);
  margin-bottom: 8px;
}

/* ─── VOTE INFO ─── */
.vote-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.vote-info-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.vote-info-card h3 {
  color: var(--navy);
  font-size: 1.1rem;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.vote-info-card .info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.92rem;
}
.vote-info-card .info-label { color: var(--text-light); }
.vote-info-card .info-value { font-weight: 600; color: var(--text); }

/* ─── FOOTER ─── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 40px 0 20px;
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 24px;
}
.footer-info { max-width: 450px; line-height: 1.7; }
.footer-info strong { color: #fff; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: rgba(255,255,255,0.7); transition: color 0.2s; }
.footer-links a:hover { color: #fff; }
.footer-legal {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 16px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  text-align: center;
}

/* ─── RESPONSIVE — TABLET ─── */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.6rem; line-height: 1.3; }
  .hero { padding: 40px 0 32px; }
  .hero-sub { font-size: 1rem; }
  .hero-cta { flex-direction: column; align-items: center; gap: 12px; }
  .hero-cta .btn { width: 100%; max-width: 320px; }
  .section-title { font-size: 1.4rem; }
  .section-intro { font-size: 0.95rem; }

  /* All grids → single column */
  .fact-grid, .fact-grid.cols-4 { grid-template-columns: 1fr !important; }
  .org-grid, .org-grid.cols-2 { grid-template-columns: 1fr !important; }
  .spotlight-grid { grid-template-columns: 1fr !important; }
  .vote-info-grid { grid-template-columns: 1fr !important; }

  /* Slideshow — show all cards stacked, no horizontal scroll */
  .slide-container { overflow: visible; }
  .slide-track { display: block; transform: none !important; }
  .slide-item { min-width: 0; width: 100%; margin-bottom: 24px; }
  .slide-dots { display: none; }

  /* Nav → hamburger */
  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 200;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 16px; font-size: 1rem; }
  .nav-toggle { display: block; }

  /* Cards */
  .content-card { padding: 20px; }
  .fact-card { padding: 24px 16px; }
  .fact-number { font-size: 2rem; }
  .org-card { padding: 20px; overflow: hidden; word-wrap: break-word; }
  .org-card .org-detail p { word-wrap: break-word; overflow-wrap: break-word; }
  .spotlight-card { padding: 20px; }

  /* Tables — horizontal scroll on mobile */
  .cost-table { font-size: 0.82rem; }
  .cost-table th { padding: 8px 10px; font-size: 0.78rem; }
  .cost-table td { padding: 8px 10px; }

  /* Analysis blocks */
  .analysis-block { padding: 16px; margin: 16px 0; }

  /* Footer */
  .footer-inner { flex-direction: column; gap: 20px; }
  .footer-info { max-width: 100%; }

  /* Sections */
  section { padding: 32px 0; }

  /* Vote info rows — stack on narrow */
  .vote-info-card .info-row {
    flex-direction: column;
    gap: 2px;
  }
  .vote-info-card .info-value { font-size: 0.95rem; }

  /* Ballot text */
  .ballot-text { padding: 20px; font-size: 0.92rem; }

  /* Check lists */
  .check-list li { padding: 8px 0 8px 28px; font-size: 0.92rem; }
  .check-list li::before { left: 4px; }
}

/* ─── RESPONSIVE — PHONE (iPhone SE, small Android) ─── */
@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .hero h1 { font-size: 1.35rem; }
  .hero { padding: 32px 0 24px; }
  .hero-sub { font-size: 0.9rem; line-height: 1.6; }
  .fact-number { font-size: 1.6rem; }
  .fact-label { font-size: 0.88rem; }
  .fact-detail { font-size: 0.82rem; }
  .section-title { font-size: 1.2rem; }
  .btn { padding: 10px 20px; font-size: 0.88rem; }
  .logo { font-size: 1.1rem; }
  .header-inner { height: 56px; }

  /* Tables overflow wrapper */
  .content-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cost-table { min-width: 380px; }
  .org-card .cost-table { min-width: 0; } /* org-card tables fit within card */
  .org-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Question badges on questions.html */
  .content-card > div:first-child { flex-wrap: wrap; gap: 8px !important; }

  .cta-text { font-size: 0.95rem; }
  .org-card h3 { font-size: 1rem; }
  .spotlight-card h3 { font-size: 1rem; }
}

/* ─── iOS Safari fixes ─── */
@supports (-webkit-touch-callout: none) {
  /* Prevent iOS text size inflation */
  body { -webkit-text-size-adjust: 100%; }
  /* Fix sticky header on iOS */
  .site-header { position: -webkit-sticky; position: sticky; }
  /* Smooth scrolling for slide container */
  .slide-container { -webkit-overflow-scrolling: touch; }
  /* Fix tap highlight */
  a, button { -webkit-tap-highlight-color: rgba(0,0,0,0.1); }
}
