/* ---- Page width ---- */
.container { width: 100%; max-width: 1260px; margin: 0 auto; padding: 0 var(--gutter); }

.section { padding: var(--space-section) 0; }
.section--white { background: rgba(255, 255, 255, 0.72); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-sm); margin-bottom: var(--space-lg); }

/* Two columns: main content + 360px sidebar (stacks on mobile) */
.with-sidebar { display: grid; gap: var(--space-lg); }
@media (min-width: 960px) { .with-sidebar { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.stack { display: grid; gap: var(--space-md); }

/* ---- Safety banner (top of every page) ---- */
.safety-banner { background: var(--ink); color: #fff; text-align: center; font-size: 0.85rem; padding: 11px var(--gutter); }
.safety-banner strong:first-child { color: #fff; }

/* ---- Header ---- */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; gap: var(--space-lg); min-height: 84px; }
.site-header__nav { display: none; gap: 32px; }
.site-header__nav a { text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.site-header__nav a:hover, .site-header__nav a[aria-current] { font-weight: 700; }
.site-header__actions { margin-left: auto; display: flex; gap: 10px; }
@media (min-width: 900px) {
  .site-header__nav { display: flex; }
}

/* ---- Mobile menu (below 900px): ☰ button opens the nav as a panel under the header ---- */
.site-header { position: relative; }
.site-header__menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: inherit; cursor: pointer;
}
.site-header__menu-btn .icon { width: 22px; height: 22px; }
.site-header__menu-btn .icon--close,
.site-header.is-open .site-header__menu-btn .icon--open { display: none; }
.site-header.is-open .site-header__menu-btn .icon--close { display: block; }

@media (max-width: 899px) {
  .site-header.is-open .site-header__nav {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 1100; /* above the Leaflet map (uses up to 1000) */
    background: var(--card); border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 16px rgb(0 0 0 / 0.08);
  }
  .site-header.is-open .site-header__nav a { padding: 14px 16px; border-top: 1px solid var(--line); font-size: 1rem; }
}
@media (min-width: 900px) {
  .site-header__menu-btn,
  .site-header__nav-cta { display: none; }   /* wide screens: CTA sits in the header instead */
}
@media (max-width: 899px) {
  .site-header__cta { display: none; }       /* small screens: CTA moves into the menu */
  .site-header.is-open .site-header__nav a.site-header__nav-cta {
    margin: 12px 16px 16px; padding: 12px 16px; border-top: 0; justify-content: center;
  }
}

/* Logo: the SVG already includes the brand's required clear space around it.
   Brand rule: visible logo at least 144px wide (the image is ~11% padding),
   so never set the image narrower than 168px. */
.logo { display: inline-flex; flex-shrink: 0; }
.logo__img { width: 200px; height: auto; }
@media (max-width: 480px) { .logo__img { width: 168px; } }

/* ---- Breadcrumbs ---- */
.breadcrumbs { font-size: 0.85rem; padding: var(--space-md) 0 var(--space-md); display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); }
.breadcrumbs a { color: var(--ink); }

/* ---- Footer ---- */
.site-footer { background: var(--card); border-top: 1px solid var(--line); padding: var(--space-xl) 0; margin-top: var(--space-section); font-size: 0.875rem; }
.site-footer__grid { display: grid; gap: var(--space-lg); }
@media (min-width: 768px) { .site-footer__grid { grid-template-columns: 1fr auto auto auto; gap: 72px; } }
.site-footer h4 { margin: 0 0 14px; font-size: 0.85rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer .logo { margin: -12px 0 4px -14px; } /* pull in the logo's built-in padding so it lines up with the text */
.site-footer .logo__img { width: 180px; }

/* ---- Flash messages ---- */
.flash { background: var(--green-soft); color: var(--green); padding: 14px 20px; border-radius: var(--radius-sm); margin-top: var(--space-md); font-weight: 500; }
.flash--error { background: var(--error-soft); color: var(--error); }

/* ---- Small phones: keep the header on one line ---- */
@media (max-width: 480px) {
  .site-header__inner { gap: 12px; }
  .site-header__actions .btn { padding: 8px 12px; font-size: 0.85rem; }
}
/* Grid children may shrink below their content width (prevents sideways scrolling) */
.with-sidebar > *, .results > * { min-width: 0; }
