/* ==========================================================================
   Tilsari.com — design tokens
   Values taken verbatim from README.md "Design Tokens".
   ========================================================================== */
:root {
  --bg:            oklch(98% 0.008 235);
  --surface:       #fff;
  --border:        oklch(90% 0.012 235);
  --text:          oklch(24% 0.02 250);
  --muted:         oklch(48% 0.02 250);
  --body:          oklch(38% 0.03 250);
  --accent:        oklch(46% 0.13 235);
  --accent-light:  oklch(58% 0.15 235);
  --gold:          oklch(74% 0.13 75);
  --footer-bg:     oklch(22% 0.03 245);
  --footer-rule:   oklch(35% 0.02 245);
  --footer-dim:    oklch(75% 0.02 245);
  --footer-note:   oklch(70% 0.02 245);
  --footer-fine:   oklch(65% 0.02 245);
  --tint:          oklch(94% 0.015 230);
  --track:         oklch(94% 0.01 235);

  --r-input: 9px;
  --r-btn:  10px;
  --r-card: 16px;
  --r-pill: 999px;

  --pad-x: 48px;
  --shadow-card: 0 4px 24px oklch(24% 0.02 250 / 0.07);
  --shadow-lift: 0 10px 28px oklch(24% 0.02 250 / 0.10);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
}
img, iframe { max-width: 100%; }
a { color: var(--accent); }

/* Visible focus for keyboard users — never remove the outline outright. */
:focus-visible {
  outline: 3px solid var(--accent-light);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -9999px;
  background: var(--accent); color: #fff;
  padding: 10px 16px; border-radius: var(--r-btn);
  z-index: 100; font-weight: 700; text-decoration: none;
}
.skip-link:focus { left: 16px; top: 12px; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 18px var(--pad-x);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); }
.wordmark { font-weight: 800; font-size: 21px; letter-spacing: -0.01em; }

/* Logo: gold sun + two CSS border-triangle mountains. No image asset. */
.logo-mark { position: relative; width: 36px; height: 36px; flex: none; }
.logo-sun {
  position: absolute; top: 2px; right: 1px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--gold);
}
.logo-peak-back, .logo-peak-front {
  position: absolute; bottom: 4px; width: 0; height: 0;
  border-left-style: solid; border-right-style: solid; border-bottom-style: solid;
  border-left-color: transparent; border-right-color: transparent;
}
.logo-peak-back  { left: 0;    border-left-width: 16px; border-right-width: 16px; border-bottom-width: 22px; border-bottom-color: var(--accent); }
.logo-peak-front { left: 11px; border-left-width: 13px; border-right-width: 13px; border-bottom-width: 16px; border-bottom-color: var(--accent-light); }

.site-nav { display: flex; gap: 28px; flex-wrap: wrap; }
.site-nav a {
  font-size: 15px; font-weight: 600;
  color: var(--text); text-decoration: none;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); }

/* Language switcher — pill segmented control */
.lang-switch {
  display: flex; gap: 2px;
  background: var(--track);
  border-radius: var(--r-pill);
  padding: 4px;
}
.lang-switch button {
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--muted);
  background: transparent; border: 0;
  padding: 5px 12px; border-radius: var(--r-pill);
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] {
  background: #fff; color: var(--text); font-weight: 700;
}

/* ==========================================================================
   Layout
   ========================================================================== */
main { flex: 1; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--pad-x); }
.section { padding: 64px 0; }
.page-head { padding: 56px 0 8px; }
.page-title { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 12px; }
.page-sub { font-size: 17px; color: var(--body); margin: 0; max-width: 68ch; }
h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 24px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 28px;
}
.tint-box {
  background: var(--tint);
  border-radius: var(--r-card);
  padding: 24px 28px;
  color: var(--body);
  font-size: 15px;
}
.dashed-card {
  background: var(--tint);
  border: 1px dashed oklch(78% 0.03 235);
  border-radius: var(--r-card);
  padding: 28px;
}
.pill-badge {
  display: inline-block;
  background: #fff; color: var(--muted);
  border-radius: var(--r-pill);
  padding: 6px 14px; font-size: 13px; font-weight: 600;
}

.btn {
  display: inline-block;
  font: inherit; font-size: 15px; font-weight: 700;
  padding: 12px 22px; border-radius: var(--r-btn);
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-light); }
.btn-ghost { background: #fff; color: var(--accent); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); }

/* ==========================================================================
   Home — hero
   ========================================================================== */
/* The hero is a real photograph of Tilsari (media-source/landingHero-crop.png,
   a panoramic crop of landingMain.png). It replaced the CSS-drawn sun and
   clip-path mountain range that stood in before a photo existed.

   The copy sits on a frosted panel rather than directly on the image. White
   text over cumulus cloud tops out around 2:1 contrast even under a heavy
   scrim — well under WCAG AA — so the panel carries the text and the scrim
   only has to separate the panel from the sky. */
.hero {
  position: relative; overflow: hidden;
  background: oklch(42% 0.11 245);   /* holds the space while the photo loads */
  padding: 104px var(--pad-x) 172px;
  text-align: center;
}
.hero-photo { position: absolute; inset: 0; }
.hero-photo img {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
  /* The source is already cropped to a panoramic 2.88:1, which is close to
     the hero band's own aspect, so cover barely trims and centre is right.
     A tighter anchor would only matter if the source went back to being tall. */
  object-position: center;
}
/* Scrim. ::after is the last child, so at the same stacking level it paints
   over .hero-photo and under .hero-inner (z-index: 1). */
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    oklch(20% 0.05 245 / 0.30) 0%,
    oklch(20% 0.05 245 / 0.10) 42%,
    oklch(20% 0.05 245 / 0.40) 100%
  );
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: 660px; margin: 0 auto;
  background: oklch(100% 0 0 / 0.90);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  backdrop-filter: blur(16px) saturate(1.08);
  border: 1px solid oklch(100% 0 0 / 0.55);
  border-radius: 20px;
  padding: 40px 40px 38px;
  box-shadow: 0 20px 54px oklch(20% 0.04 245 / 0.30);
}
.eyebrow {
  display: inline-block;
  background: var(--tint); color: var(--accent);
  border-radius: var(--r-pill);
  padding: 7px 16px; font-size: 13px; font-weight: 700;
  margin-bottom: 22px;
}
.hero h1 { font-size: 52px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 18px; }
.hero-sub { font-size: 19px; color: var(--body); margin: 0 auto 30px; max-width: 60ch; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Facts strip — overlaps the hero */
.facts {
  position: relative; z-index: 2;
  margin-top: -88px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  padding: 32px 36px;
  display: grid; grid-template-columns: 1fr 2fr; gap: 32px; align-items: center;
}
.facts-title { font-size: 20px; font-weight: 800; margin: 0 0 6px; }
.facts-note { font-size: 13px; color: var(--muted); margin: 0; }
.facts-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.fact-num { font-size: 30px; font-weight: 800; color: var(--accent); line-height: 1.1; }
.fact-label { font-size: 13px; color: var(--muted); }

/* Highlights */
.highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.hl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 24px;
  text-decoration: none; color: inherit;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.hl-card:hover { transform: translateY(-4px); border-color: var(--accent-light); box-shadow: var(--shadow-lift); }
.hl-title { font-size: 17px; font-weight: 800; margin: 0 0 8px; }
.hl-desc  { font-size: 14px; color: var(--body); margin: 0; }

.weather { display: flex; gap: 18px; align-items: flex-start; }
.weather-emoji { font-size: 30px; line-height: 1; }
.weather h3 { font-size: 18px; font-weight: 800; margin: 0 0 8px; }
.weather p  { margin: 0; font-size: 15px; color: var(--body); }

/* ==========================================================================
   Gallery (photos)
   ========================================================================== */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.gallery-item figure { margin: 0; }
.frame {
  aspect-ratio: 4 / 3;
  border-radius: var(--r-card);
  overflow: hidden;
  background: linear-gradient(160deg, oklch(90% 0.04 230), oklch(84% 0.05 228));
  border: 1px solid var(--border);
  display: grid; place-items: center;
  position: relative;
}
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Placeholder shown until real village photography is supplied. */
.frame-placeholder { text-align: center; color: oklch(42% 0.06 235); padding: 16px; }
.frame-placeholder svg { display: block; margin: 0 auto 8px; opacity: 0.75; }
.frame-placeholder span { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
.gallery-item figcaption { font-size: 15px; font-weight: 700; margin-top: 12px; }

/* ==========================================================================
   Media gallery (photos + video)
   ========================================================================== */
.media-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.filter-btn {
  font: inherit; font-size: 14px; font-weight: 600;
  background: #fff; color: var(--muted);
  border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 8px 18px; cursor: pointer;
}
.filter-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.media-item { margin: 0; }
.media-frame { position: relative; aspect-ratio: 16 / 10; }
.media-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: oklch(22% 0.03 245 / 0.86); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  padding: 4px 10px; border-radius: var(--r-pill);
  text-transform: uppercase;
}
.media-caption { font-size: 15px; font-weight: 700; margin-top: 12px; }
.media-meta { font-size: 13px; color: var(--muted); font-weight: 500; }
.media-empty { grid-column: 1 / -1; }

/* ==========================================================================
   Events
   ========================================================================== */
.event-list { border-top: 1px solid var(--border); }
.event-row {
  display: grid; grid-template-columns: 140px 1fr; gap: 24px;
  padding: 26px 0; border-bottom: 1px solid var(--border);
}
.event-month { font-size: 15px; font-weight: 700; color: var(--accent); }
.event-title { font-size: 18px; font-weight: 800; margin: 0 0 6px; }
.event-desc  { font-size: 15px; color: var(--body); margin: 0; line-height: 1.6; }

/* ==========================================================================
   Culture / Panchayat
   ========================================================================== */
.stack { display: grid; gap: 20px; }
.card h3 { font-size: 19px; font-weight: 800; margin: 0 0 10px; }
.card p  { margin: 0; font-size: 15px; color: var(--body); }

.pradhan { display: flex; align-items: center; gap: 18px; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%; flex: none;
  background: var(--tint); color: var(--accent);
  display: grid; place-items: center;
  font-size: 21px; font-weight: 800; letter-spacing: 0.02em;
}
.pradhan-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.pradhan-name  { font-size: 20px; font-weight: 800; }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.admin-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.admin-value { font-size: 16px; font-weight: 700; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.map-frame { aspect-ratio: 16 / 10; border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--border); }
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 14px;
  padding: 11px 13px;
  border: 1px solid var(--border); border-radius: var(--r-input);
  background: #fff; color: var(--text);
}
.field textarea { min-height: 120px; resize: vertical; }
.form-status { font-size: 14px; margin: 12px 0 0; min-height: 1.4em; }
.form-status[data-state="ok"]  { color: oklch(48% 0.13 150); font-weight: 600; }
.form-status[data-state="err"] { color: oklch(52% 0.18 25);  font-weight: 600; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: var(--footer-bg); color: #fff;
  padding: 48px var(--pad-x) 32px;
}
.footer-top {
  display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap;
  max-width: 1120px; margin: 0 auto;
}
.footer-village { font-size: 19px; font-weight: 800; }
.footer-tagline { font-size: 14px; color: var(--footer-dim); }
.footer-note { font-size: 13px; color: var(--footer-note); font-style: italic; max-width: 46ch; }
.footer-bottom {
  max-width: 1120px; margin: 28px auto 0;
  padding-top: 20px; border-top: 1px solid var(--footer-rule);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--footer-fine);
}

/* ==========================================================================
   Utilities

   These exist so no element needs a style="" attribute. That is what lets the
   Content-Security-Policy drop 'unsafe-inline' from style-src — with it, an
   injected style attribute is a live attack surface (CSS can exfiltrate data
   through attribute selectors and background-image URLs, and can be used to
   redress the UI). Keep this list short; if it starts growing, the thing you
   are reaching for probably wants a real component class.
   ========================================================================== */
.u-mt-14 { margin-top: 14px; }
.u-mt-18 { margin-top: 18px; }
.u-mt-28 { margin-top: 28px; }
.u-mb-14 { margin-bottom: 14px; }
.u-mb-18 { margin-bottom: 18px; }
.u-pt-0  { padding-top: 0; }
.u-block { display: block; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .facts { grid-template-columns: 1fr; }
  .contact-cols { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --pad-x: 20px; }
  .site-header { justify-content: center; }
  .site-nav { gap: 18px; justify-content: center; }
  .hero { padding: 40px var(--pad-x) 120px; }
  .hero-inner { padding: 28px 22px 26px; border-radius: var(--r-card); }
  .hero h1 { font-size: 34px; }
  .hero-sub { font-size: 17px; }
  .page-title { font-size: 30px; }
  .facts-grid { grid-template-columns: repeat(2, 1fr); }
  .event-row { grid-template-columns: 1fr; gap: 6px; }
}

/* Honour the OS "reduce motion" setting. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hl-card:hover { transform: none; }
}
