/* =========================================================================
   /maha-sadhna (v1.1.2 realtime): the Global Synchronized Maha-Sadhna Countdown Room.
   Built on site.css tokens: Temple Dark by default, the light theme follows [data-theme="light"]. The hero is a night
   band in both themes (a festival sky); the lower sections follow the theme. Clamped at 4K (the .wrap container), no
   horizontal scroll at 390 px, touch targets ≥ 44 px, reduced motion = still frames. Behaviour: assets/js/maha-sadhna.js.
   ========================================================================= */
.maha { --maha-gold: #F2B54C; --maha-ink: #FCFBF7; --maha-muted: #CDBBA6; }

/* ---------- the hero: a night sky in both themes ---------- */
.maha-hero {
  position: relative; overflow: hidden; isolation: isolate; color: var(--maha-ink);
  background: radial-gradient(120% 90% at 78% 30%, rgba(136, 19, 55, 0.34), rgba(13, 11, 9, 0) 60%),
    radial-gradient(90% 70% at 10% 0%, rgba(217, 119, 6, 0.16), rgba(13, 11, 9, 0) 55%), #0D0B09;
  padding-block: clamp(40px, 6vw, 96px) clamp(48px, 6vw, 104px);
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}
.maha-hero__sky {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.55;
  background-image: radial-gradient(1px 1px at 12% 22%, #FFF3D6, transparent), radial-gradient(1px 1px at 32% 68%, #FFE7B0, transparent),
    radial-gradient(1.5px 1.5px at 58% 14%, #FFF3D6, transparent), radial-gradient(1px 1px at 74% 82%, #FCD34D, transparent),
    radial-gradient(1px 1px at 86% 38%, #FFF3D6, transparent), radial-gradient(1.5px 1.5px at 46% 46%, #FFE7B0, transparent),
    radial-gradient(1px 1px at 6% 86%, #FFF3D6, transparent), radial-gradient(1px 1px at 94% 8%, #FCD34D, transparent);
}
.maha-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
@media (min-width: 960px) { .maha-hero__grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); } }
.maha-hero__text { min-width: 0; }
.maha-eyebrow { color: var(--maha-gold); }
.maha-hero h1 { font-size: clamp(2.5rem, 1.6rem + 3.8vw, 4.6rem); line-height: 1.02; color: var(--maha-ink); margin: 0 0 0.35em; }
.maha-hero h1 em { font-style: italic; color: var(--maha-gold); }
.maha-lead { font-family: var(--serif); font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem); line-height: 1.5; color: #EADBC8; max-width: 38rem; }

.maha-card, .maha-empty, .maha-cal {
  position: relative; margin-top: clamp(20px, 3vw, 32px); padding: clamp(20px, 3vw, 32px); border-radius: 24px;
  background: linear-gradient(160deg, rgba(23, 20, 17, 0.92), rgba(13, 11, 9, 0.86)); border: 1px solid rgba(245, 158, 11, 0.24);
  box-shadow: 0 1px 0 rgba(252, 211, 77, 0.08) inset, 0 30px 60px -36px rgba(0, 0, 0, 0.9);
}
.maha-card::before {   /* the gold-leaf hairline along the top */
  content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 1px; background: var(--gold-leaf);
}
.maha-card__chip {
  display: inline-flex; align-items: center; min-height: 28px; margin: 0 0 10px; padding: 0 12px; border-radius: 999px;
  border: 1px solid rgba(252, 211, 77, 0.4); color: #FDE68A; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
}
.maha-card__title { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem); color: var(--maha-ink); margin: 0 0 0.3em; overflow-wrap: anywhere; }
.maha-card__when { margin: 0; font-weight: 600; color: #FDE7BF; font-size: 1.02rem; }
.maha-card__zones { margin: 0.35em 0 0; color: var(--maha-muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.maha-card__note { margin: 0.8em 0 0; color: #EADBC8; font-size: 0.95rem; overflow-wrap: anywhere; }

.maha-count { margin-top: clamp(18px, 2.4vw, 26px); }
.maha-count__label { margin: 0 0 8px; font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--maha-gold); font-weight: 600; }
.maha-count__digits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(6px, 1.4vw, 14px); max-width: 30rem; }
.maha-count__digits span {
  display: flex; flex-direction: column; align-items: center; padding: clamp(10px, 1.6vw, 16px) 4px; border-radius: 16px;
  background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 0 0 1px rgba(252, 211, 77, 0.22);
}
.maha-count__digits b { font-family: var(--serif); font-weight: 600; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); line-height: 1; color: #FDE68A; font-variant-numeric: tabular-nums lining-nums; }
.maha-count__digits small { margin-top: 6px; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--maha-muted); }

.maha-join { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: clamp(18px, 2.4vw, 26px); }
.maha-join__btn {
  background: linear-gradient(135deg, #F8D888 0%, #E7AE45 52%, #C98A22 100%); color: #2A0A14;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 0 0 1px rgba(201, 138, 34, 0.6), 0 14px 32px -14px rgba(217, 119, 6, 0.85);
}
.maha-join__btn[aria-pressed="true"] { background: linear-gradient(135deg, #9B1844, #881337 60%, #7A1131); color: #FFF7EE; box-shadow: 0 0 0 1px rgba(252, 211, 77, 0.5), 0 14px 32px -14px rgba(136, 19, 55, 0.9); }
.maha-join__dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; opacity: 0.55; }
.maha-join__btn[aria-pressed="true"] .maha-join__dot { background: #FCD34D; opacity: 1; box-shadow: 0 0 0 0 rgba(252, 211, 77, 0.6); }
@media (prefers-reduced-motion: no-preference) {
  .maha-join__btn[aria-pressed="true"] .maha-join__dot { animation: maha-beat 2.4s ease-out infinite; }
  @keyframes maha-beat { 0% { box-shadow: 0 0 0 0 rgba(252, 211, 77, 0.6); } 70% { box-shadow: 0 0 0 10px rgba(252, 211, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(252, 211, 77, 0); } }
}
.maha-join__count { margin: 0; font-family: var(--serif); font-size: 1.25rem; color: #FDE7BF; min-width: 0; }
.maha-join__count b { color: var(--maha-gold); font-variant-numeric: tabular-nums; }
.maha-fine { margin: 14px 0 0; font-size: 0.8125rem; line-height: 1.55; color: var(--maha-muted); }
.maha-link {
  display: inline; min-height: 0; padding: 0; border: 0; background: none; color: var(--maha-gold); font: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer;
}
.maha-link:focus-visible { outline: 2px solid #FCD34D; outline-offset: 3px; border-radius: 4px; }

.maha-empty__title { font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.1rem); color: var(--maha-ink); margin-bottom: 0.4em; }
.maha-empty p { color: #EADBC8; }
.maha-empty__acts { display: flex; flex-wrap: wrap; gap: 10px; }
.maha-empty .btn--ghost { color: #FDE68A; border-color: rgba(252, 211, 77, 0.45); }
.maha-cal__title { font-size: 1.35rem; color: var(--maha-ink); margin-bottom: 0.6em; }
.maha-cal__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.maha-cal__list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 10px 14px; border-radius: 14px; background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(245, 158, 11, 0.14); }
.maha-cal__name { font-weight: 600; color: #FDE7BF; }
.maha-cal__dates { color: var(--maha-muted); font-variant-numeric: tabular-nums; }

.maha-globe { margin: 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--maha-ink); }
.maha-globe djjs-pulse-globe { width: 100%; max-width: 520px; --djjs-pulse-gold: #F2B54C; }
.maha-globe__cap { max-width: 26rem; text-align: center; font-size: 0.8125rem; color: var(--maha-muted); }

/* ---------- the room (in session) ---------- */
.maha-room {
  position: relative; overflow: hidden; color: var(--maha-ink); text-align: center;
  background: radial-gradient(70% 60% at 50% 40%, rgba(136, 19, 55, 0.28), rgba(13, 11, 9, 0) 70%), #0D0B09;
  padding-block: clamp(48px, 7vw, 110px); border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}
.maha-room__inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.maha-room__breath { position: absolute; left: 50%; top: clamp(120px, 14vw, 200px); width: 0; height: 0; pointer-events: none; z-index: 0; }
.maha-room__breath span {
  position: absolute; left: 50%; top: 50%; width: clamp(220px, 34vw, 420px); aspect-ratio: 1; border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.92); border: 1px solid rgba(252, 211, 77, 0.22);
  background: radial-gradient(circle, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0) 65%);
}
.maha-room__breath span:nth-child(2) { width: clamp(160px, 24vw, 300px); }
.maha-room__breath span:nth-child(3) { width: clamp(100px, 15vw, 190px); background: radial-gradient(circle, rgba(252, 211, 77, 0.2), rgba(252, 211, 77, 0) 70%); }
@media (prefers-reduced-motion: no-preference) {
  .maha-room__breath span { animation: maha-breathe 11s ease-in-out infinite; }
  .maha-room__breath span:nth-child(2) { animation-delay: -1.2s; }
  .maha-room__breath span:nth-child(3) { animation-delay: -2.4s; }
  @keyframes maha-breathe { 0%, 100% { transform: translate(-50%, -50%) scale(0.86); opacity: 0.55; } 45% { transform: translate(-50%, -50%) scale(1.06); opacity: 1; } }
}
.maha-room__inner > *:not(.maha-room__breath) { position: relative; z-index: 1; }
.maha-room__title { font-size: clamp(1.9rem, 1.4rem + 2vw, 3rem); color: var(--maha-ink); margin-bottom: 0.2em; overflow-wrap: anywhere; }
.maha-room__timer { margin: 0.2em 0 0; font-family: var(--serif); font-weight: 600; font-size: clamp(4rem, 2.4rem + 8vw, 8.5rem); line-height: 1; color: #FDE68A; font-variant-numeric: tabular-nums lining-nums; letter-spacing: 0.02em; }
.maha-room__sub { margin: 0.6em 0 0; color: #EADBC8; font-size: 1.05rem; }
.maha-tanpura { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px; margin-top: clamp(22px, 3vw, 34px); max-width: 40rem; }
.maha-tanpura__btn { color: #FDE68A; border-color: rgba(252, 211, 77, 0.45); background: rgba(0, 0, 0, 0.3); }
.maha-tanpura__btn[aria-pressed="true"] { background: rgba(252, 211, 77, 0.16); border-color: #F59E0B; }
.maha-tanpura__vol { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--maha-muted); font-size: 0.875rem; }
.maha-tanpura__vol input { width: min(200px, 50vw); accent-color: #D97706; min-height: 44px; }
.maha-tanpura .maha-fine { flex-basis: 100%; }
.maha-room__acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.maha-room .btn--quiet { color: #FDE68A; text-decoration-color: rgba(252, 211, 77, 0.45); }

/* ---------- below: follows the theme ---------- */
.maha-more { padding-block: clamp(48px, 6vw, 96px); }
.maha-more__grid { display: grid; gap: clamp(28px, 4vw, 56px); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .maha-more__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .maha-more__grid > .maha-how:only-child, .maha-upcoming[hidden] + .maha-how { grid-column: 1 / -1; max-width: 48rem; } }
.maha-more__title { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); margin-bottom: 0.6em; }
.maha-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.maha-steps li { position: relative; padding: 14px 16px 14px 56px; border-radius: 18px; background: var(--surface); border: 1px solid var(--champagne); box-shadow: var(--shadow-soft); counter-increment: s; }
.maha-steps li::before {
  content: counter(s); position: absolute; left: 14px; top: 14px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 600; color: var(--on-vermilion); background: linear-gradient(180deg, #9B1844, #7A1131);
}
.maha-steps b { color: var(--ink); }
.maha-upcoming__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.maha-upcoming__list li { padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--champagne); box-shadow: var(--shadow-soft); }
.maha-upcoming__list b { display: block; font-family: var(--serif); font-size: 1.3rem; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.maha-upcoming__list span { color: var(--muted); font-size: 0.9rem; }

/* ---------- 4K: a little larger, still clamped by .wrap ---------- */
@media (min-width: 2400px) {
  .maha-hero h1 { font-size: 5.6rem; }
  .maha-lead { font-size: 1.6rem; max-width: 46rem; }
  .maha-globe djjs-pulse-globe { max-width: 640px; }
  .maha-count__digits { max-width: 36rem; }
}
@media print { .maha-globe, .maha-join, .maha-room__breath { display: none !important; } }

/* In session the calm room comes first (the countdown card stays below for the details). */
.maha { display: flex; flex-direction: column; }
.maha[data-phase="live"] .maha-room { order: -1; }
