/* ===========================================================
   Hazel's Fundraiser — theme: teal & white (cervical cancer
   awareness) with warm, hopeful accents.
   =========================================================== */

:root {
  --teal-900: #0c3b3a;
  --teal-700: #0f766e;
  --teal-600: #0d8a80;
  --teal-500: #14b8a6;
  --teal-300: #5eead4;
  --teal-50:  #ecfdf9;

  --peach:    #ffb59e;
  --coral:    #ff7a59;
  --gold:     #f5b94b;

  --ink:      #14302e;
  --ink-soft: #4b6360;
  --cream:    #fbfcfb;
  --card:     #ffffff;
  --line:     #e3efec;

  --shadow-sm: 0 2px 8px rgba(12, 59, 58, 0.06);
  --shadow-md: 0 12px 34px rgba(12, 59, 58, 0.10);
  --shadow-lg: 0 24px 60px rgba(12, 59, 58, 0.16);

  --radius:   20px;
  --radius-sm: 12px;
  --maxw: 1120px;

  --sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --serif: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 85% -10%, var(--teal-50), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, #fff4ef, transparent 55%),
    var(--cream);
  line-height: 1.6;
  overflow-x: hidden;
}

.ribbon-glow {
  position: fixed;
  inset: 0;
  background: radial-gradient(700px 500px at 50% 120%, rgba(20,184,166,0.10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3 { font-family: var(--serif); line-height: 1.12; font-weight: 600; }

section, header, footer, main { position: relative; z-index: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--sans); font-weight: 600; font-size: .98rem;
  border: none; border-radius: 999px; cursor: pointer;
  padding: .8rem 1.5rem; text-decoration: none; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn-lg { padding: 1rem 1.9rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--teal-600), var(--teal-500));
  box-shadow: 0 10px 24px rgba(13, 138, 128, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(13, 138, 128, 0.42); }
.btn-ghost {
  color: var(--teal-700); background: rgba(255,255,255,0.7);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { transform: translateY(-2px); background: #fff; box-shadow: var(--shadow-sm); }

/* ---------- Header ---------- */
.site-header {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem 1.5rem;
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; }
.brand-name { font-family: var(--serif); font-size: 1.2rem; color: var(--teal-900); }
.ribbon { color: var(--teal-500); display: inline-flex; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center;
}
.eyebrow {
  display: inline-block; font-weight: 600; color: var(--teal-700);
  background: var(--teal-50); border: 1px solid var(--teal-300);
  padding: .35rem .85rem; border-radius: 999px; font-size: .85rem; margin-bottom: 1.1rem;
}
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); letter-spacing: -0.02em; }
.hero h1 .hl {
  background: linear-gradient(120deg, var(--teal-600), var(--coral));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: 1.12rem; color: var(--ink-soft); margin: 1.2rem 0 1.8rem; max-width: 34rem; }

.hero-photo { position: relative; }
.hero-photo img {
  width: 100%; aspect-ratio: 4 / 4.4; object-fit: cover;
  border-radius: 28px; box-shadow: var(--shadow-lg);
  border: 6px solid #fff;
}
.hero-photo::after {
  content: ""; position: absolute; inset: auto -14px -14px auto; width: 120px; height: 120px;
  background: radial-gradient(circle at 30% 30%, var(--peach), transparent 70%);
  filter: blur(8px); z-index: -1; border-radius: 50%;
}
.hero-photo figcaption {
  text-align: center; font-size: .9rem; color: var(--ink-soft); margin-top: .9rem; font-style: italic;
}

.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* ---------- Progress ---------- */
.progress-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem 1.5rem; box-shadow: var(--shadow-md);
}
.progress-numbers { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.raised { font-family: var(--serif); font-size: 2rem; font-weight: 700; color: var(--teal-700); display: block; line-height: 1; }
.goal { font-size: .95rem; color: var(--ink-soft); }
.goal strong { color: var(--ink); }
.donor-count { font-size: .9rem; color: var(--ink-soft); background: var(--teal-50); padding: .3rem .7rem; border-radius: 999px; }
.donor-count span { font-weight: 700; color: var(--teal-700); }

.progress-empty { text-align: center; padding: .4rem .2rem .2rem; }
.progress-empty .empty-spark {
  font-size: 2rem; display: inline-block; animation: spark-pulse 2.4s ease-in-out infinite;
}
.progress-empty h3 {
  font-family: var(--serif); font-size: 1.45rem; color: var(--teal-800, var(--teal-900));
  margin: .4rem 0 .35rem; background: linear-gradient(120deg, var(--teal-600), var(--coral));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.progress-empty p { color: var(--ink-soft); font-size: 1rem; max-width: 26rem; margin: 0 auto; }
.progress-empty p strong { color: var(--teal-700); }
@keyframes spark-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }

.progress-track {
  height: 16px; background: #e9f4f1; border-radius: 999px; overflow: hidden; position: relative;
}
.progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--teal-600), var(--teal-300), var(--gold));
  background-size: 200% 100%;
  transition: width 1.3s cubic-bezier(.16,.84,.44,1);
  animation: shimmer 3s linear infinite;
}
@keyframes shimmer { to { background-position: 200% 0; } }
.progress-pct { margin-top: .7rem; font-size: .9rem; color: var(--ink-soft); }
.progress-pct span { font-weight: 700; color: var(--teal-700); }

/* ---------- Story ---------- */
.story, .donate, .where { max-width: var(--maxw); margin: 0 auto; padding: 3.5rem 1.5rem; }
.story h2, .donate h2, .where h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem); text-align: center; margin-bottom: .4rem; color: var(--teal-900);
}
.story-grid {
  max-width: 46rem; margin: 1.6rem auto 0; display: grid; gap: 1.1rem;
  font-size: 1.08rem; color: var(--ink-soft);
}
.story-grid strong { color: var(--ink); }
.signoff { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); margin-top: .6rem; }
.signoff span { color: var(--teal-700); font-weight: 700; }

/* ---------- Donate ---------- */
.donate-sub { text-align: center; color: var(--ink-soft); max-width: 38rem; margin: .3rem auto 2rem; }
.donate-card {
  max-width: 620px; margin: 0 auto; background: var(--card);
  border: 1px solid var(--line); border-radius: 26px; padding: 1.8rem; box-shadow: var(--shadow-lg);
}
.block-label { display: block; font-weight: 600; color: var(--ink); margin-bottom: .7rem; }
.block-label .muted { font-weight: 400; color: var(--ink-soft); font-size: .85rem; }
.name-block { margin-bottom: 1.4rem; }
.name-input {
  width: 100%; padding: .85rem 1rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: 1rem; color: var(--ink); background: #fff; transition: border-color .15s ease;
}
.name-input:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(20,184,166,.12); }
.amount-block { margin-bottom: 1.6rem; }
.amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.amount-chip {
  padding: .85rem; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  background: #fff; font-weight: 700; font-size: 1.05rem; color: var(--ink); cursor: pointer;
  font-family: var(--sans); transition: all .15s ease;
}
.amount-chip:hover { border-color: var(--teal-500); transform: translateY(-1px); }
.amount-chip.is-active { background: var(--teal-50); border-color: var(--teal-500); color: var(--teal-700); box-shadow: inset 0 0 0 1px var(--teal-500); }
.amount-custom {
  display: flex; align-items: center; gap: .2rem; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 0 .8rem; background: #fff;
}
.amount-custom span { color: var(--ink-soft); font-weight: 700; }
.amount-custom input { border: none; outline: none; width: 100%; padding: .85rem .2rem; font-size: 1.05rem; font-family: var(--sans); font-weight: 700; background: transparent; }

.method-block { margin-bottom: 1.5rem; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.method-card {
  display: flex; flex-direction: column; align-items: center; gap: .25rem; text-align: center;
  padding: 1rem .6rem; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  background: #fff; cursor: pointer; transition: all .15s ease; color: var(--ink);
}
.method-card:hover { border-color: var(--teal-500); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.method-card.is-active { border-color: var(--teal-500); background: var(--teal-50); box-shadow: inset 0 0 0 1px var(--teal-500); }
.method-icon { font-size: 1.5rem; color: var(--teal-700); display: inline-flex; height: 26px; align-items: center; }
.method-name { font-weight: 700; font-size: .98rem; }
.method-desc { font-size: .76rem; color: var(--ink-soft); }

.action-panel { margin-top: .4rem; min-height: 56px; }
.panel-note { font-size: .85rem; color: var(--ink-soft); text-align: center; margin-top: .8rem; }
.panel-error { color: #c0392b; font-size: .9rem; text-align: center; margin-top: .7rem; background: #fdecea; padding: .6rem; border-radius: 10px; }
.amt-echo { font-weight: 800; }

.trust-row {
  display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; justify-content: center;
  margin-top: 1.5rem; padding-top: 1.3rem; border-top: 1px solid var(--line);
  font-size: .85rem; color: var(--ink-soft);
}

/* PayPal container spacing */
#paypal-button-container, #card-button-container { min-height: 48px; display: flex; justify-content: center; }

/* ---------- Recent ---------- */
.recent { max-width: 620px; margin: 1.8rem auto 0; }
.recent h3 { font-family: var(--serif); text-align: center; color: var(--teal-900); margin-bottom: .9rem; }
.recent ul { list-style: none; display: grid; gap: .5rem; }
.recent li {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .7rem 1rem; font-size: .92rem;
}
.recent li .r-amt { font-weight: 700; color: var(--teal-700); }
.recent li .r-method { color: var(--ink-soft); font-size: .82rem; }

/* ---------- Leaderboard ---------- */
.leaderboard { max-width: 720px; margin: 0 auto; padding: 1rem 1.5rem 3.5rem; }
.board-list { list-style: none; counter-reset: rank; display: grid; gap: .6rem; margin-top: 1.8rem; }
.board-list li {
  counter-increment: rank;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: .9rem 1.1rem; box-shadow: var(--shadow-sm);
}
.board-list li::before {
  content: counter(rank); display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%; font-weight: 800; font-size: .95rem;
  background: var(--teal-50); color: var(--teal-700); border: 1px solid var(--teal-300);
}
.board-list li:nth-child(1)::before { background: linear-gradient(135deg, #ffd770, var(--gold)); color: #7a5500; border: none; }
.board-list li:nth-child(2)::before { background: linear-gradient(135deg, #e9eef0, #c7d2d6); color: #4a5a5f; border: none; }
.board-list li:nth-child(3)::before { background: linear-gradient(135deg, #f6c9a6, #e0936b); color: #7a3f1d; border: none; }
.board-list .b-name { font-weight: 700; color: var(--ink); }
.board-list .b-meta { font-size: .8rem; color: var(--ink-soft); }
.board-list .b-amt { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: var(--teal-700); }
.board-list li:nth-child(1) { border-color: var(--gold); box-shadow: 0 8px 22px rgba(245,185,75,.18); }

/* ---------- Where funds go ---------- */
.where-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 2rem; }
.where-item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.8rem 1.4rem; text-align: center; box-shadow: var(--shadow-sm);
}
.where-emoji { font-size: 2rem; }
.where-item h3 { font-size: 1.2rem; margin: .7rem 0 .4rem; color: var(--teal-900); }
.where-item p { color: var(--ink-soft); font-size: .96rem; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center; padding: 3rem 1.5rem 3.5rem; color: var(--ink-soft);
  display: grid; gap: .4rem; justify-items: center;
}
.site-footer p { max-width: 36rem; }
.fineprint { font-size: .82rem; opacity: .8; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--teal-900); color: #fff; padding: .9rem 1.4rem; border-radius: 14px;
  box-shadow: var(--shadow-lg); opacity: 0; transition: all .35s ease; z-index: 50; font-weight: 500;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===========================================================
   RESPONSIVE — optimized for phones, tablets, laptops & large screens
   =========================================================== */

/* Safety: never let anything cause a horizontal scrollbar, and let long
   donor names / words wrap instead of overflowing their cards. */
img, svg, a, .btn { max-width: 100%; }
.b-name, .r-method, .lede, .story-grid p { overflow-wrap: anywhere; word-break: break-word; }
.board-list .b-name { overflow-wrap: anywhere; }

/* PayPal renders an <iframe> button — keep it from overflowing on phones. */
#paypal-button-container iframe,
#card-button-container iframe { max-width: 100% !important; }

/* Large desktops — let the content breathe a little wider. */
@media (min-width: 1400px) {
  :root { --maxw: 1200px; }
}

/* Tablets & small laptops (≤ 980px) */
@media (max-width: 980px) {
  .hero { gap: 2.4rem; }
  .where-grid { grid-template-columns: repeat(3, 1fr); gap: .9rem; }
  .where-item { padding: 1.5rem 1.1rem; }
}

/* Stack the hero (≤ 860px) */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 1.8rem; padding-top: .5rem; }
  .hero-photo { order: -1; max-width: 380px; margin: 0 auto; }
  .hero-text { text-align: center; }
  .lede { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .story, .donate, .where, .leaderboard { padding-top: 2.6rem; padding-bottom: 2.6rem; }
  .where-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Large phones / small tablets (≤ 620px) */
@media (max-width: 620px) {
  .site-header { padding: 1.1rem 1.2rem; }
  .hero { padding-left: 1.2rem; padding-right: 1.2rem; }
  .where-grid { grid-template-columns: 1fr; gap: 1rem; }
  .progress-numbers { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .raised { font-size: 1.7rem; }
  .trust-row { gap: .5rem 1rem; font-size: .8rem; }
}

/* Phones (≤ 520px) */
@media (max-width: 520px) {
  .header-cta { display: none; }
  .amount-grid { grid-template-columns: repeat(2, 1fr); }
  .amount-custom { grid-column: span 2; }
  .method-grid { grid-template-columns: 1fr; }
  .method-card { flex-direction: row; justify-content: flex-start; gap: .9rem; text-align: left; padding: .85rem 1rem; }
  .method-icon { height: auto; }
  .donate-card { padding: 1.2rem; border-radius: 20px; }
  .hero-photo img { border-width: 4px; border-radius: 22px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .board-list li { gap: .7rem; padding: .8rem .9rem; }
  .board-list li::before { width: 30px; height: 30px; font-size: .85rem; }
  .board-list .b-amt { font-size: 1.05rem; }
  .toast { left: 12px; right: 12px; bottom: 14px; transform: translateY(20px); text-align: center; }
  .toast.show { transform: translateY(0); }
}

/* Tiny phones (≤ 360px) */
@media (max-width: 360px) {
  .amount-grid { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .amount-chip { padding: .75rem; font-size: 1rem; }
  .hero h1 { font-size: 2rem; }
  .donate-card { padding: 1rem; }
}

/* Respect users who prefer reduced motion (accessibility) */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .progress-fill { transition: none; }
}
