/* ═══════════════════════════════════════════════════
   landing.css — C.A.R.E.S. Public Portal
   Barangay Conde Labak, Batangas City

   Redesign 2026-07-25. The formal government identity
   from the previous pass stays — navy and gold, serif
   display type, official masthead, framed hall photo —
   and these changed:

     · Dark mode. Headings were hard-wired to var(--navy)
       and section fills to var(--white). Both aliases
       re-point in [data-theme="dark"], so every title on
       the page rendered dark navy on near-black and the
       "white" cards came out navy. theme.js follows the
       visitor's OS, so this was the default experience
       for anyone with a dark desktop, not an edge case.
       Component CSS here now consumes semantic roles
       (--text-brand, --surface-raised, --border) which
       are what tokens.css re-points, plus two local
       pairs for the navy tiles that need to lighten.

     · Rhythm. 96px of padding around every section, a
       1140px measure and one card row per screen made a
       four-section page scroll like ten. Padding is now
       fluid, the measure is wider, and the surfaces
       alternate so section boundaries read without
       relying on empty space.

     · New blocks: masthead preference toggles, advisory
       ribbon, "how it works" steps, contact/emergency
       band, back-to-top.

   Load order: tokens.css → shared.css → landing.css
═══════════════════════════════════════════════════ */

:root {
  --masthead-h: 40px;

  /* Fluid section rhythm — 64px on a phone, 96px on a desktop. */
  --section-pad: clamp(3.5rem, 6vw, 6rem);
  --container-max: 1200px;
  --container-pad: clamp(1.25rem, 4vw, 2rem);

  /* Navy tile + gold glyph: the service icons, official avatars and step
     numerals. On a dark page a navy-800 tile on a navy-900 card is a smudge,
     so dark mode swaps the fill for a gold wash and keeps the glyph. */
  --tile-bg: var(--navy-800);
  --tile-fg: var(--gold-300);
  --tile-border: transparent;

  /* Hairline used to separate stacked sections of the same surface. */
  --section-line: var(--border);

  /* The history band: a warm paper tone between the white bulletin and the
     grey officials, so the one section that is read rather than used looks
     like a page. */
  --history-bg: var(--gold-50);

  /* GIS map chrome. The engine's styles below used to hard-wire two values
     that do not survive a theme flip: `color: var(--navy)` for every label,
     and `rgba(255,255,255,…)` for the floating panels. --navy re-points to a
     DARK navy in dark mode, so labels came out near-black on a near-black
     control; the panels never re-pointed at all, so their (now light) text sat
     on a white sheet — which is what made the map legend unreadable. Both are
     tokens now. Kept identical to the block in gis.css, which styles the same
     engine on the MIS pages. */
  --gis-ink: var(--navy-800);
  --gis-panel-bg: rgba(255, 255, 255, 0.55);
  --gis-panel-solid: rgba(255, 255, 255, 0.96);
  --gis-panel-border: rgba(27, 42, 74, 0.08);
  --gis-panel-hover: rgba(27, 42, 74, 0.06);
}

[data-theme="dark"] {
  /* The page navy with a trace of gold — gold-50 itself would be a light
     band in the middle of a dark page. */
  --history-bg: color-mix(in srgb, var(--gold-300) 6%, var(--surface));

  --tile-bg: rgba(245, 197, 24, 0.12);
  --tile-fg: var(--gold-300);
  --tile-border: rgba(245, 197, 24, 0.22);

  --gis-ink: var(--text-primary);
  --gis-panel-bg: rgba(6, 14, 27, 0.74);
  --gis-panel-solid: rgba(9, 18, 40, 0.96);
  --gis-panel-border: rgba(232, 197, 90, 0.2);
  --gis-panel-hover: rgba(255, 255, 255, 0.09);
}

body {
  font-family: var(--font-sans);
  background: var(--surface);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* ─── UTILITIES ────────────────────────────────── */
/* !important because this utility is applied by JS to elements whose own rule
   also sets display — .office-status is inline-flex, .nav-user is relative
   flex — and it sits near the top of the file, so on equal specificity the
   component's later declaration used to win and the "hidden" element rendered
   anyway. (.nav-notif-btn.is-hidden below was the earlier one-off patch for
   the same collision.) */
.is-hidden {
  display: none !important;
}

/* Visible only to assistive tech. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Keyboard users land on this first and can jump the two fixed bars and the
   whole navigation list. It only leaves the corner while focused. */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1300;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--gold-400);
  color: var(--navy-900);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--duration-base) var(--ease-out);
}
.skip-link:focus-visible {
  transform: translateY(0);
}

/* One focus treatment for every interactive element on the page. */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ─── OFFICIAL MASTHEAD ────────────────────────── */
/* Thin institutional strip pinned above the shared navbar (gov.ph-style),
   carrying the appearance and language controls on its right. */
.gov-masthead {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 901;
  height: var(--masthead-h);
  background: var(--navy-950);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.gov-masthead-inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* Miniature national flag. 28×14 keeps the official 1:2 field exactly — the
   old three-bar chip was 27×12 and not a flag at all. The hairline stops the
   blue band from merging into the near-black masthead behind it. */
.gov-flag {
  display: inline-flex;
  width: 28px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.gov-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.gov-masthead-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gov-tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  flex-shrink: 0;
}

.gov-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.78);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out),
    color var(--duration-base) var(--ease-out);
}
.gov-tool i[data-icon] {
  font-size: 13px;
  color: var(--gold-400);
}
.gov-tool:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(245, 197, 24, 0.45);
  color: #fff;
}

.gov-masthead-gov {
  padding-left: var(--space-3);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  white-space: nowrap;
}

/* ─── NAVBAR (page-local overrides of shared.css) ─ */
.navbar {
  top: var(--masthead-h);
  transition:
    background var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

/* Past the hero the bar sits over light content — deepen it so the gold
   wordmark and links keep their contrast. */
.navbar.is-scrolled {
  background: rgba(6, 14, 27, 0.94);
  box-shadow: 0 6px 24px -10px rgba(0, 0, 0, 0.6);
}

/* Section currently under the bar. The shared stylesheet only styles :hover,
   which tells a visitor nothing about where they are. */
.nav-links a.is-active {
  color: var(--gold-400);
}
.nav-links a.is-active::after {
  width: 100%;
}

/* Seven links for a signed-in staff member. shared.css spaces them 32px
   apart, which wraps them onto a second line just above the width where the
   menu button takes over (1100px); 20px keeps them on one. */
@media (max-width: 1180px) {
  .nav-links {
    gap: var(--space-5);
  }
}

/* From 1100px down the row is the drawer (shared.css), and on this page it
   opens below the masthead + navbar, not just the navbar. */
@media (max-width: 1100px) {
  .nav-links.open {
    top: calc(var(--navbar-h) + var(--masthead-h));
  }
}

.nav-logo-fallback {
  display: none;
  width: 40px;
  height: 40px;
  background: var(--gold-400);
  border-radius: var(--radius-full);
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--navy-800);
}

/* Hamburger → X while the drawer is open. */
.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── NAV NOTIFICATIONS (landing) ──────────────── */
/* Sits immediately left of the user pill. Promoted out of the user dropdown so
   an unread count is visible without opening a menu — the badge is the whole
   point of the control, and a badge nobody sees does no work.
   Shown only while signed in (applySessionToNav toggles .is-hidden). */
.nav-notif-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.05rem;
  cursor: pointer;
  transition:
    background var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out),
    color var(--duration-base) var(--ease-out);
}

.nav-notif-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(201, 162, 39, 0.5);
  color: var(--gold-400);
}

.nav-notif-btn.is-hidden {
  display: none;
}

/* portal-account.js's paintUnread() toggles this between "none" and
   "inline-flex" inline, so display is deliberately left out here. */
.nav-notif-badge {
  /* Hidden until portal-account.js has an unread count to show. */
  display: none;
  position: absolute;
  top: -3px;
  right: -3px;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  /* Ringed in the navbar's own colour so the badge reads as a chip on top of
     the button rather than a smudge against its edge. */
  border: 2px solid var(--navy-900);
  background: var(--gold-400);
  color: var(--navy-900);
  font-size: 10px;
  font-weight: var(--weight-extrabold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* ─── NAV USER MENU (landing) ──────────────────── */
/* Clickable user pill with a Settings / Sign Out dropdown. Kept separate from
   the MIS `.nav-user-pill` styles so it stays visible (and works) on mobile. */
.nav-user {
  position: relative;
}

.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--duration-base) var(--ease-out);
  font-family: var(--font-sans);
}
.nav-user-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-user-caret {
  color: rgba(255, 255, 255, 0.5);
  transition: transform var(--duration-base) var(--ease-out);
}

/* Phone widths. Signed in, the bar holds the seal, the wordmark, the bell,
   the account pill and the menu button, and below about 414px the name in the
   pill pushed the menu button off the right edge — there was no way to reach
   the page's links. The bar now gives way in steps: the name goes first (the
   initials stay, and a screen reader still hears the name), then the spacing
   and the wordmark tighten, and on the narrowest phones the wordmark goes,
   leaving the seal. */
@media (max-width: 600px) {
  .nav-user-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .nav-user-btn {
    gap: 6px;
    padding: 4px 8px 4px 4px;
  }
  .nav-right {
    gap: var(--space-2);
  }
}
@media (max-width: 420px) {
  .navbar {
    gap: 10px;
  }
  .nav-logo {
    gap: var(--space-2);
  }
  .nav-logo img {
    width: 36px;
    height: 36px;
  }
  .nav-brand {
    font-size: 0.62rem;
    letter-spacing: 0.04em;
  }
  .btn-nav-signin {
    padding: 8px 12px;
  }
}
@media (max-width: 350px) {
  .nav-brand {
    display: none;
  }
}
.nav-user-btn[aria-expanded="true"] .nav-user-caret {
  transform: rotate(180deg);
  color: var(--gold-400);
}

.nav-user-menu-drop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 214px;
  background: rgba(13, 27, 62, 0.98);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: var(--radius-lg);
  padding: 6px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  display: none;
  flex-direction: column;
  gap: 2px;
}
.nav-user-menu-drop.open {
  display: flex;
}

.nav-user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: var(--weight-medium);
  color: rgba(255, 255, 255, 0.85);
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}
.nav-user-menu-item i[data-icon] {
  font-size: 1rem;
  color: var(--gold-400);
}
.nav-user-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.nav-user-menu-item-danger:hover {
  background: rgba(220, 38, 38, 0.14);
  color: var(--red-300);
}
.nav-user-menu-item-danger:hover i[data-icon] {
  color: var(--red-300);
}

/* ─── HERO ─────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: calc(var(--navbar-h) + var(--masthead-h) + clamp(2.5rem, 5vw, 4.5rem))
    0 clamp(3rem, 5vw, 5rem);
  background:
    radial-gradient(
      1100px 520px at 88% -12%,
      rgba(37, 99, 235, 0.2),
      transparent 62%
    ),
    radial-gradient(
      880px 420px at -12% 112%,
      rgba(201, 162, 39, 0.13),
      transparent 55%
    ),
    linear-gradient(
      180deg,
      var(--navy-950) 0%,
      var(--navy-800) 58%,
      var(--navy-700) 100%
    );
}

/* Subtle dot grid over the gradient */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px
  );
  background-size: 26px 26px;
  pointer-events: none;
}

/* The same grid, as points that can be moved — js/hero-dots.js swaps a canvas
   in over the tile above and pushes the dots near the pointer out of its way.
   The class only appears when that file decides the visit can use it: a real
   pointer, motion allowed, canvas available. Until then, and with JS off, the
   tile above is what shows, which is why it is still here. */
.hero-dots {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero.has-hero-dots::before {
  display: none;
}

/* Belt and braces. hero-dots.js already refuses to start under reduced
   motion and tears itself down if the setting changes mid-visit; this means
   that even if it somehow did not, the moving layer is hidden and the plain
   tile comes back. */
@media (prefers-reduced-motion: reduce) {
  .hero-dots {
    display: none;
  }
  .hero.has-hero-dots::before {
    display: block;
  }
}

/* Tricolor hairline along the hero's bottom edge */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #1a3a7c 0%, #c41e2a 48%, #f5c518 100%);
  opacity: 0.85;
}

.hero-shell {
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.1);
  border-radius: var(--radius-full);
  color: var(--gold-300);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}
.hero-eyebrow i[data-icon] {
  font-size: 13px;
}

.hero-title {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: clamp(2.7rem, 5vw, 4.1rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  color: #fff;
  margin-bottom: 0.9rem;
}

.hero-title-expansion {
  display: block;
  margin-top: 0.8rem;
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: clamp(0.85rem, 1.5vw, 1.05rem);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  /* Dimmed, so the acronym letters below can lift out of it. The line is
     already uppercased, so case cannot carry the distinction — weight and
     colour have to. */
  color: color-mix(in srgb, var(--gold-300) 55%, transparent);
}

/* The letters C.A.R.E.S. is built from: C-onde l-A-bak R-E-sident S-ystem. */
.hero-title-expansion b {
  color: var(--gold-300);
  font-weight: var(--weight-extrabold);
}

.hero-subtitle {
  font-size: 1rem;
  line-height: var(--leading-relaxed);
  color: rgba(255, 255, 255, 0.74);
  max-width: 46ch;
  margin-bottom: 1.8rem;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-weight: var(--weight-bold);
  font-size: 0.9rem;
  text-decoration: none;
  transition:
    background var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out),
    color var(--duration-base) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}
.btn-hero i[data-icon] {
  font-size: 15px;
}

.btn-hero-gold {
  background: var(--gold-400);
  color: var(--navy-800);
  box-shadow: 0 10px 26px -8px rgba(245, 197, 24, 0.45);
}
.btn-hero-gold:hover {
  background: var(--gold-500);
  transform: translateY(-2px);
}

.btn-hero-ghost {
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}
.btn-hero-ghost:hover {
  border-color: var(--gold-300);
  color: var(--gold-300);
  background: rgba(201, 162, 39, 0.08);
}

/* "New resident? Claim your account" — the only door into the claim flow that
   does not go through the staff sign-in page. */
.hero-claim {
  margin-top: 1.1rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}
.hero-claim a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
  color: var(--gold-300);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  border-bottom: 1px solid rgba(232, 197, 90, 0.35);
}
.hero-claim a:hover {
  color: var(--gold-400);
  border-bottom-color: var(--gold-400);
}
.hero-claim i[data-icon] {
  font-size: 12px;
}

/* Hotline / hours / address strip under the CTAs. Two fixed columns rather
   than auto-fit: the address is half again as long as the other two and an
   auto-fit track broke it across lines mid-phrase. */
.hero-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--space-6);
  margin-top: 2rem;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.hero-meta-item:last-child {
  grid-column: 1 / -1;
}

.hero-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}
.hero-meta-item > i[data-icon] {
  font-size: 18px;
  color: var(--gold-300);
  flex-shrink: 0;
  margin-top: 2px;
}

.hero-meta-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 3px;
}

.hero-meta-value {
  margin: 0;
  font-size: 0.85rem;
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  color: rgba(255, 255, 255, 0.9);
}
.hero-meta-value a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}
.hero-meta-value a:hover {
  color: var(--gold-300);
  border-bottom-color: var(--gold-300);
}

/* Answers "is the hall open right now?" from the visitor's own clock. */
.office-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  border: 1px solid var(--red-300);
  background: rgba(220, 38, 38, 0.16);
  color: var(--red-300);
  font-size: 0.62rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.office-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.office-status.is-open {
  border-color: var(--green-300);
  background: rgba(22, 163, 74, 0.18);
  color: var(--green-300);
}

/* Right column — framed hall photo with the official seal overlapping */
.hero-visual {
  position: relative;
}

.hero-photo-card {
  position: relative;
  margin: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 32px 64px -20px rgba(0, 0, 0, 0.55);
}
.hero-photo-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(13, 27, 62, 0) 55%,
    rgba(9, 18, 40, 0.85) 100%
  );
}
.hero-photo-card img {
  display: block;
  width: 100%;
  height: clamp(240px, 30vw, 350px);
  object-fit: cover;
}
.hero-photo-card figcaption {
  position: absolute;
  left: 18px;
  bottom: 14px;
  z-index: 2;
  font-size: 0.7rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.hero-seal-badge {
  position: absolute;
  top: -26px;
  right: -16px;
  z-index: 3;
  width: 96px;
  height: 96px;
  padding: 8px;
  border-radius: 50%;
  background: var(--navy-950);
  border: 3px solid var(--gold-600);
  box-shadow: 0 16px 32px -10px rgba(0, 0, 0, 0.5);
}
.hero-seal-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

/* Hall photo missing — show the seal alone, centered */
.hero-visual-noimg .hero-photo-card {
  display: none;
}
.hero-visual-noimg .hero-seal-badge {
  position: static;
  width: 200px;
  height: 200px;
  margin: 0 auto;
  padding: 18px;
}

/* ─── ADVISORY RIBBON ──────────────────────────── */
/* Only rendered when the newest bulletin item is tagged Advisory or
   Emergency, directly under the hero. */
.advisory-ribbon {
  background: var(--accent-bg);
  border-bottom: 1px solid var(--accent-border);
}
.advisory-ribbon.advisory-emergency {
  background: var(--danger-bg);
  border-bottom-color: var(--danger-border);
}

.advisory-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-top: 14px;
  padding-bottom: 14px;
}

.advisory-badge {
  flex-shrink: 0;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--navy-900);
  font-size: var(--text-2xs);
  font-weight: var(--weight-extrabold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.advisory-emergency .advisory-badge {
  background: var(--danger-solid);
  color: #fff;
}

.advisory-text {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.advisory-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 0.76rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-accent);
}
.advisory-emergency .advisory-link {
  color: var(--danger);
}
.advisory-link i[data-icon] {
  font-size: 12px;
  transition: transform var(--duration-base) var(--ease-out);
}
.advisory-link:hover i[data-icon] {
  transform: translateX(3px);
}

/* ─── SECTION SHELL ────────────────────────────── */
main section {
  padding: var(--section-pad) 0;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.section-head {
  max-width: 62ch;
  margin-bottom: clamp(2rem, 3.5vw, 3rem);
}

.section-head-center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.section-head-center .section-kicker {
  justify-content: center;
}

/* Inside a two-column head row the grid gap provides the spacing. */
.section-head-flush {
  margin-bottom: 0;
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-accent);
  margin-bottom: 0.85rem;
}
.section-kicker::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

.section-title {
  font-family: var(--font-serif);
  font-weight: var(--weight-bold);
  font-size: clamp(1.65rem, 2.8vw, 2.3rem);
  line-height: 1.15;
  color: var(--text-brand);
  margin-bottom: 0.85rem;
}

.section-desc {
  font-size: 0.97rem;
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

/* ─── CITIZEN SERVICES ─────────────────────────── */
.section-services {
  background: var(--surface);
  border-bottom: 1px solid var(--section-line);
}

/* Three cards, not four — Barangay Residency was pulled from the public grid
   on data-privacy grounds (see the comment on the list in index.html). The
   remaining three widen to fill the row rather than leaving a gap where it
   used to sit.
   auto-fit rather than a fixed repeat(3): with only three cards the count no
   longer divides evenly at every breakpoint, and this reflows 3 → 2 → 1 on
   its own instead of needing a rule per width that has to be kept in step
   with the number of cards. */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-5);
  list-style: none;
}

.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 22px 20px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    transform var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}
/* Gold accent bar that slides in on hover */
.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-600), var(--gold-300));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-slow) var(--ease-out);
}
.service-card:hover,
.service-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}
.service-card:hover::before,
.service-card:focus-within::before {
  transform: scaleX(1);
}

.service-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  color: var(--tile-fg);
  font-size: 22px;
}

.service-title {
  font-size: 1.02rem;
  font-weight: var(--weight-bold);
  color: var(--text-brand);
}

.service-desc {
  font-size: 0.83rem;
  line-height: var(--leading-normal);
  color: var(--text-secondary);
  flex: 1;
}

/* The one fact a resident wants before starting: how long, or what it costs
   them in privacy. Previously buried in the modal, or nowhere. */
.service-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 0.74rem;
  line-height: var(--leading-snug);
  color: var(--text-muted);
}
.service-note i[data-icon] {
  font-size: 13px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

/* One real button per card, stretched over the whole card by ::after so the
   card stays clickable without wrapping headings in a <button>. */
.service-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-accent);
  cursor: pointer;
}
.service-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.service-cta i[data-icon] {
  font-size: 12px;
  transition: transform var(--duration-base) var(--ease-out);
}
.service-card:hover .service-cta i[data-icon] {
  transform: translateX(3px);
}
.service-cta:focus-visible {
  outline: none;
}
/* A visitor's button says what pressing it will ask for: every service here
   needs an account, and the card opens the sign-in prompt instead of the
   form. html.is-visitor is set in the page head and by applySessionToNav(). */
.service-cta .cta-visitor,
html.is-visitor .service-cta .cta-member {
  display: none;
}
html.is-visitor .service-cta .cta-visitor {
  display: inline;
}
.service-card:focus-within {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.services-footnote {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: var(--space-6);
  font-size: 0.84rem;
  color: var(--text-secondary);
}
.services-footnote i[data-icon] {
  font-size: 15px;
  color: var(--accent);
}
.services-footnote a {
  color: var(--text-accent);
  font-weight: var(--weight-semibold);
}
/* "Sign in · Apply for one" is only news to someone who is signed out. */
html:not(.is-visitor) .services-footnote {
  display: none;
}
/* A phone number broken at its hyphen ("043-" / "702-8875") is one a reader
   in a hurry can misdial. js/hotlines.js rewrites these, so it is CSS. */
[data-hotline] {
  white-space: nowrap;
}

/* ─── HOW IT WORKS ─────────────────────────────── */
.section-how {
  background: var(--surface-raised);
  border-bottom: 1px solid var(--section-line);
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  list-style: none;
  counter-reset: step;
}

.how-step {
  position: relative;
  padding-top: var(--space-6);
  border-top: 2px solid var(--border);
}
/* Progress hairline: the completed segment is gold, so the three steps read
   as a sequence rather than three unrelated cards. */
.how-step::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 44px;
  height: 2px;
  background: var(--accent);
}

.how-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-full);
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  color: var(--tile-fg);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: var(--weight-bold);
}

.how-step-title {
  font-size: 1.05rem;
  font-weight: var(--weight-bold);
  color: var(--text-brand);
  margin-bottom: 8px;
}

.how-step-desc {
  font-size: 0.87rem;
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}


/* ─── MODALS ───────────────────────────────────── */
.modal-muted-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 10px;
}

.modal-help-text {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.modal-help-text-lg {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.form-row-tight {
  margin-bottom: 14px;
}

.form-row-roomy {
  margin-bottom: 18px;
}

.form-group-flat {
  margin: 0;
}

.cert-selected-badge {
  margin-bottom: 20px;
}

.textarea-tall {
  min-height: 120px;
}

.textarea-medium {
  min-height: 110px;
}

.btn-danger-strong {
  background: var(--red-mid);
  color: #fff;
  border-color: var(--red-mid);
}

.rating-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.gis-filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.gis-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition, 0.15s ease);
  white-space: nowrap;
}
.gis-filter-btn:hover {
  border-color: var(--gis-ink);
  color: var(--gis-ink);
}
.gis-filter-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
/* Layer-visibility toggles (Vegetation/Water/Roads/etc.) live in the same
   filter row but read as "on/off" rather than an exclusive category choice,
   so they get a softer gold active state instead of the solid navy fill. */
.gis-layer-toggle {
  border-style: dashed;
}
.gis-layer-toggle.active {
  background: rgba(201, 162, 39, 0.14);
  color: var(--gis-ink);
  border-color: var(--gold, #c9a227);
  border-style: solid;
}
/* Filter dropdowns (Building Type / Classification / Map Layers) share the
   .gis-elements-* button-plus-panel design. A choice dropdown with a filter
   applied gets the soft gold "active" treatment so it reads at a glance. */
.gis-choice-dropdown.gis-choice-active .gis-elements-btn {
  background: rgba(201, 162, 39, 0.14);
  border-color: var(--gold, #c9a227);
  color: var(--gis-ink);
}
.gis-elements-dropdown {
  position: relative;
  display: inline-flex;
}
.gis-elements-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.gis-elements-btn .gis-icon {
  width: 14px;
  height: 14px;
}
.gis-elements-btn:hover,
.gis-elements-dropdown.open .gis-elements-btn {
  border-color: var(--gis-ink);
  color: var(--gis-ink);
}
.gis-elements-caret {
  font-size: 9px;
  color: var(--gold, #c9a227);
  transition: transform 0.15s ease;
}
.gis-elements-dropdown.open .gis-elements-caret {
  transform: rotate(180deg);
}
.gis-elements-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 190px;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
/* display:flex above beats the UA's [hidden] rule — restate it so the panel
   actually closes when the dropdown is toggled shut. */
.gis-elements-panel[hidden] {
  display: none;
}
/* Every dropdown panel (Building Type, Classification, Map Layers) shares
   one row design: borderless rows, navy hover, and a soft-gold active state
   with a gold check — overriding the pill/dashed looks the row buttons
   would otherwise inherit from .gis-filter-btn/.gis-layer-toggle. */
.gis-elements-panel .gis-filter-btn {
  width: 100%;
  justify-content: flex-start;
  border: none;
  border-radius: 8px;
  background: none;
  padding: 8px 12px;
  color: var(--text-secondary);
}
.gis-elements-panel .gis-filter-btn:hover {
  background: var(--gis-panel-hover);
  color: var(--gis-ink);
}
.gis-elements-panel .gis-filter-btn.active {
  background: rgba(201, 162, 39, 0.14);
  color: var(--gis-ink);
}
.gis-elements-panel .gis-filter-btn.active::after {
  content: "✓";
  margin-left: auto;
  padding-left: 10px;
  color: var(--gold, #c9a227);
  font-weight: 700;
}
/* Household search — mounted into the same filter row as the layer toggles */
.gis-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 220px;
  flex: 1 1 220px;
  padding: 7px 12px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--white);
}
.gis-search-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.gis-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-primary);
  background: transparent;
  min-width: 0;
}
.gis-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  max-height: 240px;
  overflow-y: auto;
}
.gis-search-result {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}
.gis-search-result:hover {
  background: var(--surface);
}
.gis-search-empty {
  padding: 8px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.gis-svg-full {
  width: 100%;
  height: 100%;
}

.gis-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.gis-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s ease;
}
/* Applied to [data-legend-layer] entries whose layer is currently toggled
   off, so the legend always matches what's actually visible on the map. */
.gis-legend-item.gis-legend-dim {
  opacity: 0.35;
}
/* Engine-generated legend overlay — sits in the map's bottom-left corner on
   a translucent panel, one column per filter dropdown (Map Layers /
   Building Type / Classification), in the same order as the filters. */
.gis-legend-overlay {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 5;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 18px;
  padding: 10px 14px;
  background: var(--gis-panel-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--gis-panel-border);
  border-radius: var(--radius);
  font-size: 11px;
  pointer-events: none;
}
.gis-legend-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.gis-legend-col-title {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 1px;
}
/* Too little room on phones — the overlay would cover most of the map. */
@media (max-width: 640px) {
  .gis-legend-overlay {
    display: none;
  }
}

/* ─── LEGEND KEYS ───────────────────────────────────────────────────────────
   Each entry is drawn as the thing it stands for, so the key can be read by
   shape before colour: a line is a road, a pin is a report, a square is an
   area on the ground. .gis-dot is kept for the few swatches elsewhere in the
   MIS that are genuinely just a colour. */
.gis-key {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
}
.gis-key-square {
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(27, 42, 74, 0.22);
}
/* A road: a short line at the weight and colour the map draws that kind,
   so "service" and "main" are told apart here the same way they are there. */
.gis-key-line {
  width: 16px;
  height: 0;
  border-radius: 2px;
  background: none;
  box-shadow: none;
  border-top: 2px solid var(--gis-road, #fff);
  outline: 1px solid var(--gis-road-casing, #c6cbb6);
}
.gis-key-road-service {
  border-top-width: 2px;
}
.gis-key-road-local {
  border-top-width: 3px;
}
.gis-key-road-major {
  border-top-width: 4px;
  border-top-color: var(--gis-road-major, #f8dca2);
  outline-color: var(--gis-road-major-casing, #e9c47f);
}
/* The marker itself, at legend size: resident green, official navy — the same
   two colours the pins on the map are. */
.gis-key-pin {
  width: 10px;
  height: 14px;
  overflow: visible;
}
.gis-key-pin path {
  stroke: #ffffff;
  stroke-width: 2;
  stroke-linejoin: round;
  paint-order: stroke;
}
.gis-key-pin-report path {
  fill: #15803d;
}
.gis-key-pin-official path {
  fill: #1d4ed8;
}
/* Legend swatches. They carry the same pastel fills the map does, so a pale
   dot needs a hairline ring of its own to stay visible against a white panel —
   the inset shadow gives every dot one, including the classification dots the
   engine colours inline from GIS_HOUSEHOLD_SUBCAT_META. */
.gis-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(27, 42, 74, 0.22);
}

.gis-dot-government {
  background: #e9c6a4;
}

.gis-dot-business {
  background: #a8d5d8;
}

.gis-dot-households {
  background: #6d93dd;
}

.gis-dot-seniors {
  background: #f3c98b;
}

.gis-dot-pwd {
  background: #c6b6ec;
}

.gis-dot-solo-parent {
  background: #f3b1cc;
}

.gis-dot-indigent {
  background: #9ed9c8;
}

.gis-dot-hazard {
  background: rgba(239, 68, 68, 0.4);
  border: 1px dashed #ef4444;
}

.gis-dot-construction {
  background: rgba(234, 140, 8, 0.4);
  border: 1px dashed #ea8c08;
}
.gis-dot-vegetation {
  background: #c6ddb4;
}
.gis-dot-water {
  background: #cfe0f2;
}
.gis-dot-roads {
  background: #ffffff;
}
.gis-dot-accidents {
  background: #b91c1c;
}

.alert-spacing-top {
  margin-top: 14px;
}

.acc-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.acc-step {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.acc-step.active {
  background: var(--navy);
  color: #fff;
}

.acc-step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
}

.acc-step-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.acc-step-help {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* The optional "confirm your number" step (js/account-application.js): the
   button that asks for a code, and the line that says it worked. Hidden
   entirely unless the server says a text would really arrive. */
.acc-code-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.acc-confirmed {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--success-border, var(--border));
  border-radius: var(--radius-md);
  background: var(--success-bg, var(--surface-sunken));
  color: var(--success, var(--text-secondary));
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.alert-mb {
  margin-bottom: 18px;
}

.acc-step-complete {
  text-align: center;
  padding: 20px 0;
}

.acc-success-icon {
  width: 80px;
  height: 80px;
  background: var(--success-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 20px;
}

.acc-success-title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.3rem;
  color: var(--gis-ink);
  margin-bottom: 8px;
}

.acc-success-copy {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 auto 20px;
  line-height: 1.7;
}

.acc-ref-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  display: inline-block;
}

.acc-ref-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 6px;
}

.acc-ref-number {
  font-family: "Space Mono", monospace;
  font-size: 1.1rem;
  color: var(--gis-ink);
  font-weight: 700;
}

.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--navy);
  color: #fff;
  padding: 14px 22px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid var(--yellow);
}

.footer-logo-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.resident-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

.resident-summary {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.badge-align-right {
  margin-left: auto;
}

/* Hero Right */
.hero-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeInRight 1s ease 0.3s both;
}

.logo-showcase {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-ring-mid {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px dashed rgba(196, 30, 42, 0.3);
  animation: rotateSlow 15s linear infinite reverse;
}

@keyframes rotateSlow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.logo-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(245, 197, 24, 0.2) 0%,
    rgba(26, 58, 124, 0.1) 50%,
    transparent 70%
  );
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

.logo-img {
  position: relative;
  z-index: 2;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--yellow);
  box-shadow:
    0 0 40px rgba(245, 197, 24, 0.3),
    0 0 80px rgba(26, 58, 124, 0.4);
  animation: fadeIn 1s ease 0.5s both;
}

.logo-info {
  margin-top: 2.5rem;
  text-align: center;
}

.logo-info-title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--on-brand);
  margin-bottom: 0.4rem;
}

.logo-info-sub {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: "Space Mono", monospace;
}

/* Stats Row */
.hero-stats {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeInUp 0.8s ease 0.6s both;
}

.stat-box {
  padding: 24px 20px;
  background: rgba(13, 27, 62, 0.6);
  text-align: center;
}

.stat-num {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--yellow);
  display: block;
  line-height: 1;
}

.stat-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: "Space Mono", monospace;
  margin-top: 6px;
  display: block;
}

.gis-modal-map {
  width: 100%;
  height: 360px;
  position: relative;
  overflow: hidden;
}

/* ─── GIS SECTION (landing page) ───────────────── */
#gis {
  background: var(--white);
}

.gis-section-panel {
  margin-top: 3rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* Match the MIS GIS page map (.gis-map-embed is 640px tall) so the landing
   map shares its dimensions and fit-zoom level. Higher specificity than
   `.gis-custom-map { height: 100% }` (added to this same element by the map
   engine and defined later in this file) so the fixed height actually wins. */
.gis-section-panel .gis-section-map {
  height: 640px;
}

/* ─── CUSTOM GEOJSON GIS MAP ──────────── */
/* BASEMAP PALETTE. The map is drawn in the flat street-map idiom: pale sage
   ground, white roads with a soft casing under them, one amber artery, light
   blue water and blue-grey buildings. Every colour the base layers use is
   named here, in one place, so the whole map can be re-tinted at once — and so
   the pastel building fills further down stay in the same family as the ground
   they sit on. Features that mean "pay attention" (hazard zones, report pins,
   draw previews) deliberately keep their saturated colours: they are supposed
   to break out of this palette. */
.gis-custom-map {
  --gis-land: #eef1e4;
  --gis-land-outside: #d9ddcd;
  --gis-land-edge: #adb79c;
  --gis-water: #cfe0f2;
  --gis-water-edge: #a9c8e6;
  --gis-road: #ffffff;
  /* The casing is what makes a white road read as a road on pale ground. It
     used to be barely darker than the land, so a service road — a hairline of
     white on sage — disappeared unless you were looking for it. */
  --gis-road-casing: #bfc6ae;
  --gis-road-major: #f8dca2;
  --gis-road-major-casing: #e9c47f;
  /* Untagged buildings are the ground the tagged ones stand on: light, flat
     and a little greyer than they were, so a tagged house is told apart from
     them at the zoom staff actually work at rather than only up close. */
  --gis-bldg: #ccd3dd;
  --gis-bldg-edge: rgba(255, 255, 255, 0.7);
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--gis-land-outside);
  overflow: hidden;
}
.gis-map-toolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  left: 10px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  pointer-events: none;
}
.gis-toolbar-row {
  display: flex;
  gap: 6px;
  pointer-events: auto;
}
.gis-toolbar-row-wrap {
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
}
.gis-icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: -0.15em;
}
.gis-zoom-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--gis-ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.gis-zoom-btn .gis-icon {
  width: 16px;
  height: 16px;
}
.gis-zoom-btn:hover {
  background: var(--surface);
}
.gis-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--gis-ink);
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.gis-toolbar-btn.active {
  background: var(--gold, #c9a227);
  color: #fff;
  border-color: var(--gold, #c9a227);
}
/* Edit Mode button + its animated one-column draw/ping tools dropdown */
.gis-edit-row {
  align-items: flex-start;
}
.gis-deselect-btn {
  background: var(--surface);
  color: var(--text-secondary);
  border-style: dashed;
}
.gis-deselect-btn:hover {
  color: var(--danger, #7f1d1d);
  border-color: var(--danger, #7f1d1d);
}
/* `.gis-toolbar-btn`'s `display: inline-flex` would otherwise beat the UA
   [hidden] rule, since author-origin styles win regardless of specificity. */
.gis-deselect-btn[hidden] {
  display: none;
}
.gis-edit-menu {
  position: relative;
  pointer-events: auto;
}
.gis-edit-toggle-btn {
  position: relative;
  z-index: 2;
}
.gis-draw-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 168px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  transform-origin: top right;
  transform: scaleY(0.85) translateY(-6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0.16s;
}
.gis-draw-dropdown.open {
  opacity: 1;
  transform: scaleY(1) translateY(0);
  visibility: visible;
  pointer-events: auto;
}
.gis-draw-dropdown-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 3px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.gis-draw-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--gis-ink);
  font-size: 12.5px;
  padding: 7px 10px;
  cursor: pointer;
  white-space: nowrap;
  text-align: left;
}
.gis-draw-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.gis-draw-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  border-radius: 6px;
  border: none;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 10px;
  cursor: pointer;
  white-space: nowrap;
}
/* `display: flex` above would otherwise beat the UA [hidden] rule, since
   author-origin styles win regardless of matching specificity. */
.gis-draw-action-btn[hidden] {
  display: none;
}
.gis-draw-finish {
  background: var(--success, #166534);
  color: #fff;
}
.gis-draw-cancel {
  background: var(--danger, #7f1d1d);
  color: #fff;
}
.gis-draw-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  padding: 4px 10px;
  align-self: flex-end;
}
.gis-svg-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}
.gis-svg {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  /* The public page carries its own copy of the map's rules because it does
     not load css/gis.css. Touch gestures: `pan-y` denies the browser the
     pinch — which it answers by zooming the whole document — leaving it to
     js/gis-map.js, while a one-finger drag stays the page's until the map has
     somewhere to pan to. See css/gis.css for the long version. */
  touch-action: pan-y;
}
.gis-svg.gis-svg-pannable {
  touch-action: none;
}
.gis-drawing .gis-svg {
  cursor: crosshair;
}
.gis-svg:active {
  cursor: grabbing;
}
/* The land tint. Its outline is drawn separately, after the base layers, so
   that nothing laid on the map can cover the border — see .gis-boundary-edge
   and the second path in the SVG. */
.gis-boundary {
  fill: var(--gis-land);
  stroke: none;
}
.gis-boundary-edge {
  fill: none;
  stroke: var(--gis-land-edge);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
/* Any feature wired up via attachFeatureInteraction (buildings, roads,
   vegetation, construction, hazards, accidents) gets a pointer cursor —
   hover shows read-only info outside edit mode, click opens edit/delete
   actions inside it. */
.gis-interactive-feature {
  cursor: pointer;
}
/* Greens are flat and pale so a field reads as ground cover rather than as a
   thing to look at. Each kind sets --veg-fill and the shared rules below do
   the rest, which is what keeps the hover shade in step with the fill. */
.gis-vegetation {
  fill: var(--veg-fill, #dbe7c6);
  stroke: none;
  vector-effect: non-scaling-stroke;
  transition: fill 0.15s ease;
}
.gis-vegetation:hover {
  fill: color-mix(in srgb, var(--veg-fill, #dbe7c6) 80%, #3f5a28);
}
/* Surrounding-context vegetation past the barangay border. */
.gis-vegetation-outside {
  opacity: 0.45;
  pointer-events: none;
}
.gis-vegetation-farmland {
  --veg-fill: #e6ecc8;
}
.gis-vegetation-farmyard {
  --veg-fill: #e9e4cd;
}
.gis-vegetation-orchard {
  --veg-fill: #d4e7bd;
}
.gis-vegetation-meadow {
  --veg-fill: #e2efcf;
}
.gis-vegetation-wood,
.gis-vegetation-forest {
  --veg-fill: #c6ddb4;
}
.gis-water-poly {
  fill: var(--gis-water);
  stroke: var(--gis-water-edge);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.gis-water-line {
  fill: none;
  stroke: var(--gis-water-edge);
  stroke-width: 2.4;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
/* Roads are drawn twice (renderRoads): a wider casing path underneath, then
   the white road itself on top. That one extra pass is what makes a street
   read as a street on pale ground — a bare white line on sage looks like a
   gap in the map rather than a road. */
.gis-road {
  fill: none;
  stroke: var(--gis-road);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
/* A touch wider than a hairline, for the same reason. */
.gis-road-service {
  stroke-width: 1.9;
}
.gis-road-local {
  stroke-width: 2.4;
}
.gis-road-major {
  stroke: var(--gis-road-major);
  stroke-width: 4;
}
.gis-road-casing-layer {
  pointer-events: none;
}
.gis-road-casing {
  fill: none;
  stroke: var(--gis-road-casing);
  stroke-width: 3.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.gis-road-casing-service {
  stroke-width: 3;
}
.gis-road-casing-local {
  stroke-width: 3.6;
}
.gis-road-casing-major {
  stroke: var(--gis-road-major-casing);
  stroke-width: 5.4;
}
/* BUILDINGS. One fill variable, --bldg-fill, decides a building's colour, and
   every tag, type and classification below sets nothing but that variable. So
   a tagged building is told apart by its FILL alone: the outline is the same
   hairline white on every one of them, which is what keeps a street of mixed
   tags looking like a map instead of a set of coloured boxes. The hover shade
   is mixed from the same variable, so it follows automatically.
   Order matters where two of these can apply at once: the later rule wins
   (classification over household type), and they are written in that order. */
.gis-building {
  fill: var(--bldg-fill, var(--gis-bldg));
  stroke: var(--gis-bldg-edge);
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill 0.15s ease;
}
.gis-building:hover,
.gis-building.gis-building-group-hover {
  fill: color-mix(in srgb, var(--bldg-fill, var(--gis-bldg)) 76%, #1b2a4a);
}
.gis-building-tagged {
  --bldg-fill: #e7d6a3;
}
/* Buildings picked while group tagging — a solid blue with a real outline, the
   one place a building is deliberately louder than the rest, because the
   running selection has to be countable at a glance. */
.gis-building-grouped,
.gis-building-grouped:hover {
  fill: #7ea2e0;
  stroke: #1d4ed8;
  stroke-width: 2;
}
/* Surrounding-context buildings past the barangay border — faded grey,
   not interactive. */
.gis-building-outside {
  fill: #c3c9cf;
  stroke: rgba(255, 255, 255, 0.5);
  cursor: default;
  pointer-events: none;
}
.gis-building-cat-government {
  --bldg-fill: #e9c6a4;
}
.gis-building-cat-business {
  --bldg-fill: #a8d5d8;
}
/* A household is the one tag the map is mostly made of, and its old pastel
   blue sat a shade away from the untagged grey-blue — at any distance the two
   were one colour. This is a proper blue: still flat, still in the palette,
   but unmistakably "somebody tagged this". */
.gis-building-cat-households {
  --bldg-fill: #6d93dd;
}
/* A household someone vulnerable lives in — a senior citizen, a PWD, a solo
   parent, an indigent family — is filled, whole, in that classification's
   colour (renderBuildings() in js/gis-map.js). The colour arrives as
   --class-color straight from GIS_HOUSEHOLD_SUBCAT_META, so it is written down
   in one place. A household holding several takes the first in priority order,
   and its popup names the rest. */
.gis-building-classified {
  --bldg-fill: var(--class-color);
}
.gis-construction {
  fill: rgba(234, 179, 8, 0.15);
  stroke-width: 5;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill 0.15s ease;
}
.gis-construction:hover {
  fill: rgba(234, 179, 8, 0.3);
}
.gis-hazard-ping {
  cursor: pointer;
  transition: fill-opacity 0.15s ease;
}
.gis-hazard-severity-low {
  fill-opacity: 0.18;
}
.gis-hazard-severity-medium {
  fill-opacity: 0.3;
}
.gis-hazard-severity-high {
  fill-opacity: 0.45;
}
.gis-draw-preview-shape {
  fill: rgba(37, 99, 235, 0.15);
  stroke: #2563eb;
  stroke-width: 2;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.gis-draw-preview-line {
  fill: none;
  stroke: #2563eb;
  stroke-width: 2;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.gis-draw-preview-ping {
  fill: rgba(37, 99, 235, 0.12);
  stroke: #2563eb;
  stroke-width: 2;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
/* The vegetation cut tool traces an area to remove, not add — a red preview
   makes that "subtract" intent clear at a glance. */
.gis-draw-preview-cut {
  fill: rgba(220, 38, 38, 0.18);
  stroke: #dc2626;
  stroke-width: 2;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.gis-draw-preview-vertex {
  fill: #6b7280;
  stroke: #fff;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.gis-draw-preview-measure {
  fill: none;
  stroke: #0d9488;
  stroke-width: 2;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.gis-draw-measure-label {
  fill: #0d9488;
  font-weight: 700;
  font-family: "Space Mono", monospace;
  pointer-events: none;
}
.gis-load-error {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.gis-popup,
.gis-pin-form {
  position: absolute;
  z-index: 10;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px 14px;
  min-width: 180px;
  max-width: 240px;
  /* Never taller than the map it sits in: positionFloatingEl() keeps it
     inside the map, and a form taller than that scrolls instead of being cut
     off at the bottom. */
  max-height: calc(100% - 16px);
  overflow-y: auto;
  font-size: 12.5px;
}
/* Read-only hover popup (shown outside edit mode) — info only, no action
   buttons, and it must not intercept the mouse itself or the underlying
   feature's mouseleave would never fire, leaving it stuck open. */
.gis-popup-readonly {
  pointer-events: none;
}
.gis-popup-title {
  font-weight: 700;
  color: var(--gis-ink);
  margin-bottom: 2px;
}
.gis-popup-cat {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.gis-popup-notes {
  color: var(--text-secondary);
  line-height: 1.4;
}
.gis-popup-delete {
  margin-top: 8px;
  width: 100%;
  border: 1px solid #ef4444;
  color: #ef4444;
  background: none;
  border-radius: 6px;
  padding: 5px 0;
  font-size: 11.5px;
  cursor: pointer;
}
.gis-popup-delete:hover {
  background: rgba(239, 68, 68, 0.08);
}
.gis-popup-action {
  margin-top: 8px;
  width: 100%;
  border: 1px solid var(--gold, #c9a227);
  color: var(--gold, #c9a227);
  background: none;
  border-radius: 6px;
  padding: 5px 0;
  font-size: 11.5px;
  cursor: pointer;
}
.gis-popup-action:hover {
  background: rgba(201, 162, 39, 0.08);
}

/* ── Community report pins & cards ── */
.gis-report-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.gis-report-signin-hint {
  font-size: 12px;
  color: var(--text-muted);
}
/* ── Map pins (incident reports, accident markers, the pick-a-spot marker) ──
   One marker language for all of them: a teardrop in a single flat colour,
   its tip ON the spot it marks, with the report type's glyph knocked straight
   out of it in white — no inner disc, no second hue, nothing behind the glyph.
   A small ground shadow sits under the tip so the pin reads as standing on the
   map rather than printed on it.
   The colour is passed in as --pin-color by whatever kind of pin it is, so the
   hover shade, the drop animation and the ripple all follow one value.
   Kept in step with gis.css, which styles the same pins on the MIS map. */
.gis-map-pin {
  cursor: pointer;
  user-select: none;
}
.gis-pin-body {
  fill: var(--pin-color, #15803d);
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  transition: fill 0.15s ease;
}
.gis-map-pin:hover .gis-pin-body {
  fill: color-mix(in srgb, var(--pin-color, #15803d) 78%, #000);
}
.gis-pin-shadow {
  fill: rgba(27, 42, 74, 0.22);
  stroke: none;
}
/* Set on the GROUP, not on a list of element selectors: fill and stroke are
   inherited SVG properties, so this reaches every shape a glyph might use —
   including the <rect> in `medical` and `landDispute`, which an element list
   missed and which therefore rendered as a solid black box. It also lets the
   few deliberately filled dots (alertCircle, exclamation) keep their own
   fill="currentColor" stroke="none" attributes, which beat an inherited
   value; `color` below is what those resolve against. */
.gis-pin-glyph {
  fill: none;
  stroke: #ffffff;
  color: #ffffff;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Resident green / official navy / accident red. */
.gis-report-pin {
  --pin-color: #15803d;
}
.gis-report-pin-official {
  --pin-color: #1d4ed8;
}
.gis-accident-icon {
  --pin-color: #b91c1c;
}
/* The pin the Blotter's "View on Map" flew us to. A gold halo pulsing out from
   behind the head: the camera move alone was too easy to miss on a map that
   already carries dozens of identical pins, and a resolved report has no other
   pin around it to compare against. */
.gis-pin-halo {
  fill: none;
  stroke: #c79a3b;
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: center;
  animation: gis-report-focus-pulse 1.6s ease-out infinite;
}
@keyframes gis-report-focus-pulse {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  70% {
    transform: scale(2.1);
    opacity: 0;
  }
  100% {
    transform: scale(2.1);
    opacity: 0;
  }
}
/* PLACING A PIN. A pin that simply appears is easy to miss — on a map this
   busy the eye needs to be told where it landed. So a newly placed pin drops
   in from above, settles with a small bounce, and knocks a ring out of the
   ground at its tip. Only pins the map has not drawn before animate, so a
   filter change or a redraw does not set every pin on the map bouncing.
   The drop lives on an INNER group: the outer group carries the positioning
   transform attribute, and a CSS `transform` would replace it outright and
   throw the pin to the corner of the map. */
.gis-pin-placing .gis-pin-anim {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: gis-pin-drop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes gis-pin-drop {
  0% {
    transform: translateY(-22px) scale(0.5);
    opacity: 0;
  }
  55% {
    transform: translateY(0) scale(1.14);
    opacity: 1;
  }
  75% {
    transform: translateY(0) scale(0.93);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}
.gis-pin-ripple {
  fill: none;
  stroke: var(--pin-color, #15803d);
  stroke-width: 2.4;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: gis-pin-ripple 0.7s ease-out 0.24s both;
}
@keyframes gis-pin-ripple {
  0% {
    transform: scale(0.35);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .gis-pin-halo {
    animation: none;
    transform: scale(1.5);
    opacity: 0.8;
  }
  .gis-pin-placing .gis-pin-anim,
  .gis-pin-ripple {
    animation: none;
  }
  .gis-pin-ripple {
    opacity: 0;
  }
  .gis-hazard-focus-ring {
    animation: none;
  }
}
/* The incident modal's "you picked here" marker — brand gold so it stands
   apart from the report pins already on the map, and the one pin that keeps a
   plain white dot instead of a glyph: it marks a choice, not a report, and at
   the moment it is dropped nobody has said yet what kind of incident it is. */
.gis-pick-pin {
  --pin-color: #c79a3b;
  pointer-events: none;
}
.gis-pick-pin .gis-pin-dot {
  fill: #ffffff;
  stroke: none;
}
/* Minimal map embed (incident modal): drop the layer/filter controls and the
   legend overlay so the pick-a-location map gets the full modal width. */
.gis-minimal .gis-toolbar-row-wrap,
.gis-minimal .gis-legend-overlay {
  display: none;
}
/* Incident modal helper text under the embedded pick-a-location map + the
   "auto-filled from your record" hint under read-only complainant fields. */
.inc-pick-status {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted, #64748b);
}
.inc-pick-status.picked {
  color: #15803d;
  font-weight: 600;
}
.inc-field-hint {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted, #64748b);
}
.gis-dot-reports {
  background: #15803d;
}
/* Official (Admin/Officer/Staff) report pins are navy on the map. The legend
   lists both, so this swatch has to exist here as well as in gis.css. */
.gis-dot-reports-official {
  background: #1d4ed8;
}
/* Interactive report cards must accept the cursor — unlike the read-only
   hover popup, which is pointer-events:none so it can follow the mouse. */
.gis-popup-hoverable {
  pointer-events: auto;
}
.gis-popup-expanded {
  max-width: 320px;
  padding-top: 16px;
}
.gis-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
}
.gis-popup-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--gis-ink);
}
.gis-popup-close .gis-icon {
  width: 14px;
  height: 14px;
}
.gis-report-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-right: 20px;
}
.gis-report-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--yellow, #f5c542);
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gis-report-reporter-name {
  font-weight: 700;
  color: var(--gis-ink);
  font-size: 12.5px;
}
.gis-report-reporter-sub {
  font-size: 11px;
  color: var(--text-muted);
}
/* ── Draw dock — bottom-right of the map while Edit Mode is on. Holds the
   "Add to Map" element panel plus a companion types panel that appears to
   its LEFT when an element is picked. Both share the legend overlay's
   translucent styling and fold up into view. Only editable (MIS) embeds
   render it, but the styles live here too for completeness. ── */
.gis-draw-dock {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 8;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-height: 80%;
}
.gis-draw-dock[hidden] {
  display: none;
}
.gis-draw-panel {
  width: 210px;
  max-height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  background: var(--gis-panel-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--gis-panel-border);
  border-radius: var(--radius);
  transform-origin: bottom center;
  animation: gisFoldUp 0.18s ease;
}
.gis-draw-panel[hidden] {
  display: none;
}
/* Each dock column stacks its boxes bottom-up (hint above Add to Map;
   Finish/Cancel above the types panel). */
.gis-draw-dock-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 8px;
  max-height: 100%;
  min-height: 0;
}
.gis-draw-types-panel {
  width: 185px;
}
/* Finish/Cancel — its own box above the types panel */
.gis-draw-actions-panel {
  width: 185px;
  flex-direction: row;
  gap: 6px;
}
@keyframes gisFoldUp {
  from {
    opacity: 0;
    transform: translateY(12px) scaleY(0.8);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
/* The types panel slides in from the side (out of the Add to Map panel)
   instead of folding up like the other boxes. */
.gis-draw-types-panel {
  animation: gisSlideIn 0.18s ease;
}
@keyframes gisSlideIn {
  from {
    opacity: 0;
    transform: translateX(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.gis-draw-panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.gis-draw-panel-title .gis-icon {
  width: 13px;
  height: 13px;
}
.gis-draw-panel .gis-draw-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.gis-draw-panel .gis-draw-btn:hover {
  background: var(--gis-panel-hover);
  color: var(--gis-ink);
}
.gis-draw-panel .gis-draw-btn .gis-elements-caret {
  margin-left: auto;
}
/* Element row whose types panel is open, or whose tool is armed */
.gis-draw-btn.open,
.gis-draw-btn.armed {
  background: var(--gis-panel-hover);
  color: var(--gis-ink);
}
.gis-draw-types {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gis-draw-type-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 5px 9px;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}
.gis-draw-type-btn .gis-icon {
  width: 13px;
  height: 13px;
}
.gis-draw-type-btn:hover {
  background: var(--gis-panel-hover);
  color: var(--gis-ink);
}
.gis-draw-btn.active,
.gis-draw-type-btn.active {
  background: rgba(201, 162, 39, 0.16);
  color: var(--gis-ink);
}
.gis-draw-panel-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
/* Hint — its own translucent box above the Add to Map panel */
.gis-draw-panel.gis-draw-hint {
  width: 210px;
  align-self: stretch;
  font-size: 11.5px;
  color: var(--gis-ink);
  white-space: normal;
}
/* ── In-map delete confirmation (replaces the browser's confirm dialog) ── */
.gis-confirm-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
}
.gis-confirm-head .gis-pin-form-title {
  margin-bottom: 0;
}
.gis-confirm-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gis-confirm-icon .gis-icon {
  width: 15px;
  height: 15px;
}
.gis-confirm-message {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 4px;
}
.gis-confirm-delete {
  background: #dc2626;
  color: #fff;
  border: 1px solid #dc2626;
}
.gis-confirm-delete:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

/* The chosen type shown as a fixed line in creation pin forms (the selector
   would be redundant — the type was picked in the draw panel). */
.gis-pin-form-static {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  margin-bottom: 8px;
  border-radius: 7px;
  background: rgba(201, 162, 39, 0.12);
  color: var(--gis-ink);
  font-size: 12px;
  font-weight: 600;
}
.gis-pin-form-static .gis-icon {
  width: 14px;
  height: 14px;
}
.gis-pin-form-static .gis-swatch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* Report placement mode */
.gis-reporting .gis-svg {
  cursor: crosshair;
}
.gis-report-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 9;
  background: var(--navy);
  color: #fff;
  font-size: 11.5px;
  padding: 6px 14px;
  border-radius: 100px;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* The landing page does not load css/gis.css — it carries the subset of the
   GIS styles its embedded maps need, right here. The rules below are that
   subset's copy of the locate button and its error hint, kept in the same
   order as gis.css so the two can be read side by side.

   They are needed because filing an incident is the SAME modal on both sides
   (js/incident-report.js, opened by openServicePopup('incidents') here and by
   File Incident in the MIS), so the button was already in the DOM and already
   wired for residents — it was only ever missing its styles, which left it a
   bare static button sitting below the map instead of a pill in the corner,
   and made it miss the press entirely. A resident on a phone, standing where
   the thing happened, is the person this button is most for. */

/* An answer to the locate button rather than a standing instruction, so it is
   allowed the room to be a sentence: the out-of-barangay message has to say
   where you are, why the pin cannot go there, and what to do instead. */
.gis-report-hint.gis-hint-error {
  max-width: min(420px, 86%);
  white-space: normal;
  overflow: visible;
  line-height: 1.45;
  text-align: center;
  background: var(--danger-solid, #ef4444);
  bottom: 56px;
}

/* "Use my location" — bottom-right, clear of the hint pill along the bottom
   edge and of the zoom controls. Shown only while a pin is being placed. */
.gis-locate-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface-raised);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

/* The engine's buttons are inline-flex, which beats the browser's own rule for
   [hidden] — the same trap the Deselect and Mark Hazard buttons fell into. */
.gis-locate-btn[hidden] {
  display: none;
}

.gis-locate-btn:hover:not(:disabled) {
  border-color: var(--accent-border);
  background: var(--surface-hover);
}

/* Waiting on the phone's GPS, which can take several seconds and must not look
   like a button that did nothing. */
.gis-locate-btn.is-busy {
  opacity: 0.65;
  cursor: progress;
}

.gis-locate-btn .gis-icon {
  width: 14px;
  height: 14px;
}

.gis-pin-form-title {
  font-weight: 700;
  color: var(--gis-ink);
  margin-bottom: 8px;
}
.gis-pin-form-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
/* display:block above beats the UA's [hidden] rule — restate it so rows the
   form toggles off (e.g. Household Classification) actually disappear. */
.gis-pin-form-label[hidden] {
  display: none;
}
.gis-pin-form-input {
  display: block;
  width: 100%;
  margin-top: 3px;
  padding: 6px 8px;
  font-size: 12.5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  resize: vertical;
  background: var(--white);
  color: var(--text-primary);
}
.gis-pin-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}
.gis-swatch-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 3px;
}
.gis-swatch-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.gis-swatch-option.active {
  border-color: var(--gis-ink);
  background: var(--surface);
  color: var(--gis-ink);
  font-weight: 700;
}
.gis-swatch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.cert-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.cert-type-card {
  padding: 14px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.cert-type-card:hover,
.cert-type-card.selected {
  border-color: var(--gold);
  background: var(--gold-pale);
}

.cert-type-card .cert-icon {
  font-size: 1.4rem;
  display: block;
  margin-bottom: 6px;
}

.cert-type-card .cert-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--gis-ink);
}

.star-rating {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}

.star {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--border);
  transition: color 0.15s;
}

.star.active,
.star:hover {
  color: var(--yellow);
}

/* Submitted with no rating — see the note on the same rule in css/system.css.
   The star row is a div, so it takes the shake from .m-shake but none of
   .form-control.m-empty's amber halo; the stars carry it instead. */
.star-rating.m-empty .star {
  color: var(--warning-solid);
}

.star-rating:focus {
  outline: none;
}

.star-rating.m-empty + .rating-label {
  color: var(--warning);
  font-weight: 600;
}

/* Tags */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2rem;
}

.tag {
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tag-blue {
  background: rgba(37, 99, 235, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.tag-yellow {
  background: rgba(245, 197, 24, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(245, 197, 24, 0.3);
}

.tag-red {
  background: rgba(196, 30, 42, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(196, 30, 42, 0.3);
}

.tag-green {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ─── GIS SECTION — landing adjustments ────────── */
/* Base panel/#gis styles are in the GIS block above; these override them for
   the landing page and must stay after it in the file. */
.section-gis {
  background: var(--surface);
  border-bottom: 1px solid var(--section-line);
}
#gis {
  background: var(--surface);
}

/* Header beside a plain-language list of what the layers actually contain —
   including the privacy line, which is the question a resident asks first
   when a barangay puts households on a public map. */
.gis-head-row {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
}

.gis-facts {
  display: grid;
  gap: 12px;
  list-style: none;
  padding: var(--space-5);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
}
.gis-facts li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.84rem;
  line-height: var(--leading-snug);
  color: var(--text-secondary);
}
.gis-facts i[data-icon] {
  font-size: 15px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

.gis-section-panel {
  margin-top: 0;
  background: var(--surface-raised);
  border-radius: var(--radius-lg);
}
.gis-modal-map,
.gis-section-map {
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Shown when js/gis-map.js itself cannot be fetched. */
.gis-load-error {
  display: grid;
  place-items: center;
  height: 100%;
  padding: var(--space-8);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* The map while its layer files are still arriving: the same loader the MIS
   map shows ("Drawing the barangay map…" over a moving gold bar). This page
   does not load css/gis.css, where it lives, so until this copy the engine's
   loader landed as bare text in the corner of an empty box — in the incident
   form's pin map and in the map section. Kept identical to gis.css. */
.gis-map-loading {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--gis-land-outside, #d9ddcd);
  color: var(--text-muted, #64748b);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.gis-map-loading-bar {
  width: 148px;
  height: 6px;
  border-radius: 100px;
  background: rgba(27, 42, 74, 0.1);
  overflow: hidden;
  position: relative;
}
.gis-map-loading-bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: 100px;
  background: var(--gold, #c9a227);
  animation: gisMapLoading 1.1s ease-in-out infinite;
}
@keyframes gisMapLoading {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(345%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .gis-map-loading-bar::after {
    animation: none;
    width: 100%;
    opacity: 0.4;
  }
}

/* ─── LATEST ANNOUNCEMENTS ─────────────────────── */
.section-announcements {
  background: var(--surface-raised);
  border-bottom: 1px solid var(--section-line);
}

/* Six equal cards gave a calamity advisory and a fun-run notice identical
   weight. The newest item now takes a double-width slot; the renderer in
   js/site-config.js is untouched — this is the grid's first child. */
.announcements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.announcement-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  transition:
    transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out);
}
.announcement-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.announcements-grid .announcement-card:first-child {
  grid-column: span 2;
  background: var(--surface);
  border-left: 3px solid var(--accent);
}
.announcements-grid .announcement-card:first-child .announcement-title {
  font-family: var(--font-serif);
  font-weight: var(--weight-bold);
  font-size: 1.5rem;
  line-height: 1.2;
}
.announcements-grid .announcement-card:first-child .announcement-body {
  -webkit-line-clamp: 6;
  font-size: 0.9rem;
}

.announcement-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.announcement-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.64rem;
  font-weight: var(--weight-extrabold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
/* Tag chips run through the status token pairs, so they follow the theme
   instead of carrying six hard-coded light-mode hexes. */
.ann-tag-advisory {
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent-fg);
}
.ann-tag-health {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success);
}
.ann-tag-community {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--info);
}
.ann-tag-event {
  background: var(--surface-sunken);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}
.ann-tag-emergency {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

.announcement-date {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.announcement-title {
  font-weight: var(--weight-bold);
  font-size: 1rem;
  line-height: var(--leading-snug);
  color: var(--text-brand);
}

.announcement-body {
  font-size: 0.85rem;
  line-height: var(--leading-normal);
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.announcements-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 34px 20px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* ─── HISTORY ──────────────────────────────────── */
/* Heading on the left, the story on the right on a sheet of its own. It is
   the one section people sit and read, so it is set for reading:
   a measure near 65 characters, generous leading, and a drop cap to say
   where the story starts. */
.section-history {
  background: var(--history-bg);
  border-bottom: 1px solid var(--section-line);
}

.history-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

/* Stays beside the text while it is read on a wide screen. */
.history-head {
  position: sticky;
  top: calc(var(--navbar-h) + var(--masthead-h) + 32px);
}

.history-text {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 3rem) clamp(1.5rem, 4.5vw, 3.5rem);
  box-shadow: var(--shadow-sm);
}

.history-text p {
  max-width: 65ch;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-secondary);
}
.history-text p + p {
  margin-top: 1.15em;
}

.history-text p:first-child {
  font-size: 1.08rem;
  color: var(--text-primary);
}
.history-text p:first-child::first-letter {
  float: left;
  margin: 0.06em 0.12em 0 0;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 3.7em;
  line-height: 0.82;
  color: var(--text-brand);
}

/* ─── BARANGAY OFFICIALS ───────────────────────── */
.section-officials {
  background: var(--surface);
  border-bottom: 1px solid var(--section-line);
}

.officials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.official-card {
  position: relative;
  overflow: hidden;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px 24px 28px;
  text-align: center;
  transition:
    transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out);
}
.official-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--navy-700), var(--gold-600));
}
.official-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.official-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  height: 104px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--tile-bg);
  color: var(--tile-fg);
  border: 3px solid var(--gold-600);
  font-weight: var(--weight-extrabold);
  font-size: 1.7rem;
  letter-spacing: 0.02em;
  overflow: hidden;
}

.official-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.official-name {
  font-weight: var(--weight-extrabold);
  font-size: 1.05rem;
  color: var(--text-brand);
  margin-bottom: 6px;
}

.official-role {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent-fg);
  font-size: 0.66rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.official-desc {
  font-size: 0.84rem;
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

/* ─── VISIT / CONTACT ──────────────────────────── */
/* Closing dark band. It runs straight into the footer on purpose, separated
   by the footer's gold rule — one institutional block instead of two. */
.section-visit {
  position: relative;
  background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
  color: rgba(255, 255, 255, 0.72);
}
.section-visit::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1a3a7c 0%, #c41e2a 48%, #f5c518 100%);
  opacity: 0.85;
}
.section-visit .section-kicker {
  color: var(--gold-300);
}
.section-visit .section-kicker::before {
  background: var(--gold-400);
}
.section-visit .section-title {
  color: #fff;
}
.section-visit .section-desc {
  color: rgba(255, 255, 255, 0.68);
}

.visit-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.visit-list {
  display: grid;
  gap: 14px;
  margin-top: var(--space-6);
  list-style: none;
}
.visit-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.82);
}
.visit-list i[data-icon] {
  font-size: 17px;
  color: var(--gold-300);
  flex-shrink: 0;
}
.visit-list a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
}
.visit-list a:hover {
  color: var(--gold-300);
  border-bottom-color: var(--gold-300);
}

/* Emergency card — deliberately the loudest thing in the band. An online
   blotter form is the wrong channel for an emergency and the page never said
   so anywhere. */
.visit-emergency {
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: rgba(196, 30, 42, 0.14);
  border: 1px solid rgba(252, 165, 165, 0.32);
}

.visit-emergency-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-md);
  background: rgba(220, 38, 38, 0.24);
  color: var(--red-300);
  font-size: 21px;
}

.visit-emergency-title {
  font-size: 1.05rem;
  font-weight: var(--weight-bold);
  color: #fff;
  margin-bottom: 6px;
}

.visit-emergency-desc {
  font-size: 0.84rem;
  line-height: var(--leading-normal);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--space-5);
}

.visit-emergency-num {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  transition:
    background var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out);
}
.visit-emergency-num + .visit-emergency-num {
  margin-top: 8px;
}
.visit-emergency-num:hover {
  background: rgba(0, 0, 0, 0.34);
  border-color: rgba(252, 165, 165, 0.45);
}
/* The number never wraps. The card is a ~400px column, and once the label
   beside it carries the hours as well ("Barangay Hotline · Mon-Fri 8AM-5PM")
   the flex row started shrinking the number instead — "043-702-" on one line
   and "8875" on the next, which is not a phone number. The label wraps; the
   thing being read out loud to an operator does not. */
.visit-emergency-num strong {
  flex: none;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: 0.02em;
}
.visit-emergency-num span {
  min-width: 0;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}
/* When the line is answered ("24/7", "office hours only"), from the hotline
   directory. A number nobody picks up after 9 PM is worth saying out loud —
   the report form is the after-hours route. Not italic: the label beside it is
   already small uppercase, and two kinds of emphasis in six words is noise. */
.visit-emergency-num .hotline-when {
  font-style: normal;
  color: rgba(255, 255, 255, 0.42);
}
/* Heading over the non-emergency entries (a water or power office). Rendered
   by js/hotlines.js only when there are any, so there is never a heading
   standing over nothing. */
.visit-emergency-more {
  margin: var(--space-4) 0 8px;
  font-size: 0.66rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

/* ─── FOOTER ───────────────────────────────────── */
.site-footer {
  background: var(--navy-950);
  color: rgba(255, 255, 255, 0.7);
  border-top: 3px solid var(--gold-600);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.85fr 0.85fr 1.1fr;
  gap: clamp(1.75rem, 4vw, 3rem);
  padding: clamp(2.5rem, 5vw, 3.75rem) 0 clamp(2rem, 4vw, 3rem);
}

.footer-seal-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.footer-seal {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--gold-600);
  object-fit: cover;
}

.footer-title {
  font-family: var(--font-serif);
  font-weight: var(--weight-bold);
  font-size: 1.25rem;
  color: #fff;
}

.footer-subtitle {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-300);
  margin-top: 3px;
}

.footer-text {
  font-size: 0.83rem;
  line-height: var(--leading-relaxed);
  color: rgba(255, 255, 255, 0.55);
  max-width: 38ch;
}

.footer-privacy {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 42ch;
  font-size: 0.76rem;
  line-height: var(--leading-normal);
  color: rgba(255, 255, 255, 0.45);
}
.footer-privacy i[data-icon] {
  font-size: 14px;
  color: var(--gold-300);
  flex-shrink: 0;
  margin-top: 1px;
}

.footer-heading {
  font-size: 0.68rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 16px;
}

.footer-links,
.footer-contact {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* The service links are buttons (they open a modal, they don't navigate), so
   they need the anchor styling applied by hand. */
.footer-links a,
.footer-links button {
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.86rem;
  cursor: pointer;
  transition: color var(--duration-base) var(--ease-out);
}
.footer-links a:hover,
.footer-links button:hover {
  color: var(--gold-300);
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  line-height: var(--leading-snug);
  color: rgba(255, 255, 255, 0.6);
}
.footer-contact i[data-icon] {
  font-size: 15px;
  color: var(--gold-300);
  flex-shrink: 0;
  margin-top: 2px;
}
.footer-contact a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  word-break: break-word;
}
.footer-contact a:hover {
  color: var(--gold-300);
  border-bottom-color: var(--gold-300);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 18px 0;
}

.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ─── BACK TO TOP ──────────────────────────────── */
.to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: var(--z-sticky);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-brand);
  border-radius: var(--radius-full);
  background: var(--navy-800);
  color: var(--gold-300);
  font-size: 19px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  box-shadow: var(--shadow-lg);
  transition:
    opacity var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out),
    visibility var(--duration-base) var(--ease-out),
    background var(--duration-base) var(--ease-out);
}
.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top:hover {
  background: var(--navy-700);
  color: var(--gold-400);
}

/* ─── ANIMATIONS ───────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Scroll reveal.
   Gated behind html.js — set by an inline script in <head> — so the start
   state only exists if there is JavaScript around to finish it. The old rule
   applied opacity:0 unconditionally, which meant a script error, a blocked
   file or a browser without IntersectionObserver left a visitor staring at an
   empty page below the hero. */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.js .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── COMPAT ───────────────────────────────────── */
/* Modal titles keep the heavier weight from the previous refresh */
.modal-title {
  font-weight: var(--weight-bold);
}

/* Anchor jumps land below the fixed masthead + navbar. One value, on the
   scroller: this used to be a scroll-margin on each section, and it ADDED UP
   with shared.css's scroll-padding (navbar only), so a nav link landed 92px
   lower than meant — far enough that the link highlighted was the section
   above the one clicked. As padding it also keeps a focused field clear of
   the masthead, which the navbar-only value did not. */
html {
  scroll-padding-top: calc(var(--navbar-h) + var(--masthead-h) + 12px);
}

/* ─── RESPONSIVE ───────────────────────────────── */
@media (max-width: 1024px) {
  .hero-grid,
  .gis-head-row,
  .history-grid,
  .visit-grid {
    grid-template-columns: 1fr;
  }

  /* Stacked, the heading sits above the text and there is nothing for it to
     stay beside. */
  .history-head {
    position: static;
  }

  .hero-grid {
    gap: 3rem;
  }

  .hero-visual {
    max-width: 560px;
  }

  /* .services-grid is auto-fit now and reflows on its own — no override. */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .officials-grid,
  .announcements-grid {
    grid-template-columns: 1fr 1fr;
  }

  .announcements-grid .announcement-card:first-child .announcement-title {
    font-size: 1.3rem;
  }

  .how-steps {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
}

@media (max-width: 768px) {
  .gov-masthead-text {
    display: none;
  }

  .gov-masthead-gov {
    display: none;
  }

  .gov-tools {
    margin-left: 0;
  }

  .hero-seal-badge {
    top: -18px;
    right: 8px;
    width: 74px;
    height: 74px;
    padding: 6px;
  }

  /* Badge and "read the bulletin" share the top row; the headline gets the
     full width below them instead of four words per line. */
  .advisory-inner {
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
  }
  .advisory-text {
    order: 3;
    flex: 1 1 100%;
  }
  .advisory-link {
    margin-left: auto;
  }

  /* A 640px map on a 640px-tall phone screen is a scroll trap. */
  .gis-section-panel .gis-section-map {
    height: 420px;
  }
}

@media (max-width: 600px) {
  /* .services-grid is left out — auto-fit already collapses it to one column
     well before this width, and a fixed 1fr here would fight the minmax. */
  .officials-grid,
  .announcements-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .announcements-grid .announcement-card:first-child {
    grid-column: span 1;
  }

  .hero-cta-row .btn-hero {
    flex: 1;
    justify-content: center;
  }

  .hero-meta {
    grid-template-columns: 1fr;
  }

  .footer-bottom-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .to-top {
    width: 40px;
    height: 40px;
  }
}

/* ─── RESIDENT SEARCH RESULTS (residency modal) ── */
.resident-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  transition: background 0.2s;
}

.resident-card:hover {
  background: var(--gold-pale);
}

.resident-avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  font-family: "Space Mono", monospace;
}

.resident-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.resident-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
