/* ============================================================================
   Dakshin Vrindavan Trust — donor experience layer
   --------------------------------------------------------------------------
   Conversion-focused UI components added on top of site.css. Each component
   here exists to lower friction or to give the donor a reason to act NOW:

     • .dx-fab            — floating sticky donate CTA (always visible)
     • .dx-progress-band  — monthly fundraising goal progress (urgency)
     • .dx-calc           — interactive donation impact calculator
     • .dx-spotlight      — featured cow of the day with story
     • .dx-ticker         — live donor activity ticker (social proof)
     • .dx-tax-savings    — 80G tax saving widget on donate page
     • .dx-trust-line     — reassurance microcopy under CTAs
     • .dx-impact-row     — quick "your gift = X meals" preview band

   All components respect prefers-reduced-motion (set in tokens.css).
   ========================================================================= */


/* 1. (retired, P4-18) The floating donate CTA is the redesign dv-fab
   (redesign.css section 8); the legacy fab styles, its :has() drawer
   hider and media swaps went with it. Numbering below kept stable. */


/* ── 2. Monthly Goal Progress Band ──────────────────────────────────────── */
/* Sits between the topbar and the header to create urgency. Hidden by
   default — admin opts in via /api/v1/public/monthly-goal. When visible on
   mobile we keep the layout tight (label + bar on row 1, meta on row 2) so
   it never wraps awkwardly into 3 stacked rows. */
.dx-progress-band {
  background: var(--c-success-soft);
  border-bottom: 1px solid #CCE2D3;
  padding: 8px 0;
  font-size: 12px;
  color: var(--c-ink);
}
.dx-progress-band[hidden] { display: none; }
.dx-progress-band .container {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "label  meta"
    "bar    bar";
  gap: 6px var(--s-3);
  align-items: center;
}
.dx-progress-band__label { grid-area: label; min-width: 0; }
.dx-progress-band__bar   { grid-area: bar; }
.dx-progress-band__meta  { grid-area: meta; justify-content: flex-end; gap: var(--s-3); }
@media (min-width: 768px) {
  .dx-progress-band {
    padding: 10px 0;
    font-size: 13px;
  }
  .dx-progress-band .container {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "label bar meta";
    gap: var(--s-4);
  }
}
.dx-progress-band__label {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dx-progress-band__label svg { width: 16px; height: 16px; color: var(--c-success); }
.dx-progress-band__bar {
  position: relative;
  height: 8px;
  background: var(--c-white);
  border-radius: var(--r-pill);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08);
}
.dx-progress-band__fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--c-success) 0%, #4FA876 100%);
  border-radius: inherit;
  transform-origin: left center;
  animation: dx-progress-grow 1.6s var(--ease) both;
}
@keyframes dx-progress-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.dx-progress-band__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  color: var(--c-ink-soft);
}
.dx-progress-band__meta strong { color: var(--c-ink); }


/* ── 3. Donation Impact Calculator ──────────────────────────────────────── */
/* Interactive widget. Donor drags a slider, sees in real time:
     • how many cow meals their gift covers
     • how many days of full care
     • how much they'll save under 80G (50% on the donation amount)
   The "Donate ₹X" button updates with the chosen amount. */
.dx-calc {
  background: linear-gradient(135deg, #FFF7E1 0%, #FFE9B6 100%);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
@media (min-width: 768px) {
  .dx-calc { padding: var(--s-6); }
}
.dx-calc::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 255, 255, .55) 0%, transparent 70%);
  pointer-events: none;
}
.dx-calc__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
  position: relative;
}
.dx-calc__head h3 {
  margin: 0;
  font-size: var(--fs-xl);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--c-ink);
}
.dx-calc__head .dx-calc__hint {
  font-size: var(--fs-sm);
  color: var(--c-ink-soft);
}
.dx-calc__amount {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  font-family: var(--font-display);
  margin: var(--s-3) 0 var(--s-2);
  position: relative;
}
.dx-calc__amount .dx-calc__currency {
  font-size: clamp(20px, 4.5vw, 28px);
  font-weight: 700;
  color: var(--c-saffron-deep);
}
.dx-calc__amount .dx-calc__value {
  font-size: clamp(36px, 9vw, 56px);
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1;
  letter-spacing: -.02em;
}
.dx-calc__amount .dx-calc__period {
  font-size: clamp(13px, 3vw, 16px);
  color: var(--c-ink-soft);
  font-weight: 500;
  margin-left: 6px;
}
.dx-calc__slider {
  width: 100%;
  margin: var(--s-3) 0 var(--s-5);
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--c-saffron-soft);
  border-radius: var(--r-pill);
  outline: none;
  position: relative;
}
.dx-calc__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  background: var(--c-saffron-deep);
  border: 4px solid var(--c-white);
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 2px 8px rgba(35, 34, 32, .25);
  transition: transform var(--d-fast) var(--ease);
}
.dx-calc__slider::-webkit-slider-thumb:hover { transform: scale(1.12); }
.dx-calc__slider::-webkit-slider-thumb:active { cursor: grabbing; }
.dx-calc__slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  background: var(--c-saffron-deep);
  border: 4px solid var(--c-white);
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 2px 8px rgba(35, 34, 32, .25);
}
.dx-calc__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--s-5);
  justify-content: center;
}
.dx-calc__quick button {
  padding: 8px 12px;
  background: rgba(255, 255, 255, .8);
  color: var(--c-ink);
  border: 1px solid var(--c-rule);
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: background var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease), transform var(--d-fast) var(--ease);
  flex: 0 0 auto;
}
@media (min-width: 480px) {
  .dx-calc__quick { gap: 8px; }
  .dx-calc__quick button { padding: 8px 14px; font-size: 13px; }
}
.dx-calc__quick button:hover {
  background: var(--c-white);
  border-color: var(--c-saffron-deep);
  transform: translateY(-1px);
}
.dx-calc__quick button.is-active {
  background: var(--c-saffron-deep);
  color: var(--c-white);
  border-color: var(--c-saffron-deep);
}

/* ── .dx-quick-amounts — chip row inside the "Give what feels right" card.
   3-col grid on mobile (3+2 layout for 5 chips) → 5-col grid above 480 px
   (single tidy row). Equal-width chips within their row regardless of
   label length, so ₹500 and ₹10,000 are the same width — feels intentional
   instead of organic flex-wrap. The grid container's `width:100%` and the
   buttons' `min-width:0` together let chips shrink past their intrinsic
   text width on very narrow viewports without breaking out of the card. */
.dx-quick-amounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin-bottom: var(--s-4);
}
.dx-quick-amounts .btn {
  min-width: 0;          /* allow shrinking inside grid cell */
  padding-left: 8px;
  padding-right: 8px;
}
@media (min-width: 480px) {
  .dx-quick-amounts { grid-template-columns: repeat(5, 1fr); }
}
.dx-quick-amounts .btn.is-active {
  background: var(--c-saffron-deep);
  color: var(--c-white);
  border-color: var(--c-saffron-deep);
}
.dx-calc__impact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-2);
  background: rgba(255, 255, 255, .65);
  backdrop-filter: blur(4px);
  border-radius: var(--r-md);
  padding: var(--s-3);
  margin-bottom: var(--s-5);
  position: relative;
}
@media (min-width: 640px) {
  .dx-calc__impact { padding: var(--s-4); gap: var(--s-3); }
}
.dx-calc__impact-item {
  text-align: center;
  border-right: 1px solid var(--c-rule);
  padding: 0 4px;
}
.dx-calc__impact-item:last-child { border-right: 0; }
.dx-calc__impact-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(18px, 4.5vw, 26px);
  color: var(--c-saffron-deep);
  line-height: 1.1;
  display: block;
}
.dx-calc__impact-lbl {
  font-size: clamp(10px, 2.4vw, 12px);
  color: var(--c-ink-soft);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 2px;
  display: block;
  line-height: 1.25;
}
.dx-calc__cta {
  position: relative;
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: var(--c-ink);
  color: var(--c-white);
  border: 0;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  letter-spacing: .03em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: transform var(--d-base) var(--ease), background var(--d-base) var(--ease);
}
.dx-calc__cta:hover {
  background: #000;
  transform: translateY(-2px);
}
.dx-calc__taxnote {
  margin: var(--s-3) 0 0;
  font-size: 12px;
  text-align: center;
  color: var(--c-ink-soft);
}
.dx-calc__taxnote strong { color: var(--c-success); }


/* ── 4. Featured Cow Spotlight ──────────────────────────────────────────── */
/* Emotional storyteller card. Rotates between cows on each page-load via JS.
   Big photo, name, age, story, days at gaushala, "Adopt me" CTA. */
.dx-spotlight {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: var(--c-white);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--c-rule);
}
@media (min-width: 768px) {
  .dx-spotlight { grid-template-columns: 1.1fr 1fr; }
}
.dx-spotlight__media {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--c-saffron-soft);
}
@media (min-width: 768px) {
  .dx-spotlight__media { aspect-ratio: auto; height: 100%; min-height: 380px; }
}
.dx-spotlight__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.dx-spotlight:hover .dx-spotlight__media img { transform: scale(1.04); }
.dx-spotlight__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--c-ink);
  color: var(--c-white);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dx-spotlight__badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FF5252;
  animation: dx-pulse-dot 1.6s var(--ease) infinite;
}
@keyframes dx-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .55; transform: scale(1.25); }
}
.dx-spotlight__body {
  padding: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.dx-spotlight__id {
  font-size: 12px;
  color: var(--c-ink-soft);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
}
.dx-spotlight__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: 1.05;
  color: var(--c-ink);
}
.dx-spotlight__name small {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--c-ink-soft);
  margin-top: 4px;
  font-style: italic;
}
.dx-spotlight__story {
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--c-text);
  margin: 0;
}
.dx-spotlight__meta {
  display: flex;
  gap: var(--s-5);
  flex-wrap: wrap;
  padding-top: var(--s-3);
  border-top: 1px dashed var(--c-rule);
}
.dx-spotlight__meta-item .num {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--c-saffron-deep);
  line-height: 1;
}
.dx-spotlight__meta-item .lbl {
  display: block;
  font-size: 11px;
  color: var(--c-ink-soft);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 4px;
}
.dx-spotlight__cta {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: var(--s-4);
}
.dx-spotlight__cta .btn { flex: 1 1 auto; }


/* ── 5. Live Donor Activity Ticker ──────────────────────────────────────── */
/* Curated/rotating recent-donor entries to provide social proof. */
.dx-ticker {
  background: var(--c-white);
  border: 1px solid var(--c-rule);
  border-radius: var(--r-pill);
  padding: 10px var(--s-4) 10px var(--s-3);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  box-shadow: var(--shadow-sm);
  font-size: var(--fs-sm);
  max-width: 100%;
  width: 100%;       /* Take the full available width on mobile */
  box-sizing: border-box;
  min-width: 0;      /* Allow children to shrink under flex */
}
@media (min-width: 768px) {
  .dx-ticker { display: inline-flex; width: auto; }
}
.dx-ticker__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-success);
  flex-shrink: 0;
  position: relative;
}
.dx-ticker__dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--c-success);
  opacity: .35;
  animation: dx-ticker-pulse 1.8s var(--ease) infinite;
}
@keyframes dx-ticker-pulse {
  0%   { transform: scale(.8); opacity: .35; }
  100% { transform: scale(2);  opacity: 0;   }
}
.dx-ticker__text {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--c-ink);
  font-size: 13px;
  line-height: 1.4;
}
/* Keep the <strong> node (donor-experience.js targets ".dx-ticker__text strong")
   but render it at body weight — the authoritative hero pill is plain text. */
.dx-ticker__text strong { font-weight: 400; }
.dx-ticker__text .dx-ticker__time {
  color: var(--c-ink-soft);
  font-size: 11px;
  margin-left: 6px;
}
/* On mobile let the time wrap on its own line so the donor name + city +
   amount stay readable instead of being ellipsised away. */
@media (max-width: 480px) {
  .dx-ticker { padding: 8px var(--s-3); }
  .dx-ticker__text { white-space: normal; }
  .dx-ticker__text .dx-ticker__time { display: block; margin-left: 0; margin-top: 2px; }
}


/* ── 6. Tax Savings Widget (donate page) ────────────────────────────────── */
/* Inline widget that says "you give ₹X, you save ₹Y on tax". Rational appeal. */
.dx-tax {
  background: #F0F8F2;
  border: 1px solid #C8E0CF;
  border-left: 4px solid var(--c-success);
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.dx-tax__icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--c-success);
  color: var(--c-white);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dx-tax__icon svg { width: 24px; height: 24px; }
.dx-tax__body { flex: 1 1 240px; }
.dx-tax__title {
  font-weight: 700;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  color: var(--c-ink);
  margin: 0 0 2px;
}
.dx-tax__sub { margin: 0; font-size: var(--fs-sm); color: var(--c-ink-soft); }
.dx-tax__sub strong { color: var(--c-success); }


/* ── 7. Trust microcopy under CTAs ──────────────────────────────────────── */
/* Tiny reassurance line: "🔒 Secure · Direct bank transfer · 80G receipt" */
.dx-trust-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--s-3);
  font-size: 12px;
  color: var(--c-ink-soft);
  margin-top: var(--s-3);
}
.dx-trust-line span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dx-trust-line svg { width: 14px; height: 14px; color: var(--c-success); }


/* ── 8. Quick Impact Row (homepage strip) ───────────────────────────────── */
/* "₹125 = 1 cow meal · ₹3,750 = 1 month feed · ₹45,000 = full year care" */
.dx-impact-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
  padding: var(--s-5);
  background: var(--c-white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--c-rule);
}
@media (min-width: 640px) {
  .dx-impact-row { grid-template-columns: repeat(3, 1fr); padding: var(--s-6); gap: var(--s-5); }
}
.dx-impact-row__cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--s-3);
  border-radius: var(--r-md);
  position: relative;
  transition: background var(--d-base) var(--ease);
}
.dx-impact-row__cell + .dx-impact-row__cell {
  border-left: 1px solid var(--c-rule);
}
@media (max-width: 639px) {
  .dx-impact-row__cell + .dx-impact-row__cell {
    border-left: 0;
    border-top: 1px solid var(--c-rule);
    padding-top: var(--s-4);
  }
}
.dx-impact-row__cell:hover { background: var(--c-saffron-soft); }
.dx-impact-row__amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-xl);
  color: var(--c-saffron-deep);
  line-height: 1;
}
.dx-impact-row__what {
  font-size: var(--fs-sm);
  color: var(--c-ink);
  font-weight: 600;
}
.dx-impact-row__sub {
  font-size: 12px;
  color: var(--c-ink-soft);
}


/* ── 9. Donation tier "compare" matrix ──────────────────────────────────── */
.dx-compare {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-white);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: var(--fs-sm);
}
.dx-compare th, .dx-compare td {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  border-bottom: 1px solid var(--c-rule);
}
.dx-compare th {
  background: var(--c-cream);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--c-ink);
  font-size: var(--fs-sm);
}
.dx-compare th.amt {
  text-align: center;
  font-size: var(--fs-md);
  color: var(--c-saffron-deep);
}
.dx-compare td.check { text-align: center; color: var(--c-success); font-weight: 700; }
.dx-compare td.dash  { text-align: center; color: var(--c-rule);   }
.dx-compare tr:hover td { background: rgba(234, 175, 0, .04); }


/* ── 10. CTA emphasis — bigger, more confident ──────────────────────────── */
.btn-pulse {
  position: relative;
  isolation: isolate;
}
.btn-pulse::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid currentColor;
  opacity: 0;
  animation: dx-fab-pulse 2.4s var(--ease) infinite;
  z-index: -1;
}


/* ── 11. Section eyebrow refinement (existing class enhancement) ────────── */
.section-eyebrow.dx-eyebrow-emoji {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--c-saffron-soft);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  text-transform: uppercase;
  letter-spacing: .08em;
}
