/* ===== EDIT COLOURS & FONTS HERE ===== */
:root {
  --ink: #1c0f0c;
  --kumkum: #8e1b16;
  --turmeric: #e3a62a;
  --sandal: #f4e7d4;
  --paper: #fffcf7;
  --leaf: #2e5b3b;
  --display: "Fraunces", Georgia, serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;
}
:root:lang(ml) {
  --display: "Noto Serif Malayalam", "Fraunces", serif;
  --body: "Noto Sans Malayalam", "Hanken Grotesk", sans-serif;
}

/* ===== LANGUAGE SWITCH ===== */
html[lang="en"] .ml, html[lang="ml"] .en { display: none !important; }

/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { font-family: var(--body); color: var(--ink); background: var(--paper); line-height: 1.65; font-size: 1rem; }
:lang(ml) body { line-height: 1.85; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; }
:lang(ml) :is(h1, h2, h3) { line-height: 1.35; }
img { max-width: 100%; display: block; }
a { color: inherit; }
ul, ol, dl { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--turmeric); outline-offset: 3px; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: .75rem; top: .75rem; z-index: 60; background: var(--turmeric); padding: .5rem .75rem; border-radius: 4px; }

/* ===== HEADER ===== */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 40; background: rgb(28 15 12 / .92); color: var(--paper); border-bottom: 1px solid rgb(227 166 42 / .25); backdrop-filter: blur(8px); }
.bar { height: 4rem; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; min-width: 0; }
.brand img { width: 2.5rem; height: 2.5rem; object-fit: contain; flex-shrink: 0; }
.brand span { font-family: var(--display); font-weight: 700; font-size: 1.125rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#nav { margin-left: auto; display: flex; gap: 1.5rem; font-size: .95rem; }
#nav a { text-decoration: none; padding: .25rem 0; }
#nav a:hover { color: var(--turmeric); }
.lang-switch { display: flex; gap: .25rem; border: 1px solid rgb(227 166 42 / .4); border-radius: 999px; padding: 2px; font-size: .875rem; }
.lang-switch button { border: 0; background: none; padding: .25rem .75rem; border-radius: 999px; cursor: pointer; color: rgb(255 252 247 / .8); }
.lang-switch button[aria-pressed="true"] { background: var(--turmeric); color: var(--ink); font-weight: 700; }
.menu-btn { display: none; background: none; border: 0; color: inherit; padding: .5rem; cursor: pointer; }
@media (max-width: 1023px) {
  .lang-switch { margin-left: auto; }
  .menu-btn { display: block; }
  #nav { display: none; position: absolute; top: 4rem; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--ink); padding: .5rem 1.25rem; border-top: 1px solid rgb(227 166 42 / .25); font-size: 1.125rem; }
  #nav.open { display: flex; }
  #nav a { padding: .75rem 0; }
}



/* ===== 2. Soft scroll reveal (only active when JS adds .anim) ===== */
.anim .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0s); }
.anim .reveal.in { opacity: 1; transform: none; }

/* ===== 3. Timeline line draws, dots light up ===== */
.timeline { border-left: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: rgb(227 166 42 / .6); }
.timeline .dot { left: -5px; }
.anim .timeline::before { transform: scaleY(0); transform-origin: top; transition: transform 1.4s ease; }
.anim .timeline.in::before { transform: scaleY(1); }
.anim .timeline .dot { transform: scale(0); transition: transform .45s cubic-bezier(.3, 1.6, .5, 1); transition-delay: calc(var(--i, 0) * .25s + .25s); }
.anim .timeline.in .dot { transform: scale(1); }

/* ===== 4. Live "Now / Next" pooja highlight ===== */
.timeline li.now, .timeline li.next { background: linear-gradient(90deg, rgb(227 166 42 / .25), transparent 85%); border-radius: 0 8px 8px 0; }
.timeline li.now .dot, .timeline li.next .dot { box-shadow: 0 0 0 4px rgb(227 166 42 / .35); }
.timeline li.now .t-name::after, .timeline li.next .t-name::after { margin-left: .6rem; padding: .1rem .55rem; border-radius: 999px; background: var(--turmeric); color: var(--ink); font-size: .7rem; font-weight: 700; vertical-align: middle; }
.timeline li.now .t-name::after { content: "NOW"; }
.timeline li.next .t-name::after { content: "NEXT"; }
html[lang="ml"] .timeline li.now .t-name::after { content: "ഇപ്പോൾ"; }
html[lang="ml"] .timeline li.next .t-name::after { content: "അടുത്തത്"; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgb(227 166 42 / .45); } 50% { box-shadow: 0 0 0 8px rgb(227 166 42 / 0); } }
@media (prefers-reduced-motion: no-preference) { .timeline li.now .dot, .timeline li.next .dot { animation: pulse 2s ease-in-out infinite; } }

/* ===== HERO ===== */
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--ink); color: var(--paper); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .25; z-index: -2; }
.glow { position: absolute; right: -6rem; top: 33%; width: 34rem; height: 34rem; border-radius: 50%; background: rgb(227 166 42 / .3); filter: blur(64px); z-index: -1; }
.hero-grid { display: grid; gap: 3rem; align-items: center; padding-top: 8rem; padding-bottom: 5rem; }
@media (min-width: 1024px) { .hero-grid { grid-template-columns: 1.15fr .85fr; min-height: 100svh; padding-bottom: 4rem; } }
.status { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid rgb(227 166 42 / .5); background: rgb(28 15 12 / .6); border-radius: 999px; padding: .375rem 1rem; font-size: .95rem; }
.status-dot { width: .625rem; height: .625rem; border-radius: 50%; background: rgb(255 252 247 / .4); }
.status-dot.on { background: #34d399; }
h1 { margin-top: 1.5rem; font-size: 2.25rem; font-weight: 700; }
@media (min-width: 640px) { h1 { font-size: 3.75rem; } }
.hero-sub { margin-top: 1.25rem; max-width: 36rem; font-size: 1.25rem; color: rgb(255 252 247 / .85); }
.actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.deity { width: 100%; max-width: 24rem; margin: 0 auto; }
.arch { border: 2px solid rgb(227 166 42 / .7); padding: .625rem; border-radius: 9999px 9999px 0 0; }
.arch img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 9999px 9999px 0 0; }
.deity figcaption { margin-top: 1rem; text-align: center; font-family: var(--display); font-size: 1.25rem; color: var(--turmeric); }

/* hero entrance: one orchestrated moment */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes glow { 0%, 100% { opacity: .55; } 50% { opacity: .85; } }
.hero-in > * { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.hero-in > :nth-child(2) { animation-delay: .12s; } .hero-in > :nth-child(3) { animation-delay: .24s; } .hero-in > :nth-child(4) { animation-delay: .36s; }
.lamp-glow { animation: glow 4.5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .hero-in > *, .lamp-glow { animation: none; } .shot img { transition: none !important; } }

/* ===== BUTTONS ===== */
.btn { display: inline-block; border-radius: 6px; padding: .75rem 1.5rem; font-weight: 700; text-decoration: none; border: 1px solid transparent; cursor: pointer; text-align: center; }
.btn.small { padding: .375rem 1rem; }
.btn-gold { background: var(--turmeric); color: var(--ink); } .btn-gold:hover { background: var(--paper); }
.btn-ghost { border-color: rgb(255 252 247 / .5); color: var(--paper); } .btn-ghost:hover { border-color: var(--turmeric); color: var(--turmeric); }
.btn-red { background: var(--kumkum); color: var(--paper); margin-top: 2rem; } .btn-red:hover { background: var(--ink); }
.btn-green { background: var(--leaf); color: var(--paper); width: 100%; margin-top: 1.5rem; } .btn-green:hover { background: var(--ink); }

/* ===== SECTIONS ===== */
.sec { padding: 5rem 0; }
@media (min-width: 640px) { .sec { padding: 6rem 0; } }
.paper { background: var(--paper); } .sandal { background: var(--sandal); } .kumkum { background: var(--kumkum); color: var(--paper); }
.heading { max-width: 42rem; margin-bottom: 2.5rem; }
.heading h2 { font-size: 1.875rem; font-weight: 700; color: var(--kumkum); }
@media (min-width: 640px) { .heading h2 { font-size: 2.25rem; } }
.heading p { margin-top: .75rem; font-size: 1.125rem; color: rgb(28 15 12 / .75); }
.kumkum .heading h2 { color: var(--paper); } .kumkum .heading p { color: rgb(255 252 247 / .8); }
h3 { font-size: 1.5rem; font-weight: 700; }
h3.green { color: var(--leaf); margin-bottom: .5rem; } h3.red { color: var(--kumkum); }
.prose { max-width: 40rem; font-size: 1.125rem; } .prose > * + * { margin-top: 1.25rem; }
.two-col { display: grid; gap: 2.5rem; }
@media (min-width: 768px) { .two-col { grid-template-columns: 1fr 1fr; } }
.card { border: 1px solid rgb(227 166 42 / .5); background: var(--sandal); border-radius: 8px; padding: 1.5rem; }

/* About */
.about-grid { display: grid; gap: 3rem; }
@media (min-width: 1024px) { .about-grid { grid-template-columns: 1.2fr .8fr; } }
.about-grid aside { align-self: start; }
.about-grid aside h3 { color: var(--kumkum); }
.subdeities { margin-top: 1.25rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; text-align: center; }
.subdeities img { height: 8rem; width: 100%; object-fit: contain; }
.subdeities p { margin-top: .5rem; font-weight: 700; }

/* Poojas timeline */
.kumkum h3 { color: var(--turmeric); margin-bottom: 1rem; }
.timeline { border-left: 2px solid rgb(227 166 42 / .6); }
.timeline li { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .75rem 0 .75rem 1.5rem; }
.dot { position: absolute; left: -7px; top: 1.15rem; width: .75rem; height: .75rem; border-radius: 50%; background: var(--turmeric); }
.t-name { font-size: 1.125rem; }
.t-time { font-family: var(--display); font-size: 1.25rem; font-weight: 700; color: var(--turmeric); white-space: nowrap; }

/* Festivals */
.fests { display: grid; column-gap: 3rem; }
@media (min-width: 768px) { .fests { grid-template-columns: 1fr 1fr; } }
.fests li { border-top: 1px solid rgb(142 27 22 / .3); padding: 1.75rem 0; }
.fest-top { display: flex; align-items: flex-start; gap: 1rem; }
.fest-icon { font-size: 1.875rem; line-height: 1.2; }
.fest-month { font-weight: 700; color: var(--leaf); }
.fests li > p { margin-top: .75rem; }
.fest-note { border-left: 4px solid var(--turmeric); padding-left: .75rem; color: rgb(28 15 12 / .8); }

/* Administration */
.admin-intro { max-width: 48rem; font-size: 1.125rem; margin-bottom: 3rem; }
.people { border-top: 1px solid rgb(28 15 12 / .15); border-bottom: 1px solid rgb(28 15 12 / .15); }
.people > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 1.5rem; padding: 1rem 0; }
.people > div + div { border-top: 1px solid rgb(28 15 12 / .15); }
.people dt { font-size: 1.125rem; font-weight: 700; } .people dd { color: var(--leaf); }
/* Committee members pop-up */
.more { margin-top: 2.5rem; } .more .btn { margin-top: 0; }
#membersDialog { margin: auto; width: min(40rem, calc(100% - 2.5rem)); max-height: 85vh; overflow: auto; padding: 0; border: 1px solid rgb(227 166 42 / .6); border-radius: 8px; background: var(--paper); color: var(--ink); }
#membersDialog::backdrop { background: rgb(28 15 12 / .85); }
.dlg-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.5rem; background: var(--kumkum); color: var(--paper); }
.dlg-head h3 { font-size: 1.375rem; }
.dlg-x { border: 0; background: none; color: inherit; font-size: 1.25rem; padding: .25rem .5rem; cursor: pointer; }
.members { counter-reset: m; padding: .5rem 1.5rem 1rem; }
.members li { counter-increment: m; display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; padding: .875rem 0; border-bottom: 1px solid rgb(28 15 12 / .15); font-size: 1.125rem; }
.members li:last-child { border-bottom: 0; }
.members li::before { content: counter(m); width: 2rem; color: var(--leaf); font-weight: 700; }
.members .who { flex: 1; font-weight: 700; } .members .role { color: var(--leaf); }
body:has(dialog[open]) { overflow: hidden; }

/* ===== Committee pop-up: style ===== */
.dlg-head { border-bottom: 3px solid var(--turmeric); }
.dlg-head h3 { color: var(--paper); }
.dlg-x { width: 2.25rem; height: 2.25rem; border-radius: 50%; transition: background .2s, transform .3s; }
.dlg-x:hover { background: rgb(255 252 247 / .18); transform: rotate(90deg); }
.members li { position: relative; transition: background .25s, padding-left .25s; }
.members li::before { display: grid; place-items: center; width: 2rem; height: 2rem; flex-shrink: 0; border: 1px solid var(--turmeric); border-radius: 50%; font-size: .85rem; color: var(--kumkum); transition: background .25s, color .25s; }
.members li:hover { background: rgb(227 166 42 / .14); padding-left: .5rem; }
.members li:hover::before { background: var(--kumkum); border-color: var(--kumkum); color: var(--paper); }

/* ===== Committee pop-up: animation ===== */
@media (prefers-reduced-motion: no-preference) {
  #membersDialog[open] { animation: dlgIn .5s cubic-bezier(.2, .8, .2, 1) both; }
  #membersDialog[open]::backdrop { animation: dlgFade .4s ease both; backdrop-filter: blur(4px); }
  #membersDialog[open] .members li { animation: rowIn .5s ease both; animation-delay: calc(var(--i, 0) * .05s + .2s); }
  #membersDialog.closing { animation: dlgOut .25s ease forwards; }
  #membersDialog.closing::backdrop { animation: dlgFadeOut .25s ease forwards; }
}
@keyframes dlgIn { from { opacity: 0; transform: translateY(28px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes dlgOut { to { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes dlgFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dlgFadeOut { to { opacity: 0; } }
@keyframes rowIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
/* Fix: keep the pop-up header above the scrolling names */
.dlg-head { z-index: 10; background: var(--kumkum); }
.members { position: relative; z-index: 0; }


/* Gallery */
.shots { column-count: 2; column-gap: 1rem; }
@media (min-width: 1024px) { .shots { column-count: 3; } }
.shot { display: block; width: 100%; margin-bottom: 1rem; padding: 0; border: 0; overflow: hidden; border-radius: 6px; background: var(--ink); cursor: zoom-in; }
.shot img { width: 100%; transition: transform .5s; } .shot:hover img { transform: scale(1.03); }
#lightbox { margin: auto; max-width: 94vw; max-height: 92vh; padding: 0; border: 0; background: transparent; color: var(--paper); }
#lightbox::backdrop { background: rgb(28 15 12 / .92); }
#lightbox figure { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
#lightbox img { max-height: 80vh; max-width: 100%; object-fit: contain; border-radius: 6px; }
#lightbox figcaption { display: flex; align-items: center; gap: 1rem; font-size: 1.125rem; }

/* Contact */
.contact h3 { margin-bottom: .5rem; }
.details { margin-top: 2rem; display: grid; gap: 1.25rem; }
.details dt { font-weight: 700; color: var(--leaf); }
.details a { text-underline-offset: 4px; text-decoration-color: var(--turmeric); }
.form { padding: 1.5rem; } @media (min-width: 640px) { .form { padding: 2rem; } }
.note { margin-bottom: 1.25rem; color: rgb(28 15 12 / .75); }
.form label { display: block; font-weight: 700; margin-top: 1rem; }
.form input, .form select, .form textarea { display: block; width: 100%; margin-top: .25rem; padding: .625rem .75rem; border: 1px solid rgb(28 15 12 / .25); border-radius: 6px; background: #fff; font-weight: 400; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--kumkum); }

/* Footer + WhatsApp */
.site-footer { background: var(--ink); color: rgb(255 252 247 / .85); }
.foot { display: flex; flex-direction: column; gap: .5rem; padding-top: 2.5rem; padding-bottom: 2.5rem; font-size: .875rem; }
@media (min-width: 640px) { .foot { flex-direction: row; align-items: center; justify-content: space-between; } }
.foot-name { font-family: var(--display); font-size: 1.25rem; font-weight: 700; color: var(--turmeric); }
.wa { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 30; width: 3.5rem; height: 3.5rem; border-radius: 50%; background: #25d366; display: grid; place-items: center; box-shadow: 0 6px 16px rgb(0 0 0 / .3); }
