/* Kshetra Darshanam
   Layout: a whitewashed-wall page under a strip of Kerala roof tiles; kumkum red for action,
   turmeric for festival marks, sea teal for links; one column of reading, cards for browsing. */
:root {
  --ground: #f6f5f1;
  --surface: #ffffff;
  --sunk: #eeebe4;
  --ink: #24170f;
  --muted: #6c5d50;
  --line: #e2dcd2;
  --kumkum: #a3241b;
  --kumkum-ink: #ffffff;
  --turmeric: #b9800f;
  --turmeric-soft: #f6e7c6;
  --sea: #0e5c63;
  --open: #2f7a3a;
  --closed: #8a5a50;
  --t-shiva: #3e4b88;
  --t-vishnu: #0e5c63;
  --t-devi: #a3241b;
  --t-ganesha: #a76a08;
  --shadow: 0 1px 2px rgb(36 23 15 / .06), 0 6px 20px rgb(36 23 15 / .06);
  --display: "Yatra One", "Mukta", Georgia, serif;
  --body: "Mukta", "Segoe UI", system-ui, sans-serif;
  --radius: 10px;
  --wrap: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #16110d; --surface: #201813; --sunk: #2a2019; --ink: #f2eae0; --muted: #b8a797;
    --line: #3a2e25; --kumkum: #e0584b; --kumkum-ink: #1a0f0b; --turmeric: #e6b24c; --turmeric-soft: #3a2c14;
    --sea: #67bfc5; --open: #79c487; --closed: #d39a8f;
    --t-shiva: #9aa6e6; --t-vishnu: #67bfc5; --t-devi: #e0584b; --t-ganesha: #e6b24c;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 20px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #16110d; --surface: #201813; --sunk: #2a2019; --ink: #f2eae0; --muted: #b8a797;
  --line: #3a2e25; --kumkum: #e0584b; --kumkum-ink: #1a0f0b; --turmeric: #e6b24c; --turmeric-soft: #3a2c14;
  --sea: #67bfc5; --open: #79c487; --closed: #d39a8f;
  --t-shiva: #9aa6e6; --t-vishnu: #67bfc5; --t-devi: #e0584b; --t-ganesha: #e6b24c;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 20px rgb(0 0 0 / .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 120px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 1.0625rem/1.6 var(--body); }
img { max-width: 100%; display: block; }
a { color: var(--sea); text-underline-offset: 3px; }
a:hover { color: var(--kumkum); }
:focus-visible { outline: 3px solid var(--turmeric); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { .wrap { padding-inline: 28px; } }
.eyebrow { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.prose { max-width: 66ch; display: grid; gap: 1em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.tiles { height: 12px; background: url("assets/roof-tiles.webp") left center / 120px auto repeat-x, #8a3b22; }
.bar { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--display); font-size: 1.35rem; line-height: 1; }
.brand-sub { display: block; font-size: .78rem; color: var(--muted); font-family: var(--body); margin-top: 2px; }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; color: var(--ink); padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: var(--sunk); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--kumkum); background: var(--sunk); }
.nav-btn { display: none; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 8px; padding: 8px 12px; font: inherit; cursor: pointer; }
.yatra-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding-inline: 5px; border-radius: 10px; background: var(--kumkum); color: var(--kumkum-ink); font-size: .75rem; font-weight: 700; margin-left: 4px; vertical-align: 1px; }
@media (max-width: 860px) {
  .nav-btn { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); flex-direction: column; padding: 8px 16px 16px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
}

/* ---------- Footer ---------- */
.site-footer { margin-top: 72px; border-top: 1px solid var(--line); background: var(--surface); }
.site-footer .wrap { display: grid; gap: 24px; padding-block: 32px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer h3 { font-size: 1.05rem; margin-bottom: 8px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--kumkum); }
.fineprint { font-size: .85rem; color: var(--muted); }

/* ---------- Buttons, chips, pills ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 9px 16px; border-radius: 999px; font: 600 .95rem var(--body); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn.primary { background: var(--kumkum); border-color: var(--kumkum); color: var(--kumkum-ink); }
.btn.primary:hover { filter: brightness(1.08); color: var(--kumkum-ink); }
.btn svg { width: 18px; height: 18px; }
.btn[aria-pressed="true"] { background: var(--turmeric-soft); border-color: var(--turmeric); }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 6px 14px; border-radius: 999px; font: 500 .92rem var(--body); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--sunk); color: var(--muted); }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.open { color: var(--open); }
.pill.closed { color: var(--closed); }
.pill.unknown::before { display: none; }
.tag { font-size: .8rem; font-weight: 600; letter-spacing: .04em; color: var(--tc, var(--muted)); }
.t-shiva { --tc: var(--t-shiva); } .t-vishnu { --tc: var(--t-vishnu); } .t-devi { --tc: var(--t-devi); } .t-ganesha { --tc: var(--t-ganesha); }

/* ---------- Placeholder art (temples without photos yet) ---------- */
.ph { position: relative; display: grid; place-items: center; background:
  radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--tc) 40%, transparent), transparent 60%),
  repeating-radial-gradient(circle at 50% 50%, transparent 0 14px, color-mix(in srgb, var(--tc) 12%, transparent) 14px 15px),
  var(--sunk); color: var(--tc); overflow: hidden; }
.ph span { font-family: var(--display); font-size: clamp(3rem, 8vw, 5.5rem); line-height: 1; opacity: .85; }
.ph small { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: .75rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s; min-width: 0; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.card .media { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; }
.card .ph.media { aspect-ratio: 16 / 10; }
.card .body { padding: 14px 16px 16px; display: grid; gap: 6px; flex: 1; align-content: start; }
.card h3 { font-size: 1.2rem; }
.card p { color: var(--muted); font-size: .95rem; line-height: 1.45; }
.card .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.draft-badge { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--turmeric); }

/* ---------- Home ---------- */
.home-hero { display: grid; gap: 28px; padding-block: 36px 24px; align-items: center; }
@media (min-width: 880px) { .home-hero { grid-template-columns: 1.05fr 1fr; padding-block: 56px 32px; } }
.home-hero .lede { font-size: 1.15rem; color: var(--muted); max-width: 52ch; margin-top: 14px; }
.saying { margin-top: 22px; padding-left: 16px; border-left: 3px solid var(--turmeric); }
.saying .ta { font-size: 1.15rem; font-weight: 600; }
.saying .en { color: var(--muted); font-size: .95rem; }
.hero-figure { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hero-figure img { width: 100%; aspect-ratio: 9 / 5; object-fit: cover; }
.hero-figure figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 14px 10px; font-size: .85rem; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / .6)); }
.search { position: relative; margin-top: 22px; max-width: 520px; }
.search input { width: 100%; font: inherit; padding: 12px 16px 12px 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.search svg { position: absolute; left: 15px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--muted); }
.results { margin-top: 8px; display: grid; gap: 2px; max-width: 520px; }
.results a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; border-radius: 8px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.results a span { color: var(--muted); font-size: .9rem; }
section.block { padding-block: 36px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 20px; }
.traditions { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.trad { display: grid; gap: 4px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.trad b { font-family: var(--display); font-weight: 400; font-size: 2rem; color: var(--tc); line-height: 1.1; }
.trad:hover { border-color: var(--tc); color: var(--ink); }
.month-list { display: grid; gap: 10px; }
.fest { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.fest .when { grid-row: span 2; align-self: start; font-weight: 700; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--turmeric); min-width: 70px; padding-top: 3px; }
.fest a { font-weight: 600; text-decoration: none; }
.fest p { color: var(--muted); font-size: .95rem; }
.empty { padding: 24px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }

/* ---------- Catalog ---------- */
.page-head { padding-block: 32px 8px; display: grid; gap: 10px; }
.filters { display: grid; gap: 12px; padding-block: 16px 20px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip-row .lbl { font-size: .85rem; color: var(--muted); margin-right: 4px; min-width: 70px; }
.count { color: var(--muted); font-size: .95rem; }

/* ---------- Temple page ---------- */
.crumbs { font-size: .9rem; padding-top: 18px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.t-hero { display: grid; gap: 24px; padding-block: 16px 24px; align-items: center; }
@media (min-width: 880px) { .t-hero { grid-template-columns: 1fr 1.1fr; gap: 40px; } }
.t-hero .frame { border-radius: var(--radius); overflow: hidden; background: var(--sunk); }
.t-hero .frame img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.t-hero .frame img.contain { object-fit: contain; background: var(--sunk); }
.t-hero .frame .ph { aspect-ratio: 4 / 3; }
.t-hero .frame figcaption { font-size: .8rem; color: var(--muted); padding: 6px 10px; }
.t-hero .intro { display: grid; gap: 12px; min-width: 0; }
.t-hero .alt { color: var(--muted); font-size: 1.05rem; }
.t-hero .summary { font-size: 1.15rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.facts div { padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; display: grid; gap: 2px; min-width: 0; }
.facts dt { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; font-weight: 500; line-height: 1.4; }
.tabs { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 75px); z-index: 20; background: var(--ground); border-bottom: 1px solid var(--line); margin-top: 28px; }
.tabs .wrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs .wrap::-webkit-scrollbar { display: none; }
.tabs a { white-space: nowrap; padding: 12px 12px 10px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 3px solid transparent; }
.tabs a.active, .tabs a:hover { color: var(--ink); border-bottom-color: var(--kumkum); }
.t-body { display: grid; gap: 0; }
.t-section { padding-block: 36px; border-bottom: 1px solid var(--line); display: grid; gap: 16px; }
.t-section:last-child { border-bottom: 0; }
.t-section header { display: grid; gap: 4px; }
.uniq { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.uniq li { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); line-height: 1.5; }
.uniq li strong { display: block; font-family: var(--display); font-weight: 400; font-size: 1.15rem; color: var(--kumkum); margin-bottom: 4px; }
ul.dots { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; max-width: 70ch; }
ul.dots li::marker { color: var(--turmeric); }
.two { display: grid; gap: 24px; }
@media (min-width: 880px) { .two { grid-template-columns: 1fr 1fr; } }
.timeline { display: grid; gap: 10px; }
.hours { display: grid; gap: 8px; }
.hours .row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-variant-numeric: tabular-nums; }
.hours .row b { font-weight: 600; }
.note { font-size: .95rem; color: var(--muted); }
.route { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.route div { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 4px; }
.route dt { font-weight: 700; }
.route dd { margin: 0; color: var(--muted); }
.nearby { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.near { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.near img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.near .body { padding: 14px 16px; display: grid; gap: 4px; }
.near .dist { font-size: .85rem; color: var(--turmeric); font-weight: 600; }
.near p { color: var(--muted); font-size: .95rem; }
.craft { padding: 20px; border-radius: var(--radius); background: var(--turmeric-soft); display: grid; gap: 6px; }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.gallery button { padding: 0; border: 0; background: var(--sunk); border-radius: 8px; overflow: hidden; cursor: zoom-in; }
.gallery img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgb(10 6 4 / .9); display: grid; place-items: center; padding: 24px; }
.lightbox img { max-height: 82vh; width: auto; border-radius: 6px; }
.lightbox p { color: #fff; text-align: center; margin-top: 10px; }
.lightbox button { position: absolute; top: 16px; right: 16px; background: #fff; color: #000; border: 0; border-radius: 999px; padding: 8px 14px; font: 600 .95rem var(--body); cursor: pointer; }
.todo { padding: 16px 18px; border: 1px dashed var(--turmeric); border-radius: var(--radius); background: var(--turmeric-soft); display: grid; gap: 6px; }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 36px; }
.pager a { flex: 1 1 240px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); display: grid; gap: 2px; }
.pager a.next { text-align: right; }
.pager small { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); translate: -50% 0; background: var(--ink); color: var(--ground); padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 70; }

/* ---------- Yatra planner ---------- */
.saved { display: grid; gap: 10px; }
.saved-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.saved-item .info { flex: 1; min-width: 0; }
.saved-item a { font-weight: 600; text-decoration: none; }
.saved-item small { display: block; color: var(--muted); }
.cal-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.cal { border-collapse: collapse; width: 100%; min-width: 760px; font-size: .9rem; }
.cal th, .cal td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: center; }
.cal th:first-child, .cal td:first-child { text-align: left; padding-left: 14px; position: sticky; left: 0; background: var(--surface); min-width: 180px; }
.cal td:first-child a { text-decoration: none; font-weight: 600; }
.cal thead th { font-weight: 600; color: var(--muted); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }
.cal th.now { color: var(--kumkum); }
.cal td.best { background: color-mix(in srgb, var(--sea) 14%, transparent); }
.cal td.now { box-shadow: inset 2px 0 0 var(--kumkum), inset -2px 0 0 var(--kumkum); }
.cal .f { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--turmeric); }
.legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: .9rem; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.month-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.month-pick .chip { min-width: 52px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.checklist input { margin-top: 5px; accent-color: var(--kumkum); width: 18px; height: 18px; }

/* ---------- Art ---------- */
.feature { display: grid; gap: 28px; align-items: start; }
@media (min-width: 880px) { .feature { grid-template-columns: 1fr 1fr; } .feature.flip > :first-child { order: 2; } }
.feature figure { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--sunk); }
.feature figure img { width: 100%; max-height: 640px; object-fit: cover; }
.feature figcaption { font-size: .85rem; color: var(--muted); padding: 8px 12px; }
.yantra { width: 100%; max-width: 360px; aspect-ratio: 1; margin-inline: auto; color: var(--kumkum); }
.levels { counter-reset: lv; list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
