/* ==========================================================================
   Naroth Shree Mahavishnu Temple — public site styles
   Direction: photographs at uneven sizes. A pale neutral ground, one deep
   ink, photographs placed like prints on a wall, and quiet type between them.
   Tokens first, then base, then components.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* A pale photographic neutral, one deep ink, and a saffron ramp in four steps:
     a vivid marigold for marks, then light → mid → deep. The primary button rests
     on the light step and the pointer takes it to the mid one; links, the active
     nav state and the donation band use the deep step, which is dark enough to
     carry the cream. */
  --page: #ededea;
  --paper: #f5f5f3;
  --mid: #e4e3df;
  --field: #14171a;
  --accent: #ef8a0c;
  /* How light the rest state may go is not a taste call: with a label on it, the
     mid step is the last one cream still carries, so the light step is the
     lightest saffron that passes at all (white label, measured 4.63:1). */
  --accent-light: #b25f09;
  --accent-mid: #a3540a;
  --accent-deep: #8f4708;

  --ink: #17181a;
  --muted: #4a4844;
  --on-field: #f3f3f0;
  --on-field-muted: #b4b8b1;
  --on-accent: #faf0dc;
  --on-accent-muted: #ecd8b6;
  /* The filled buttons' label. White rather than the band's cream, because their
     ground is lighter than the band's: cream drops to 4.1:1 on the light step,
     white holds 4.63:1 there and 5.48:1 on the mid one. */
  --on-button: #ffffff;

  --line: #d3d2cc;
  --focus: #8f4708;
  /* The one red on the public site: a form that could not be sent. */
  --danger: #9b2226;

  /* One display face and one text face per language — never more. */
  --font-display: "Noto Serif Malayalam", "Noto Serif", Georgia, "Times New Roman", serif;
  --font-body: "Noto Sans Malayalam", "Noto Sans", system-ui, -apple-system, sans-serif;

  --wrap: 1280px;
  --pad: clamp(20px, 5vw, 72px);
  --header-h: 72px;
  --band-pad: clamp(68px, 7.5vw, 116px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  /* Photo corners. The chrome radii (2–6px) are for buttons and inputs; a
     photograph reads better with a little more air than a control does. */
  --radius-photo: 12px;
}

html[lang="hi"] {
  --font-display: "Noto Serif Devanagari", "Noto Serif", Georgia, serif;
  --font-body: "Noto Sans Devanagari", "Noto Sans", system-ui, sans-serif;
}

html[lang="en"] {
  --font-display: "Noto Serif", Georgia, "Times New Roman", serif;
  --font-body: "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 18px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--page);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  color: inherit;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--accent);
  color: #fff;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* A section (or link) switched off by content, e.g. `donations.enabled === false`. */
.is-hidden {
  display: none !important;
}

/* The page loads with a spinner; nothing should slide around while it waits. */
.skip-link {
  position: absolute;
  left: var(--pad);
  top: -64px;
  z-index: 60;
  padding: 10px 16px;
  background: var(--field);
  color: var(--on-field);
  font-size: 15px;
  text-decoration: none;
  border-radius: 0 0 6px 6px;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 0;
}

/* --------------------------------------------------------------------------
   3. Layout grounds
   -------------------------------------------------------------------------- */

.wrap {
  width: min(calc(100% - (var(--pad) * 2)), var(--wrap));
  margin-inline: auto;
}

.band {
  position: relative;
  padding-block: var(--band-pad);
}

.band--paper {
  background: var(--paper);
}

.band--mid {
  background: var(--mid);
}

.band--dark {
  background: var(--field);
  color: var(--on-field);
  --ink: var(--on-field);
  --muted: var(--on-field-muted);
}

.band--accent {
  background: var(--accent-deep);
  color: var(--on-accent);
  --ink: var(--on-accent);
  --muted: var(--on-accent-muted);
}

.section-head {
  max-width: 58ch;
  margin-bottom: clamp(34px, 4vw, 58px);
}

.section-head h2 {
  font-size: clamp(1.4rem, 2.4vw, 2.05rem);
  font-weight: 300;
  line-height: 1.24;
}

.section-sub {
  margin-top: 14px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 52ch;
}

/* --------------------------------------------------------------------------
   4. Motion
   -------------------------------------------------------------------------- */

html.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   5. Buttons & links
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

/* The primary action wears the temple's saffron rather than ink, and the pointer
   takes it *darker* — rest on the light step, hover on the mid one — so the label
   never has to flip to dark text, which would read as a different element. */
.btn--solid {
  background: var(--accent-light);
  color: var(--on-button);
}

.btn--solid:hover {
  background: var(--accent-mid);
  color: var(--on-button);
}

.btn--quiet {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}

.btn--quiet:hover {
  background: var(--accent-mid);
  border-color: var(--accent-mid);
  color: var(--on-button);
}

/* No `.band--accent .btn--solid` override, deliberately: the one solid button in
   that band (the donate CTA) lives inside the paper `.panel--slip`, so it already
   reads as a saffron button on a light ground. Inverting it to cream would hide it
   on the cream panel. */

.band--accent .btn--quiet:hover {
  background: var(--on-accent);
  color: var(--accent-deep);
}

.btn--sm {
  min-height: 38px;
  padding: 8px 15px;
  font-size: 15px;
  border-radius: 3px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  color: inherit;
  text-decoration: none;
}

.text-link .link-label {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color 0.2s var(--ease);
}

.text-link:hover .link-label {
  text-decoration-color: currentColor;
}

/* Interface icons ride beside the label, never inside a [data-i18n] node: the
   language pass uses textContent and would wipe them. */
.btn svg,
.text-link svg,
.copy-btn svg,
.action-bar .btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn--sm svg {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   6. Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--page);
}

.site-header.is-stuck {
  box-shadow: 0 1px 0 rgba(23, 24, 26, 0.07), 0 12px 30px rgba(23, 24, 26, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.4vw, 20px);
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  min-width: 0;
  text-decoration: none;
}

.brand img {
  width: 28px;
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
  white-space: nowrap;
}

.brand-sub {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.nav-group {
  display: none;
}

.nav a {
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.78;
  padding: 6px 0;
  white-space: nowrap;
  transition: opacity 0.2s var(--ease), color 0.2s var(--ease);
}

.nav a:hover {
  opacity: 1;
}

.nav a.is-active {
  opacity: 1;
  color: var(--accent-deep);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: none;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
}

.lang-switch button {
  padding: 6px 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.lang-switch button:hover {
  color: var(--ink);
}

.lang-switch button[aria-pressed="true"] {
  background: var(--field);
  color: var(--on-field);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  place-items: center;
}

.nav-toggle > span:first-child {
  position: relative;
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--ink);
}

.nav-toggle > span:first-child::before,
.nav-toggle > span:first-child::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 1.5px;
  background: var(--ink);
}

.nav-toggle > span:first-child::before {
  top: -6px;
}

.nav-toggle > span:first-child::after {
  top: 6px;
}

/* The full Malayalam wordmark, eight nav links and the language switch want about
   1190px on one row. Below 1366 the wordmark steps aside — the mark alone carries
   the header, as it already did on phones — and the name is repeated in the hero. */
@media (max-width: 1365px) {
  .brand-text {
    display: none;
  }
}

/* Below this the mark, eight links and the language switch no longer fit; the nav
   becomes the hamburger. It used to be 1080 when the header carried six links. */
@media (max-width: 1240px) {
  .nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    padding: 10px var(--pad) 22px;
    background: var(--paper);
    box-shadow: 0 18px 30px rgba(23, 24, 26, 0.1);
  }

  .nav.is-open {
    display: flex;
  }

  .nav-group {
    display: block;
    margin: 8px 0 6px;
    font-size: 13px;
    color: var(--muted);
  }

  .nav a {
    width: 100%;
    padding: 13px 0;
    font-size: 17px;
    opacity: 1;
  }

  .nav-toggle {
    display: grid;
  }
}

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */

.hero {
  background: var(--page);
  padding-top: clamp(28px, 4vw, 58px);
  padding-bottom: clamp(72px, 9vw, 140px);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(20px, 2.5vw, 40px);
  row-gap: clamp(30px, 3.6vw, 54px);
  align-items: end;
}

.hero-copy {
  grid-column: 1 / -1;
  grid-row: 1;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 4.6rem);
  font-weight: 300;
  line-height: 1.06;
  letter-spacing: -0.015em;
}

.hero-deity {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 15px;
  color: var(--muted);
}

.hero-deity svg {
  width: 9px;
  height: 9px;
  color: var(--accent);
  flex: none;
}

.hero-tagline {
  margin-top: 12px;
  font-size: 20px;
  line-height: 1.45;
  max-width: 46ch;
}

.hero-place {
  margin-top: 8px;
  font-size: 15px;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.hero-live {
  grid-column: 1 / 6;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.live-label {
  font-size: 15px;
  color: var(--muted);
}

.hero-today {
  display: flex;
  flex-wrap: wrap;
  column-gap: 20px;
  row-gap: 8px;
}

.hero-chip {
  font-size: 15px;
  color: var(--muted);
}

.hero-chip b {
  font-weight: 500;
  color: var(--ink);
}

.hero-chip.is-open {
  color: var(--accent-deep);
  font-weight: 500;
}

.hero-figure {
  grid-column: 6 / -1;
  grid-row: 2 / 4;
  align-self: start;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-photo);
}

/* Deliberately still. The hero photo used to drift on a slow scale; it was
   re-timed (`ease-in-out`, so an `alternate` loop turns around gracefully) and
   given its own compositor layer with `will-change`, and still stuttered on real
   hardware — a bitmap scaled upwards is re-rasterised as it grows, and no easing
   curve hides that. The motion carried nothing, so it went rather than got tuned
   a third time. Don't add it back; see SESSION-LOG.md. */
.hero-figure img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
}

.next-puja {
  grid-column: 1 / 6;
  grid-row: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  align-items: flex-end;
}

.next-puja-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.next-puja-name {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 500;
}

.next-puja-when {
  margin-top: 2px;
  font-size: 15px;
  color: var(--muted);
}

.countdown {
  display: flex;
  gap: 16px;
  margin-top: 6px;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
}

.countdown-num {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.1;
  color: var(--accent-deep);
}

.countdown-cap {
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero-live,
  .hero-figure,
  .next-puja {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .hero-figure img {
    aspect-ratio: 4 / 3;
  }
}

/* --------------------------------------------------------------------------
   8. Today — the day as a quiet vertical timeline
   -------------------------------------------------------------------------- */

.banner-wrap {
  margin-bottom: 26px;
}

.open-banner {
  display: inline-block;
  font-size: 17px;
  color: var(--accent-deep);
}

.open-banner.is-closed {
  color: var(--muted);
}

.schedule {
  position: relative;
  max-width: 980px;
  padding-left: 40px;
}

.schedule::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 28px;
  bottom: 28px;
  width: 1px;
  background: var(--line);
}

.schedule-item {
  position: relative;
  padding-block: 22px;
}

.schedule-icon {
  position: absolute;
  left: -40px;
  top: 24px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--muted);
}

.schedule-icon svg {
  width: 16px;
  height: 16px;
}

.schedule-time {
  display: inline-block;
  font-size: 15px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.schedule-name {
  display: block;
  margin-top: 2px;
  font-size: 22px;
  font-weight: 400;
}

.schedule-note {
  margin-top: 6px;
  font-size: 17px;
  color: var(--muted);
  max-width: 56ch;
}

.now-badge {
  display: inline-block;
  margin-left: 12px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--accent-deep);
  vertical-align: middle;
}

.schedule-item.is-past {
  opacity: 0.62;
}

.schedule-item.is-now .schedule-time,
.schedule-item.is-now .schedule-name,
.schedule-item.is-now .schedule-icon {
  color: var(--accent-deep);
}

@media (max-width: 620px) {
  .schedule {
    padding-left: 30px;
  }

  .schedule::before {
    left: 8px;
  }

  .schedule-icon {
    left: -30px;
    width: 18px;
    height: 18px;
  }

  .schedule-name {
    font-size: 20px;
  }
}

/* --------------------------------------------------------------------------
   9. Pujas — set like a menu
   -------------------------------------------------------------------------- */

.puja-list {
  max-width: 1040px;
}

.puja-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 30px;
  align-items: baseline;
  padding-block: 30px;
}

.puja-date {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.puja-date .d {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 3vw, 1.75rem);
}

.puja-date .m {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.puja-body h3 {
  font-size: 22px;
  font-weight: 400;
}

.puja-desc {
  margin-top: 8px;
  font-size: 17px;
  color: var(--muted);
  max-width: 46ch;
}

.tag-soon {
  margin-left: 10px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--accent-deep);
}

.puja-meta {
  display: flex;
  align-items: center;
  gap: 22px;
  justify-self: end;
  white-space: nowrap;
}

.puja-price {
  display: flex;
  flex-direction: column;
  font-size: 20px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.puja-price small {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.tag-free {
  font-size: 20px;
  font-weight: 500;
  color: var(--accent-deep);
}

.puja-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: var(--muted);
}

.puja-time svg {
  width: 16px;
  height: 16px;
  flex: none;
}

@media (max-width: 860px) {
  .puja-card {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 8px 20px;
    padding-block: 24px;
  }

  .puja-meta {
    grid-column: 2;
    justify-self: start;
    margin-top: 14px;
    gap: 18px;
  }
}

@media (max-width: 520px) {
  .puja-meta {
    flex-wrap: wrap;
  }
}

/* --------------------------------------------------------------------------
   10. Festivals — the one dark room
   -------------------------------------------------------------------------- */

.list-tag {
  margin-bottom: 22px;
  font-size: 15px;
  color: var(--muted);
}

.event-list {
  max-width: 1000px;
}

.event-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 30px;
  align-items: baseline;
  padding-block: 28px;
}

.event-date {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.event-date .d {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 3vw, 1.75rem);
}

.event-date .m {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.event-date .range {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.event-body h3 {
  font-size: 22px;
  font-weight: 400;
}

.event-body p {
  margin-top: 8px;
  font-size: 17px;
  color: var(--muted);
  max-width: 52ch;
}

.event-when {
  justify-self: end;
  font-size: 15px;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .event-item {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px 20px;
  }

  .event-when {
    grid-column: 2;
    justify-self: start;
    margin-top: 10px;
  }
}

/* --------------------------------------------------------------------------
   11. Deities — a row of prints you can slide

   The track is the scroller, not a deck with a fixed frame: on a phone the next
   card peeks in from the right, which is what tells a thumb it can move. Cards
   are aligned to the top and every second one drops, so the row keeps the
   gallery's "prints pinned at uneven heights" rhythm.
   -------------------------------------------------------------------------- */

.deities {
  --d-gap: clamp(18px, 2.2vw, 32px);
}

.deity-track {
  display: flex;
  align-items: flex-start;
  gap: var(--d-gap);
  margin: 0;
  padding: 0 0 30px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

/* A thin, quiet scrollbar — the row must still look draggable on a desktop. */
.deity-track::-webkit-scrollbar {
  height: 6px;
}

.deity-track::-webkit-scrollbar-track {
  background: transparent;
}

.deity-track::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

.deity-card {
  flex: 0 0 clamp(248px, 29%, 372px);
  scroll-snap-align: start;
}

.deity-card:nth-child(even) {
  margin-top: clamp(0px, 3.4vw, 42px);
}

.deity-figure {
  margin: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--field);
  border-radius: var(--radius-photo);
}

.deity-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.deity-figure--blank {
  display: grid;
  place-items: center;
  color: var(--accent);
}

.deity-blank {
  display: block;
  width: 42%;
}

.deity-body {
  padding-top: 18px;
}

.deity-name {
  font-size: clamp(1.15rem, 1.7vw, 1.45rem);
}

.deity-note {
  margin-top: 8px;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 34ch;
}

.deity-nav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.deity-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.deity-btn:hover:not(:disabled),
.deity-btn:focus-visible:not(:disabled) {
  background: var(--field);
  border-color: var(--field);
  color: var(--on-field);
}

.deity-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.deity-btn svg {
  width: 18px;
  height: 18px;
}

/* Autoplay is a touch-layout enhancement; desktop keeps the two arrow controls. */
@media (min-width: 901px) {
  #deity-autoplay {
    display: none;
  }
}

.deity-empty {
  color: var(--muted);
  font-size: 17px;
}

@media (max-width: 900px) {
  .deity-card {
    flex-basis: min(74vw, 340px);
  }

  .deity-card:nth-child(even) {
    margin-top: 0;
  }
}

@media (max-width: 620px) {
  .deity-card {
    flex-basis: 78vw;
  }

  .deity-nav {
    justify-content: flex-start;
  }
}

/* --------------------------------------------------------------------------
   12. Trustees — office bearers on the wall, everyone else in the book

   Two weights, one section: the people who sign for the temple get a portrait
   like the deities above; the rest are a compact roster, because a fifteen-person
   committee at card size would push Donate two screens down.
   -------------------------------------------------------------------------- */

.trustee-group + .trustee-group {
  margin-top: clamp(44px, 5vw, 68px);
}

.trustee-group-title {
  margin-bottom: clamp(18px, 2vw, 26px);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  /* Indic scripts are not letter-spaced: wide tracking pulls Malayalam conjuncts
     apart and makes a label read as separate glyphs. The label relies on size,
     weight and colour instead. */
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.trustee-office {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(20px, 2.4vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.trustee-figure {
  margin: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--field);
  border-radius: var(--radius-photo);
}

.trustee-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.trustee-card:hover .trustee-figure img {
  transform: scale(1.03);
}

.trustee-figure--blank,
.trustee-thumb--blank {
  display: grid;
  place-items: center;
  color: var(--accent);
}

.trustee-mark {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  color: var(--accent);
}

.trustee-mark svg {
  width: 44%;
}

.trustee-body {
  padding-top: 16px;
}

.trustee-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  font-weight: 400;
  line-height: 1.25;
}

.trustee-role {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.trustee-note {
  display: block;
  margin-top: 8px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted);
}

.trustee-roster {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 30px) clamp(24px, 3vw, 44px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.trustee-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.trustee-thumb {
  width: 76px;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--field);
  border-radius: 6px;
}

.trustee-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trustee-thumb .trustee-mark {
  font-size: 26px;
}

.trustee-row-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.trustee-row .trustee-name {
  font-size: 17px;
}

.trustee-row .trustee-role {
  margin-top: 3px;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.trustee-row .trustee-note {
  margin-top: 4px;
  font-size: 13.5px;
}

@media (max-width: 980px) {
  .trustee-roster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .trustee-office {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .trustee-roster {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .trustee-row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 13px;
  }

  .trustee-thumb {
    width: 64px;
  }
}

/* --------------------------------------------------------------------------
   13. Gallery — prints on a wall

   The composition is a rhythm, not a scatter: one offset value (`--g-off`) is
   applied to the *second* print in each pair, and every crop is chosen to suit
   the photograph's own shape — a landscape stays a landscape, the one portrait
   stays portrait — so nothing is squashed into the wrong frame.
   -------------------------------------------------------------------------- */

.gallery {
  --g-off: clamp(56px, 8vw, 128px);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(20px, 2.5vw, 40px);
  row-gap: clamp(56px, 7vw, 110px);
  align-items: start;
}

.gallery-item {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  grid-column: span 4;
}

.gallery-item img {
  display: block;
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius-photo);
  transition: opacity 0.3s var(--ease);
}

.gallery-cap {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.gallery-item:hover img {
  opacity: 0.92;
}

/* Row 1 — a landscape print beside a tall one, dropped by the offset. */
.gallery-item:nth-child(1) {
  grid-column: 1 / span 7;
}
.gallery-item:nth-child(2) {
  grid-column: 9 / span 4;
  margin-top: var(--g-off);
}

/* Row 2 — a square, indented, beside a wide band dropped by the offset. */
.gallery-item:nth-child(3) {
  grid-column: 2 / span 4;
}
.gallery-item:nth-child(4) {
  grid-column: 7 / span 6;
  margin-top: var(--g-off);
}

/* Row 3 — the panorama runs the full width. */
.gallery-item:nth-child(5) {
  grid-column: 1 / -1;
}

/* Row 4 — a landscape print sitting in from the left. */
.gallery-item:nth-child(6) {
  grid-column: 4 / span 7;
}

.gallery-item:nth-child(1) img {
  aspect-ratio: 3 / 2;
}
.gallery-item:nth-child(2) img {
  aspect-ratio: 4 / 5;
}
.gallery-item:nth-child(3) img {
  aspect-ratio: 1 / 1;
}
.gallery-item:nth-child(4) img {
  aspect-ratio: 2 / 1;
}
.gallery-item:nth-child(5) img {
  aspect-ratio: 5 / 2;
}
.gallery-item:nth-child(6) img {
  aspect-ratio: 3 / 2;
}

@media (max-width: 760px) {
  .gallery {
    display: block;
  }

  /* On a phone the prints stack full width with one even gap: the differing
     heights of the crops carry the rhythm, not a scatter of widths. */
  .gallery-item,
  .gallery-item:nth-child(n) {
    width: 100%;
    margin: 0 0 48px;
  }

  .gallery-item:last-child {
    margin-bottom: 0;
  }
}

/* --------------------------------------------------------------------------
   14. About
   -------------------------------------------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(20px, 2.5vw, 40px);
  row-gap: clamp(40px, 5vw, 72px);
}

.about-text {
  grid-column: 1 / span 6;
}

#about-body {
  font-size: 17px;
  line-height: 1.65;
  max-width: 58ch;
}

.about-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 30px;
  margin-top: 34px;
}

.fact-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.fact-value {
  display: block;
  margin-top: 4px;
  font-size: 17px;
}

.fact-value a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}

.about-figure {
  grid-column: 8 / -1;
  margin: 0;
}

.about-figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-photo);
}

.about-map {
  grid-column: 1 / -1;
}

.map-label {
  margin-bottom: 14px;
  font-size: 15px;
  color: var(--muted);
}

.map-frame {
  overflow: hidden;
}

.map-frame iframe,
.map-photo {
  width: 100%;
  aspect-ratio: 21 / 9;
  border: 0;
  object-fit: cover;
}

.map-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 22px;
}

@media (max-width: 900px) {
  .about-text,
  .about-figure {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .about-facts {
    grid-template-columns: 1fr;
  }

  .map-frame iframe,
  .map-photo {
    aspect-ratio: 4 / 3;
  }
}

/* --------------------------------------------------------------------------
   15. Donate
   -------------------------------------------------------------------------- */

.donate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(22px, 2.6vw, 40px);
  align-items: start;
}

.panel {
  background: color-mix(in srgb, var(--on-accent) 12%, transparent);
  padding: clamp(26px, 3vw, 40px);
}

.panel--slip {
  background: var(--paper);
  color: var(--ink);
  --ink: #17181a;
  --muted: #4a4844;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 400;
}

.panel-title svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.panel-note {
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 48ch;
}

.panel--slip .panel-title {
  font-size: 22px;
}

.copy-list {
  margin-top: 22px;
  display: grid;
  gap: 20px;
}

.copy-row {
  display: flex;
  align-items: baseline;
  gap: 20px;
}

.copy-row .k {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.copy-row .v {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  margin-left: auto;
  padding: 6px 0;
  border: 0;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.copy-btn-label {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color 0.2s var(--ease);
}

.copy-btn:hover .copy-btn-label {
  text-decoration-color: currentColor;
}

.copy-btn.is-done {
  color: var(--accent-deep);
}

.copy-btn.is-done .copy-btn-label {
  text-decoration-color: currentColor;
}

/* On the deep-saffron band the deep accent is too close to the ground. */
.band--accent .copy-btn.is-done {
  color: var(--on-accent);
}

.panel--slip .copy-row {
  margin-top: 22px;
}

.donate-pay {
  margin-top: 18px;
}

.donate-qr {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 220px;
}

.donate-qr img {
  display: block;
  width: 100%;
  height: auto;
  padding: 8px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: var(--radius-photo);
}

.donate-qr figcaption {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.seva-note {
  margin-top: 24px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 48ch;
}

.seva-note strong {
  color: var(--ink);
  font-weight: 500;
}

@media (max-width: 760px) {
  .donate-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   16. Contact / enquiry
   -------------------------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: clamp(28px, 3.6vw, 64px);
  align-items: start;
}

.enquiry-form {
  display: grid;
  gap: 20px;
  /* The form is as wide as a comfortable measure, not as wide as the band. */
  max-width: 640px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}

.field-opt {
  font-weight: 400;
  color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.enquiry-form input,
.enquiry-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.2s var(--ease);
}

.enquiry-form textarea {
  min-height: 132px;
  resize: vertical;
}

.enquiry-form input:hover,
.enquiry-form textarea:hover {
  border-color: color-mix(in srgb, var(--line) 45%, var(--ink));
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 4px;
}

.form-note {
  flex: 1 1 240px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 48ch;
}

.form-note--plain {
  flex: none;
  max-width: 56ch;
}

/* Reserved even when empty, so the button never jumps as the answer arrives. */
.form-status {
  min-height: 24px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

.form-status.is-error {
  color: var(--danger);
}

.contact-aside h3 {
  font-size: 20px;
  font-weight: 400;
}

.contact-facts {
  display: grid;
  gap: 16px;
  margin: 20px 0 0;
}

.contact-fact dt {
  font-size: 13px;
  color: var(--muted);
}

.contact-fact dd {
  margin: 3px 0 0;
  font-size: 17px;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   17. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--field);
  color: var(--on-field);
  --ink: var(--on-field);
  --muted: var(--on-field-muted);
  padding-block: clamp(60px, 7vw, 96px) clamp(34px, 4vw, 54px);
}

.footer-cols {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1.4fr;
  gap: clamp(26px, 3vw, 50px);
}

.footer-about-col #footer-about {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 40ch;
}

.footer-town {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

.site-footer h3 {
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

.footer-nav,
.footer-timings,
.footer-contact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.footer-nav a,
.footer-contact a {
  font-size: 15px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.footer-nav a:hover,
.footer-contact a:hover {
  color: var(--ink);
}

.footer-timings li {
  display: flex;
  gap: 12px;
  font-size: 13px;
}

.ft-time {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  flex: none;
  min-width: 66px;
}

.ft-name {
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.footer-photos p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 40ch;
}

.footer-wordmark {
  margin-top: clamp(56px, 7vw, 96px);
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4.6rem);
  font-weight: 300;
  line-height: 1.1;
  color: var(--ink);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: clamp(30px, 4vw, 46px);
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 960px) {
  .footer-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px 30px;
  }

  .footer-about-col {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .footer-cols {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   18. Mobile action bar
   -------------------------------------------------------------------------- */

.action-bar {
  display: none;
}

@media (max-width: 640px) {
  .action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    gap: 10px;
    padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--page);
    box-shadow: 0 -10px 26px rgba(23, 24, 26, 0.1);
  }

  .action-bar .btn {
    flex: 1;
  }
}

/* --------------------------------------------------------------------------
   19. Lightbox
   -------------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 64px);
  background: rgba(10, 11, 12, 0.94);
}

.lightbox img {
  max-width: min(100%, 1100px);
  max-height: 78vh;
  width: auto;
  margin-inline: auto;
  object-fit: contain;
  border-radius: var(--radius-photo);
}

.lightbox-cap {
  margin-top: 16px;
  font-size: 15px;
  color: var(--on-field-muted);
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: clamp(14px, 3vw, 28px);
  right: clamp(14px, 3vw, 28px);
  width: 46px;
  height: 46px;
  border: 0;
  background: transparent;
  color: var(--on-field);
  font-size: 30px;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   20. Loading & error
   -------------------------------------------------------------------------- */

.page-status {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 20px;
  text-align: center;
  background: var(--page);
}

.page-status h2 {
  font-size: 22px;
}

/* Without JavaScript nothing is loading: the page arrives with its content already in
   it. This overlay is a full-screen panel, so leaving it up would hide the very text
   that makes the page readable without script — and the `hidden` attribute that
   removes it is set by app.js, which is not running. */
html:not(.js) .page-status {
  display: none;
}

.page-status .panel-note {
  max-width: 40ch;
  color: var(--muted);
}

.spinner {
  width: 30px;
  height: 30px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   21. Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  /* The carousel is scrolled by CSS on a track, not by the document, so it needs
     its own opt-out; `app.js` reads the same query before asking for a smooth move. */
  .deity-track {
    scroll-behavior: auto;
  }

  /* The trustee portrait's hover zoom is decoration: keep the page still. */
  .trustee-card:hover .trustee-figure img {
    transform: none;
  }

  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .spinner {
    animation: none;
  }
}
