/* =========================================================
   THEME SYSTEM — 3 selectable themes via body[data-theme]
   ========================================================= */
:root {
  --radius: 10px;
  --shadow: 0 2px 10px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Noto Sans', sans-serif;
  --header-h: 140px;
}

/* Mobile browsers draw their own translucent tap-highlight rectangle over
   whatever's tapped, on top of any custom press effect the page already
   defines (like .btn's own scale+ripple below). On a button whose resting
   colour is already fairly dark (e.g. the green-earth theme's dark green
   primary), that extra overlay can make the button flash as an
   unexpectedly darker/muddier colour for an instant while pressed.
   Turning the default off and relying purely on the site's own
   intentional :active feedback keeps every button's press state
   consistent and correct across browsers/themes. */
a, button, .btn, .icon-btn { -webkit-tap-highlight-color: transparent; }

body, body[data-theme="classic-blue"] {
  --c-primary: #0b3d91;
  --c-primary-dark: #082a66;
  --c-accent: #ff9933;
  --c-success: #138808;
  --c-bg: #f7f9fc;
  --c-surface: #ffffff;
  --c-text: #1c2530;
  --c-text-muted: #5b6b7d;
  --c-border: #e3e8ef;
}
body[data-theme="green-earth"] {
  --c-primary: #1e5631;
  --c-primary-dark: #123a20;
  --c-accent: #d4af37;
  --c-success: #2e7d32;
  --c-bg: #f6f8f3;
  --c-surface: #ffffff;
  --c-text: #202a1f;
  --c-text-muted: #5c6b58;
  --c-border: #e1e8dc;
}
body[data-theme="saffron-royal"] {
  --c-primary: #8b1e2e;
  --c-primary-dark: #641420;
  --c-accent: #d4af37;
  --c-success: #138808;
  --c-bg: #fbf6f2;
  --c-surface: #ffffff;
  --c-text: #2a1c1c;
  --c-text-muted: #7a6058;
  --c-border: #efe0d8;
}
body[data-theme="coastal-teal"] {
  --c-primary: #0e6e73;
  --c-primary-dark: #0a4d51;
  --c-accent: #f2a541;
  --c-success: #2e7d32;
  --c-bg: #f4fafa;
  --c-surface: #ffffff;
  --c-text: #14282a;
  --c-text-muted: #4f6b6d;
  --c-border: #dcebec;
}
/* High-contrast theme: WCAG AAA-oriented palette — pure black text on
   white, a darker/more saturated primary so text on colored backgrounds
   still clears a 7:1 contrast ratio, and borders dark enough to be visible
   without relying on color alone. */
body[data-theme="high-contrast"] {
  --c-primary: #00297a;
  --c-primary-dark: #001a52;
  --c-accent: #b35900;
  --c-success: #0b6b0b;
  --c-bg: #ffffff;
  --c-surface: #ffffff;
  --c-text: #000000;
  --c-text-muted: #2b2b2b;
  --c-border: #3a3a3a;
}
body[data-theme="high-contrast"] a { text-decoration: underline; }
body[data-theme="high-contrast"] .btn, body[data-theme="high-contrast"] .icon-btn { outline: 2px solid transparent; }
body[data-theme="high-contrast"] :focus-visible { outline: 3px solid #000; outline-offset: 2px; }
body.dark-mode {
  --c-bg: #10151c;
  --c-surface: #1a212b;
  --c-text: #e7ecf3;
  --c-text-muted: #a3afc0;
  --c-border: #2a3441;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { margin: 0; font-family: var(--font-body); background: var(--c-bg); color: var(--c-text); transition: background 0.25s ease, color 0.25s ease; }
h1, h2, h3, h4, h5 { font-family: var(--font-heading); margin: 0 0 0.5em; color: var(--c-text); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.hide-sm { display: inline; }
button { font-family: inherit; cursor: pointer; }

/* Accessibility: visible keyboard focus ring on every interactive element
   (buttons, links, form fields) — previously relied entirely on browser
   defaults, which some reset styles above end up suppressing. */
:focus-visible {
  outline: 3px solid var(--c-accent, #ff9933);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip-to-content link: invisible until focused (first Tab press), then
   jumps keyboard/screen-reader users straight past the header/nav/ticker
   to <main id="main-content"> — added once here since navbar.php is
   included at the top of every page. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--c-primary);
  color: #fff;
  padding: 12px 20px;
  z-index: 200;
  font-weight: 600;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

/* Page loading animation: a brief, branded overlay shown while the page's
   assets finish loading, instead of a jarring blank-white flash. Fades out
   smoothly (not abruptly hidden) and is removed from the DOM entirely once
   done so it never intercepts clicks or shows up for keyboard/screen-reader
   navigation. See js/site.js for the fade-out trigger. */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg, #f7f9fc);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.page-loader.loader-done { opacity: 0; visibility: hidden; pointer-events: none; }
.page-loader-mark { position: relative; width: 76px; height: 76px; display: flex; align-items: center; justify-content: center; }
.page-loader-logo { width: 42px; height: 42px; object-fit: contain; animation: loaderPulse 1.1s ease-in-out infinite; }
.page-loader-ring {
  position: absolute;
  inset: 0;
  width: 76px;
  height: 76px;
  animation: loaderSpin 1.1s linear infinite;
}
.page-loader-ring circle {
  fill: none;
  stroke: var(--c-primary, #0b3d91);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 120 43;
  opacity: 0.85;
}
@keyframes loaderSpin { to { transform: rotate(360deg); } }
@keyframes loaderPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.92); opacity: 0.75; } }
@media (prefers-reduced-motion: reduce) {
  .page-loader-logo, .page-loader-ring { animation: none; }
}

/* =========================================================
   UTILITY BAR + TRICOLOR STRIP
   ========================================================= */
.utility-bar { background: var(--c-primary-dark); color: #fff; font-size: 13px; }
.utility-inner { display: flex; justify-content: space-between; align-items: center; padding: 6px 20px; }
.utility-left { display: flex; gap: 18px; }
.utility-left span { display: inline-flex; align-items: center; gap: 5px; }
.utility-left i { width: 14px; height: 14px; }
.tricolor-strip { height: 4px; background: linear-gradient(90deg, #ff9933 33%, #ffffff 33% 66%, #138808 66%); }

/* =========================================================
   HEADER / NAV — spans full width at any zoom level
   ========================================================= */
.main-header { background: var(--c-surface); box-shadow: var(--shadow); position: sticky; top: var(--gc-bar-height, 0px); z-index: 40; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 6px 32px; gap: 14px; flex-wrap: nowrap; width: 100%; }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
/* Section 2: logo enlarged from 100px -> 128px. object-fit:contain keeps it
   sharp/undistorted at any source aspect ratio; --header-h above (and the
   tablet/mobile sizes below) are kept in sync so the sticky header and the
   mobile slide-out nav's top offset never fall out of alignment with the
   header's real rendered height at any breakpoint. */
.brand-logo { width: 128px; height: 128px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--font-heading); font-size: 19px; color: var(--c-primary); white-space: nowrap; }
.brand-text small { color: var(--c-text-muted); font-size: 12px; white-space: nowrap; }

.main-nav {
  display: flex; align-items: center; gap: 2px; flex: 1; justify-content: center; flex-wrap: wrap;
}
/* BUG FIX: this container previously had `overflow-x: auto` (for horizontal
   scrolling on narrow desktop widths). Per the CSS overflow spec, when
   overflow-x is anything other than visible, overflow-y is implicitly forced
   to auto too — even though it was never set to a non-visible value here.
   That silently clipped the absolutely-positioned .dropdown-menu (which
   hangs below the nav bar via `top: 100%`), so the Panchayat/Transparency
   dropdowns rendered in the DOM but were invisible. Using `flex-wrap: wrap`
   instead lets nav items wrap onto a second line on narrower desktop widths
   rather than needing horizontal scroll, which avoids the clipping problem
   entirely at any screen width. */
.main-nav > a, .main-nav .dropdown > button {
  padding: 9px 9px; font-size: 13.5px; font-weight: 500; border-radius: 6px; background: none; border: none; color: var(--c-text);
  display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; flex-shrink: 0;
}
.main-nav > a:hover, .main-nav .dropdown > button:hover, .main-nav > a.active { background: var(--c-primary); color: #fff; }
.main-nav .dropdown { position: relative; }
.main-nav .dropdown-menu {
  position: absolute; top: 100%; left: 0; background: var(--c-surface); box-shadow: var(--shadow-lg);
  border-radius: 8px; padding: 6px; min-width: 200px; display: none; z-index: 50; border: 1px solid var(--c-border);
}
/* NOTE: uses the direct-child combinator (">") rather than a plain
   descendant selector on purpose — a plain ".dropdown:hover .dropdown-menu"
   would also match the nested .dropdown-submenu-menu flyouts below (since
   they're descendants of the same .dropdown too) and pop every sub-menu
   open at once as soon as the top-level dropdown is hovered. Restricting
   this rule to the dropdown's own immediate menu keeps each level's
   open/closed state independent, so sub-menus only reveal themselves via
   their own .dropdown-submenu:hover rule further down. */
.main-nav .dropdown:hover > .dropdown-menu, .main-nav .dropdown.open > .dropdown-menu { display: block; }
.main-nav .dropdown-menu a { display: block; padding: 8px 12px; border-radius: 6px; font-size: 14px; white-space: normal; }
.main-nav .dropdown-menu a:hover { background: var(--c-bg); }
/* Nested flyout sub-menus (Section 5, e.g. "Panchayat Records" -> "Reports"
   -> individual report links): a dropdown item whose own children need
   further breaking up renders as a .dropdown-submenu trigger button
   instead of a plain link, opening a second dropdown-menu beside it
   rather than dumping every link from every sub-section into one long
   flat list. */
.dropdown-submenu { position: relative; }
.dropdown-submenu-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; border-radius: 6px; font-size: 14px; font-family: inherit; text-align: left;
  background: none; border: none; color: var(--c-text); cursor: pointer;
}
.dropdown-submenu-toggle:hover, .dropdown-submenu.open > .dropdown-submenu-toggle { background: var(--c-bg); }
.dropdown-submenu-toggle i { width: 14px; height: 14px; flex-shrink: 0; color: var(--c-text-muted); }
/* Positioned beside (not below) the parent item, capped relative to the
   viewport so it can never run off the right edge or bottom of shorter
   screens; falls back to a static, full-width accordion panel on mobile
   (see the max-width:1000px block below), same as the parent dropdown. */
.main-nav .dropdown-menu.dropdown-submenu-menu {
  top: -6px; left: 100%; margin-left: 4px; min-width: 240px; max-width: min(320px, 92vw); max-height: 70vh; overflow-y: auto;
}
.main-nav .dropdown-submenu:hover > .dropdown-submenu-menu, .main-nav .dropdown-submenu.open > .dropdown-submenu-menu { display: block; }

.header-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icon-btn {
  background: var(--c-bg); border: 1px solid var(--c-border); width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--c-text);
}
.icon-btn:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.icon-btn i { width: 18px; height: 18px; }
.lang-btn { border-radius: 19px; width: auto; padding: 0 12px; font-weight: 700; font-size: 12px; }
.menu-toggle { display: none; }

.search-panel { display: none; background: var(--c-surface); border-top: 1px solid var(--c-border); padding: 14px 0; }
.search-panel.open { display: block; }
.search-panel input { width: 100%; padding: 12px 16px; border-radius: 8px; border: 1px solid var(--c-border); font-size: 15px; background: var(--c-bg); color: var(--c-text); }
.search-results { margin-top: 10px; max-height: 320px; overflow-y: auto; }
.search-results a { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 6px; }
.search-results a:hover { background: var(--c-bg); }
.search-results .type-tag { font-size: 11px; color: var(--c-text-muted); }
.search-view-all { display: block; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--c-primary); padding: 10px 12px; border-top: 1px solid var(--c-border); margin-top: 4px; }

/* Advanced search page (Section 21) */
.search-form-advanced { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 20px; }
.search-form-advanced input[type="text"] { width: 100%; padding: 11px 14px; border: 1px solid var(--c-border); border-radius: 8px; font-size: 14px; }
.search-filters { border: none; padding: 0; margin: 0; flex-basis: 100%; }
.search-filters legend { font-size: 12.5px; font-weight: 600; color: var(--c-text-muted); padding: 0 0 6px; }
.search-result-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--radius); margin-bottom: 10px; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.search-result-row:hover { transform: translateX(4px); box-shadow: var(--shadow); border-color: var(--c-primary); }
.search-result-icon { width: 38px; height: 38px; border-radius: 8px; background: color-mix(in srgb, var(--c-primary) 12%, transparent); color: var(--c-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.search-result-info { display: flex; flex-direction: column; gap: 2px; }
.search-result-type { font-size: 12px; color: var(--c-text-muted); }

.news-ticker { background: var(--c-accent); color: #1c2530; display: flex; align-items: center; overflow: hidden; }
.ticker-label { flex-shrink: 0; padding: 8px 14px; font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,0.1); }
.ticker-label i { width: 15px; height: 15px; }
/* BUG FIX: flex items default to min-width:auto, meaning a flex item
   refuses to shrink below its CONTENT's intrinsic minimum width — and the
   ticker's nowrap content can be very wide (many notices concatenated).
   Without min-width:0 here, this silently broke overflow:hidden and caused
   horizontal scrolling/overflow on every single page, at every screen
   size, confirmed via automated testing across all 17 public pages. */
.ticker-track { overflow: hidden; flex: 1; min-width: 0; }
.ticker-content { display: inline-flex; white-space: nowrap; padding-left: 100%; animation: ticker 30s linear infinite; }
.ticker-content a { padding: 8px 30px; font-size: 13px; font-weight: 500; }
.ticker-content a.urgent { color: #b00020; font-weight: 700; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* =========================================================
   BREADCRUMB
   ========================================================= */
.breadcrumb { background: var(--c-surface); border-bottom: 1px solid var(--c-border); padding: 12px 0; font-size: 13px; color: var(--c-text-muted); }
.breadcrumb a { color: var(--c-primary); }
.breadcrumb .current { color: var(--c-text); }

/* =========================================================
   HOMEPAGE INTRO BAND — replaces the old text-over-image hero
   overlay. Heading/tagline/CTAs now live in their own full-width
   band, never covering the slider photos.
   ========================================================= */
.hero-intro { background: linear-gradient(120deg, var(--c-primary), var(--c-primary-dark)); padding: 44px 0; }
.hero-intro-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.hero-intro h1 { color: #fff; font-size: 30px; margin-bottom: 8px; }
.hero-intro p { color: rgba(255,255,255,0.9); font-size: 15px; margin: 0; }
.hero-intro .hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; flex-shrink: 0; }

/* =========================================================
   HOME SLIDER
   ========================================================= */
.hero {
  position: relative;
  overflow: hidden;
  background: #111827;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  height: clamp(460px, 68vh, 780px);
  min-height: 520px;
  box-shadow: inset 0 -120px 140px rgba(0,0,0,0.28);
}

/* "Boxed slider" homepage layout option (Admin → Site Settings): keeps the
   slider within the same max-width container as the rest of the page
   instead of running full-bleed edge-to-edge. */
.hero.hero-boxed {
  width: 100%;
  max-width: 1180px;
  margin: 24px auto 0;
  border-radius: var(--radius);
  height: clamp(360px, 52vh, 620px);
}
@media (max-width: 1220px) {
  .hero.hero-boxed { max-width: calc(100% - 40px); }
}

.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s ease; background: #0c1119; pointer-events: none; }
.hero-slide.active { opacity: 1; pointer-events: auto; }
/* BUG FIX (blurred-backdrop slider): the foreground image previously used
   object-fit: cover, which crops portrait/square photos to fit the wide
   hero band and loses important content (faces, banners, signage). Now
   every slide has TWO layers:
     1. hero-bg-blur — the same photo, object-fit: cover + heavy blur,
        filling the whole band edge-to-edge so there's never an empty gap.
     2. hero-fg-img  — the same photo again, object-fit: contain, shown
        crisp and complete on top of the blurred backdrop.
   Landscape photos end up filling almost the entire band anyway (so the
   blur is barely visible); portrait/square photos are shown in full with
   the blur providing a full-bleed background instead of empty bars. */
.hero-bg-blur {
  position: absolute;
  inset: -30px; /* overscan so the blurred edge never shows a hard border */
  width: calc(100% + 60px);
  height: calc(100% + 60px);
  object-fit: cover;
  object-position: center;
  filter: blur(28px) saturate(1.15) brightness(0.65);
  transform: scale(1.1);
  z-index: 0;
}
.hero-fg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  z-index: 1;
  filter: saturate(1.05) contrast(1.02);
}
.hero-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.34), transparent 38%, rgba(0,0,0,0.1)),
    linear-gradient(0deg, rgba(0,0,0,0.42), transparent 42%);
  pointer-events: none;
}
.hero-slide.active .hero-fg-img { animation: heroKenBurns 9s ease-out forwards; }
@keyframes heroKenBurns { from { transform: scale(1.02); } to { transform: scale(1.06); } }

.hero-caption {
  position: absolute;
  left: clamp(16px, 5vw, 70px);
  bottom: clamp(34px, 8vw, 78px);
  z-index: 4;
  max-width: min(680px, calc(100% - 32px));
  color: #fff;
  pointer-events: none;
}
.hero-caption span {
  display: inline-block;
  background: rgba(0,0,0,0.58);
  border-left: 4px solid var(--c-accent);
  padding: 10px 16px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: clamp(18px, 3vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}
.hero-caption { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.hero-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--c-accent);
  color: #1c1c1c;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  text-shadow: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.hero-cta-btn i { width: 15px; height: 15px; }
.hero-slide:hover .hero-cta-btn, .hero-slide:focus-visible .hero-cta-btn { transform: translateX(3px); box-shadow: 0 4px 12px rgba(0,0,0,0.35); }
a.hero-slide { cursor: pointer; }
a.hero-slide:focus-visible { outline: 3px solid var(--c-accent); outline-offset: -3px; }

.hero-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 7px; z-index: 5; }
.hero-dots button { width: 8px; height: 8px; border-radius: 5px; background: rgba(120,120,120,0.4); border: none; transition: width 0.35s ease, background 0.35s ease; }
.hero-dots button.active { width: 26px; background: var(--c-primary); }

.hero-nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,0.85); color: var(--c-primary); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.25s ease, background 0.2s ease;
}
.hero:hover .hero-nav-btn { opacity: 1; }
.hero-nav-btn:hover { background: #fff; }
.hero-nav-btn svg { width: 20px; height: 20px; }
.hero-prev { left: 16px; }
.hero-next { right: 16px; }

.hero-progress-track { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: rgba(0,0,0,0.08); z-index: 5; }
.hero-progress { height: 100%; width: 0%; background: var(--c-accent); }
.hero-progress.animating { transition: width linear; }

.garbage-call-widget {
  position: absolute;
  right: clamp(16px, 3vw, 42px);
  bottom: clamp(32px, 5vw, 64px);
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(320px, calc(100% - 32px));
  padding: 10px 14px 10px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  color: var(--c-primary);
  box-shadow: 0 12px 30px rgba(0,0,0,0.24);
  border: 1px solid rgba(255,255,255,0.5);
  backdrop-filter: blur(8px);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.garbage-call-widget:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(0,0,0,0.3); }
.garbage-call-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--c-success);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.garbage-call-icon svg { width: 21px; height: 21px; }
.garbage-call-text { display: grid; line-height: 1.15; }
.garbage-call-text strong { font-size: 13px; color: var(--c-primary); margin: 0; }
.garbage-call-text small { font-size: 12px; color: var(--c-text-muted); white-space: nowrap; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 11px 22px; border-radius: 8px; font-weight: 600; font-size: 14px; border: none; transition: transform 0.15s ease, filter 0.15s ease; position: relative; overflow: hidden; isolation: isolate; }
.btn:active { transform: scale(0.97); }

/* Button ripple effect: a soft circular wash that expands from the click
   point and fades — pure CSS animation, triggered by the click handler in
   site.js which positions/sizes a .btn-ripple span per click. */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transform: scale(0);
  pointer-events: none;
  animation: rippleExpand 0.6s ease-out;
  z-index: 0;
}
.btn > * { position: relative; z-index: 1; }
@keyframes rippleExpand {
  to { transform: scale(1); opacity: 0; }
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--c-accent); color: #1c2530; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-outline { background: transparent; color: #fff; border: 1.5px solid #fff; }
.btn-outline:hover { background: rgba(255,255,255,0.15); }
.btn-solid { background: var(--c-primary); color: #fff; }
.btn-solid:hover { background: var(--c-primary-dark); }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* =========================================================
   QUICK ACCESS GRID + STATS BAR
   ========================================================= */
.section { padding: 56px 0; }
.section-title { text-align: center; margin-bottom: 34px; }
.section-title h2 { font-size: 26px; }
.section-title p { color: var(--c-text-muted); max-width: 560px; margin: 8px auto 0; }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.quick-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 22px 16px; text-align: center; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.quick-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.quick-card .icon-wrap { width: 52px; height: 52px; border-radius: 50%; background: var(--c-primary); color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.quick-card span { font-weight: 600; font-size: 14px; }

.stats-bar { background: var(--c-primary); color: #fff; padding: 30px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.stats-grid .stat-num { font-size: 30px; font-weight: 700; font-family: var(--font-heading); }
.stats-grid .stat-label { opacity: 0.85; font-size: 13px; margin-top: 4px; }

/* =========================================================
   ABOUT SECTION
   ========================================================= */
.about-flex { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; align-items: center; }
.about-flex img { border-radius: var(--radius); box-shadow: var(--shadow-lg); aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.about-text { color: var(--c-text); }
.about-text p { color: var(--c-text-muted); line-height: 1.7; }
.about-summary-clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* =========================================================
   CARDS: services / schemes / gallery / notices
   ========================================================= */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
.svc-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 24px; transition: transform 0.2s ease, box-shadow 0.2s ease; display: flex; flex-direction: column; }
.svc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.svc-card .icon-wrap { width: 46px; height: 46px; border-radius: 10px; background: color-mix(in srgb, var(--c-primary) 12%, transparent); color: var(--c-primary); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.svc-card h3 { font-size: 17px; }
.svc-card p { color: var(--c-text-muted); font-size: 14px; line-height: 1.5; margin-bottom: 0; }
.svc-card .learn-link { color: var(--c-primary); font-weight: 600; font-size: 13px; }
.badge { display: inline-block; padding: 2px 8px; font-size: 11px; border-radius: 20px; font-weight: 700; }
/* Honeypot field for the public forms in citizen-services.php — hidden from
   real visitors (off-canvas + zero size + not focusable), present in the
   DOM for simple spam bots that auto-fill every input. */
.hp-field { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }
.badge-scheme { background: color-mix(in srgb, var(--c-success) 15%, transparent); color: var(--c-success); }
.badge-new { background: #ff3b30; color: #fff; margin-left: 8px; }
.badge-urgent { background: #b00020; color: #fff; }

.svc-detail-toggle { display: none; }
.svc-detail-label { cursor: pointer; display: inline-block; margin-top: 10px; }
.svc-detail-panel { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--c-border); font-size: 13px; color: var(--c-text-muted); line-height: 1.6; }
.svc-detail-toggle:checked ~ .svc-detail-panel { display: block; }
.svc-detail-toggle:checked ~ .svc-detail-label { color: var(--c-text-muted); }
.svc-detail-row { margin-bottom: 8px; }
.svc-detail-row ul { margin: 4px 0 0; padding-left: 18px; }
.svc-detail-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; }

.sarpanch-message { background: var(--c-surface); border-radius: var(--radius); padding: 40px; display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; box-shadow: var(--shadow); }
.sarpanch-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid var(--c-accent); }
.sarpanch-message blockquote { font-size: 17px; font-style: italic; color: var(--c-text); margin: 0 0 10px; line-height: 1.6; }
.sarpanch-message strong { color: var(--c-primary); }

.notices-list { display: flex; flex-direction: column; gap: 10px; }
.notice-item { display: flex; justify-content: space-between; align-items: center; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px; padding: 14px 18px; gap: 10px; flex-wrap: wrap; }
.notice-item .notice-title { font-weight: 600; }
.notice-item .notice-date { font-size: 12px; color: var(--c-text-muted); white-space: nowrap; }

.office-info-card { background: var(--c-surface); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.office-info-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.office-info-card li { display: flex; gap: 10px; align-items: flex-start; color: var(--c-text-muted); font-size: 14px; }
.office-info-card i { color: var(--c-primary); flex-shrink: 0; }
.office-info-card a { color: var(--c-primary); font-weight: 600; }

.gallery-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.gallery-strip img, .gallery-grid img { border-radius: 8px; aspect-ratio: 1; object-fit: cover; width: 100%; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gallery-card { background: var(--c-surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--c-border); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.gallery-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.gallery-card .cap { padding: 12px 14px; }
.gallery-card .cap h4 { font-size: 14px; margin-bottom: 4px; }
.gallery-card .cap p { font-size: 12px; color: var(--c-text-muted); margin: 0; }

.gallery-card-trigger { display: block; width: 100%; padding: 0; border: none; background: none; cursor: zoom-in; position: relative; }
.gallery-card-trigger img { width: 100%; height: 200px; object-fit: cover; display: block; transition: transform 0.35s ease; }
.gallery-card-trigger:hover img { transform: scale(1.05); }
.gallery-zoom-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 14, 20, 0); color: #fff; opacity: 0; transition: opacity 0.2s ease, background 0.2s ease;
}
.gallery-card-trigger:hover .gallery-zoom-hint { opacity: 1; background: rgba(10, 14, 20, 0.28); }
.gallery-zoom-hint svg { width: 30px; height: 30px; }

/* Lightbox modal (Gallery + About Us photos) */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(8, 10, 16, 0.94);
  display: flex; align-items: center; justify-content: center;
  animation: lightboxFadeIn 0.2s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lightboxFadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox-stage { max-width: min(92vw, 1100px); max-height: 86vh; display: flex; flex-direction: column; align-items: center; }
.lightbox-stage img { max-width: 100%; max-height: 74vh; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); animation: lightboxZoomIn 0.25s ease; }
@keyframes lightboxZoomIn { from { transform: scale(0.96); opacity: 0.6; } to { transform: scale(1); opacity: 1; } }
.lightbox-caption { color: #f2f2f2; text-align: center; margin-top: 14px; font-size: 14.5px; max-width: 640px; }
.lightbox-counter { color: rgba(255,255,255,0.55); font-size: 12.5px; margin-top: 6px; }
.lightbox-close, .lightbox-nav {
  position: absolute; background: rgba(255,255,255,0.1); border: none; color: #fff; border-radius: 50%;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255,255,255,0.22); transform: scale(1.06); }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-nav[hidden] { display: none; }
@media (max-width: 640px) {
  .lightbox-close, .lightbox-nav { width: 40px; height: 40px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-stage img { max-height: 62vh; }
}

.eservices-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.eservice-link { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 10px; padding: 18px; text-align: center; font-weight: 600; font-size: 14px; transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; }
.eservice-link:hover { border-color: var(--c-primary); color: var(--c-primary); transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.map-embed { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); height: 380px; }
.map-embed iframe, .map-embed #leafletMap { width: 100%; height: 100%; border: 0; }

/* =========================================================
   GENERIC INNER-PAGE CONTENT
   ========================================================= */
.page-header { background: var(--c-primary); color: #fff; padding: 40px 0; }
.page-header h1 { color: #fff; font-size: 28px; }
.people-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.person-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 20px; text-align: center; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.person-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.person-card img, .person-card .avatar-blank { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; border: 3px solid var(--c-border); }
.person-card .avatar-blank { background: var(--c-bg); }
.person-card h4 { font-size: 15px; margin-bottom: 2px; }
.person-card .role { color: var(--c-primary); font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.person-card .contact { font-size: 12px; color: var(--c-text-muted); }
.sarpanch-tag { position: relative; }
.sarpanch-tag::before { content: '★ SARPANCH'; display: block; font-size: 10px; font-weight: 800; color: var(--c-accent); margin-bottom: 6px; letter-spacing: 0.5px; }

.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.table-responsive .doc-table { min-width: 560px; box-shadow: none; }

.doc-table { width: 100%; border-collapse: collapse; background: var(--c-surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.doc-table th, .doc-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--c-border); font-size: 14px; }
.doc-table th { background: var(--c-bg); color: var(--c-text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.doc-table tr:last-child td { border-bottom: none; }
.download-link { color: var(--c-primary); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

.committee-block { margin-bottom: 30px; }
.committee-block h3 { color: var(--c-primary); border-bottom: 2px solid var(--c-border); padding-bottom: 8px; margin-bottom: 14px; }

.meeting-item { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 20px; margin-bottom: 14px; }
.meeting-item h4 { margin-bottom: 4px; }
.meeting-item .date { color: var(--c-text-muted); font-size: 13px; margin-bottom: 8px; }

.form-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 30px; margin-bottom: 24px; }
.form-card h3 { margin-bottom: 4px; }
.form-card .sub { color: var(--c-text-muted); font-size: 14px; margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { font-size: 13px; font-weight: 600; margin-bottom: 6px; display: block; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; padding: 11px 13px; border-radius: 8px; border: 1px solid var(--c-border); font-size: 14px; background: var(--c-bg); color: var(--c-text); font-family: inherit; }
.form-grid textarea { min-height: 100px; resize: vertical; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: color-mix(in srgb, var(--c-success) 15%, transparent); color: var(--c-success); }
.star-rating { display: flex; gap: 4px; font-size: 26px; }
.star-rating input { display: none; }
.star-rating label { cursor: pointer; color: var(--c-border); }
.star-rating input:checked ~ label, .star-rating label:hover, .star-rating label:hover ~ label { color: var(--c-accent); }

.tab-buttons { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.tab-btn { padding: 10px 18px; border-radius: 20px; border: 1px solid var(--c-border); background: var(--c-surface); font-weight: 600; font-size: 13px; }
.tab-btn.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* Meetings calendar view (Section 21) */
.calendar-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.calendar-nav h3 { margin: 0; font-size: 18px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--c-border); border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.calendar-weekday { background: var(--c-surface); text-align: center; padding: 8px 4px; font-size: 12px; font-weight: 700; color: var(--c-text-muted); text-transform: uppercase; }
.calendar-cell { background: var(--c-surface); min-height: 90px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.calendar-cell-empty { background: var(--c-bg); }
.calendar-daynum { font-size: 12.5px; font-weight: 600; color: var(--c-text-muted); }
.calendar-today { box-shadow: inset 0 0 0 2px var(--c-primary); }
.calendar-today .calendar-daynum { color: var(--c-primary); }
.calendar-has-event { background: color-mix(in srgb, var(--c-primary) 5%, var(--c-surface)); }
.calendar-event {
  display: block; font-size: 11px; font-weight: 600; color: #fff; background: var(--c-primary);
  border-radius: 4px; padding: 2px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: filter 0.15s ease;
}
.calendar-event:hover { filter: brightness(1.15); }
@media (max-width: 700px) {
  .calendar-cell { min-height: 62px; font-size: 11px; }
  .calendar-weekday { font-size: 10px; padding: 6px 2px; }
  .calendar-event { font-size: 9.5px; padding: 1px 3px; }
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.emergency-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.emergency-list li { display: flex; justify-content: space-between; background: var(--c-surface); border: 1px solid var(--c-border); padding: 12px 16px; border-radius: 8px; }
.emergency-list .num { font-weight: 700; color: var(--c-primary); }
.emergency-list .num a { color: inherit; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { background: var(--c-primary-dark); color: rgba(255,255,255,0.85); margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; padding: 46px 20px 30px; }
.footer-brand { color: #fff; margin-bottom: 10px; }
.footer-col h4 { color: #fff; font-size: 14px; margin-bottom: 14px; }
.footer-col a, .footer-col p { display: block; font-size: 13px; margin-bottom: 10px; color: rgba(255,255,255,0.75); }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-col a[href^="tel:"] { display: inline; }
.social-links { display: flex; gap: 10px; margin-top: 12px; }
.social-links a { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; }
.social-links [data-lucide], .social-links .social-icon { width: 16px; height: 16px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); padding: 16px 0; text-align: center; font-size: 12px; }

/* =========================================================
   404 / MESSAGE PAGE
   ========================================================= */
.message-page { text-align: center; padding: 100px 20px; }
.message-page h1 { font-size: 60px; color: var(--c-primary); }
.message-page-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.btn-outline-dark { background: transparent; color: var(--c-primary); border: 1.5px solid var(--c-border); }
.btn-outline-dark:hover { background: var(--c-bg); }

/* =========================================================
   SCROLL REVEAL + BACK TO TOP
   ========================================================= */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in-view { opacity: 1; transform: none; }
.reveal.js-fallback-visible { opacity: 1; transform: none; }

.back-to-top {
  position: fixed; bottom: 26px; right: 26px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--c-primary); color: #fff; border: none; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease; z-index: 45; cursor: pointer;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: none; }
.back-to-top:hover { background: var(--c-primary-dark); }
.back-to-top svg { width: 20px; height: 20px; }

/* Floating quick-contact button (Section 12) — bottom-left, opposite the
   back-to-top button on the right, so they never collide. */
.contact-fab { position: fixed; bottom: 26px; left: 26px; z-index: 90; }
.contact-fab-toggle {
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--c-primary); color: #fff; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
  position: relative;
}
.contact-fab-toggle:hover { transform: scale(1.06); background: var(--c-primary-dark); }
.contact-fab-toggle svg { width: 22px; height: 22px; position: absolute; transition: opacity 0.15s ease, transform 0.15s ease; }
.contact-fab-icon-open { opacity: 0; transform: rotate(-45deg); }
.contact-fab-icon-closed { opacity: 1; transform: rotate(0); }
.contact-fab.open .contact-fab-icon-closed { opacity: 0; transform: rotate(45deg); }
.contact-fab.open .contact-fab-icon-open { opacity: 1; transform: rotate(0); }
.contact-fab-menu {
  position: absolute; bottom: 64px; left: 0; display: flex; flex-direction: column; gap: 10px;
  opacity: 0; pointer-events: none; transform: translateY(10px) scale(0.96); transform-origin: bottom left;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.contact-fab.open .contact-fab-menu { opacity: 1; pointer-events: auto; transform: none; }
.contact-fab-item {
  display: flex; align-items: center; gap: 10px; background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: 30px; padding: 8px 16px 8px 8px; box-shadow: var(--shadow); white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.contact-fab-item:hover { transform: translateX(4px); box-shadow: var(--shadow-lg); }
.contact-fab-item-icon {
  width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--c-primary) 12%, transparent);
  color: var(--c-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.contact-fab-item-icon svg { width: 16px; height: 16px; }
.contact-fab-item-text { display: flex; flex-direction: column; line-height: 1.25; }
.contact-fab-item-text strong { font-size: 12.5px; color: var(--c-text); }
.contact-fab-item-text small { font-size: 11.5px; color: var(--c-text-muted); }
@media (max-width: 640px) {
  .contact-fab { bottom: 18px; left: 18px; }
  .back-to-top { bottom: 18px; right: 18px; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid, .gallery-grid, .people-grid { grid-template-columns: repeat(2, 1fr); }
  .about-flex, .contact-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-strip { grid-template-columns: repeat(3, 1fr); }
  .eservices-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .sarpanch-message { grid-template-columns: 1fr; text-align: center; }
  .sarpanch-photo { margin: 0 auto; }
  .hero-intro-inner { flex-direction: column; text-align: center; align-items: center; }
}
@media (max-width: 1000px) {
  .hide-sm {
    /* BUG FIX: found via computed-style testing at 375px — this rule was
       losing the cascade to `.utility-left span` (display:inline-flex,
       specificity 0-1-1) which beats a single class like `.hide-sm`
       (0-1-0), no matter which one comes later in the file. That silently
       broke this utility class's entire purpose everywhere it was used —
       the mobile topbar showed phone + email + hours all at once, wrapping
       into a cramped 3-line block instead of just showing the phone
       number. `.hide-sm` is a general-purpose "hide on small screens"
       utility (by name and intent), so it needs to reliably win regardless
       of whatever specificity happens to apply to a given element it's
       used on — the standard, narrowly-scoped use of !important for
       exactly this kind of utility class. */
    display: none !important;
  }
  .main-nav { position: fixed; top: calc(var(--header-h) + var(--gc-bar-height, 0px)); left: 0; right: 0; bottom: 0; background: var(--c-surface);
    flex-direction: column; align-items: stretch; padding: 16px; transform: translateX(-100%); transition: transform 0.25s ease; overflow-y: auto; z-index: 39; }
  .main-nav.open { transform: translateX(0); }
  .main-nav .dropdown-menu { position: static; box-shadow: none; display: none; border: none; padding-left: 12px; max-width: none; }
  .main-nav .dropdown.open > .dropdown-menu { display: block; }
  /* Sub-menus become their own nested accordion panel on mobile (tap the
     top item to reveal its sub-options, then tap a sub-option to reveal
     its own links) rather than a side flyout, and get extra left padding
     on top of the parent's so the two levels are visually distinct. */
  .dropdown-submenu-toggle { min-height: 44px; padding: 12px 14px; }
  .main-nav .dropdown-menu.dropdown-submenu-menu { padding-left: 12px; }
  .main-nav .dropdown-submenu.open > .dropdown-submenu-menu { display: block; }
  .menu-toggle { display: flex; }
  .quick-grid, .card-grid, .gallery-grid, .people-grid, .gallery-strip, .eservices-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero { height: min(420px, 66vw); min-height: 300px; }
  .brand-logo { width: 88px; height: 88px; }
  /* BUG FIX: found via automated viewport testing (Playwright, 375px
     width) — .header-inner never reduced its horizontal padding for
     mobile, and .brand-text had no truncation, so the fixed-width logo +
     title + the 4 header-tools icon buttons simply didn't fit in 375px
     and got pushed past the right edge, causing horizontal scroll on
     EVERY page (the header is shared via includes/navbar.php). Confirmed
     the exact offending element (.header-tools, overflowing to 487px on
     a 375px viewport) via a DOM bounding-box sweep before writing this
     fix, and confirmed zero horizontal overflow after it, across mobile/
     tablet/desktop and all main pages. */
  .header-inner { padding: 8px 16px; gap: 8px; }
  .brand { min-width: 0; flex-shrink: 1; }
  .brand-text { min-width: 0; }
  .brand-text strong, .brand-text small { overflow: hidden; text-overflow: ellipsis; }
  /* Touch targets: on touch-sized viewports, every tappable nav/menu item
     gets a comfortable >=44px minimum height (WCAG 2.5.5 / Apple & Material
     guidance), not just enough padding to look right visually. */
  .main-nav > a, .main-nav .dropdown > button, .main-nav .dropdown-menu a { min-height: 44px; padding: 12px 14px; }
  .icon-btn { width: 44px; height: 44px; }
  .doc-table th, .doc-table td { padding: 12px; }
  .download-link { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (max-width: 480px) {
  .quick-grid, .card-grid, .gallery-grid, .people-grid, .gallery-strip, .eservices-grid, .footer-grid { grid-template-columns: 1fr; }
  /* Continuation of the .header-inner overflow fix above, for the
     narrowest phones where even the tightened ≤1000px spacing is too
     tight — drop the "Our Village" tagline (logo + title alone is
     enough for branding at this size) and trim the logo and button
     gaps a little further. Icon buttons stay at the 44px accessible
     touch-target size set above; this is spacing, not target size. */
  .header-inner { padding: 8px 10px; gap: 6px; }
  .brand-logo { width: 52px; height: 52px; }
  .brand-text small { display: none; }
  .header-tools { gap: 2px; }
  .hero-intro h1 { font-size: 24px; }
  .hero { height: 300px; min-height: 260px; }
  .hero-caption { left: 12px; right: 12px; bottom: 42px; max-width: none; }
  .hero-caption span { width: 100%; font-size: 17px; padding: 9px 12px; }
  .garbage-call-widget { right: 12px; bottom: 84px; padding: 8px; }
  .garbage-call-text { display: none; }
  .garbage-call-icon { width: 40px; height: 40px; }
  .page-header h1 { font-size: 22px; }
  .section { padding: 40px 0; }
}

/* Village History Timeline (About page) */
.timeline { position: relative; max-width: 760px; margin: 0 auto; padding-left: 32px; }
.timeline::before {
  content: '';
  position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(var(--c-border), var(--c-primary), var(--c-border));
}
.timeline-item { position: relative; padding-bottom: 28px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
  position: absolute; left: -32px; top: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--c-primary); border: 3px solid var(--c-surface); box-shadow: 0 0 0 2px var(--c-primary);
}
.timeline-content { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 14px 18px; }
.timeline-year { font-weight: 700; color: var(--c-primary); font-size: 15px; margin-bottom: 4px; }
.timeline-event { font-size: 14px; color: var(--c-text); line-height: 1.5; }
@media (max-width: 600px) {
  .timeline { padding-left: 26px; }
  .timeline-marker { left: -26px; }
}

/* =========================================================
   GARBAGE COLLECTOR CONTACT BAR (namespaced gc-bar-* throughout to avoid
   any collision with existing styles — see includes/navbar.php and
   js/site.js for the matching markup/behavior)
   ========================================================= */
.gc-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 250;
  height: 40px;
  display: flex;
  align-items: center;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  font-size: 13px;
}
.gc-bar-track {
  position: relative;
  flex: 1;
  height: 100%;
  overflow: hidden;
  min-width: 0;
}
.gc-bar-vehicle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gc-bar-vehicle img { width: 100%; height: 100%; object-fit: contain; }
.gc-bar-vehicle-animated {
  left: 100%;
  animation-name: gcBarDrive;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes gcBarDrive {
  from { left: 100%; }
  to { left: -15%; }
}
@media (prefers-reduced-motion: reduce) {
  .gc-bar-vehicle-animated { animation: none; left: calc(50% - 24px); }
}
.gc-bar-contact {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 100%;
  flex-shrink: 0;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(0,0,0,0.12);
}
.gc-bar-contact:hover { background: rgba(0,0,0,0.22); }
.gc-bar-icon { width: 16px; height: 16px; flex-shrink: 0; }
.gc-bar-label { font-weight: 600; opacity: 0.9; }
.gc-bar-number { font-weight: 700; }
@media (max-width: 560px) {
  .gc-bar { height: 36px; font-size: 11.5px; }
  .gc-bar-label { display: none; }
  .gc-bar-contact { padding: 0 12px; gap: 4px; }
}

/* ==========================================================================
   PRINT STYLESHEET
   Applies to any page — most useful for Panchayat Records (reports, acts,
   downloads) and Notices, so an admin or citizen can print a clean copy
   without the site chrome (nav, ticker, footer, garbage-collector bar,
   hero slider controls, floating buttons) cluttering the page or wasting
   ink/paper. Forces plain black-on-white regardless of dark mode or theme,
   since printed output should never rely on colour to convey meaning.
   ========================================================================== */
@media print {
  /* Site chrome: never useful on a printed page */
  .main-header, .main-nav, .news-ticker, .gc-bar, .page-loader,
  .search-panel, .site-footer, .back-to-top, .garbage-call-widget,
  .hero-nav-btn, .hero-dots, .hero-progress-track, .hero-bg-blur,
  .quick-grid, .skip-link {
    display: none !important;
  }

  /* Hero slider: only the active slide's foreground image is worth
     printing (if it prints at all), never the decorative blurred
     duplicate or off-screen slides. */
  .hero-slide:not(.active) { display: none !important; }
  .hero { height: auto !important; }

  /* Flat black-on-white regardless of the active theme/dark-mode, and no
     decorative shadows/gradients that just waste toner */
  * { color: #000 !important; background: #fff !important; box-shadow: none !important; text-shadow: none !important; }
  body { font-size: 12pt; line-height: 1.4; }
  a { color: #000 !important; text-decoration: underline; }

  /* Show the destination of external links, since a printed link can't
     be clicked. Every internal link in this codebase is generated via
     url()/asset_url(), which always produces a relative path (e.g.
     "/reports") rather than an absolute URL, so this only ever matches
     genuinely external links — no need to check the current host. */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    font-weight: normal;
  }

  /* Tables, document rows, and notice content blocks: avoid splitting a
     row or an image across a page break wherever the printer can help it */
  table, tr, .list-card, .notice-block, figure { page-break-inside: avoid; }
  h1, h2, h3, h4 { page-break-after: avoid; }
  img { max-width: 100% !important; }

  /* A PDF embedded via <iframe> (notice.php PDF blocks) won't print
     usefully — show a plain text pointer to it instead */
  iframe { display: none !important; }
  .notice-block-pdf::after {
    content: "PDF attachment: see the file linked above, or visit this page online to view it.";
    display: block;
    font-style: italic;
    font-size: 11pt;
  }

  .container { max-width: 100% !important; padding: 0 !important; }
  .page-header { padding: 12px 0 !important; }
}
