*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-padding-top: 85px;
}

body {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  color: #333333;
  line-height: 1.6;
  margin: 0;
}

h1, h2, h3, h4 {
  font-family: 'Merriweather', Georgia, serif;
}

/* Container */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Section spacing */
.section-py { padding: 80px 0; }

/* Anchor offset — clears sticky nav when jumping to a section */
section[id] { scroll-margin-top: 0; }

/* ---- Buttons ---- */
.btn-primary {
  display: inline-block;
  background: #B22222;
  color: white;
  padding: 16px 32px;
  border-radius: 4px;
  font-size: 1.125rem;
  font-weight: 600;
  font-family: 'Source Sans 3', sans-serif;
  text-decoration: none;
  border: none;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.2s cubic-bezier(0.34,1.56,0.64,1),
              transform 0.15s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.2s ease;
}
.btn-primary:hover {
  background: #8B1A1A;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(178,34,34,0.35);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible { outline: 3px solid #B22222; outline-offset: 3px; }

.btn-primary-lg {
  font-size: 1.25rem;
  padding: 20px 44px;
}

.btn-secondary {
  display: inline-block;
  background: #0B2D5C;
  color: white;
  padding: 16px 32px;
  border-radius: 4px;
  font-size: 1.125rem;
  font-weight: 600;
  font-family: 'Source Sans 3', sans-serif;
  text-decoration: none;
  border: none;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.2s cubic-bezier(0.34,1.56,0.64,1),
              transform 0.15s cubic-bezier(0.34,1.56,0.64,1);
}
.btn-secondary:hover { background: #1F3F77; transform: translateY(-2px); }
.btn-secondary:active { transform: translateY(0); }
.btn-secondary:focus-visible { outline: 3px solid #0B2D5C; outline-offset: 3px; }

.btn-outline-white {
  display: inline-block;
  background: transparent;
  color: white;
  padding: 14px 30px;
  border: 2px solid white;
  border-radius: 4px;
  font-size: 1.125rem;
  font-weight: 600;
  font-family: 'Source Sans 3', sans-serif;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.2s cubic-bezier(0.34,1.56,0.64,1),
              color 0.2s ease,
              transform 0.15s cubic-bezier(0.34,1.56,0.64,1);
}
.btn-outline-white-lg {
  font-size: 1.25rem;
  padding: 18px 42px;
}
.btn-outline-white:hover { background: white; color: #0B2D5C; transform: translateY(-2px); }
.btn-outline-white:active { transform: translateY(0); }
.btn-outline-white:focus-visible { outline: 3px solid white; outline-offset: 3px; }

.btn-outline-navy {
  display: inline-block;
  background: transparent;
  color: #0B2D5C;
  padding: 14px 30px;
  border: 2px solid #0B2D5C;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Source Sans 3', sans-serif;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.2s cubic-bezier(0.34,1.56,0.64,1),
              color 0.2s ease,
              transform 0.15s cubic-bezier(0.34,1.56,0.64,1);
}
.btn-outline-navy:hover { background: #0B2D5C; color: white; transform: translateY(-2px); }
.btn-outline-navy:active { transform: translateY(0); }
.btn-outline-navy:focus-visible { outline: 3px solid #0B2D5C; outline-offset: 3px; }

/* ---- Nav ---- */
.nav-link {
  color: #333333;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 0;
  position: relative;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: #0B2D5C;
  transition: width 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.nav-link:hover { color: #0B2D5C; }
.nav-link:hover::after { width: 100%; }
.nav-link:focus-visible { outline: 2px solid #0B2D5C; outline-offset: 3px; }

/* ---- Cards ---- */
.card {
  border-radius: 8px;
  overflow: hidden;
  background: white;
  border: 1px solid rgba(11,45,92,0.08);
  box-shadow: 0 1px 3px rgba(11,45,92,0.06), 0 4px 12px rgba(11,45,92,0.07);
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(11,45,92,0.08), 0 12px 28px rgba(11,45,92,0.13);
}

/* ---- Hero ---- */
.hero-bg {
  position: relative;
  background-color: #0B2D5C;
  background-image: url('brand_assets/hero-image-clean-shaven.webp');
  background-size: cover;
  background-position: center center;
}

@media (max-width: 767px) {
  .hero-section {
    background-image: url('brand_assets/hero-mobile.webp') !important;
    background-position: center top !important;
  }
}

/* ---- Stats ---- */
.stat-num {
  font-family: 'Merriweather', serif;
  font-size: 3rem;
  font-weight: 700;
  color: #0B2D5C;
  line-height: 1;
}

/* ---- Eyebrow ---- */
.eyebrow {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #B22222;
  margin-bottom: 14px;
}

/* ---- Layered shadows ---- */
.shadow-elevated {
  box-shadow:
    0 1px 2px rgba(11,45,92,0.06),
    0 4px 10px rgba(11,45,92,0.09),
    0 10px 24px rgba(11,45,92,0.07);
}
.shadow-floating {
  box-shadow:
    0 2px 4px rgba(11,45,92,0.08),
    0 8px 20px rgba(11,45,92,0.12),
    0 20px 40px rgba(11,45,92,0.08);
}

/* ---- Form inputs ---- */
.form-input {
  width: 100%;
  border: 2px solid #D1D5DB;
  padding: 12px 16px;
  font-size: 1.125rem;
  border-radius: 4px;
  color: #333333;
  background: white;
  outline: none;
  font-family: 'Source Sans 3', sans-serif;
  min-height: 44px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input:focus {
  border-color: #0B2D5C;
  box-shadow: 0 0 0 3px rgba(11,45,92,0.12);
}
.form-label {
  display: block;
  color: #0B2D5C;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 8px;
  font-family: 'Source Sans 3', sans-serif;
}
.form-input.invalid {
  border-color: #B22222;
  box-shadow: 0 0 0 3px rgba(178,34,34,0.1);
}
.form-error-msg {
  margin-top: 6px;
  font-size: 0.875rem;
  color: #B22222;
  font-weight: 600;
  font-family: 'Source Sans 3', sans-serif;
}

/* ---- Active nav link (current page indicator) ---- */
.nav-link-active {
  color: #0B2D5C;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  padding: 6px 0;
  position: relative;
}
.nav-link-active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 2px;
  background: #B22222;
}

/* ---- Events page ---- */
.event-card {
  background: white;
  border-radius: 8px;
  border: 1px solid rgba(11,45,92,0.09);
  box-shadow: 0 1px 3px rgba(11,45,92,0.06), 0 4px 12px rgba(11,45,92,0.07);
  padding: 28px 32px;
  display: flex;
  gap: 28px;
  align-items: flex-start;
  position: relative;
}
.month-label {
  font-family: 'Merriweather', serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #B22222;
  margin: 0 0 6px;
}
.no-events-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 32px;
  border-radius: 8px;
  border: 1px solid rgba(11,45,92,0.07);
}
.date-badge {
  min-width: 64px;
  height: 64px;
  border-radius: 8px;
  background: #0B2D5C;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.date-badge .day {
  color: white;
  font-family: 'Merriweather', serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}
.date-badge .mo {
  color: rgba(255,255,255,0.65);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
}
.date-badge.tbd {
  background: rgba(11,45,92,0.08);
}
.date-badge.tbd .day {
  color: #0B2D5C;
  font-size: 0.875rem;
}

/* ---- Dropdown nav ---- */
.nav-item {
  position: relative;
}
/* Invisible bridge prevents hover state from dropping when cursor moves
   from the nav link down into the dropdown panel (covers the gap) */
.nav-item::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -10px;
  right: -10px;
  height: 20px;
  background: transparent;
}
.nav-item > .nav-link,
.nav-item > .nav-link-active {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.nav-item:hover > .nav-link .nav-chevron,
.nav-item:hover > .nav-link-active .nav-chevron,
.nav-item:focus-within > .nav-link .nav-chevron,
.nav-item:focus-within > .nav-link-active .nav-chevron {
  transform: rotate(180deg);
}
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  min-width: 210px;
  padding: 14px 0 8px;
  background: white;
  border-radius: 8px;
  border: 1px solid rgba(11,45,92,0.1);
  box-shadow: 0 4px 12px rgba(11,45,92,0.12), 0 12px 32px rgba(11,45,92,0.09);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-6px);
  transition: opacity 0.18s ease, transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: white;
  border-top: 1px solid rgba(11,45,92,0.1);
  border-left: 1px solid rgba(11,45,92,0.1);
}
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown a {
  display: block;
  padding: 10px 20px;
  color: #333;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: 'Source Sans 3', sans-serif;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-dropdown a:hover { background: #F4F6F8; color: #0B2D5C; }
.nav-dropdown a:focus-visible { outline: 2px solid #0B2D5C; outline-offset: -2px; }

/* Sub-link styling for mobile */
.nav-sub-link {
  padding-left: 20px !important;
  font-size: 0.9375rem !important;
  font-weight: 600;
  color: #555 !important;
  border-left: 2px solid rgba(11,45,92,0.15);
  margin-left: 8px;
}
.nav-sub-link:hover { color: #0B2D5C !important; }

/* Deep sub-link for mobile (sub-items of sub-items) */
.nav-sub-sub-link {
  padding-left: 36px !important;
  font-size: 0.875rem !important;
  font-weight: 500;
  color: #777 !important;
  border-left: 2px solid rgba(11,45,92,0.08);
  margin-left: 8px;
}
.nav-sub-sub-link:hover { color: #0B2D5C !important; }

/* Indented sub-item inside desktop dropdown */
.nav-dropdown-subitem {
  padding-left: 32px !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #666 !important;
  border-left: 2px solid rgba(11,45,92,0.12);
  margin-left: 16px;
  margin-right: 8px;
  border-radius: 0 4px 4px 0;
}
.nav-dropdown-subitem:hover { background: #F4F6F8; color: #0B2D5C !important; }

/* ---- Mobile nav ---- */
#mobile-menu { display: none; }
#mobile-menu.open { display: block; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr !important; gap: 48px !important; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 40px !important; }
  .three-stats { grid-template-columns: 1fr 1fr !important; }
  .support-nav-grid { grid-template-columns: 1fr 1fr !important; }
  .support-nav-grid a { border-right: none !important; border-bottom: 1px solid rgba(11,45,92,0.09); }
  .support-nav-grid a:nth-child(odd) { border-right: 1px solid rgba(11,45,92,0.09) !important; }
  .support-nav-grid a:nth-last-child(-n+2) { border-bottom: none !important; }
}
@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .section-py { padding: 56px 0; }
  .hero-ctas { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr !important; }
  .three-stats { grid-template-columns: 1fr !important; }
  .support-nav-grid { grid-template-columns: 1fr !important; }
  .support-nav-grid a { border-right: none !important; border-bottom: 1px solid rgba(11,45,92,0.09) !important; }
  .support-nav-grid a:last-child { border-bottom: none !important; }
  .stat-num { font-size: 2.25rem; }
  .name-grid { grid-template-columns: 1fr !important; }
  .event-card { flex-direction: column; gap: 16px; padding: 24px 20px; }
  .no-events-row { padding: 14px 20px; }
  .about-cta { flex-direction: column; text-align: center; padding: 32px 24px; }
  .about-cta-btns { justify-content: center; }
}


/* Reserve space for nav CTA button to prevent layout shift while Givebutter loads */
givebutter-button#nav-cta {
  display: inline-block;
  min-width: 140px;
  min-height: 44px;
}

/* Target ONLY the Donate button */
givebutter-button#donateBtn .givebutter-button {
  background: #B22222;
  border-radius: 4px; 
  padding: 18px 42px !important;   /* horizontal + vertical padding */
  font-size: 1.25rem !important;   /* matches your inline attempt */
  line-height: 1.2 !important;     /* prevents vertical compression */
  min-height: 56px !important;     /* optional: matches .btn-primary-lg scale */
  display: inline-flex !important; /* ensures proper centering */
  align-items: center !important;
  justify-content: center !important;
}