/* ==========================================================================
   Kandankarykkavu Devi Temple — kavilamma.in
   Mobile-first design system. Saffron / kumkum / temple-brass palette.
   ========================================================================== */

:root {
  /* Saffron family */
  --saffron-50:  #FFF6EA;
  --saffron-100: #FDE8CC;
  --saffron-200: #FAD09A;
  --saffron-400: #F39A3C;
  --saffron-500: #E8751A;
  --saffron-600: #C9560B;   /* button fill — passes AA with white */
  --saffron-700: #A2440A;

  /* Kumkum / maroon */
  --kumkum:     #B3261E;
  --maroon:     #6B1414;
  --maroon-900: #3B0B0B;

  /* Temple brass */
  --gold:     #D4A12A;
  --gold-300: #F1D17B;
  --gold-600: #A87912;

  /* Neutrals */
  --cream:  #FFFAF2;
  --sandal: #F8EBD6;
  --line:   #EBD5B3;
  --ink:    #2B1A10;
  --ink-2:  #6A4D3B;
  --ink-3:  #9A7B66;
  --leaf:   #3F7D2A;

  --bg: var(--cream);
  --surface: #FFFFFF;

  /* Type */
  --font-ml-display: "Noto Serif Malayalam", "Manjari", serif;
  --font-ml: "Manjari", "Noto Sans Malayalam", system-ui, sans-serif;
  --font-en-display: "Cormorant Garamond", "Noto Serif Malayalam", Georgia, serif;
  --font-ui: "Figtree", "Manjari", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-s: 10px;
  --radius:   16px;
  --radius-l: 24px;
  --shadow-s: 0 1px 2px rgba(91, 40, 8, .06), 0 2px 8px rgba(91, 40, 8, .06);
  --shadow:   0 2px 6px rgba(91, 40, 8, .06), 0 12px 32px rgba(91, 40, 8, .10);

  --gutter: 16px;
  --maxw: 1120px;
  --header-h: 60px;
  --tabbar-h: 66px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; overflow-x: clip; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--saffron-700); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--saffron-400); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--maroon); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 12px; }

.ml { font-family: var(--font-ml); }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Top invocation strip ---------- */
.invocation {
  background: var(--maroon-900);
  color: var(--gold-300);
  text-align: center;
  font-family: var(--font-ml);
  font-size: 13px;
  letter-spacing: .04em;
  padding: 6px 12px 4px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 250, 242, .88);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 20px rgba(91, 40, 8, .06); }
.site-header .container { display: flex; align-items: center; gap: 12px; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; margin-right: auto; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-text { min-width: 0; }
.brand-ml { display: block; font-family: var(--font-ml-display); font-weight: 700; font-size: 15px; line-height: 1.25; color: var(--maroon); }
.brand-en { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--saffron-700);
  text-decoration: none; cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }

.main-nav { display: none; }

/* ---------- Language switch ---------- */
.lang-btn {
  display: inline-grid; place-items: center; flex: none;
  min-width: 44px; height: 44px; padding: 0 10px;
  border-radius: 999px; border: 1.5px solid var(--saffron-200);
  background: var(--saffron-50); color: var(--saffron-700);
  font-weight: 800; font-size: 14px; line-height: 1; text-decoration: none;
}
.lang-btn:hover { background: var(--saffron-100); }
.lang-btn .lang-long { display: none; }
.lang-btn[lang="ml"] { font-family: var(--font-ml); font-size: 15px; padding-top: 3px; }
.lang-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 14px 16px 6px; padding: 4px; background: var(--sandal); border-radius: 999px; }
.lang-seg a { text-align: center; padding: 9px 8px 7px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: 15px; }
.lang-seg a[lang="ml"] { font-family: var(--font-ml); }
.lang-seg a[aria-current] { background: var(--surface); color: var(--saffron-700); box-shadow: var(--shadow-s); }
@media (max-width: 399px) { .site-header .container { gap: 8px; } .icon-btn, .lang-btn { width: 42px; min-width: 42px; height: 42px; padding: 0; } }
@media (max-width: 459px) { .brand-en { display: none; } .brand-ml { font-size: 15.5px; line-height: 1.2; } }

/* ---------- Mobile drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; visibility: hidden; overflow: hidden; }
.drawer.is-open { visibility: visible; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(43, 14, 4, .45); opacity: 0; transition: opacity .25s; }
.drawer.is-open .drawer-scrim { opacity: 1; }
.drawer-panel {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: min(86vw, 360px);
  background: var(--cream);
  transform: translateX(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  display: flex; flex-direction: column;
  box-shadow: -10px 0 40px rgba(43, 14, 4, .2);
  overflow-y: auto;
}
.drawer.is-open .drawer-panel { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.drawer-head strong { font-family: var(--font-ml-display); color: var(--maroon); }
.drawer nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid rgba(235, 213, 179, .6);
}
.drawer nav a svg { width: 22px; height: 22px; color: var(--saffron-600); flex: none; }
.drawer nav a .ml { display: block; font-weight: 700; font-size: 16px; line-height: 1.3; }
.drawer nav a small { display: block; font-size: 12px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.drawer nav a[aria-current="page"] { background: var(--saffron-100); }
.drawer-foot { margin-top: auto; padding: 20px; font-size: 14px; color: var(--ink-2); }

/* ---------- Bottom tab bar (mobile) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 250, 242, .96);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -6px 24px rgba(91, 40, 8, .08);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--tabbar-h);
  text-decoration: none; color: var(--ink-2);
  font-family: var(--font-ml); font-size: 12px; line-height: 1.1;
  position: relative;
}
.tabbar svg { width: 23px; height: 23px; }
.tabbar a[aria-current="page"] { color: var(--saffron-600); font-weight: 700; }
.tabbar a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px;
  border-radius: 0 0 4px 4px; background: var(--saffron-500);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 700; font-size: 16px; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: transform .15s, box-shadow .2s, background-color .2s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--saffron-600); color: #fff; box-shadow: 0 6px 18px rgba(201, 86, 11, .35); }
.btn-primary:hover { background: var(--saffron-700); }
.btn-gold { background: linear-gradient(180deg, var(--gold-300), var(--gold)); color: var(--maroon-900); box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
.btn-ghost { background: transparent; color: var(--saffron-700); border-color: var(--saffron-200); }
.btn-ghost-light { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn-block { width: 100%; }

/* ---------- Thoranam (mango-leaf garland) ---------- */
.thoranam {
  height: 40px;
  background: url("../images/svg/thoranam.svg") repeat-x center top / auto 40px;
  pointer-events: none;
}

/* ---------- Hero (home) ---------- */
.hero {
  position: relative;
  color: #fff;
  background:
    radial-gradient(120% 70% at 50% 30%, rgba(255, 196, 92, .55) 0%, rgba(255, 196, 92, 0) 60%),
    linear-gradient(180deg, #C24A0C 0%, #9C2A10 55%, #6B1414 100%);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("../images/svg/mandala-tile.svg") center / 120px 120px;
  opacity: .16;
}
.hero .thoranam { position: absolute; top: 0; left: 0; right: 0; z-index: 2; }
.hero-inner { position: relative; padding: 64px var(--gutter) 0; max-width: var(--maxw); margin: 0 auto; text-align: center; }

.hero-shrine { position: relative; width: min(78vw, 340px); margin: 0 auto; }
.thiruvachi { position: absolute; top: -13%; left: 50%; transform: translateX(-50%); width: 132%; max-width: none; z-index: 1; pointer-events: none; }
.idol-frame {
  position: relative; z-index: 2;
  aspect-ratio: 760 / 902;
  border-radius: 50% 50% 18px 18px / 42% 42% 18px 18px;
  overflow: hidden;
  border: 3px solid var(--gold-300);
  box-shadow: 0 0 0 6px rgba(241, 209, 123, .18), 0 0 60px 10px rgba(255, 190, 80, .45), 0 24px 50px rgba(0, 0, 0, .35);
  background: #0b1020;
}
.idol-frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-lamp { position: absolute; bottom: -6px; width: 17%; z-index: 3; }
.hero-lamp.left { left: -12%; }
.hero-lamp.right { right: -12%; }

.hero-eyebrow { margin-top: 30px; font-family: var(--font-ml); color: var(--gold-300); font-size: 15px; letter-spacing: .06em; }
.hero h1 { font-family: var(--font-ml-display); font-weight: 700; font-size: clamp(30px, 8.4vw, 54px); line-height: 1.25; margin-top: 6px; text-shadow: 0 2px 14px rgba(0, 0, 0, .25); }
.hero-en { font-family: var(--font-en-display); font-weight: 600; font-size: clamp(18px, 4.6vw, 26px); letter-spacing: .06em; color: #FFE6C2; margin-top: 4px; }
.hero-place { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 234, 204, .85); margin-top: 6px; }
.hero-actions { display: grid; gap: 10px; margin: 26px auto 0; max-width: 420px; }
.hero-skyline { position: relative; margin-top: 36px; color: var(--cream); height: 120px; }
.hero-skyline svg { position: absolute; left: 50%; bottom: -1px; transform: translateX(-50%); max-width: none; width: max(100%, 900px); height: auto; }

/* ---------- Page hero (inner pages) ---------- */
/* The section right after an inner-page hero starts flush; the hero already gives the breathing room */
.page-hero + .section, .sticky-chapters + .section { padding-top: 0; }
.page-hero {
  position: relative; overflow: hidden; isolation: isolate;
  color: #fff; text-align: center;
  background: linear-gradient(180deg, #B8420C 0%, #8E2210 100%);
}
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("../images/svg/mandala-tile.svg") center / 110px 110px;
  opacity: .14;
}
.page-hero .thoranam { position: absolute; top: 0; left: 0; right: 0; }
.page-hero-inner { padding: 58px var(--gutter) 0; max-width: 760px; margin: 0 auto; }
.page-hero .kicker { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-300); }
.page-hero h1 { font-family: var(--font-ml-display); font-size: clamp(28px, 7.6vw, 44px); margin-top: 6px; }
.page-hero p { color: #FFE6C2; font-size: 16px; margin: 8px auto 0; max-width: 560px; }
.page-hero .skyline { color: var(--cream); margin-top: 18px; height: 104px; position: relative; }
.page-hero .skyline svg { position: absolute; left: 50%; bottom: -1px; transform: translateX(-50%); max-width: none; width: max(100%, 900px); }

/* ---------- Sections ---------- */
.section { padding: 48px 0; }
.section-tight { padding: 28px 0; }
.section-sandal { background: var(--sandal); }
.section-head { text-align: center; margin-bottom: 26px; }
.section-head .kicker { font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--saffron-600); }
.section-head h2 { font-family: var(--font-ml-display); font-size: clamp(24px, 6.4vw, 34px); color: var(--maroon); margin-top: 4px; }
.section-head p { color: var(--ink-2); max-width: 560px; margin: 8px auto 0; }

.ornament { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--gold); margin: 12px auto 0; }
.ornament::before, .ornament::after { content: ""; height: 1px; width: 56px; background: linear-gradient(90deg, transparent, currentColor); }
.ornament::after { transform: scaleX(-1); }
.ornament svg { width: 28px; height: 28px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
}
.card-pad { padding: 20px; }

/* Status / darshan card */
.darshan { margin-top: -30px; position: relative; z-index: 5; }
.darshan-card { padding: 18px 18px 8px; }
.status-row { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.status-dot { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--ink-3); flex: none; box-shadow: 0 0 0 5px rgba(154, 123, 102, .15); }
.status-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; opacity: 0; }
.status-dot.open { background: #2E9B4E; box-shadow: 0 0 0 5px rgba(46, 155, 78, .15); }
.status-dot.closed { background: var(--kumkum); box-shadow: 0 0 0 5px rgba(179, 38, 30, .12); }
.status-dot.open::after { animation: pulse 2s ease-out infinite; }
.status-dot.closed::after { animation: pulse 2.6s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(2.8); opacity: 0; } }
.status-title { font-family: var(--font-ml); font-weight: 700; font-size: 18px; line-height: 1.3; }
.status-sub { font-size: 14px; color: var(--ink-2); }
.timing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.timing { padding: 14px 4px; }
.timing + .timing { border-left: 1px dashed var(--line); padding-left: 16px; }
.timing .label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.timing .label svg { width: 16px; height: 16px; color: var(--saffron-500); }
.timing .value { font-size: 19px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.timing .ml-label { font-family: var(--font-ml); font-size: 14px; color: var(--ink-2); }

/* Utsavam feature */
.utsavam-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius-l);
  color: #fff;
  background:
    radial-gradient(90% 60% at 100% 0%, rgba(241, 209, 123, .35), transparent 60%),
    linear-gradient(160deg, #7A1A12, #3B0B0B);
  padding: 26px 22px;
  box-shadow: var(--shadow);
}
.utsavam-card::after {
  content: ""; position: absolute; right: -40px; bottom: -40px; width: 200px; height: 200px;
  background: url("../images/svg/lotus.svg") center / contain no-repeat; opacity: .12;
}
.utsavam-card .kicker { color: var(--gold-300); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; }
.utsavam-card h3 { font-family: var(--font-ml-display); font-size: 26px; margin-top: 6px; }
.utsavam-card .dates { color: #FFE0B8; margin-top: 4px; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 20px 0; }
.countdown .cd-label { grid-column: 1 / -1; margin: 0; font-family: var(--font-ml); font-weight: 700; font-size: 16px; color: var(--gold-300); }
.countdown div { background: rgba(255, 255, 255, .08); border: 1px solid rgba(241, 209, 123, .25); border-radius: 12px; text-align: center; padding: 10px 4px; }
.countdown b { display: block; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--gold-300); }
.countdown span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #FFE0B8; }
.utsavam-card .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; position: relative; z-index: 1; }

/* Key-day list */
.keydays { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.keydays li { display: flex; align-items: center; gap: 14px; background: rgba(255, 255, 255, .07); border-radius: 12px; padding: 10px 14px; }
.keydays .d { text-align: center; min-width: 48px; }
.keydays .d b { display: block; font-size: 22px; line-height: 1; color: var(--gold-300); }
.keydays .d b.range { font-size: 16px; white-space: nowrap; }
.keydays .d small { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #FFE0B8; }
.keydays .t { font-family: var(--font-ml); font-weight: 700; font-size: 17px; line-height: 1.3; }
.keydays .t small { display: block; font-family: var(--font-ui); font-weight: 400; font-size: 13px; color: #FFE0B8; }

/* Quick links */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick {
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px 16px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-s); transition: transform .15s, box-shadow .2s;
}
.quick:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.quick-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--saffron-100); color: var(--saffron-700); }
.quick-icon svg { width: 22px; height: 22px; }
.quick .ml { font-weight: 700; font-size: 17px; line-height: 1.3; }
.quick small { color: var(--ink-3); font-size: 13px; line-height: 1.3; }

/* About teaser */
.split > * + * { margin-top: 44px; }
.about-teaser { display: grid; gap: 22px; align-items: center; }
.about-teaser .lead { font-family: var(--font-ml); font-size: 18px; line-height: 1.85; color: var(--ink); }
.fact-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.fact small { display: block; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.fact b { display: block; font-family: var(--font-ml); font-size: 16px; line-height: 1.4; color: var(--maroon); margin-top: 4px; }

/* Blessing quote */
.blessing {
  position: relative; text-align: center;
  padding: 36px 22px; border-radius: var(--radius-l);
  background: linear-gradient(180deg, var(--saffron-50), var(--saffron-100));
  border: 1px solid var(--saffron-200);
}
.blessing blockquote { margin: 0; font-family: var(--font-ml-display); font-size: 19px; line-height: 1.9; color: var(--maroon); }
.blessing cite { display: block; margin-top: 12px; font-style: normal; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }

/* Kunchan Nambiar verse — always set in Malayalam, even on English pages */
.verse { margin: 0; }
html .blessing blockquote.verse-lines { font-family: "Noto Serif Malayalam", "Manjari", serif; font-size: clamp(16px, 4.4vw, 20px); line-height: 2.1; font-weight: 600; color: var(--maroon); }
.verse figcaption { margin-top: 14px; font-family: var(--font-ml); font-size: 15px; color: var(--ink-2); }
.verse-more { margin: 18px 0 0; }
.prose .verse { margin: 26px 0; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { font-family: var(--font-ml); font-size: 15px; padding: 7px 14px 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.chip-dark { background: rgba(255, 255, 255, .08); border-color: rgba(241, 209, 123, .3); color: #FFF1DD; }

/* ---------- Long-read (history) ---------- */
.prose { max-width: 680px; margin: 0 auto; }
.prose p { font-family: var(--font-ml); font-size: 18px; line-height: 1.95; color: var(--ink); }
.prose h2 { font-family: var(--font-ml-display); font-size: 24px; color: var(--maroon); margin: 36px 0 12px; display: flex; align-items: center; gap: 10px; }
.prose h2[id] { scroll-margin-top: 75px; } /* clears the sticky chapter bar (on top of html scroll-padding for the header) */
.prose h2 svg { width: 26px; height: 26px; color: var(--gold); flex: none; }
.prose .dropcap::first-letter { font-family: var(--font-ml-display); float: left; font-size: 3.1em; line-height: 1; padding: 6px 10px 0 0; color: var(--saffron-600); }

.chapter-nav { display: flex; gap: 8px; overflow-x: auto; padding: 4px var(--gutter) 12px; margin: 0 calc(-1 * var(--gutter)); scrollbar-width: none; scroll-snap-type: x proximity; }
.chapter-nav::-webkit-scrollbar { display: none; }
.chapter-nav a { flex: none; scroll-snap-align: start; font-family: var(--font-ml); font-size: 15px; padding: 8px 14px 6px; border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.sticky-chapters { position: sticky; top: var(--header-h); z-index: 20; background: var(--cream); padding-top: 12px; border-bottom: 1px solid var(--line); }

.timeline { list-style: none; padding: 0; margin: 24px 0 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--saffron-400), var(--gold)); }
.timeline li { position: relative; padding: 0 0 22px 40px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--cream); border: 3px solid var(--saffron-500); }
.timeline b { display: block; font-family: var(--font-ml); color: var(--maroon); font-size: 17px; }
.timeline span { font-family: var(--font-ml); color: var(--ink-2); font-size: 16px; line-height: 1.7; }

.callout { display: flex; gap: 14px; padding: 18px; border-radius: var(--radius); background: var(--saffron-50); border: 1px solid var(--saffron-200); }
.callout svg { width: 28px; height: 28px; flex: none; color: var(--saffron-600); }
.callout p { margin: 0; font-family: var(--font-ml); font-size: 16px; line-height: 1.75; }

/* ---------- Offerings ---------- */
.seg { display: flex; gap: 6px; padding: 5px; background: var(--sandal); border-radius: 999px; max-width: 520px; margin: 0 auto 22px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 10px 8px 8px; line-height: 1.3; border-radius: 999px; font-family: var(--font-ml); font-weight: 700; font-size: 16px; cursor: pointer; color: var(--ink-2); }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--saffron-700); box-shadow: var(--shadow-s); }
.deity-head { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; }
.deity-head .emblem { width: 52px; height: 52px; flex: none; border-radius: 50%; background: var(--saffron-100); display: grid; place-items: center; color: var(--saffron-700); }
.deity-head .emblem svg { width: 30px; height: 30px; }
.deity-head h2 { font-family: var(--font-ml-display); color: var(--maroon); font-size: 24px; }
.deity-head p { margin: 0; font-size: 14px; color: var(--ink-3); }
.offer-list { display: grid; gap: 10px; }
.offer { display: flex; align-items: center; gap: 14px; padding: 16px; }
.offer-icon { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--saffron-50); border: 1px solid var(--saffron-200); display: grid; place-items: center; color: var(--saffron-600); }
.offer-icon svg { width: 20px; height: 20px; }
.offer-body { flex: 1; min-width: 0; }
.offer-body .ml { font-weight: 700; font-size: 17px; line-height: 1.35; display: block; }
.offer-body small { display: block; color: var(--ink-3); font-size: 13.5px; line-height: 1.4; margin-top: 2px; }
.offer-price { font-weight: 800; color: var(--saffron-700); white-space: nowrap; font-size: 16px; }
.offer-price.tba { color: var(--ink-3); font-weight: 600; font-size: 13px; }
[role="tabpanel"][hidden] { display: none; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; display: flex; gap: 14px; align-items: flex-start; }
.steps li::before { content: counter(step); flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--saffron-600); color: #fff; font-weight: 800; font-size: 15px; }
.steps li div { padding-top: 3px; }
.steps b { display: block; }
.steps span { color: var(--ink-2); font-size: 15px; }

/* ---------- Festival schedule ---------- */
.schedule { display: grid; gap: 12px; }
.sched-item { display: flex; gap: 16px; padding: 16px; align-items: flex-start; }
.sched-date { flex: none; width: 62px; text-align: center; border-radius: 12px; overflow: hidden; border: 1px solid var(--saffron-200); background: var(--surface); }
.sched-date .m { display: block; background: var(--saffron-600); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 3px 0; }
.sched-date .d { display: block; font-size: 24px; font-weight: 800; line-height: 1.3; color: var(--maroon); padding: 4px 0 0; }
.sched-date .w { display: block; font-size: 11px; color: var(--ink-3); padding-bottom: 4px; }
.sched-date.range .d { font-size: 17px; padding: 8px 0 2px; }
.sched-body .ml { font-weight: 700; font-size: 18px; line-height: 1.35; display: block; }
.sched-body small { display: block; color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.sched-body .me { font-family: var(--font-ml); color: var(--ink-3); font-size: 14px; }
.sched-item.highlight { border-color: var(--gold); background: linear-gradient(180deg, #FFFDF7, #FFF4DF); }
.badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--kumkum); color: #fff; margin-bottom: 6px; }

.notice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.notice { text-decoration: none; color: var(--ink); display: block; overflow: hidden; }
.notice img { aspect-ratio: 3 / 4; object-fit: cover; object-position: top; width: 100%; border-bottom: 1px solid var(--line); }
.notice div { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.notice b { font-size: 16px; }
.notice small { color: var(--saffron-700); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.notice small svg { width: 14px; height: 14px; }

/* ---------- Gallery ---------- */
.sticky-chapters .filter-row { margin-bottom: 0; padding: 4px var(--gutter) 12px; }
.gallery-note { margin: 18px 0 0; font-size: 14px; color: var(--ink-2); }
.gallery-note + .masonry { margin-top: 14px; }
.masonry { columns: 2 150px; column-gap: 10px; margin-top: 22px; scroll-margin-top: 75px; }
.masonry figure { margin: 0 0 10px; break-inside: avoid; position: relative; border-radius: 12px; overflow: hidden; background: var(--sandal); }
.masonry button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.masonry img { width: 100%; transition: transform .4s; }
.masonry figure:hover img { transform: scale(1.03); }
.masonry figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; font-size: 12.5px; line-height: 1.3; color: #fff; background: linear-gradient(transparent, rgba(30, 8, 2, .75)); pointer-events: none; }

.filter-row { display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)) 18px; padding: 2px var(--gutter); scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
/* Centre the pills when they fit; auto margins (not justify-content) keep the start reachable when they scroll */
.chapter-nav > :first-child, .filter-row > :first-child { margin-left: auto; }
.chapter-nav > :last-child, .filter-row > :last-child { margin-right: auto; }
.filter-row button { flex: none; border: 1px solid var(--line); background: var(--surface); padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.filter-row button[aria-pressed="true"] { background: var(--maroon); border-color: var(--maroon); color: #fff; }

.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(20, 6, 2, .94); display: none; flex-direction: column; }
.lightbox.is-open { display: flex; }
.lightbox-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; color: #fff; font-size: 14px; }
.lightbox-top .icon-btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff; }
.lightbox-stage { flex: 1; display: grid; place-items: center; padding: 0 8px; min-height: 0; touch-action: pan-y; }
.lightbox-stage img { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: 6px; }
.lightbox-cap { color: #FFE6C2; text-align: center; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); font-size: 15px; }
.lightbox-nav { display: none; }

/* Songs */
.song-list { display: grid; gap: 12px; }
.song { display: flex; align-items: center; gap: 14px; padding: 14px; }
.song-play {
  width: 52px; height: 52px; flex: none; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(180deg, var(--saffron-500), var(--saffron-600)); color: #fff;
  display: grid; place-items: center; box-shadow: 0 6px 14px rgba(201, 86, 11, .35);
}
.song-play svg { width: 22px; height: 22px; }
.song-body { flex: 1; min-width: 0; }
.song-body b { display: block; font-size: 16px; }
.song-body small { color: var(--ink-3); font-size: 13px; }
.song-progress { height: 4px; border-radius: 4px; background: var(--sandal); margin-top: 8px; overflow: hidden; cursor: pointer; }
.song-progress i { display: block; height: 100%; width: 0; background: var(--saffron-500); }
.song .icon-btn { width: 40px; height: 40px; }

/* ---------- Visit ---------- */
.route-map { padding: 10px; }
.route-map svg { width: 100%; height: auto; }
.map-embed { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 3; background: var(--sandal); }
.map-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.contact-rows { display: grid; gap: 0; }
.contact-row { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-bottom: 1px dashed var(--line); }
.contact-row:last-child { border-bottom: 0; }
.contact-row svg { width: 22px; height: 22px; color: var(--saffron-600); flex: none; margin-top: 2px; }
.contact-row small { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.contact-row a, .contact-row span { font-size: 17px; color: var(--ink); text-decoration: none; }
.contact-row a { font-weight: 700; color: var(--saffron-700); }
.etiquette { display: grid; gap: 10px; list-style: none; margin: 0; }
.etiquette li { display: flex; gap: 12px; align-items: flex-start; font-family: var(--font-ml); font-size: 16px; line-height: 1.6; }
.etiquette li svg { width: 20px; height: 20px; color: var(--gold-600); flex: none; margin-top: 3px; }

/* ---------- Footer ---------- */
.site-footer { position: relative; color: #F6DFC0; background: var(--maroon-900); }
/* Skyline sits wholly over the last section (on its own bg colour); that section reserves room for it.
   SVG is 1200×160 at max(100%, 900px) wide → max(13.34vw, 120px) tall. The .skyline box is exactly
   page-wide and clips the wider SVG itself — iOS ignores overflow-x on html/body when sizing the viewport. */
.site-footer .skyline { color: var(--maroon-900); position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); height: max(13.4vw, 120px); overflow: hidden; pointer-events: none; }
main > section:last-of-type { padding-bottom: calc(48px + max(13.4vw, 120px)); }
.site-footer .skyline svg { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); max-width: none; width: max(100%, 900px); }
.footer-inner { padding: 30px var(--gutter) 28px; max-width: var(--maxw); margin: 0 auto; display: grid; gap: 22px; }
.footer-brand { display: flex; gap: 12px; align-items: center; }
.footer-brand svg { width: 48px; height: 48px; flex: none; }
.footer-brand b { display: block; font-family: var(--font-ml-display); font-size: 18px; color: var(--gold-300); line-height: 1.35; }
.footer-brand small { letter-spacing: .12em; text-transform: uppercase; font-size: 11px; color: #D9B993; }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.site-footer h4 { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 4px 0; }
.site-footer a { color: #F6DFC0; text-decoration: none; }
.site-footer a:hover { color: var(--gold-300); }
.site-footer address { font-style: normal; line-height: 1.7; font-size: 15px; }
.footer-bottom { border-top: 1px solid rgba(241, 209, 123, .15); padding: 16px var(--gutter); text-align: center; font-size: 13px; color: #BF9E7C; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-bottom: 10px; }
.footer-legal a { color: #E7C9A3; text-decoration: none; font-size: 14px; padding: 4px 0; }
.footer-legal a:hover { color: #fff; text-decoration: underline; }

/* ---------- Legal pages (terms / privacy / refund) ---------- */
html[lang] .prose.legal p { font-size: 16px; line-height: 1.85; }
html[lang] .prose.legal h2 { font-size: 20px; margin: 30px 0 8px; }
.legal-num { color: var(--saffron-600); }
html[lang] .prose .legal-updated { font-size: 14px; color: var(--ink-3); margin: 0; }
html[lang] .prose .legal-note { font-size: 14px; color: var(--ink-2); margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }
.legal-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; font-size: 15px; }

/* ---------- Lamp flame animation ---------- */
.flame { transform-origin: 50% 90%; transform-box: fill-box; animation: flicker 2.6s ease-in-out infinite; }
.flame.f2 { animation-delay: -.8s; animation-duration: 3.1s; }
.flame.f3 { animation-delay: -1.5s; animation-duration: 2.2s; }
@keyframes flicker {
  0%, 100% { transform: scale(1, 1) rotate(0deg); opacity: 1; }
  25% { transform: scale(.94, 1.06) rotate(-2deg); }
  50% { transform: scale(1.04, .95) rotate(1.5deg); opacity: .92; }
  75% { transform: scale(.97, 1.04) rotate(-1deg); }
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .flame, .status-dot::after { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- English pages ----------
   The "ml" font tokens switch to the English faces, so every component keeps working;
   Malayalam words on English pages still fall back to the Malayalam fonts. */
html[lang="en"] {
  --font-ml: "Figtree", "Manjari", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ml-display: var(--font-en-display);
}
html[lang="en"] .hero h1 { font-size: clamp(38px, 10.5vw, 64px); line-height: 1.05; letter-spacing: .005em; }
html[lang="en"] .hero-en { font-family: "Noto Serif Malayalam", serif; font-size: clamp(16px, 4.2vw, 21px); letter-spacing: 0; }
html[lang="en"] .page-hero h1 { font-size: clamp(34px, 9vw, 52px); line-height: 1.1; }
html[lang="en"] .section-head h2 { font-size: clamp(30px, 7.6vw, 40px); line-height: 1.15; }
html[lang="en"] .utsavam-card h3 { font-size: 30px; }
html[lang="en"] .deity-head h2, html[lang="en"] .prose h2 { font-size: 28px; }
html[lang="en"] .brand-ml { font-size: 17px; line-height: 1.1; }
html[lang="en"] .brand-en, html[lang="en"] .kicker, html[lang="en"] .fact small { letter-spacing: .02em; text-transform: none; }
html[lang="en"] .brand-en { font-family: "Manjari", sans-serif; font-size: 12px; }
html[lang="en"] .prose p { font-size: 18px; line-height: 1.8; }
html[lang="en"] .blessing blockquote { font-size: 24px; line-height: 1.5; font-weight: 600; }
html[lang="en"] .footer-brand b { font-size: 21px; }

/* ==========================================================================
   Tablet
   ========================================================================== */
@media (min-width: 640px) {
  :root { --gutter: 24px; }
  .hero-actions { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .notice-grid { grid-template-columns: repeat(4, 1fr); }
  .masonry { columns: 3 180px; }
  .footer-cols { grid-template-columns: repeat(3, 1fr); }
  .offer-list { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   Desktop — top nav replaces tab bar
   ========================================================================== */
@media (min-width: 1024px) {
  :root { --header-h: 76px; }
  body { padding-bottom: 0; }
  .tabbar, .menu-btn { display: none; }
  .brand-mark { width: 48px; height: 48px; }
  .brand-ml { font-size: 18px; }
  .brand-en { font-size: 11.5px; }
  .main-nav { display: flex; gap: 2px; }
  .lang-btn { padding: 0 16px; }
  .lang-btn .lang-short { display: none; }
  .lang-btn .lang-long { display: inline; }
  .main-nav a { text-decoration: none; color: var(--ink); padding: 10px 14px 8px; border-radius: 999px; font-family: var(--font-ml); font-weight: 700; font-size: 15.5px; }
  .main-nav a:hover { background: var(--saffron-100); }
  .main-nav a[aria-current="page"] { color: var(--saffron-700); background: var(--saffron-100); }

  .hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; text-align: left; padding-top: 90px; }
  .hero-shrine { order: 2; width: 380px; }
  .hero-copy { order: 1; }
  .hero-eyebrow { margin-top: 0; }
  .hero-actions { margin-left: 0; }
  .hero-skyline { height: 170px; margin-top: 35px; }
  .page-hero .skyline { margin-top: 150px; }
  .split .quick-grid { grid-template-columns: 1fr 1fr; }

  .darshan { margin-top: -44px; }
  .darshan-card { display: grid; grid-template-columns: 1.1fr 2fr; align-items: center; padding: 22px 26px; gap: 20px; }
  .status-row { border-bottom: 0; padding-bottom: 0; border-right: 1px dashed var(--line); }
  .timing-grid { grid-template-columns: repeat(2, 1fr); }

  .split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
  .split > * + * { margin-top: 0; }
  .about-teaser { grid-template-columns: 1.2fr 1fr; gap: 48px; }
  .section { padding: 72px 0; }
  .masonry { columns: 4 200px; }
  .lightbox-nav { display: grid; position: absolute; top: 50%; transform: translateY(-50%); }
  .lightbox-nav.prev { left: 16px; }
  .lightbox-nav.next { right: 16px; }
  .footer-inner { grid-template-columns: 1fr 2fr; align-items: start; }
  main > section:last-of-type { padding-bottom: calc(72px + 13.4vw); }
}

/* "Coming soon" tag (offerings → how to book) */
.soon { display: inline-block; margin-top: 4px; padding: 3px 10px 1px; border-radius: 999px; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; background: var(--saffron-100); color: var(--saffron-700); border: 1px dashed var(--saffron-400); }

/* Bank details (offerings → how to book) */
.bank { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.bank h3 { display: flex; align-items: center; gap: 8px; font-size: 17px; color: var(--maroon); }
.bank h3 svg { width: 20px; height: 20px; }
.bank dl { margin: 12px 0 0; display: grid; gap: 10px; }
.bank dl > div { background: var(--sandal); border-radius: 10px; padding: 10px 12px; }
.bank dt { font-size: 12px; color: var(--ink-3); }
.bank dd { margin: 2px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 16px; overflow-wrap: anywhere; user-select: all; }
.bank dd span { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.copy-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--maroon); font-size: 12px; font-weight: 700; cursor: pointer; user-select: none; }
.copy-btn svg { width: 18px; height: 18px; }
.copy-btn.done { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.upi { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 12px; }
.upi-qr { flex: none; margin: 0 auto; }
.upi-qr img { display: block; width: 180px; height: 180px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.upi-body { flex: 1 1 220px; display: grid; gap: 10px; }
.upi-body small { color: var(--ink-3); font-size: 13px; }
.upi-body dl { margin: 0; }
/* Tap-to-pay / save-QR only make sense on a phone that has UPI apps */
.upi-mobile { display: grid; gap: 8px; margin-top: 12px; }
.upi-mobile small { color: var(--ink-3); font-size: 13px; margin-bottom: 6px; }
@media (min-width: 1024px) { .upi-mobile { display: none; } }
.upi-apps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.upi-apps > span { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-sizing: border-box; }
.upi-apps > span { font-family: var(--font-ui); font-size: 13px; font-weight: 700; color: #5F259F; }
.upi-apps img { display: block; }
.upi-apps > .upi-etc { background: none; border: 0; padding: 0 2px; color: var(--ink-3); font-weight: 600; }
