/*
 * EmpowerED Africa — Brand Style for donate.empowered-africa.org
 *
 * Goal: make GiveWP forms look like a polished extension of the
 * Astro main site (empowered-africa.org), not the bare twentytwentyfive
 * default theme. Brand tokens mirror tailwind.config.mjs.
 */

/* ---------------------------------------------------------------- Brand tokens */
:root {
  --ea-coral:   #E85C3A;
  --ea-coral-600: #D04421;
  --ea-coral-700: #A1351A;
  --ea-forest:  #1B4B3A;
  --ea-forest-600: #1B4B3A;
  --ea-forest-700: #153B2E;
  --ea-cream:   #F8F5F0;
  --ea-charcoal: #2A2A2A;
  --ea-ochre:   #D4A574;
}

/* ---------------------------------------------------------------- Self-hosted fonts (replaces GiveWP Google Fonts CDN, DSGVO) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/Inter-Variable.woff2') format('woff2-variations'),
       url('fonts/Inter-Variable.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/Fraunces-Variable.woff2') format('woff2-variations'),
       url('fonts/Fraunces-Variable.woff2') format('woff2');
}

/* ---------------------------------------------------------------- Hide twentytwentyfive classic-template chrome */
/* GiveWP form pages fall back to the classic single-give_forms.php template,
   which renders a kubrick-style #header/#footer with the WP site title and
   "powered by WordPress". We hide both and inject our own. */
body.single-give_forms #header,
body.single-give_forms #footer,
body.single-give_forms > #page > hr,
body.single-give_forms #page > hr {
  display: none !important;
}

/* Some twentytwentyfive deployments render bare <hr/> separators between
   sections. They never look intentional in our design. */
body.single-give_forms hr:not(.give-hr-keep) {
  display: none !important;
}

/* ---------------------------------------------------------------- Page chrome */
body.single-give_forms {
  background-color: var(--ea-cream) !important;
  color: var(--ea-charcoal) !important;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
  margin: 0;
  padding: 0;
}

body.single-give_forms #page {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Constrain the GiveWP embed div even though the classic template doesn't
   wrap it in a #content container — without this it sits flush against
   the viewport edge on desktop and looks unanchored. min-height keeps
   the area reserved while the form's React app is still hydrating, so
   the page doesn't visibly collapse before the form paints. */
body.single-give_forms .root-data-givewp-embed {
  display: block;
  max-width: 720px;
  margin: 24px auto 0;
  padding: 0 24px;
  min-height: 480px;
}

/* ---------------------------------------------------------------- EA branded header (injected via wp_body_open) */
.ea-brand-header {
  background-color: var(--ea-cream);
  border-bottom: 1px solid rgba(27, 75, 58, 0.08);
  padding: 18px 24px;
}
.ea-brand-header__inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ea-brand-header__logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ea-forest);
}
.ea-brand-header__mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}
.ea-brand-header__wordmark {
  font-family: 'Fraunces', 'Iowan Old Style', 'Hoefler Text', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ea-forest);
}
.ea-brand-header__wordmark .ea-ed { color: var(--ea-coral); }
.ea-brand-header__lang {
  display: inline-flex;
  gap: 4px;
  font-size: 13px;
  color: rgba(42, 42, 42, 0.7);
}
.ea-brand-header__lang a,
.ea-brand-header__lang span {
  padding: 4px 10px;
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}
.ea-brand-header__lang a:hover {
  background-color: rgba(27, 75, 58, 0.06);
  color: var(--ea-forest);
}
.ea-brand-header__lang .is-active {
  background-color: var(--ea-forest);
  color: var(--ea-cream);
  font-weight: 600;
}

/* "Back to empowered-africa.org" link below the header — was inline-styled
   from PHP, moved here so the CSS file is the single source of truth. */
.ea-brand-header__back {
  max-width: 720px;
  margin: 8px auto 0;
  padding: 0 24px;
  font-size: 13px;
}
.ea-brand-header__back a {
  color: rgba(42, 42, 42, 0.6);
  text-decoration: none;
  transition: color 0.15s ease;
}
.ea-brand-header__back a:hover {
  color: var(--ea-forest);
}

/* ---------------------------------------------------------------- GiveWP form: brand color overrides */
/* The form embed div ships inline `style="--givewp-primary-color: #0b72d9;
   --givewp-secondary-color: #27ae60;"` — overriding requires !important. */
.root-data-givewp-embed,
[data-givewp-embed-id] {
  --givewp-primary-color: var(--ea-coral) !important;
  --givewp-secondary-color: var(--ea-forest) !important;
  --givewp-primary-color-hover: var(--ea-coral-600) !important;
  --givewp-primary-color-contrast: var(--ea-cream) !important;
}

/* Form container: cream surface, forest-tinted shadow matching Astro's --shadow-card */
.root-data-givewp-embed {
  background: #ffffff;
  border-radius: 16px;
  box-shadow:
    0 2px 10px -2px rgba(27, 75, 58, 0.08),
    0 8px 24px -4px rgba(27, 75, 58, 0.06);
  overflow: hidden;
}

/* GiveWP buttons (Donate now CTA + tier buttons in selected state) */
.root-data-givewp-embed button[type="submit"],
.root-data-givewp-embed .givewp-design-system__button--primary,
.root-data-givewp-embed [class*="primaryButton"],
.root-data-givewp-embed [class*="DonateButton"] {
  background-color: var(--ea-coral) !important;
  border-color: var(--ea-coral) !important;
  color: #ffffff !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.root-data-givewp-embed button[type="submit"]:hover,
.root-data-givewp-embed .givewp-design-system__button--primary:hover,
.root-data-givewp-embed [class*="primaryButton"]:hover,
.root-data-givewp-embed [class*="DonateButton"]:hover {
  background-color: var(--ea-coral-600) !important;
  border-color: var(--ea-coral-600) !important;
  transform: translateY(-1px);
}

/* Tier amount buttons — outline style, coral when selected */
.root-data-givewp-embed [class*="amountButton"][aria-pressed="true"],
.root-data-givewp-embed [class*="LevelButton"][aria-pressed="true"],
.root-data-givewp-embed [class*="amountButton"].is-selected,
.root-data-givewp-embed [class*="LevelButton"].is-selected {
  background-color: var(--ea-coral) !important;
  border-color: var(--ea-coral) !important;
  color: #ffffff !important;
}
.root-data-givewp-embed [class*="amountButton"]:not([aria-pressed="true"]):hover,
.root-data-givewp-embed [class*="LevelButton"]:not([aria-pressed="true"]):hover {
  border-color: var(--ea-coral-600) !important;
  color: var(--ea-coral-600) !important;
}

/* Form headings inside the embed */
.root-data-givewp-embed h2,
.root-data-givewp-embed h3 {
  font-family: 'Fraunces', 'Iowan Old Style', 'Hoefler Text', Georgia, serif !important;
  color: var(--ea-forest) !important;
  letter-spacing: -0.01em;
}

/* Required-field asterisk to coral — was a plain red */
.root-data-givewp-embed [class*="required"],
.root-data-givewp-embed .give-required {
  color: var(--ea-coral) !important;
}

/* ---------------------------------------------------------------- EA branded footer (injected via wp_footer) */
.ea-brand-footer {
  background-color: var(--ea-forest);
  color: rgba(248, 245, 240, 0.85);
  padding: 28px 24px 32px;
  margin-top: 48px;
  font-size: 13px;
  line-height: 1.55;
}
.ea-brand-footer__inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ea-brand-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}
.ea-brand-footer__nav a {
  color: var(--ea-cream);
  text-decoration: none;
  border-bottom: 1px solid rgba(248, 245, 240, 0.25);
  transition: border-color 0.15s ease;
}
.ea-brand-footer__nav a:hover {
  border-color: var(--ea-cream);
}
.ea-brand-footer__legal {
  color: rgba(248, 245, 240, 0.65);
  font-size: 12px;
}
.ea-brand-footer__legal strong {
  color: var(--ea-cream);
  font-weight: 600;
}

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 540px) {
  .ea-brand-header__inner {
    flex-wrap: wrap;
    gap: 12px;
  }
  .ea-brand-header__wordmark {
    font-size: 16px;
  }
  .ea-form-intro h1 {
    font-size: 1.6rem;
  }
}
