/* =========================================================================
   RICHMOND CITY DEMOCRATIC COMMITTEE — SITE STYLESHEET
   Design system: Federal Navy + Old Glory Red on warm paper, set in
   Source Serif 4 (headlines) and Public Sans (body/UI — the U.S. Web
   Design System typeface).
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700;8..60,900&family=Public+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* ---- Color ---- */
  --navy:        #14213D;
  --navy-light:  #22335C;
  --navy-pale:   #E7EAF2;
  --red:         #B22234;
  --red-dark:    #8F1B29;
  --paper:       #F7F4EC;
  --white:       #FFFFFF;
  --ink:         #1F2733;
  --ink-soft:    #4A5468;
  --blue:        #3E5C86;
  --line:        #DCD6C7;
  --line-dark:   #B9C0CE;

  /* ---- Type ---- */
  --font-head: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* ---- Scale ---- */
  --measure: 68ch;
  --container: 1200px;
  --radius: 3px;
  --shadow-card: 0 1px 2px rgba(20,33,61,0.06);

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------------------------------------------------------------------
   RESET & BASE
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--red-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--navy);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 700;
}
h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); font-weight: 900; }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.3rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1.1em; max-width: var(--measure); }
p.lede { font-size: 1.15rem; color: var(--ink-soft); }

ul, ol { margin: 0 0 1.1em; padding-left: 1.25em; }
li { margin-bottom: 0.4em; }

hr { border: none; border-top: 1px solid var(--line); margin: 2.5em 0; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 200;
  background: var(--navy); color: var(--white); padding: 0.6em 1em;
  border-radius: var(--radius); transition: top 0.15s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------------------------------------------------------------------
   LAYOUT HELPERS
   --------------------------------------------------------------------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.section--navy { background: var(--navy); color: var(--white); }
.section--navy h2, .section--navy h3 { color: var(--white); }
.section--navy p { color: #C9D2E6; }
.section--pale { background: var(--navy-pale); }

.section-head { max-width: 640px; margin-bottom: 2.2em; }
.section-head p { margin-bottom: 0; }
.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--red-dark);
  letter-spacing: 0.02em;
  margin-bottom: 0.6em;
}

.grid { display: grid; gap: 28px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* Two-column content + sidebar layout used on interior pages */
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 56px;
  align-items: start;
}
@media (max-width: 900px) {
  .page-layout { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------
   BUTTONS
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 0.85em 1.5em;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: var(--red-dark); color: var(--white); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-light); color: var(--white); }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-outline-white { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.6); }
.btn-outline-white:hover { background: var(--white); color: var(--navy); }
.btn-sm { padding: 0.55em 1.1em; font-size: 0.88rem; }

.btn-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 1.6em; }

/* ---------------------------------------------------------------------
   HEADER / NAV
   --------------------------------------------------------------------- */
.utility-bar {
  background: var(--navy);
  color: #AEB9D4;
  font-size: 0.82rem;
}
.utility-bar .container {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 8px; padding-bottom: 8px;
}
.utility-bar a { color: #C9D2E6; text-decoration: none; margin-left: 16px; }
.utility-bar a:hover { color: var(--white); }
.social-row { display: flex; gap: 14px; align-items: center; }
.social-row a { margin-left: 0; }
.social-row svg { width: 16px; height: 16px; fill: currentColor; vertical-align: -3px; }

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; padding-bottom: 14px;
  gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--navy);
}
.brand-mark {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover;
  background: var(--navy);
  flex-shrink: 0;
}
/* Bigger logo variant — used on the header mark only, so the
   smaller footer mark is unaffected. Change the width/height
   below to resize it. */
.brand-mark--lg { width: 128px; height: 128px; }
.brand-text { line-height: 1.2; }
.brand-text .name { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; color: var(--navy); }
.brand-text .tag { font-size: 0.74rem; color: var(--ink-soft); letter-spacing: 0.03em; }

.primary-nav { display: flex; align-items: center; gap: 4px; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.primary-nav > .container > ul { align-items: center; }
.nav-item { position: relative; }
.nav-item > a {
  display: block; padding: 10px 14px; color: var(--navy);
  text-decoration: none; font-weight: 600; font-size: 0.96rem;
  border-radius: var(--radius);
}
.nav-item > a:hover { background: var(--navy-pale); color: var(--navy); }
.nav-item.has-submenu > a::after { content: ' ▾'; font-size: 0.7em; }

.submenu {
  list-style: none; margin: 0; padding: 8px; position: absolute; top: 100%; left: 0;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  min-width: 230px; box-shadow: 0 8px 20px rgba(20,33,61,0.12);
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity 0.15s var(--ease), transform 0.15s var(--ease), visibility 0.15s;
}
.nav-item.has-submenu:hover .submenu,
.nav-item.has-submenu:focus-within .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.submenu a { display: block; padding: 8px 10px; color: var(--ink); text-decoration: none; font-size: 0.92rem; border-radius: var(--radius); }
.submenu a:hover { background: var(--navy-pale); color: var(--navy); }

.header-cta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.nav-toggle {
  display: none;
  background: none; border: 2px solid var(--navy); border-radius: var(--radius);
  padding: 8px 10px; cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 20px; height: 2px; background: var(--navy); position: relative; transition: 0.2s;
}
.nav-toggle span::before, .nav-toggle span::after { content: ''; position: absolute; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .primary-nav {
    position: fixed; inset: 0 0 0 auto; width: min(320px, 85vw); height: 100vh;
    background: var(--white); flex-direction: column; align-items: stretch;
    padding: 90px 20px 20px; transform: translateX(100%); transition: transform 0.25s var(--ease);
    box-shadow: -10px 0 30px rgba(0,0,0,0.15); overflow-y: auto;
  }
  .primary-nav.is-open { transform: translateX(0); }
  .primary-nav .container { padding: 0; display: block; width: 100%; }
  .primary-nav ul { flex-direction: column; gap: 0; width: 100%; }
  .submenu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; padding-left: 14px; display: none; }
  .nav-item.has-submenu.is-expanded .submenu { display: block; }
  .header-cta .btn-sm { display: none; }
}

/* ---------------------------------------------------------------------
   HERO
   --------------------------------------------------------------------- */
.hero {
  position: relative;
  color: var(--white);
  background: linear-gradient(115deg, rgba(20,33,61,0.94) 0%, rgba(20,33,61,0.80) 45%, rgba(20,33,61,0.55) 100%), var(--navy);
  background-size: cover; background-position: center;
  padding: 96px 0 84px;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: linear-gradient(90deg, var(--red) 0 33%, var(--white) 33% 66%, var(--navy) 66% 100%);
}
.hero-inner { max-width: 640px; }
.hero .section-label { color: #F4C6CC; }
.hero h1 { color: var(--white); }
.hero p.lede { color: #D7DDEC; }

.hero-reveal { opacity: 0; transform: translateY(14px); animation: heroReveal 0.7s var(--ease) forwards; }
.hero-reveal:nth-child(2) { animation-delay: 0.08s; }
.hero-reveal:nth-child(3) { animation-delay: 0.16s; }
.hero-reveal:nth-child(4) { animation-delay: 0.24s; }
@keyframes heroReveal { to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .hero-reveal { opacity: 1; transform: none; animation: none; } }

/* Page header band for interior pages (no photo) */
.page-header {
  background: var(--navy);
  color: var(--white);
  padding: 56px 0 44px;
  position: relative;
}
.page-header::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: linear-gradient(90deg, var(--red) 0 33%, var(--white) 33% 66%, var(--navy) 66% 100%);
}
.page-header h1 { color: var(--white); margin-bottom: 0.3em; }
.page-header p { color: #C9D2E6; margin-bottom: 0; max-width: 60ch; }
.page-header .section-label { color: #F4C6CC; }

/* ---------------------------------------------------------------------
   CARDS
   --------------------------------------------------------------------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-card);
}
.card h3 { margin-bottom: 0.4em; }
.card p:last-child { margin-bottom: 0; }
.card .card-eyebrow {
  color: var(--red-dark); font-weight: 700; font-size: 0.82rem; margin-bottom: 0.5em; display: block;
}

.card-icon {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--navy-pale); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.card-icon svg { width: 22px; height: 22px; fill: currentColor; }

.card-link { font-weight: 700; display: inline-block; margin-top: 0.8em; text-decoration: none; }
.card-link::after { content: ' →'; }

/* Teaser strip (image + text) */
.teaser {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center;
}
.teaser img { border-radius: var(--radius); }
@media (max-width: 760px) { .teaser { grid-template-columns: 1fr; } }
.teaser.reverse .teaser-media { order: 2; }
@media (max-width: 760px) { .teaser.reverse .teaser-media { order: 0; } }

/* ---------------------------------------------------------------------
   NUMBERED STEPS (used only for genuine sequences)
   --------------------------------------------------------------------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 44px 1fr; gap: 16px;
  padding: 18px 0; border-top: 1px solid var(--line);
}
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: counter(step);
  font-family: var(--font-head); font-weight: 700; font-size: 1.1rem;
  color: var(--white); background: var(--navy);
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.steps h4 { margin-bottom: 0.25em; }
.steps p { margin-bottom: 0; }

/* ---------------------------------------------------------------------
   VOTER INFO TOOL CARDS
   --------------------------------------------------------------------- */
.tool-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; gap: 10px;
}
.tool-card .btn { align-self: flex-start; margin-top: 6px; }

/* ---------------------------------------------------------------------
   TABLES (officers / ward chairs)
   --------------------------------------------------------------------- */
.roster-table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
.roster-table th, .roster-table td {
  text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line);
  font-size: 0.96rem;
}
.roster-table th {
  font-family: var(--font-body); font-weight: 700; color: var(--navy);
  border-bottom: 2px solid var(--navy);
}
.roster-table td.role { color: var(--ink-soft); }

.people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 1.5em 0; }
@media (max-width: 760px) { .people-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .people-grid { grid-template-columns: 1fr; } }
.person {
  text-align: left;
}
.person-photo {
  aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden;
  background: var(--navy-pale); margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center;
}
.person-photo img { width: 100%; height: 100%; object-fit: cover; }
.person-photo.is-placeholder { color: var(--blue); font-size: 0.78rem; text-align: center; padding: 10px; font-weight: 600; }
.person .p-name { font-weight: 700; color: var(--navy); font-family: var(--font-head); font-size: 1.02rem; }
.person .p-role { font-size: 0.88rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------------
   SIDEBAR MODULE (also used standalone as WP widget)
   --------------------------------------------------------------------- */
.sidebar { display: flex; flex-direction: column; gap: 22px; }
.sidebar-module {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.sidebar-module h3 {
  font-size: 1.05rem; margin-bottom: 0.7em; padding-bottom: 0.5em;
  border-bottom: 2px solid var(--red);
}
.sidebar-module p { font-size: 0.92rem; margin-bottom: 0.9em; }

.team-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.team-photos .tp {
  aspect-ratio: 1/1; border-radius: var(--radius); overflow: hidden;
  background: var(--navy-pale);
}
.team-photos .tp img { width: 100%; height: 100%; object-fit: cover; }

.stat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.stat-list li { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.stat-num {
  font-family: var(--font-head); font-weight: 900; font-size: 1.9rem; color: var(--red-dark);
  min-width: 3ch;
}
.stat-label { font-size: 0.86rem; color: var(--ink-soft); line-height: 1.3; }

.sidebar-module .social-row { color: var(--navy); }
.sidebar-module .social-row a { color: var(--navy); }
.sidebar-module .social-row a:hover { color: var(--red-dark); }

.sidebar-module.donate { background: var(--navy); color: var(--white); border-color: var(--navy); }
.sidebar-module.donate h3 { color: var(--white); }
.sidebar-module.donate p { color: #C9D2E6; }

/* ---------------------------------------------------------------------
   STATS BAND (full width, home page)
   --------------------------------------------------------------------- */
.stats-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: left; }
@media (max-width: 760px) { .stats-band { grid-template-columns: 1fr 1fr; } }
.stats-band .stat-num { font-size: 2.6rem; display: block; }
.stats-band .stat-label { font-size: 0.92rem; }

/* ---------------------------------------------------------------------
   NEWSLETTER / CTA BAND
   --------------------------------------------------------------------- */
.cta-band { display: flex; justify-content: space-between; align-items: center; gap: 30px; flex-wrap: wrap; }
.cta-band h2 { margin-bottom: 0.2em; }
.cta-band p { margin-bottom: 0; }
.subscribe-form { display: flex; gap: 10px; flex-wrap: wrap; }
.subscribe-form input[type="email"] {
  padding: 0.85em 1em; border-radius: var(--radius); border: 1px solid var(--line-dark);
  font-family: var(--font-body); font-size: 0.96rem; min-width: 260px;
}

/* ---------------------------------------------------------------------
   FORMS (contact page)
   --------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 0.9rem; color: var(--navy); }
.field input, .field select, .field textarea {
  padding: 0.75em 0.9em; border: 1px solid var(--line-dark); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 0.98rem; background: var(--white); color: var(--ink);
}
.field textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 0.85rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------------
   FOOTER
   --------------------------------------------------------------------- */
.site-footer { background: var(--navy); color: #C9D2E6; padding-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; padding-bottom: 40px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: var(--white); font-family: var(--font-body); font-size: 0.9rem; letter-spacing: 0.02em; margin-bottom: 0.9em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.55em; }
.site-footer a { color: #C9D2E6; text-decoration: none; font-size: 0.94rem; }
.site-footer a:hover { color: var(--white); }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer-brand .name { font-family: var(--font-head); font-weight: 700; color: var(--white); font-size: 1.1rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 18px 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 0.82rem; color: #93A0BF;
}

/* ---------------------------------------------------------------------
   MISC UTILITIES
   --------------------------------------------------------------------- */
.tag {
  display: inline-block; font-size: 0.78rem; font-weight: 700; color: var(--blue);
  background: var(--navy-pale); padding: 0.25em 0.7em; border-radius: 20px; margin: 0 6px 6px 0;
}
.divider-flag {
  height: 5px; width: 100%;
  background: linear-gradient(90deg, var(--red) 0 33%, var(--white) 33% 66%, var(--navy) 66% 100%);
  border: 1px solid var(--line);
  margin: 0 0 2.5em;
}
.callout {
  border-left: 4px solid var(--red);
  background: var(--white);
  padding: 18px 22px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.6em 0;
}
.callout p:last-child { margin-bottom: 0; }

header.page-header {
  display: none;
}