/* ============================================================
   Bootstrap Nonprofit Theme — Prototype CSS
   ------------------------------------------------------------
   Styling hooks live in :root as Bootstrap 5.3 CSS custom
   properties (--bs-*). Your lead dev can override these in
   a single stylesheet or via SCSS _variables.scss later.
   ============================================================ */

:root {
  /* Brand — override --bs-primary to rebrand the whole theme */
  --bs-primary: #0d6efd;
  --bs-primary-rgb: 13, 110, 253;

  /* Radius — Bootstrap exposes these natively */
  --bs-border-radius: .375rem;
  --bs-border-radius-sm: .25rem;
  --bs-border-radius-lg: .5rem;
  --bs-border-radius-xl: 1rem;

  /* Body / headings font stacks — safe system defaults */
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-heading-font-family: var(--bs-body-font-family);

  /* Density (spacing multiplier applied to .nonprofit-section) */
  --theme-section-y: 4rem;
}

/* Density variants (toggled via data-density on <html>) */
html[data-density="compact"] { --theme-section-y: 2.5rem; }
html[data-density="cozy"]    { --theme-section-y: 4rem; }
html[data-density="airy"]    { --theme-section-y: 6.5rem; }

body {
  font-family: var(--bs-body-font-family);
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--bs-heading-font-family);
}

/* ---------- Skip link (WCAG 2.4.1) ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: #000;
  color: #fff;
  padding: .75rem 1rem;
  z-index: 10000;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid var(--bs-primary);
  outline-offset: 2px;
}

/* ---------- Focus visibility (WCAG 2.4.7) ---------- */
:focus-visible {
  outline: 3px solid var(--bs-primary);
  outline-offset: 2px;
}
.btn:focus-visible {
  box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .35);
}

/* ---------- Utility bar above main nav ---------- */
.utility-bar {
  background: #212529;
  color: #f8f9fa;
  font-size: .875rem;
}
.utility-bar a { color: #f8f9fa; text-decoration: none; }
.utility-bar a:hover,
.utility-bar a:focus { text-decoration: underline; }

/* ---------- Mega menu ---------- */
.navbar .mega-menu {
  width: 100%;
  max-width: 960px;
  padding: 1.5rem;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: var(--bs-border-radius);
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.1);
}
.navbar .mega-menu h3 {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6c757d;
  margin-bottom: .75rem;
}
.navbar .mega-menu a.mega-link {
  display: block;
  padding: .375rem 0;
  color: #212529;
  text-decoration: none;
}
.navbar .mega-menu a.mega-link:hover,
.navbar .mega-menu a.mega-link:focus {
  color: var(--bs-primary);
  text-decoration: underline;
}
.navbar .mega-menu .mega-feature {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: var(--bs-border-radius);
}
@media (max-width: 991.98px) {
  .navbar .mega-menu { max-width: none; box-shadow: none; border: none; padding: 0; }
}

/* ---------- Placeholder imagery ---------- */
.ph-img {
  background: #e9ecef;
  background-image: linear-gradient(135deg, #e9ecef 25%, #dee2e6 25%, #dee2e6 50%, #e9ecef 50%, #e9ecef 75%, #dee2e6 75%);
  background-size: 24px 24px;
  color: #495057;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  aspect-ratio: 16 / 9;
  border-radius: var(--bs-border-radius);
}
.ph-img[data-ratio="1"]     { aspect-ratio: 1 / 1; }
.ph-img[data-ratio="4x5"]   { aspect-ratio: 4 / 5; }
.ph-img[data-ratio="21x9"]  { aspect-ratio: 21 / 9; }
.ph-img[data-ratio="3x4"]   { aspect-ratio: 3 / 4; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 520px;
  background: #343a40;
  color: #fff;
  display: flex;
  align-items: end;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(135deg, #495057 25%, #6c757d 25%, #6c757d 50%, #495057 50%, #495057 75%, #6c757d 75%);
  background-size: 48px 48px;
  opacity: .4;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,.2) 60%, transparent);
}
.hero > .container { position: relative; z-index: 2; padding-top: 5rem; padding-bottom: 3rem; }
.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .875rem;
  font-weight: 600;
  opacity: .9;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  text-wrap: balance;
  max-width: 20ch;
}
.hero .lede {
  font-size: 1.125rem;
  max-width: 55ch;
  opacity: .95;
}

/* Hero variants */
.hero[data-variant="split"] {
  background: #f8f9fa;
  color: #212529;
  min-height: auto;
}
.hero[data-variant="split"]::before,
.hero[data-variant="split"]::after { display: none; }
.hero[data-variant="split"] > .container { padding-top: 4rem; padding-bottom: 4rem; }

.hero[data-variant="stat"] {
  background: #0d6efd;
  background: var(--bs-primary);
}
.hero[data-variant="stat"]::before { opacity: .15; }
.hero[data-variant="stat"]::after { display: none; }

/* ---------- Stat block ---------- */
.stat-block .stat-value {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1;
  color: var(--bs-primary);
}
.stat-block .stat-label {
  font-size: .9375rem;
  color: #495057;
  margin-top: .5rem;
}

/* ---------- Page section spacing ---------- */
.nonprofit-section {
  padding-top: var(--theme-section-y);
  padding-bottom: var(--theme-section-y);
}
.nonprofit-section .section-eyebrow {
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--bs-primary);
}
.nonprofit-section .section-title {
  font-weight: 700;
  text-wrap: balance;
}

/* ---------- Program card ---------- */
.program-card {
  height: 100%;
  border: 1px solid rgba(0,0,0,.125);
  transition: transform .15s ease, box-shadow .15s ease;
}
.program-card:hover,
.program-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.08);
}

/* ---------- Event item (list layout) ---------- */
.event-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.25rem 0;
  border-bottom: 1px solid #dee2e6;
}
.event-date {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: var(--bs-border-radius);
  padding: .75rem 1rem;
  text-align: center;
  min-width: 5rem;
}
.event-date .month {
  text-transform: uppercase;
  font-size: .75rem;
  letter-spacing: .05em;
  color: var(--bs-primary);
  font-weight: 600;
}
.event-date .day {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}
@media (max-width: 575.98px) {
  .event-item {
    grid-template-columns: auto 1fr;
  }
  .event-item .event-action {
    grid-column: 1 / -1;
  }
}

/* ---------- Donation form ---------- */
.donate-amounts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr));
  gap: .5rem;
}
.donate-amounts input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.donate-amounts label {
  display: block;
  text-align: center;
  padding: .875rem .5rem;
  border: 2px solid #dee2e6;
  border-radius: var(--bs-border-radius);
  font-weight: 600;
  cursor: pointer;
  background: #fff;
}
.donate-amounts input[type="radio"]:checked + label {
  border-color: var(--bs-primary);
  background: rgba(var(--bs-primary-rgb), .08);
  color: var(--bs-primary);
}
.donate-amounts input[type="radio"]:focus-visible + label {
  outline: 3px solid var(--bs-primary);
  outline-offset: 2px;
}

/* ---------- Testimonial carousel ---------- */
.story-carousel .carousel-item blockquote {
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.5;
  text-wrap: balance;
}
.story-carousel .carousel-item cite {
  font-style: normal;
  font-weight: 600;
}

/* ---------- Sponsors grid ---------- */
.sponsor-logo {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: var(--bs-border-radius);
  aspect-ratio: 5 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-family: ui-monospace, monospace;
  font-size: .8125rem;
  padding: 1rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #212529;
  color: #dee2e6;
  padding: 3rem 0 1.5rem;
}
.site-footer h2, .site-footer h3 {
  color: #fff;
  font-size: .875rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 1rem;
}
.site-footer a { color: #dee2e6; text-decoration: none; }
.site-footer a:hover,
.site-footer a:focus { color: #fff; text-decoration: underline; }
.site-footer .footer-legal {
  border-top: 1px solid #495057;
  padding-top: 1.5rem;
  margin-top: 2rem;
  font-size: .8125rem;
  color: #adb5bd;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb-wrap {
  background: #f8f9fa;
  padding: .75rem 0;
  border-bottom: 1px solid #dee2e6;
  font-size: .875rem;
}
.breadcrumb { margin: 0; }

/* ---------- Page header (non-home pages) ---------- */
.page-header {
  background: #f8f9fa;
  padding: 3rem 0;
  border-bottom: 1px solid #dee2e6;
}
.page-header h1 {
  font-weight: 700;
  text-wrap: balance;
  margin: 0;
}
.page-header .lede {
  font-size: 1.125rem;
  color: #495057;
  margin-top: .75rem;
  max-width: 65ch;
}

/* ---------- Article prose ---------- */
.prose {
  font-size: 1.0625rem;
  line-height: 1.7;
  max-width: 65ch;
}
.prose h2 { margin-top: 2.5rem; font-weight: 700; }
.prose h3 { margin-top: 2rem; font-weight: 700; }
.prose figure { margin: 2rem 0; }
.prose figcaption {
  font-size: .875rem;
  color: #6c757d;
  margin-top: .5rem;
}
.prose blockquote {
  border-left: 4px solid var(--bs-primary);
  padding-left: 1.25rem;
  margin: 2rem 0;
  font-size: 1.125rem;
  font-style: italic;
}

/* ---------- WordPress core / editor alignment helpers ---------- */
.wp-caption,
.aligncenter { text-align: center; }
.alignleft  { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.wp-block-image img,
.prose img { max-width: 100%; height: auto; }
.bypostauthor,
.gallery-caption,
.sticky,
.screen-reader-text { /* WP required classes — keep for theme review */ }
.posts-empty {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: var(--bs-border-radius);
  padding: 2.5rem;
  text-align: center;
  color: #6c757d;
}

/* ---------- Reduced motion (WCAG 2.3.3) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .carousel-item { transition: none !important; }
}

/* ---------- Visually hidden (for screen readers only) ---------- */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
