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

/* --- Reset & Base --- */

: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% !important;
  max-width: var(--max-width) !important;
  margin: 0 auto;
  padding: 0 var(--space-md);
  box-sizing: border-box;
}

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

.section {
  padding: var(--space-2xl) 0;
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  box-sizing: border-box;
}

.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);
  width: 100vw !important;
  max-width: 100vw !important;
  box-sizing: border-box;
}

.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);
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  box-sizing: border-box;
}

.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;
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  box-sizing: border-box;
}

.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);
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  box-sizing: border-box;
}

.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;
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  box-sizing: border-box;
}

.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; }
}


/* ============================================================
   BEAVER BUILDER ADJUSTMENTS
   Light touch -- only override what clashes with the design.
   Scoped to front-end only so the BB editor stays functional.
   ============================================================ */

/* Let CCD modules control their own spacing */
body:not(.fl-builder-edit) .fl-module-ccd-hero .fl-module-content,
body:not(.fl-builder-edit) .fl-module-ccd-stats-bar .fl-module-content,
body:not(.fl-builder-edit) .fl-module-ccd-mission .fl-module-content,
body:not(.fl-builder-edit) .fl-module-ccd-action-cta .fl-module-content,
body:not(.fl-builder-edit) .fl-module-ccd-cards-grid .fl-module-content,
body:not(.fl-builder-edit) .fl-module-ccd-cta-banner .fl-module-content,
body:not(.fl-builder-edit) .fl-module-ccd-action-card .fl-module-content,
body:not(.fl-builder-edit) .fl-module-ccd-newsletter .fl-module-content,
body:not(.fl-builder-edit) .fl-module-ccd-donate-form .fl-module-content,
body:not(.fl-builder-edit) .fl-module-ccd-impact-sidebar .fl-module-content {
  margin: 0;
}

/* Heading styles within BB rows */
.fl-row h1, .fl-row h2, .fl-row h3,
.fl-row h4, .fl-row h5, .fl-row h6 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* --- Themer header/footer full-width resets ---
   BB wraps shortcode output in row > col-group > col > module layers.
   Strip all padding/margin/max-width so .site-header and .site-footer
   backgrounds extend edge to edge. */
.fl-theme-builder-header .fl-row-content-wrap,
.fl-theme-builder-footer .fl-row-content-wrap,
.fl-theme-builder-header .fl-row-content,
.fl-theme-builder-footer .fl-row-content,
.fl-theme-builder-header .fl-col-content,
.fl-theme-builder-footer .fl-col-content,
.fl-theme-builder-header .fl-module-content,
.fl-theme-builder-footer .fl-module-content {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

.fl-theme-builder-header .fl-row,
.fl-theme-builder-footer .fl-row {
  max-width: 100% !important;
}

.fl-theme-builder-header .fl-col,
.fl-theme-builder-footer .fl-col {
  padding: 0 !important;
}

/* Ensure .fl-page doesn't constrain width */
.fl-page {
  max-width: 100% !important;
  width: 100% !important;
}

/* ---- FULL-WIDTH RESET ----
   BB Theme wraps everything in nested containers, rows, columns.
   When BB Builder is active, nuke ALL width constraints so
   full-width sections (hero, CTA, footer, etc.) can stretch. */

/* The main content wrapper */
.fl-page,
.fl-page-content,
.fl-content-full,
.fl-content-full.container,
.fl-content-full > .row,
.fl-content-full .fl-content,
.fl-content-full .fl-post,
.fl-content-full .fl-post-content {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* BB Builder rows */
.fl-row,
.fl-row-content-wrap,
.fl-row-full-width .fl-row-content {
  max-width: 100% !important;
  width: 100% !important;
}

.fl-row-content-wrap {
  padding: 0 !important;
}

/* BB columns inside full-width rows */
.fl-row-full-width .fl-col-group,
.fl-row-full-width .fl-col,
.fl-row-full-width .fl-col-content,
.fl-row-full-width .fl-module-content {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Fixed-width rows still get our max-width for their inner content */
.fl-row-fixed-width .fl-row-content {
  max-width: var(--max-width) !important;
  margin: 0 auto !important;
  padding: 0 var(--space-md) !important;
}
