/* Jashn Foundation — site-specific styles layered on top of app.css (compiled utility classes). */

:root {
  --navy: #3B2A1B;
  --ivory: #FBF7F1;
  --sand: #F1E7D8;
  --gold: #E8A62C;
  --emerald: #1C8A8C;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

body { background: var(--ivory); color: var(--navy); }
[hidden] { display: none !important; }
.no-js [data-item][hidden] { display: block !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
legend { padding: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
button, label, summary { -webkit-tap-highlight-color: transparent; }

/* ---------- Navbar ---------- */
.site-nav { padding: 1rem 0; background: transparent; transition: all .3s ease; }
.site-nav .nav-tone { color: var(--ivory); }
.site-nav .nav-toggle:hover { background: rgba(251, 247, 241, .1); }
.site-nav.is-scrolled {
  padding: .5rem 0;
  background: rgba(251, 247, 241, .78);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--sand);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
.site-nav.is-scrolled .nav-tone { color: var(--navy); }
.site-nav.is-scrolled .nav-toggle:hover { background: var(--sand); }
.site-nav a.nav-tone:hover, .site-nav button.nav-tone:hover { color: var(--emerald); }
.nav-dd:focus-within .nav-dd-menu { visibility: visible; opacity: 1; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease-out) var(--d, 0s), transform .7s var(--ease-out) var(--d, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Hero entrance */
@keyframes hero-in { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.hero-in { animation: hero-in .8s var(--ease-out) var(--d, 0s) both; }
.hero-line { animation-duration: .8s; }
.hero-fade { animation: fade-in 1s ease 1.4s both; }
.hero-still { display: none; }

/* Progress bars animate from 0 when revealed */
.progress-fill { width: var(--w); transition: width 1.2s var(--ease-out) .2s; }
.js .reveal:not(.is-in) .progress-fill { width: 0; }

/* Timeline alternating sides on wide screens */
@media (min-width: 640px) {
  .timeline .tl-right { margin-left: 50%; }
  .timeline .tl-odd .tl-dot { left: -8px; right: auto; }
}

@media (min-width: 640px) {
  .sm\:grid-cols-\[auto\2c 1fr\] { grid-template-columns: auto 1fr; }
}

/* ---------- Accordion (<details>) ---------- */
.acc[open] > summary .acc-chev { transform: rotate(180deg); }
.acc > summary:hover { text-decoration: none; }
.acc > div { animation: fade-in .25s ease; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 1rem; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .8); animation: fade-in .2s ease; }
.modal-panel {
  position: relative; width: 100%; max-height: calc(100vh - 2rem); overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25);
  animation: modal-in .22s var(--ease-out);
}
@keyframes modal-in { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
.modal-x {
  position: absolute; right: 1rem; top: 1rem; z-index: 2; display: inline-flex; padding: .4rem;
  border-radius: 9999px; color: var(--navy); background: rgba(251, 247, 241, .85); opacity: .85; transition: opacity .2s;
}
.modal-x:hover { opacity: 1; }
.modal-dark .modal-x { color: var(--ivory); background: rgba(59, 42, 27, .7); }
body.no-scroll { overflow: hidden; }

/* ---------- Mobile sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 70; }
.sheet-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .8); animation: fade-in .3s ease; }
.sheet-panel { position: absolute; right: 0; top: 0; height: 100%; animation: sheet-in .35s var(--ease-out); }
@keyframes sheet-in { from { transform: translateX(100%); } to { transform: none; } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: .5rem; width: min(92vw, 380px); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: .75rem; align-items: flex-start; padding: 1rem 1.1rem;
  border-radius: 1rem; border: 1px solid; background: #fff; box-shadow: 0 10px 30px rgba(59, 42, 27, .15);
  font-size: .875rem; animation: toast-in .35s var(--ease-out);
}
.toast.is-out { opacity: 0; transform: translateY(-8px); transition: all .3s ease; }
.toast svg { flex-shrink: 0; margin-top: 1px; }
.toast-title { font-weight: 700; }
.toast-desc { margin-top: 2px; opacity: .85; }
.toast-success { background: #ECFDF3; border-color: #BFF4D2; color: #046C4E; }
.toast-error { background: #FEF0F0; border-color: #FBD5D5; color: #B42318; }
.toast-info { background: #F0F7FF; border-color: #CFE3FB; color: #1849A9; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* ---------- Form option controls ---------- */
.opt-card:hover { border-color: rgba(59, 42, 27, .3); }
.opt-card:has(input:checked) { border-color: var(--emerald); background: rgba(28, 138, 140, .05); }
.opt-radio svg { opacity: 0; }
.opt-card:has(input:checked) .opt-radio { border-color: var(--emerald); background: var(--emerald); }
.opt-card:has(input:checked) .opt-radio svg { opacity: 1; }
.opt-card:has(input:focus-visible), .amt-opt:has(input:focus-visible), .seg-opt:has(input:focus-visible), .chip:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }

.seg-opt:has(input:checked) { background: var(--navy); color: var(--ivory); }
.amt-opt:hover { border-color: rgba(59, 42, 27, .4); }
.amt-opt:has(input:checked) { border-color: var(--emerald); background: var(--emerald); color: var(--ivory); }
.chip:has(input:checked) { border-color: var(--emerald); background: var(--emerald); color: var(--ivory); }
.consent-box { accent-color: var(--emerald); }

input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: #E0592A !important; }
button[disabled], button.is-loading { opacity: .6; pointer-events: none; }

/* ---------- Donation wizard ---------- */
.wz-dot { background: var(--sand); color: rgba(59, 42, 27, .5); }
.wz-dot.is-on { background: var(--emerald); color: var(--ivory); }
.wz-check { display: none; }
.wz-dot.is-done .wz-num { display: none; }
.wz-dot.is-done .wz-check { display: inline-flex; }
.wz-line { background: var(--sand); }
.wz-line.is-on { background: var(--emerald); }
.no-js .wizard-steps, .no-js [data-next], .no-js [data-back] { display: none; }
.no-js [data-step] + [data-step] { margin-top: 2.5rem; }
.js [data-wizard] [data-step]:not(.is-current) { display: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  .hero-video { display: none; }
  .hero-still { display: block; }
  .animate-marquee { animation: none; flex-wrap: wrap; justify-content: center; width: auto; }
}
