/* =========================================================
   Chemmanthatta Mahadeva Kshethram — shared stylesheet
   Palette grounded in the temple's own laterite stone and its
   17th-18th century mural pigments (red / mustard-gold / green).
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,500&family=Hind:wght@400;500;600;700&family=Manjari:wght@400;700&display=swap');

:root{
  --bg:        #F6F1E6;
  --bg-deep:   #EDE3CE;
  --panel:     #FFFDF9;
  --ink:       #2E1B12;
  --ink-soft:  #5B4636;
  --rust:      #A83E1C;
  --rust-dark: #832E12;
  --maroon:    #5B1220;
  --gold:      #B8862F;
  --leaf:      #2F5233;
  --leaf-dark: #223D26;
  --line:      #DCCFB0;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Hind', -apple-system, 'Segoe UI', sans-serif;
  --font-mal: 'Manjari', 'Noto Sans Malayalam', sans-serif;

  --max-w: 1120px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img{ max-width:100%; display:block; }
a{ color: var(--rust-dark); }
a:hover{ color: var(--maroon); }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *{ animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

a:focus-visible, button:focus-visible, input:focus-visible{
  outline: 2px solid var(--leaf);
  outline-offset: 2px;
}

.wrap{ max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

h1,h2,h3,h4{ font-family: var(--font-display); color: var(--maroon); margin: 0 0 0.5em; font-weight: 600; line-height: 1.15; }
h1{ font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 700; }
h2{ font-size: clamp(1.5rem, 3vw, 2.05rem); }
h3{ font-size: 1.3rem; color: var(--rust-dark); }
p{ margin: 0 0 1.1em; max-width: 70ch; }
.lede{ font-size: 1.15rem; color: var(--ink-soft); }

.section-head{ margin-bottom: 1.6rem; }
.section-head h2{ display:inline-block; padding-bottom: 10px; border-bottom: 3px solid var(--gold); }
.section-head.center{ text-align:center; }

section{ padding: 3.2rem 0; }
section.alt{ background: var(--bg-deep); }

.skip-link{ position:absolute; left:-999px; top:auto; background: var(--maroon); color:#fff; padding: 10px 16px; z-index: 200; }
.skip-link:focus{ left: 12px; top: 12px; }

/* ============ HEADER / NAV ============ */
.site-header{ position: sticky; top:0; z-index: 100; background: rgba(246,241,230,0.96); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.1) blur(3px); }
.nav-row{ display:flex; align-items:center; justify-content:space-between; padding: 10px 20px; max-width: var(--max-w); margin:0 auto; position:relative; }
.brand{ display:flex; align-items:center; gap:12px; text-decoration:none; }
.brand img{ width:38px; height:56px; object-fit:cover; }
.brand-text{ display:flex; flex-direction:column; line-height:1.15; }
.brand-text .en{ font-family: var(--font-display); font-weight:700; color: var(--maroon); font-size:1.15rem; }
.brand-text .ml{ font-family: var(--font-mal); font-size:0.82rem; color: var(--rust-dark); }

.nav-links{ display:flex; gap: 4px; list-style:none; margin:0; padding:0; }
.nav-links a{ display:block; padding: 8px 14px; text-decoration:none; color: var(--ink); font-weight:600; font-size:0.97rem; border-bottom: 2px solid transparent; }
.nav-links a:hover{ color: var(--rust-dark); }
.nav-links a[aria-current="page"]{ color: var(--rust-dark); border-bottom-color: var(--gold); }

.nav-toggle{ display:none; background:none; border:1px solid var(--line); padding:8px 10px; cursor:pointer; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after{ content:""; display:block; width:20px; height:2px; background: var(--ink); position:relative; }
.nav-toggle span::before{ position:absolute; top:-6px; }
.nav-toggle span::after{ position:absolute; top:6px; }

@media (max-width: 800px){
  .nav-toggle{ display:block; }
  .nav-links{ position:absolute; left:0; right:0; top:100%; flex-direction:column; background: var(--bg); border-bottom: 1px solid var(--line); max-height:0; overflow:hidden; }
  .nav-links.open{ max-height: 480px; }
  .nav-links a{ padding: 14px 20px; border-bottom:1px solid var(--line); }
  .nav-links a[aria-current="page"]{ border-bottom:1px solid var(--line); border-left: 3px solid var(--gold); }
}

/* ============ HERO ============ */
.hero{ position: relative; color: #fff; overflow:hidden; }
.hero-slides{ position:relative; height: min(78vh, 620px); min-height:340px; }
.hero-slide{ position:absolute; inset:0; opacity:0; transition: opacity 1.1s ease; background-size:cover; background-position:center; }
.hero-slide.active{ opacity:1; }
.hero-slides::after{ content:""; position:absolute; inset:0; background: linear-gradient(180deg, rgba(46,27,18,0.15) 0%, rgba(46,27,18,0.55) 75%, rgba(46,27,18,0.85) 100%); }
.hero-content{ position:absolute; left:0; right:0; bottom:0; z-index:2; padding: 0 20px 2.4rem; }
.hero-content .inner{ max-width: var(--max-w); margin:0 auto; }
.hero-eyebrow{ font-family: var(--font-mal); font-size:1.15rem; color:#EBD9A8; margin-bottom:4px; }
.hero h1{ color:#fff; margin-bottom:0.25em; text-shadow: 0 2px 10px rgba(0,0,0,0.35); }
.hero .sub{ color:#F1E6CE; font-size:1.1rem; max-width:60ch; }
.hero-nav{ position:absolute; top:50%; transform:translateY(-50%); z-index:3; background:rgba(46,27,18,0.35); color:#fff; border:none; width:40px; height:40px; cursor:pointer; font-size:1.3rem; line-height:1; }
.hero-nav:hover{ background:rgba(46,27,18,0.6); }
.hero-nav.prev{ left:12px; } .hero-nav.next{ right:12px; }
@media (max-width:640px){ .hero-nav{ display:none; } }

/* ============ TODAY STRIP ============ */
.today-strip{ background: var(--maroon); color:#F6F1E6; }
.today-strip .wrap{ display:flex; flex-wrap:wrap; gap: 1.4rem 2.4rem; align-items:center; justify-content:space-between; padding-top:14px; padding-bottom:14px; }
.today-item{ display:flex; align-items:center; gap:10px; font-size:0.98rem; }
.today-dot{ width:9px; height:9px; border-radius:50%; background:#8a8a8a; flex:none; }
.today-dot.open{ background:#7FBF6B; box-shadow:0 0 0 3px rgba(127,191,107,0.25); }
.today-dot.closed{ background:#D97757; }
.today-item strong{ color:#EBD9A8; font-weight:700; }
.today-strip a{ color:#EBD9A8; font-weight:600; text-decoration:underline; }

/* ============ BUTTONS ============ */
.btn{ display:inline-block; font-family:var(--font-body); font-weight:700; padding: 11px 22px; text-decoration:none; border:2px solid transparent; cursor:pointer; font-size:0.98rem; }
.btn-primary{ background: var(--rust); color:#fff; }
.btn-primary:hover{ background: var(--rust-dark); color:#fff; }
.btn-outline{ background:transparent; border-color:#fff; color:#fff; }
.btn-outline:hover{ background:rgba(255,255,255,0.12); color:#fff; }
.btn-line{ background:transparent; border-color: var(--rust); color: var(--rust-dark); }
.btn-line:hover{ background: var(--rust); color:#fff; }
.btn-row{ display:flex; gap:12px; flex-wrap:wrap; }
.btn-sm{ padding:8px 16px; font-size:0.88rem; }

/* ============ CARDS / GRIDS ============ */
.grid{ display:grid; gap: 1.6rem; }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
.grid-2{ grid-template-columns: repeat(2, 1fr); }
.grid-4{ grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px){ .grid-3, .grid-4{ grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px){ .grid-2, .grid-3, .grid-4{ grid-template-columns: 1fr; } }

.card{ background: var(--panel); border:1px solid var(--line); }
.deity-card{ text-align:center; padding: 0 0 1.4rem; }
.deity-card img{ width:100%; aspect-ratio:1/1; object-fit:cover; margin-bottom:1rem; }
.deity-card h3{ margin-bottom:0.3em; padding:0 1rem; }
.deity-card p{ padding:0 1.2rem; margin:0; color:var(--ink-soft); font-size:0.96rem; }

.teaser-card{ padding: 1.6rem; }
.teaser-card h3{ margin-top:0; }

/* ============ TABLES ============ */
.table-scroll{ overflow-x:auto; border:1px solid var(--line); }
table{ width:100%; border-collapse:collapse; background:var(--panel); min-width:480px; }
caption{ caption-side:top; text-align:left; font-family:var(--font-display); font-size:1.2rem; color:var(--maroon); padding: 10px 0; font-weight:700; }
th, td{ text-align:left; padding: 10px 14px; border-bottom:1px solid var(--line); font-size:0.95rem; }
th{ background: var(--bg-deep); color:var(--maroon); font-family:var(--font-display); font-weight:700; font-size:1rem; }
tr:last-child td{ border-bottom:none; }
tbody tr:hover{ background: rgba(184,134,47,0.08); }
.now-row td{ background: rgba(127,191,107,0.18); font-weight:700; }

/* ============ VAZHIPADU GROUPS ============ */
.vazhipadu-group{ margin-bottom:1.8rem; }
.vazhipadu-group h3{ margin-bottom:0.6rem; }
.chip-list{ display:flex; flex-wrap:wrap; gap:8px; padding:0; margin:0; list-style:none; }
.chip-list li{ background: var(--panel); border:1px solid var(--line); padding: 6px 12px; font-size:0.92rem; color:var(--ink-soft); }

/* ============ GALLERY ============ */
.gallery-grid{ display:grid; gap:10px; grid-template-columns: repeat(4, 1fr); }
.gallery-grid img{ width:100%; height:220px; object-fit:cover; cursor:zoom-in; transition:opacity .15s; }
.gallery-grid img:hover{ opacity:0.85; }
@media (max-width:900px){ .gallery-grid{ grid-template-columns: repeat(3,1fr); } .gallery-grid img{ height:170px; } }
@media (max-width:600px){ .gallery-grid{ grid-template-columns: repeat(2,1fr); } .gallery-grid img{ height:140px; } }

.lightbox{ position:fixed; inset:0; background:rgba(20,12,8,0.92); z-index:300; display:none; align-items:center; justify-content:center; padding: 30px; }
.lightbox.open{ display:flex; }
.lightbox img{ max-width: 92vw; max-height: 86vh; object-fit:contain; }
.lightbox-close{ position:absolute; top:18px; right:24px; background:none; border:none; color:#fff; font-size:2rem; cursor:pointer; line-height:1; }

/* ============ QUOTE / PRELUDE ============ */
.poem-block{ background: var(--panel); border-left:4px solid var(--rust); padding: 1.6rem 1.8rem; margin-bottom:1.4rem; }
.poem-block p{ margin:0 0 0.35em; font-style:italic; color: var(--ink-soft); }
.poem-block p:first-child{ font-weight:700; font-style:normal; color:var(--maroon); }
.poem-block.mal{ font-family: var(--font-mal); border-left-color: var(--leaf); }
.poem-block.mal p{ font-style:normal; font-size:1.05rem; }
.poem-caption{ font-size:0.85rem; color:var(--ink-soft); }
.audio-card{ background:var(--panel); border:1px solid var(--line); padding:1.4rem; text-align:center; }
audio{ width:100%; max-width:480px; }
.video-embed{ position:relative; width:100%; padding-bottom:56.25%; height:0; overflow:hidden; border:1px solid var(--line); background:#000; }
.video-embed iframe{ position:absolute; inset:0; width:100%; height:100%; border:0; }

/* ============ CONTRIBUTION / ACCOUNT ============ */
.account-card{ background: var(--leaf-dark); color:#EFE9D8; padding:1.8rem; display:flex; gap:1.8rem; flex-wrap:wrap; align-items:center; }
.account-card dl{ margin:0; display:grid; grid-template-columns:auto 1fr; gap:6px 14px; }
.account-card dt{ color:#B9CBB3; font-size:0.85rem; }
.account-card dd{ margin:0; font-weight:700; }
.account-card img{ width:130px; border:4px solid #fff; }
.upi-placeholder{ border:2px dashed var(--line); display:flex; align-items:center; justify-content:center; text-align:center; font-size:0.85rem; line-height:1.4; aspect-ratio:1/1; flex:none; }
.upi-placeholder.dark{ border-color: rgba(239,233,216,0.45); color:#EFE9D8; }
.copy-btn{ background:transparent; border:1px solid #EFE9D8; color:#EFE9D8; padding:5px 10px; font-size:0.8rem; cursor:pointer; margin-left:8px; }
.copy-btn:hover{ background:#EFE9D8; color:var(--leaf-dark); }

/* ============ FOOTER ============ */
.site-footer{ background: var(--maroon); color:#EAD9BE; margin-top:2rem; }
.site-footer .wrap{ padding: 2.6rem 20px 1.6rem; display:grid; grid-template-columns:1.4fr 1fr 1fr; gap:2rem; }
.site-footer h4{ color:#fff; font-family:var(--font-display); margin-bottom:0.6em; }
.site-footer a{ color:#EAD9BE; }
.site-footer a:hover{ color:#fff; }
.site-footer ul{ list-style:none; padding:0; margin:0; }
.site-footer li{ margin-bottom:6px; }
.footer-bottom{ border-top:1px solid rgba(255,255,255,0.15); text-align:center; padding:14px 20px; font-size:0.85rem; color:#CBB693; }
@media (max-width:760px){ .site-footer .wrap{ grid-template-columns:1fr; } }

/* ============ PAGE HERO (inner pages) ============ */
.page-hero{ background: linear-gradient(155deg, var(--maroon) 0%, var(--rust-dark) 100%); color:#fff; padding: 2.6rem 0 2.2rem; }
.page-hero .ml{ font-family:var(--font-mal); color:#EBD9A8; font-size:1.1rem; }
.page-hero h1{ color:#fff; margin-bottom:0.15em; }
.page-hero p{ color:#F1E6CE; max-width:65ch; }
.breadcrumb{ font-size:0.85rem; color:#E0C9A0; margin-bottom:0.8rem; }
.breadcrumb a{ color:#E0C9A0; }

.jump-nav{ display:flex; gap:10px; flex-wrap:wrap; margin: 1.6rem 0 2.2rem; }
.legend-body{ max-width:74ch; }
.legend-body h3{ margin-top:2rem; }

.map-frame{ border:1px solid var(--line); }
.map-frame iframe{ width:100%; height:420px; border:0; display:block; }

.admin-card{ text-align:center; padding:1.6rem; }
.admin-card img{ width:96px; height:96px; object-fit:cover; border-radius:50%; margin:0 auto 0.8rem; border:3px solid var(--bg-deep); }

address{ font-style:normal; }
