/* ============ PAGE HERO (interior page pattern) ============ */
.page-hero {
  background: var(--navy);
  padding: 128px 20px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .page-hero { padding: 152px 24px 72px; }
}

.page-hero::before {
  content: '';
  position: absolute;
  top: -160px; right: -140px;
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(170,14,65,0.22) 0%, transparent 70%);
  pointer-events: none;
}
.page-hero-inner { position: relative; z-index: 2; max-width: 700px; margin: 0 auto; }
.page-hero-inner .hero-eyebrow { margin: 0 auto 24px; }
.page-hero h1 {
  font-size: clamp(32px, 6vw, 52px);
  font-weight: 900; line-height: 1.06;
  color: var(--white); letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.page-hero h1 span,
.page-hero h1 em { color: var(--crimson); font-style: normal; }
.page-hero p { font-size: 17px; line-height: 1.7; color: rgba(255,255,255,0.65); max-width: 520px; margin: 0 auto; }

/* ============ MAIN SPLIT SECTION ============ */
.bhumap-main {
  background: var(--ivory);
  border-radius: 24px;
  margin: -24px 10px 0;
  position: relative; z-index: 1;
  padding: 40px 20px 56px;
}
@media (min-width: 641px) {
  .bhumap-main { border-radius: 40px; margin: -40px 16px 0; padding: 60px 48px 80px; }
}

.bhumap-split {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: stretch;
}
@media (min-width: 900px) {
  .bhumap-split { flex-direction: row; align-items: stretch; }
}

/* LEFT — MAP */
.bhumap-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Wrapper adds the scroll-cue fade masks; kept separate from
   .bhumap-filter-row itself since that's display:flex (its own ::before/
   ::after would become flex items and disrupt pill layout, not overlay
   the edges). Fade opacity toggled by bhumap.js based on scroll position —
   hidden at the start/end since there's nothing more to indicate there. */
.bhumap-pill-scroll-wrap { position: relative; }
.bhumap-pill-scroll-wrap::before,
.bhumap-pill-scroll-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 2px;
  width: 28px;
  pointer-events: none;
  z-index: 2;
  opacity: 1;
  transition: opacity 0.15s;
}
.bhumap-pill-scroll-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--ivory), transparent);
}
.bhumap-pill-scroll-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--ivory), transparent);
}
.bhumap-pill-scroll-wrap.at-start::before { opacity: 0; }
.bhumap-pill-scroll-wrap.at-end::after { opacity: 0; }

.bhumap-filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.bhumap-filter-row::-webkit-scrollbar { display: none; }

.bhumap-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 12.5px; font-weight: 700;
  padding: 8px 16px;
  border-radius: 100px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.bhumap-pill:hover { border-color: var(--crimson); color: var(--crimson); }
.bhumap-pill.active { background: var(--crimson); border-color: var(--crimson); color: var(--white); box-shadow: 0 4px 14px rgba(170,14,65,0.28); }

.bhumap-map-wrap {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(10,0,64,0.10);
  height: 380px;
  position: relative;
  flex: none;
}
@media (min-width: 900px) {
  /* .bhumap-left only has a definite height here (via align-items:stretch
     from the row-direction .bhumap-split), so flex-grow can resolve —
     below 900px .bhumap-left's height is auto and flex:1 collapses this
     to ~0 regardless of the height property. */
  .bhumap-map-wrap { height: 540px; flex: 1; }
}

#bhumapMap { width: 100%; height: 100%; }

/* Map overlays */
.bhumap-search {
  position: absolute; top: 16px; left: 16px; z-index: 500;
  display: flex; align-items: center;
  background: rgba(255,255,255,0.97);
  border: 1px solid var(--border);
  border-radius: 100px;
  box-shadow: 0 6px 18px rgba(10,0,64,0.12);
  padding: 4px 4px 4px 16px;
  max-width: calc(100% - 32px);
}
.bhumap-search input {
  border: none; outline: none; background: transparent;
  font-family: 'Inter', sans-serif; font-size: 13px; color: var(--text);
  width: 220px; max-width: 36vw;
}
.bhumap-search input::placeholder { color: #9CA3AF; }
.bhumap-search button {
  border: none; background: var(--navy); color: var(--white);
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  font-size: 15px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.bhumap-search button:hover { background: var(--crimson); }

.bhumap-legend {
  position: absolute; bottom: 16px; right: 16px; z-index: 500;
  background: rgba(255,255,255,0.97);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 6px 18px rgba(10,0,64,0.12);
  width: 186px; overflow: hidden;
  max-width: calc(100% - 32px);
}
.bhumap-legend-header {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--ivory); border: none;
  border-bottom: 1px solid var(--border);
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--heading); cursor: pointer;
}
.bhumap-legend-caret { transition: transform 0.2s; }
.bhumap-legend-caret.collapsed { transform: rotate(-90deg); }
/* Capped so the expanded legend (naturally ~217px for 2 groups/7 items)
   can't swallow most of the map — internal scroll keeps every item
   reachable without growing the overlay's footprint. */
.bhumap-legend-body { padding: 12px 14px; max-height: 160px; overflow-y: auto; }
.bhumap-legend-group { margin-bottom: 10px; }
.bhumap-legend-group:last-child { margin-bottom: 0; }
.bhumap-legend-group-title { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #9CA3AF; margin-bottom: 6px; }
.bhumap-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--heading); padding: 3px 0; }
.bhumap-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* Moved from bottom-left to just under the search bar (top:78px = search's
   own top:16 + its 54px height + 8px gap) so it's permanently out of the
   legend's vertical territory at the bottom-right, regardless of how tall
   the legend grows — height-capping the legend alone can't guarantee that
   on its own at narrow widths where the map itself is short. */
.bhumap-coords {
  position: absolute; top: 78px; left: 16px; z-index: 500;
  background: rgba(10,0,64,0.82); color: rgba(255,255,255,0.85);
  font-size: 11px; font-weight: 600; padding: 6px 12px;
  border-radius: 100px; letter-spacing: 0.01em;
}

/* Leaflet overrides */
.bhumap-popup { font-family: 'Inter', sans-serif; }
.bhumap-popup-title { font-weight: 800; color: var(--heading); font-size: 13px; margin-bottom: 4px; }
.bhumap-popup-row { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.bhumap-popup-badge { display: inline-block; margin-top: 6px; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 100px; color: var(--white); }
.bhumap-cluster-icon { background: var(--navy); color: var(--white); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Inter', sans-serif; font-weight: 800; font-size: 12px; border: 3px solid rgba(255,255,255,0.85); box-shadow: 0 4px 10px rgba(10,0,64,0.35); }

/* Leaflet zoom control — enlarged for comfortable touch (default is 26px, well under the 44px minimum) */
.leaflet-control-zoom { border: none !important; box-shadow: 0 6px 18px rgba(10,0,64,0.12) !important; }
.leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--heading) !important;
  width: 44px !important;
  height: 44px !important;
  line-height: 44px !important;
  font-size: 20px !important;
}
.leaflet-control-zoom a:hover { background: var(--ivory) !important; }

/* RIGHT — FORM CARD */
.bhumap-right { flex: none; width: 100%; }
@media (min-width: 900px) { .bhumap-right { flex: 0 0 360px; width: auto; } }

.bhumap-form-card {
  background: linear-gradient(155deg, var(--navy-mid) 0%, var(--navy) 100%);
  border-radius: 20px;
  padding: 28px 22px;
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}
@media (min-width: 480px) {
  .bhumap-form-card { padding: 36px 32px; }
}
.bhumap-form-card::before {
  content: ''; position: absolute;
  top: -80px; right: -80px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(170,14,65,0.2) 0%, transparent 70%);
  pointer-events: none;
}
.bhumap-form-card::after {
  content: ''; position: absolute;
  bottom: -60px; left: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(170,14,65,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.bhumap-form-title {
  font-size: 20px; font-weight: 900;
  color: var(--white); letter-spacing: -0.02em;
  margin-bottom: 6px;
  position: relative; z-index: 1;
}
@media (min-width: 480px) {
  .bhumap-form-title { font-size: 22px; }
}
.bhumap-form-sub {
  font-size: 13.5px; line-height: 1.6;
  color: rgba(255,255,255,0.55);
  margin-bottom: 26px;
  position: relative; z-index: 1;
}

.bhumap-field {
  margin-bottom: 15px;
  position: relative; z-index: 1;
}
.bhumap-field label {
  display: block;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 7px;
}
.bhumap-field input,
.bhumap-field select {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.07);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.bhumap-field input::placeholder { color: rgba(255,255,255,0.28); }
.bhumap-field input:focus,
.bhumap-field select:focus { border-color: rgba(170,14,65,0.7); }
.bhumap-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.bhumap-field select option { background: #0a0040; color: var(--white); }

.bhumap-divider {
  border: none; border-top: 1px solid rgba(255,255,255,0.1);
  margin: 4px 0 18px;
  position: relative; z-index: 1;
}

.bhumap-submit {
  width: 100%;
  min-height: 44px;
  padding: 14px;
  border-radius: 10px;
  background: var(--crimson);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 700;
  border: none; cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  position: relative; z-index: 1;
  margin-top: auto;
}
.bhumap-submit:hover { background: var(--crimson-dark); transform: translateY(-1px); }

.bhumap-callback {
  font-size: 12px; color: rgba(255,255,255,0.35);
  text-align: center; margin-top: 12px;
  position: relative; z-index: 1; line-height: 1.5;
}
.bhumap-callback strong { color: #86efac; font-weight: 600; }

/* ============ RISK LAYERS EXPLAINER ============ */
.bhumap-layers {
  background: var(--surface);
  border-radius: 24px;
  margin: 4px 10px 0;
  position: relative; z-index: 2;
  padding: 48px 20px 60px;
}
@media (min-width: 641px) {
  .bhumap-layers { border-radius: 40px; margin: 6px 16px 0; padding: 72px 48px 80px; }
}

.layers-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 641px) { .layers-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .layers-grid { grid-template-columns: repeat(4, 1fr); } }

.layer-card {
  background: var(--ivory);
  border-radius: 16px;
  padding: 24px 20px;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s, transform 0.2s;
}
.layer-card:hover { box-shadow: 0 8px 24px rgba(10,0,64,0.07); transform: translateY(-2px); }

.layer-dot-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.layer-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.layer-card-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}
.layer-card-title {
  font-size: 16px; font-weight: 800;
  color: var(--heading); letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.layer-card-body {
  font-size: 13px; line-height: 1.65; color: var(--muted);
}

/* ============ FINAL CTA BUTTON (adds to main.css's shared .final-cta) ============ */
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 32px;
  padding: 15px 36px;
  background: var(--white);
  color: var(--crimson);
  border-radius: 100px;
  font-size: 15px; font-weight: 700;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.cta-btn:hover { background: var(--crimson-light); transform: translateY(-1px); }

/* ============ RICH MULTI-COLUMN FOOTER (overrides main.css footer) ============ */
footer { text-align: left; padding: 0; }

.footer-rich { padding: 48px 20px 24px; }
@media (min-width: 560px) {
  .footer-rich { padding: 56px 32px 28px; }
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  max-width: 1160px;
  margin: 0 auto;
}
@media (min-width: 560px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.3fr 1.2fr; }
}

.footer-brand-logo { height: 26px; width: auto; display: block; margin-bottom: 16px; opacity: 0.95; }

.footer-brand-desc {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,0.55);
  margin-bottom: 16px;
  max-width: 260px;
}

.footer-trust-line {
  font-size: 12px;
  font-weight: 600;
  color: #86efac;
  margin-bottom: 18px;
}

.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.footer-social a:hover { background: var(--crimson); border-color: var(--crimson); }

.footer-col-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 4px; }
.footer-col a {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.footer-col a:hover { color: var(--white); }

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.footer-contact-icon {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(170,14,65,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
}
.footer-contact-text {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
}

.footer-bottom {
  max-width: 1160px;
  margin: 36px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: rgba(255,255,255,0.4);
}

@media (max-width: 559px) {
  .footer-bottom { flex-direction: column; }
}

/* ============ MOBILE — hero background matches bhucheq-mobile-mockup.html's
   BhuMap frame (.hero has no background, no glow). Navy card + glow here
   was a live-only addition with no mockup basis; same fix already applied
   to about.css. Scoped to max-width:640px only, desktop untouched. ============ */
@media (max-width: 640px) {
  /* Top padding is 76px measured .topbar-wrap clearance (re-measured on
     this page, same fixed component as About/Services) + the mockup's
     own 26px breathing room. Left/right/bottom match the mockup literally.
     text-align/h1 size/em markup follow the same About/Services fix. */
  /* Bottom padding is 24px, not the mockup-matched 8px used on About/Services
     — BhuMap's hero paragraph runs 4 lines here (vs. the mockup's shorter
     text), so the 8px + .bhumap-main's -24px overlap pull cut 16px into the
     actual paragraph text. 24px = 16px measured overlap + 8px buffer.
     BhuMap-specific: this file's own .page-hero copy, not the shared
     pattern used elsewhere. */
  .page-hero { background: none; padding: 102px 20px 24px; text-align: left; }
  .page-hero::before { display: none; }
  .page-hero h1 { color: var(--heading); font-size: 26px; }
  .page-hero h1 br { display: none; }
  .page-hero p { color: var(--muted); }
  /* .hero-eyebrow (main.css) is #f4a0bc light-pink text on rgba(170,14,65,0.2)
     — tuned for a navy backdrop. Composited over the now-light hero it's
     pale-on-pale, low contrast. Same fix already applied to about.css and
     services.html. */
  .page-hero .hero-eyebrow {
    background: rgba(170,14,65,0.08);
    color: var(--crimson);
  }
  .page-hero .hero-eyebrow::before { display: none; }

  /* "Live Risk Map" / "What BhuMap Shows" headers — typography only, the
     card-wrapper (.bhumap-main/.bhumap-layers) shape is kept as-is.
     Matches mockup's .card-eyebrow (11px) and inline h3 (17px/800); only
     these two .section-eyebrow/.section-title instances on this page are
     scoped, not the shared classes generally. */
  .bhumap-main .section-eyebrow,
  .bhumap-layers .section-eyebrow { font-size: 11px; }
  .bhumap-main .section-title,
  .bhumap-layers .section-title { font-size: 17px; }

  /* FINAL CTA — navy gradient score-card treatment, not the sitewide solid
     crimson. Same fix already applied to about.css/services.html. */
  .final-cta {
    background: linear-gradient(160deg, var(--navy), #180060);
    border-radius: 20px;
    padding: 20px 18px;
    margin: 8px 16px 20px;
  }
  .final-cta h2 { font-size: 17px; font-weight: 700; }
  .final-cta p { font-size: 12.5px; }
  .cta-btn {
    display: block;
    width: 100%;
    min-height: auto;
    padding: 15px;
    border-radius: 14px;
    background: var(--white);
    color: var(--navy);
    box-shadow: none;
  }
  .cta-btn:hover { background: var(--white); transform: none; }

  /* PILLS — mockup's .map-pill: navy text, navy-tinted hairline border,
     navy active state (not crimson). --line isn't a live CSS variable
     (mockup-only token, rgba(10,0,64,0.08)); using its literal value here. */
  .bhumap-pill {
    border: 1.5px solid rgba(10,0,64,0.08);
    color: var(--navy);
    padding: 8px 14px;
  }
  .bhumap-pill.active {
    background: var(--navy);
    border-color: var(--navy);
    color: var(--ivory);
    box-shadow: none;
  }

  /* LAYER CARDS — mockup's .layer-mini-card: shadow instead of border,
     bold navy label, smaller title/body. */
  .layer-card {
    border-radius: 20px;
    padding: 18px;
    border: none;
    box-shadow: 0 8px 22px rgba(10,0,64,0.06);
  }
  .layer-card-label { color: var(--navy); }
  .layer-card-title { font-size: 14.5px; }
  .layer-card-body { font-size: 12px; }

  /* FORM CARD — mockup's .cheq-card: plain white card, no glow decoration,
     navy text on light fields, matching the sitewide .contact-field
     pattern (contact.css) for label/border/placeholder colors. Divider,
     placeholder, and select-arrow colors were tuned for the dark card and
     needed a matching flip — otherwise a light-gray-on-white divider/
     placeholder/arrow would be invisible. */
  .bhumap-form-card { background: var(--white); }
  .bhumap-form-card::before,
  .bhumap-form-card::after { display: none; }
  .bhumap-form-title { color: var(--heading); }
  .bhumap-form-sub { color: var(--muted); }
  .bhumap-field label { color: var(--heading); }
  .bhumap-field input,
  .bhumap-field select {
    border: 1.5px solid var(--border);
    background-color: var(--white);
    color: var(--heading);
  }
  .bhumap-field input::placeholder { color: #9CA3AF; }
  .bhumap-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(10,0,64,0.4)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  }
  .bhumap-divider { border-top-color: var(--border); }
  .bhumap-callback { color: var(--muted); }
  .bhumap-callback strong { color: var(--navy); }
}
