
/* ============================================================
   CENTER FOR COMPETITIVE DEMOCRACY -- Design System
   WordPress theme stylesheet
   WCAG 2.1 AA compliant | PageSpeed optimized
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette -- all pairs tested for WCAG AA contrast */
  --navy:       #0f1d35;
  --navy-light: #1a2d4a;
  --navy-mid:   #2a3f5f;
  --white:      #ffffff;
  --offwhite:   #f7f7f4;
  --warmgray:   #e9e7e2;
  --midgray:    #6b6b66;  /* 4.97:1 on white -- passes AA */
  --darkgray:   #4a4a46;  /* 8.90:1 on white */
  --red:        #c5283d;  /* 5.61:1 on white */
  --red-dark:   #a01e30;
  --red-light:  #e8d3d6;
  --red-bright: #ff8a97;  /* 6.22:1 on navy -- for labels on dark bg */

  /* Type Scale (modular -- 1.25 ratio) */
  --text-xs:    0.8rem;
  --text-sm:    0.9rem;
  --text-base:  1rem;
  --text-md:    1.125rem;
  --text-lg:    1.25rem;
  --text-xl:    1.563rem;
  --text-2xl:   1.953rem;
  --text-3xl:   2.441rem;
  --text-4xl:   3.052rem;
  --text-5xl:   3.815rem;
  --text-6xl:   4.768rem;

  /* Spacing */
  --space-xs:   0.5rem;
  --space-sm:   1rem;
  --space-md:   1.5rem;
  --space-lg:   2.5rem;
  --space-xl:   4rem;
  --space-2xl:  6rem;
  --space-3xl:  10rem;

  /* Layout */
  --max-width:  1200px;
  --content-width: 720px;

  /* Focus ring */
  --focus-ring: 0 0 0 3px var(--red), 0 0 0 5px var(--white);
  --focus-ring-dark: 0 0 0 3px var(--red-bright), 0 0 0 5px var(--navy);

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--navy);
  background: var(--white);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }


/* --- Accessibility Utilities --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 200;
  transition: top 0.15s var(--ease);
}

.skip-link:focus {
  top: 0;
  outline: none;
}


/* --- Focus Styles --- */
*:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

.section--navy *:focus-visible,
.site-header *:focus-visible,
.site-footer *:focus-visible,
.hero *:focus-visible,
.article-header *:focus-visible {
  outline-color: var(--red-bright);
}

/* Remove default outline when focus-visible handles it */
*:focus:not(:focus-visible) {
  outline: none;
}


/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-6xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl);  }

p { max-width: 65ch; }

.label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* On dark backgrounds, use bright variant for contrast */
.label--on-dark {
  color: var(--red-bright);
}

.lead {
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--darkgray);
}


/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container--narrow {
  max-width: var(--content-width);
}

.section {
  padding: var(--space-2xl) 0;
}

.section--navy {
  background: var(--navy);
  color: var(--white);
}

.section--offwhite {
  background: var(--offwhite);
}

.section--red {
  background: var(--red);
  color: var(--white);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }


/* --- Header / Navigation --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-logo__img {
  height: 36px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.site-nav__link {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-sm);
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s var(--ease);
  position: relative;
  padding: 0.25rem 0;
}

.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  color: var(--white);
}

.site-nav__link[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--red-bright);
}

.site-nav__cta {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--white);
  background: var(--red);
  border: none;
  padding: 0.6rem 1.4rem;
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.2s var(--ease);
  cursor: pointer;
}

.site-nav__cta:hover {
  background: var(--red-dark);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  margin: 5px 0;
}


/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  text-decoration: none;
  border: none;
  cursor: pointer;
  padding: 0.9rem 2rem;
  border-radius: 2px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.btn--primary {
  background: var(--red);
  color: var(--white);
}
.btn--primary:hover { background: var(--red-dark); }

.btn--secondary {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}
.btn--secondary:hover {
  background: var(--navy);
  color: var(--white);
}

.btn--white {
  background: var(--white);
  color: var(--navy);
}
.btn--white:hover {
  background: var(--offwhite);
}

.btn--ghost {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.4);
}
.btn--ghost:hover {
  border-color: var(--white);
  background: rgba(255,255,255,0.08);
}

.btn--large {
  padding: 1.1rem 2.8rem;
  font-size: var(--text-base);
}

.btn--arrow::after {
  content: '\2192';
  transition: transform 0.2s var(--ease);
}
.btn--arrow:hover::after {
  transform: translateX(4px);
}


/* --- Cards --- */
.card {
  background: var(--white);
  border: 1px solid var(--warmgray);
  border-radius: 2px;
  padding: var(--space-lg);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.card:hover {
  border-color: var(--navy);
  box-shadow: 0 4px 20px rgba(15,29,53,0.06);
}

.card--dark {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.12);
}

.card--dark:hover {
  border-color: rgba(255,255,255,0.3);
}

.card__label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: var(--space-sm);
}

.card--dark .card__label {
  color: var(--red-bright);
}

.card__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  line-height: 1.25;
}

.card--dark .card__title {
  color: var(--white);
}

.card__text {
  color: var(--darkgray);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.card--dark .card__text {
  color: rgba(255,255,255,0.75);
}

.card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: var(--space-md);
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--red);
  text-decoration: none;
}

.card--dark .card__link {
  color: var(--red-bright);
}

.card__link:hover { text-decoration: underline; }


/* --- Forms (prototype classes) --- */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--navy);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: var(--text-base);
  padding: 0.8rem 1rem;
  border: 2px solid var(--warmgray);
  border-radius: 2px;
  background: var(--white);
  color: var(--navy);
  transition: border-color 0.2s var(--ease);
}

.form-input:focus-visible,
.form-textarea:focus-visible,
.form-select:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 1px;
  border-color: var(--navy);
}

.form-input:focus:not(:focus-visible),
.form-textarea:focus:not(:focus-visible),
.form-select:focus:not(:focus-visible) {
  outline: none;
  border-color: var(--navy);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--midgray);
  margin-top: 0.3rem;
}


/* --- Dividers & Decorations --- */
.rule {
  border: none;
  height: 2px;
  background: var(--warmgray);
}

.accent-bar {
  width: 48px;
  height: 3px;
  background: var(--red);
  margin-bottom: var(--space-md);
}


/* --- Footer --- */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.75);
  padding: var(--space-2xl) 0 var(--space-lg);
}

.site-footer a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.site-footer a:hover {
  color: var(--white);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--white);
  margin-bottom: var(--space-sm);
}

.footer-description {
  font-size: var(--text-sm);
  line-height: 1.6;
  max-width: 320px;
}

.footer-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: var(--space-sm);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: var(--text-sm);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
}

.footer-legal {
  display: flex;
  gap: var(--space-md);
}


/* --- Hero Section --- */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  background: var(--navy);
  color: var(--white);
  padding-top: 72px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60%;
  height: 140%;
  background: linear-gradient(135deg, transparent 0%, rgba(197,40,61,0.06) 100%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero__label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red-bright);
  margin-bottom: var(--space-md);
}

.hero__title {
  margin-bottom: var(--space-md);
}

.hero__subtitle {
  font-size: var(--text-lg);
  line-height: 1.6;
  color: rgba(255,255,255,0.75);
  max-width: 580px;
  margin-bottom: var(--space-lg);
}

.hero__actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}


/* --- Stats Bar --- */
.stats-bar {
  background: var(--offwhite);
  border-bottom: 1px solid var(--warmgray);
}

.stats-bar__inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: var(--max-width);
  margin: 0 auto;
}

.stat {
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  border-right: 1px solid var(--warmgray);
}

.stat:last-child { border-right: none; }

.stat__number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.stat__label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--midgray);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}


/* --- Donate Page --- */
.donate-tiers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.donate-tier {
  padding: var(--space-md);
  border: 2px solid var(--warmgray);
  border-radius: 2px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  font-family: 'Space Grotesk', sans-serif;
  background: var(--white);
}

.donate-tier:hover,
.donate-tier[aria-pressed="true"] {
  border-color: var(--red);
  background: var(--red-light);
}

.donate-tier__amount {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--navy);
}

.donate-tier__desc {
  font-size: var(--text-xs);
  color: var(--midgray);
  margin-top: 0.3rem;
}

.donate-frequency {
  display: flex;
  border: 2px solid var(--warmgray);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.donate-frequency__option {
  flex: 1;
  padding: 0.8rem;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  border: none;
  background: var(--white);
  color: var(--darkgray);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.donate-frequency__option:not(:last-child) {
  border-right: 2px solid var(--warmgray);
}

.donate-frequency__option[aria-pressed="true"] {
  background: var(--navy);
  color: var(--white);
}

.impact-item {
  display: flex;
  gap: 1.25rem;
  align-items: start;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--warmgray);
}

.impact-item:last-child { border-bottom: none; }

.impact-amount {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
  min-width: 72px;
}

.impact-desc {
  color: var(--darkgray);
  font-size: var(--text-sm);
  line-height: 1.5;
}


/* --- Article Page --- */
.article-header {
  padding: var(--space-3xl) 0 var(--space-xl);
  padding-top: calc(72px + var(--space-3xl));
  background: var(--navy);
  color: var(--white);
}

.article-meta {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.75);
  margin-bottom: var(--space-md);
}

.article-meta__tag {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red-bright);
}

.article-body {
  padding: var(--space-xl) 0 var(--space-2xl);
}

.article-body .container--narrow p {
  font-size: var(--text-md);
  margin-bottom: var(--space-md);
  color: var(--darkgray);
}

.article-body .container--narrow h2 {
  font-size: var(--text-2xl);
  margin: var(--space-xl) 0 var(--space-md);
  color: var(--navy);
}

.article-body .container--narrow blockquote {
  border-left: 3px solid var(--red);
  padding-left: var(--space-md);
  margin: var(--space-lg) 0;
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--navy);
}


/* --- Action Cards --- */
.action-card {
  background: var(--white);
  border: 1px solid var(--warmgray);
  border-radius: 2px;
  overflow: hidden;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.action-card:hover {
  border-color: var(--navy);
  box-shadow: 0 4px 24px rgba(15,29,53,0.08);
}

.action-card__header {
  padding: var(--space-md) var(--space-lg);
  background: var(--offwhite);
  border-bottom: 1px solid var(--warmgray);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.action-card__icon {
  width: 40px;
  height: 40px;
  background: var(--navy);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.action-card__header-text .label {
  color: var(--red);
  margin-bottom: 0.15rem;
}

.action-card__body {
  padding: var(--space-lg);
}

.action-card__progress {
  margin-top: var(--space-md);
}

.progress-bar {
  height: 6px;
  background: var(--warmgray);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.progress-bar__fill {
  height: 100%;
  background: var(--red);
  border-radius: 3px;
}

.progress-text {
  font-size: var(--text-xs);
  color: var(--midgray);
}


/* --- CTA Banner --- */
.cta-banner {
  background: var(--red);
  color: var(--white);
  text-align: center;
  padding: var(--space-xl) 0;
}

.cta-banner h2 {
  margin-bottom: var(--space-sm);
}

.cta-banner p {
  margin: 0 auto var(--space-md);
  color: rgba(255,255,255,0.9);
}


/* --- Gravity Forms Integration ---
   Maps GF markup to the CCD design system.
   Requires GF "No Styles" or "Orbital" output setting. */

.gform_wrapper.gravity-theme {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.gform_wrapper.gravity-theme .gfield {
  margin-bottom: var(--space-md);
}

.gform_wrapper.gravity-theme .gfield_label,
.gform_wrapper.gravity-theme .gfield_consent_label {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--navy);
}

.gform_wrapper.gravity-theme input[type="text"],
.gform_wrapper.gravity-theme input[type="email"],
.gform_wrapper.gravity-theme input[type="tel"],
.gform_wrapper.gravity-theme input[type="url"],
.gform_wrapper.gravity-theme input[type="number"],
.gform_wrapper.gravity-theme input[type="password"],
.gform_wrapper.gravity-theme textarea,
.gform_wrapper.gravity-theme select {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: var(--text-base);
  padding: 0.8rem 1rem;
  border: 2px solid var(--warmgray);
  border-radius: 2px;
  background: var(--white);
  color: var(--navy);
  transition: border-color 0.2s var(--ease);
}

.gform_wrapper.gravity-theme input:focus-visible,
.gform_wrapper.gravity-theme textarea:focus-visible,
.gform_wrapper.gravity-theme select:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 1px;
  border-color: var(--navy);
}

.gform_wrapper.gravity-theme .gform_button,
.gform_wrapper.gravity-theme .gform_next_button,
.gform_wrapper.gravity-theme .gform_previous_button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  text-decoration: none;
  border: none;
  cursor: pointer;
  padding: 0.9rem 2rem;
  border-radius: 2px;
  background: var(--red);
  color: var(--white);
  transition: background 0.2s var(--ease);
}

.gform_wrapper.gravity-theme .gform_button:hover,
.gform_wrapper.gravity-theme .gform_next_button:hover {
  background: var(--red-dark);
}

.gform_wrapper.gravity-theme .gform_previous_button {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}

.gform_wrapper.gravity-theme .gform_previous_button:hover {
  background: var(--navy);
  color: var(--white);
}

.gform_wrapper.gravity-theme .gfield_description,
.gform_wrapper.gravity-theme .instruction {
  font-size: var(--text-xs);
  color: var(--midgray);
  margin-top: 0.3rem;
}

.gform_wrapper.gravity-theme .gfield_error input,
.gform_wrapper.gravity-theme .gfield_error textarea,
.gform_wrapper.gravity-theme .gfield_error select {
  border-color: var(--red);
}

.gform_wrapper.gravity-theme .gfield_error .gfield_label {
  color: var(--red);
}

.gform_wrapper.gravity-theme .validation_message {
  font-size: var(--text-xs);
  color: var(--red);
  margin-top: 0.3rem;
  font-weight: 500;
}

.gform_wrapper.gravity-theme .gform_validation_errors {
  background: var(--red-light);
  border: 2px solid var(--red);
  border-radius: 2px;
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  color: var(--red-dark);
}

.gform_wrapper.gravity-theme .gform_confirmation_message {
  background: var(--offwhite);
  border: 2px solid var(--warmgray);
  border-radius: 2px;
  padding: var(--space-lg);
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-lg);
  color: var(--navy);
  text-align: center;
}

/* GF on dark backgrounds (e.g. navy sections) */
.section--navy .gform_wrapper.gravity-theme .gfield_label {
  color: var(--white);
}

.section--navy .gform_wrapper.gravity-theme input,
.section--navy .gform_wrapper.gravity-theme textarea,
.section--navy .gform_wrapper.gravity-theme select {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  color: var(--white);
}

.section--navy .gform_wrapper.gravity-theme input::placeholder,
.section--navy .gform_wrapper.gravity-theme textarea::placeholder {
  color: rgba(255,255,255,0.4);
}

/* GF Checkbox & Radio styling */
.gform_wrapper.gravity-theme .gchoice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.gform_wrapper.gravity-theme .gfield_checkbox input[type="checkbox"],
.gform_wrapper.gravity-theme .gfield_radio input[type="radio"] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--red);
}

/* GF multi-column layout support */
.gform_wrapper.gravity-theme .gfield--width-half {
  width: calc(50% - 0.5rem);
}

/* GF footer/submit row */
.gform_wrapper.gravity-theme .gform_footer {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
}

/* GF progress bar (multi-step forms) */
.gform_wrapper.gravity-theme .gf_progressbar {
  height: 6px;
  background: var(--warmgray);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.gform_wrapper.gravity-theme .gf_progressbar_percentage {
  height: 100%;
  background: var(--red);
  border-radius: 3px;
  transition: width 0.3s var(--ease);
}


/* --- WordPress Core Alignment Classes --- */
.alignwide {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(-50vw + 50%);
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.alignleft {
  float: left;
  margin-right: var(--space-md);
  margin-bottom: var(--space-sm);
}

.alignright {
  float: right;
  margin-left: var(--space-md);
  margin-bottom: var(--space-sm);
}

/* WordPress image captions */
.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  font-size: var(--text-xs);
  color: var(--midgray);
  margin-top: 0.4rem;
  text-align: center;
}

/* WordPress navigation (post nav) */
.post-navigation {
  display: flex;
  justify-content: space-between;
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--warmgray);
  margin-top: var(--space-xl);
}

/* Screen reader text - WP standard */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Admin bar offset */
body.admin-bar .site-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}


/* --- Responsive Breakpoints --- */
@media (max-width: 900px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }

  .grid--2, .grid--3, .grid--4 {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: var(--space-md) var(--space-lg);
    gap: var(--space-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 999;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav__link,
  .site-nav.is-open .site-nav__cta {
    width: 100%;
    text-align: left;
  }

  .nav-toggle {
    display: block;
  }

  body.nav-open {
    overflow: hidden;
  }

  /* Hide the mobile-nav overlay (JS uses .site-nav.is-open instead) */
  .mobile-nav {
    display: none;
  }

  /* Hamburger to X animation */
  .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .nav-toggle span {
    transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
  }

  .section {
    padding: var(--space-xl) 0;
  }

  .stats-bar__inner {
    grid-template-columns: repeat(2, 1fr);
  }

  .donate-tiers {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }

  .stats-bar__inner {
    grid-template-columns: 1fr;
  }

  .donate-tiers {
    grid-template-columns: 1fr 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: calc(72px + var(--space-xl));
    padding-bottom: var(--space-xl);
  }
}


/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* --- High Contrast Mode --- */
@media (forced-colors: active) {
  .btn { border: 2px solid ButtonText; }
  .card { border: 1px solid CanvasText; }
  .accent-bar { background: Highlight; }
  .progress-bar__fill { background: Highlight; }
}


/* ============================================================
   GENERATEPRESS RESETS
   Strip GP's layout chrome so BB content runs edge to edge.
   ============================================================ */

/* Remove GP's container max-width and padding */
.site.grid-container.container,
.grid-container {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Remove GP's content area width constraint */
#primary,
.content-area,
.site-content,
.site-main {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Override GP's one-container padding and background */
.one-container .site-content,
.one-container .inside-article,
.one-container .site-main {
  padding: 0 !important;
  margin: 0 !important;
}

/* Override GP's exact selector that sets white background on .container */
.separate-containers .inside-article,
.separate-containers .comments-area,
.separate-containers .page-header,
.one-container .container,
.separate-containers .paging-navigation,
.inside-page-header {
  background-color: transparent !important;
}

/* Hide sidebar completely */
.sidebar,
.is-right-sidebar,
.is-left-sidebar,
#right-sidebar,
#left-sidebar {
  display: none;
}

/* Remove GP's article chrome (padding, background, borders) */
.inside-article {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Remove GP's separate-container styling */
.separate-containers .inside-article,
.separate-containers .comments-area,
.separate-containers .page-header,
.separate-containers .paging-navigation {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  margin-bottom: 0 !important;
}

/* Hide GP's entry-header (page title) on BB pages */
.fl-builder .entry-header {
  display: none;
}

/* Prevent header/footer from collapsing on empty BB pages */
.fl-builder .fl-builder-content-primary {
  min-height: 50vh;
}

/* Push all BB page content below the fixed header.
   The hero section handles its own 72px padding internally,
   so this just ensures the page container starts below the header. */
.fl-builder .inside-article {
  padding-top: 72px !important;
}

/* Remove GP's post content padding */
.entry-content {
  padding: 0;
  margin: 0;
}

/* Strip GP's styling from footer wrapper (Themer content is inside it) */
.gp-footer-hidden,
.gp-header-hidden {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
}

/* GP's site-footer wrapper should not add its own styling */
.site-footer,
div.site-footer {
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
}

/* Remove GP's default site-info footer bar */
.site-info {
  display: none;
}

/* Make sure BB rows inside GP content stretch full width */
.entry-content .fl-builder-content {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
}

/* GP wraps BB content in .fl-post which may have margins */
.fl-post {
  margin: 0 !important;
  padding: 0 !important;
}

/* BB layout cache sets padding/margins on wrapper elements.
   Override them for full-width CCD content. */
.fl-row-content-wrap {
  padding: 0 !important;
}

.fl-builder-content .fl-module-content {
  margin: 0 !important;
}

/* GP's default header is replaced by Themer -- no hide rule needed
   since Themer takes over when a header layout exists */

/* GP skip-link styling conflicts with ours */
a.screen-reader-text.skip-link {
  clip: rect(0, 0, 0, 0) !important;
  position: absolute !important;
}

/* Remove GP background color on body */
body {
  background-color: var(--white) !important;
}


/* ============================================================
   NON-BB PAGE STYLES
   Styles for regular WP pages (About, etc.) that don't use
   Beaver Builder. Uses body.page:not(.fl-builder) to ensure
   BB-built pages like Home are never affected.
   ============================================================ */

/* Navy header with page title */
body.page:not(.fl-builder) .entry-header {
  background: var(--navy);
  color: var(--white);
  padding: calc(72px + var(--space-xl)) var(--space-md) var(--space-xl);
  margin: 0;
  display: block;
}

body.page:not(.fl-builder) .entry-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--white);
  max-width: var(--content-width);
  margin: 0 auto;
  line-height: 1.15;
}

/* Content area -- readable width with CCD typography */
body.page:not(.fl-builder) .entry-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md) var(--space-2xl);
}

body.page:not(.fl-builder) .entry-content p {
  font-size: var(--text-md);
  margin-bottom: var(--space-md);
  color: var(--darkgray);
  line-height: 1.7;
}

body.page:not(.fl-builder) .entry-content a {
  color: var(--red);
}

body.page:not(.fl-builder) .entry-content a:hover {
  color: var(--red-dark);
}

body.page:not(.fl-builder) .entry-content h1,
body.page:not(.fl-builder) .entry-content h2 {
  font-size: var(--text-2xl);
  margin: var(--space-xl) 0 var(--space-md);
  color: var(--navy);
}

body.page:not(.fl-builder) .entry-content h3 {
  font-size: var(--text-xl);
  margin: var(--space-lg) 0 var(--space-sm);
  color: var(--navy);
}

body.page:not(.fl-builder) .entry-content blockquote {
  border-left: 3px solid var(--red);
  padding-left: var(--space-md);
  margin: var(--space-lg) 0;
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--navy);
}

body.page:not(.fl-builder) .entry-content img {
  margin: var(--space-md) 0;
  border-radius: 2px;
}

/* Hide comments and footer meta on pages */
body.page .comments-area,
body.page footer.entry-meta,
body.page .post-navigation,
body.page #nav-below {
  display: none;
}


/* ============================================================
   BB POST GRID MODULE STYLES
   Styles BB's Post Grid module (fl-post-feed) to match the
   prototype's "Latest News" 3-column card layout.
   ============================================================ */

/* Post feed list as 3-column card grid */
.fl-post-feed ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

/* Each post as a card */
.fl-post-feed-post {
  background: var(--white);
  border: 1px solid var(--warmgray);
  border-radius: 2px;
  padding: var(--space-lg) !important;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  display: flex;
  flex-direction: column;
}

.fl-post-feed-post:hover {
  border-color: var(--navy);
  box-shadow: 0 4px 20px rgba(15,29,53,0.06);
}

/* Post title */
.fl-post-feed-post .fl-post-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-xl) !important;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 var(--space-sm);
}

.fl-post-feed-post .fl-post-title a {
  color: var(--navy);
  text-decoration: none;
}

.fl-post-feed-post .fl-post-title a:hover {
  color: var(--red);
}

/* Hide post meta (date, separator) */
.fl-post-feed-post .fl-post-meta {
  display: none;
}

/* Post excerpt */
.fl-post-feed-post .fl-post-excerpt {
  color: var(--darkgray);
  font-size: var(--text-sm);
  line-height: 1.6;
  flex-grow: 1;
}

.fl-post-feed-post .fl-post-excerpt p {
  margin: 0;
  max-width: none;
}

/* Read More link */
.fl-post-feed-post .fl-post-more-link {
  margin-top: var(--space-md);
}

.fl-post-feed-post .fl-post-more-link a {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--red);
  text-decoration: none;
}

.fl-post-feed-post .fl-post-more-link a:hover {
  text-decoration: underline;
}

/* Add arrow after Read More */
.fl-post-feed-post .fl-post-more-link a::after {
  content: ' \2192';
}

/* Responsive: 2 columns on tablet, 1 on mobile */
@media (max-width: 900px) {
  .fl-post-feed ul {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .fl-post-feed ul {
    grid-template-columns: 1fr;
  }
}


/* BB Post Grid pagination */
.fl-builder-pagination {
  padding: var(--space-xl) 0 var(--space-md);
  text-align: center;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.fl-builder-pagination ul.page-numbers {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
}

.fl-builder-pagination li {
  display: inline-block;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.fl-builder-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--navy);
  background: transparent;
  /*border: 2px solid var(--warmgray);
  border-radius: 2px; */
  text-decoration: none;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.fl-builder-pagination .page-numbers:hover {
  border-color: var(--navy);
  /* background: var(--offwhite); */
  text-decoration: none;
}

.fl-builder-pagination .page-numbers.current {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.fl-builder-pagination .page-numbers.dots {
  border: none;
  background: none;
  min-width: auto;
  padding: 0 0.25rem;
  color: var(--midgray);
}

.fl-builder-pagination .next,
.fl-builder-pagination .prev {
  font-size: var(--text-sm);
  color: var(--red);
  border-color: var(--warmgray);
}

.fl-builder-pagination .next:hover,
.fl-builder-pagination .prev:hover {
  /* color: var(--white); */
  background: var(--red);
  border-color: var(--red);
}


/* Active nav link underline in BB Themer header menu */
header.fl-builder-content[data-type="header"] .menu li.current-menu-item > a,
header.fl-builder-content[data-type="header"] .menu li.current_page_item > a,
header.fl-builder-content[data-type="header"] .menu li.current-menu-ancestor > a {
  position: relative;
  color: var(--white) !important;
}

header.fl-builder-content[data-type="header"] .menu li.current-menu-item > a::after,
header.fl-builder-content[data-type="header"] .menu li.current_page_item > a::after,
header.fl-builder-content[data-type="header"] .menu li.current-menu-ancestor > a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--red-bright);
}
