/* ============================================================
   BP-C05 HopeBridge Foundation — NGO / Non-Profit (Asia)
   Primary: Orange-700 (#c2410c)  Accent: Teal-700 (#0f766e)
   Every text/background pairing below clears WCAG AA (4.5:1).
   ============================================================ */

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; } /* anchors clear the fixed header */
body { font-family: 'Inter', system-ui, 'Noto Sans', sans-serif; color: #1e293b; background: #fff; }
img  { display: block; max-width: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- Keyboard focus: dark ring + white halo reads on light and dark sections ---- */
:focus-visible { outline: 2px solid #c2410c; outline-offset: 2px; box-shadow: 0 0 0 5px rgba(255,255,255,.9); border-radius: .25rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: 0 0 0 3px rgba(194,65,12,.18); border-radius: .625rem; }
main:focus { outline: none; } /* skip-link target */

.skip-link {
  position: fixed;
  top: .5rem;
  left: .5rem;
  z-index: 100;
  padding: .625rem 1rem;
  background: #7c2d12;
  color: #fff;
  font-weight: 700;
  font-size: .875rem;
  border-radius: .5rem;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---- Inputs / Selects ---- */
/* "html select" outranks Tailwind's preflight reset (button, input, select, textarea { padding: 0 }) */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
html select,
html textarea {
  width: 100%;
  border: 1.5px solid #94a3b8;           /* slate-400: 3:1 against white (WCAG 1.4.11) */
  border-radius: 0.625rem;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input::placeholder, textarea::placeholder { color: #64748b; text-transform: none; }
input:focus, select:focus, textarea:focus {
  border-color: #c2410c;
  box-shadow: 0 0 0 3px rgba(194,65,12,.18);
}
input.field-error, select.field-error, textarea.field-error { border-color: #b91c1c; }
.form-error { color: #b91c1c; font-size: .75rem; margin-top: .3rem; display: none; }
.form-error.show { display: block; }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---- Announcement bar (sits *behind* the navbar once the navbar compacts) ---- */
#alertBar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: 38px;
  padding: 0 1rem;
  background: #115e59;   /* teal-800 */
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .01em;
  gap: .75rem;
  white-space: nowrap;
}
#alertBar > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#alertBar a { color: #fde68a; text-decoration: underline; text-underline-offset: 2px; flex-shrink: 0; }
#alertBar a:hover { color: #fff; }

/* ---- Navbar ---- */
#navbar {
  position: fixed;
  top: 38px;
  left: 0;
  right: 0;
  z-index: 50;
  height: 70px;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  box-shadow: 0 1px 10px rgba(0,0,0,.06);
  transition: top .35s, box-shadow .3s;
}
#navbar.compact {
  top: 0;
  box-shadow: 0 2px 14px rgba(0,0,0,.1);
}
/* the menu is a child of the 70px header — hang it below the bar */
#mobileMenu { display: none; position: absolute; top: 100%; left: 0; right: 0; box-shadow: 0 12px 20px rgba(0,0,0,.08); max-height: calc(100vh - 110px); overflow-y: auto; }
#mobileMenu.open { display: flex; }

/* Active nav link */
a.nav-link.active { color: #c2410c !important; font-weight: 700; }

/* ---- Page hero offset ---- */
.page-hero-padding { padding-top: calc(38px + 70px + 2rem); }

/* ---- Scroll reveal (only hides content when JS is running) ---- */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .6s ease, transform .6s ease; }
.js [data-reveal].revealed { opacity: 1; transform: none; }
[data-delay="1"] { transition-delay: .1s !important; }
[data-delay="2"] { transition-delay: .2s !important; }
[data-delay="3"] { transition-delay: .3s !important; }
[data-delay="4"] { transition-delay: .4s !important; }

/* ---- Stat counters ---- */
.stat-num {
  font-size: clamp(1.625rem, 8.2vw, 2.25rem);   /* "120,000+" must fit a half-width cell at 320px */
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-num-sm { font-size: clamp(1.625rem, 8.2vw, 1.875rem); }   /* hero card tiles are narrower than the page grid */

/* ---- Cause card ---- */
.cause-card {
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  transition: transform .25s, box-shadow .25s;
}
.cause-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(194,65,12,.14);
}
.cause-card .cause-img { transition: transform .4s ease; }
.cause-card:hover .cause-img { transform: scale(1.05); }

/* ---- Progress bar ---- */
.progress-bar-wrap {
  height: 8px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #c2410c, #ea580c);
  border-radius: 99px;
  width: 0;
  transition: width 1.4s cubic-bezier(.22,.61,.36,1);
}
.progress-bar.teal { background: linear-gradient(90deg, #0f766e, #14b8a6); }
.progress-bar.blue { background: linear-gradient(90deg, #1d4ed8, #3b82f6); }
.progress-bar.pink { background: linear-gradient(90deg, #be185d, #ec4899); }

/* ---- Event card ---- */
.event-card {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  transition: box-shadow .25s;
  overflow: hidden;
}
.event-card:hover { box-shadow: 0 8px 24px rgba(15,118,110,.14); }

/* ---- Donate button pulse ---- */
.donate-pulse { animation: donatePulse 2.4s ease-in-out infinite; }
@keyframes donatePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(194,65,12,.4); }
  50%       { box-shadow: 0 0 0 10px rgba(194,65,12,0); }
}

/* ---- FAQ accordion ---- */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  visibility: hidden;                       /* closed answers leave the tab order / a11y tree */
  transition: max-height .4s ease, visibility 0s .4s;
}
.faq-item.open .faq-answer { visibility: visible; transition: max-height .4s ease, visibility 0s; }
.faq-icon { transition: transform .3s; }
.faq-item.open .faq-icon { transform: rotate(180deg); }

/* ---- Filter tabs ---- */
.filter-tab {
  padding: .45rem 1.1rem;
  border-radius: 99px;
  font-size: .8125rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  border: 1.5px solid #94a3b8;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .2s, border-color .2s, color .2s;
}
.filter-tab:hover { background: #fff7ed; border-color: #c2410c; color: #9a3412; }
.filter-tab.active { background: #c2410c; border-color: #c2410c; color: #fff; }
.scrollbar-hide { scrollbar-width: none; -ms-overflow-style: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ---- Impact badge ---- */
.impact-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .8rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ---- Team card ---- */
.team-card {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
}
.team-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.team-photo { transition: transform .4s ease; }
.team-card:hover .team-photo { transform: scale(1.04); }

/* ---- Donate form: frequency toggle + amount buttons ---- */
.freq-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; padding: .25rem; background: #f1f5f9; border-radius: .75rem; }
.freq-toggle label { cursor: pointer; }
.freq-toggle span {
  display: block;
  text-align: center;
  padding: .55rem .75rem;
  border-radius: .5rem;
  font-size: .875rem;
  font-weight: 600;
  color: #475569;
  transition: background-color .2s, color .2s;
}
.freq-toggle input:checked + span { background: #fff; color: #9a3412; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.freq-toggle input:focus-visible + span { outline: 2px solid #c2410c; outline-offset: 2px; }
.amt-btn {
  border: 1.5px solid #94a3b8;
  border-radius: .625rem;
  padding: .6rem 1rem;
  font-size: .875rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
  text-align: center;
}
.amt-btn:hover { border-color: #c2410c; color: #9a3412; }
.amt-btn.selected { background: #c2410c; border-color: #c2410c; color: #fff; }

/* ---- Timeline (about page) ---- */
.timeline-item { position: relative; padding-left: 2.5rem; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: .75rem;
  top: 1.5rem;
  bottom: -2.5rem;
  width: 2px;
  background: #fdba74;
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  position: absolute;
  left: 0;
  top: .25rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #c2410c;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .55rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ---- Initials avatar (testimonials — no stock faces posing as beneficiaries) ---- */
.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .02em;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .cause-card:hover, .team-card:hover { transform: none; }
}
@media print {
  #alertBar, #navbar, .skip-link { display: none; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .page-hero-padding { padding-top: 2rem; }
}

/* filtered events scroll to just under the navbar + sticky filter bar */
.filterable { scroll-margin-top: 9.5rem; }
