/* ===================================================================
   NW Bee Club — Varroa Watch full map page
   Layout, header strip, filter pills, legend, empty state.
   Built on top of tokens.css + varroa.css. Page-scoped styles only —
   shared Varroa primitives stay in varroa.css.
   =================================================================== */

/* ---- Page shell -------------------------------------------------- */

.vwp-page {
  background: var(--al-paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.vwp-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ---- Header strip ------------------------------------------------ */

.vwp-header {
  background: var(--al-paper);
  border-bottom: 1px solid var(--al-rule);
  padding: 22px var(--gutter) 18px;
}

.vwp-header__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: end;
}

.vwp-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--al-ink-soft);
  text-decoration: none;
  padding: 6px 0;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.vwp-back:hover {
  color: var(--al-honey-deep);
}
.vwp-back svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.vwp-eyebrow {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--al-honey-deep);
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 10px;
}

.vwp-title {
  margin: 6px 0 0;
  font-family: var(--ff-display);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.4px;
  color: var(--al-ink);
}

.vwp-lede {
  margin: 8px 0 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--al-ink-soft);
  max-width: 720px;
}
.vwp-lede a {
  color: var(--al-honey-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.vwp-header__cta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.vwp-counter {
  font-size: 12.5px;
  color: var(--al-ink-soft);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
  min-height: 18px;
}
.vwp-counter strong {
  color: var(--al-ink);
  font-weight: 700;
}
.vwp-counter[data-state="loading"]::after {
  content: "Loading…";
  color: var(--al-ink-soft);
  font-style: italic;
}

.vwp-cta-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

/* ---- Filter row -------------------------------------------------- */

.vwp-filters {
  background: var(--al-paper);
  padding: 0 var(--gutter) 16px;
  border-bottom: 1px solid var(--al-rule-soft);
}

.vwp-filters__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.vwp-filters__label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--al-honey-deep);
  text-transform: uppercase;
  font-weight: 700;
  margin-right: 6px;
}

.vwp-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--al-white);
  border: 1px solid var(--al-rule);
  color: var(--al-ink);
  font-family: var(--ff-body);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.vwp-pill:hover {
  border-color: var(--al-honey);
}
.vwp-pill:focus-visible {
  outline: 2px solid var(--al-honey);
  outline-offset: 2px;
}
.vwp-pill[aria-pressed="true"] {
  background: var(--al-ink);
  color: var(--al-paper);
  border-color: var(--al-ink);
}

/* ---- Map shell --------------------------------------------------- */

.vwp-map-wrap {
  position: relative;
  width: 100%;
  background: #dbe8d9;
}

.vwp-map {
  width: 100%;
  height: 75vh;
  min-height: 480px;
  background: #dbe8d9;
}
.vwp-map:focus {
  outline: none;
}

.vwp-loading {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--vw-border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--al-ink-soft);
  box-shadow: var(--vw-shadow-soft);
  z-index: 600;
  display: none;
  letter-spacing: 0.2px;
}
.vwp-loading.is-visible {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.vwp-loading::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--al-honey);
  border-top-color: transparent;
  animation: vwp-spin 0.9s linear infinite;
}

@keyframes vwp-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- Legend card ------------------------------------------------- */

.vwp-legend-card {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 600;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--vw-border);
  border-radius: var(--vw-radius);
  padding: 12px 14px;
  box-shadow: var(--vw-shadow);
  max-width: min(280px, calc(100vw - 28px));
  font-family: var(--ff-body);
}
.vwp-legend-card:focus-visible {
  outline: 2px solid var(--al-honey);
  outline-offset: 2px;
}

.vwp-legend-card__title {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--al-honey-deep);
  margin: 0 0 8px;
}

.vwp-legend-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vwp-legend-card__row {
  display: grid;
  grid-template-columns: 14px 1fr;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  color: var(--al-ink);
  line-height: 1.3;
}
.vwp-legend-card__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
  align-self: center;
}
.vwp-legend-card__label {
  font-weight: 600;
}
.vwp-legend-card__range {
  display: block;
  font-size: 11.5px;
  color: var(--al-ink-soft);
  font-weight: 400;
  margin-top: 1px;
}

.vwp-legend-card__foot {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--al-rule);
  font-size: 11px;
  color: var(--al-ink-soft);
  line-height: 1.4;
}

/* ---- Empty state ------------------------------------------------- */

.vwp-empty {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 700;
  padding: 24px;
}
.vwp-empty.is-visible {
  display: flex;
}

.vwp-empty__card {
  pointer-events: auto;
  background: var(--al-white);
  border: 1px solid var(--al-rule);
  border-radius: var(--vw-radius);
  box-shadow: var(--vw-shadow);
  padding: 28px 28px 24px;
  max-width: 420px;
  text-align: center;
}
.vwp-empty__kicker {
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--al-honey-deep);
}
.vwp-empty__title {
  margin: 8px 0 6px;
  font-family: var(--ff-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--al-ink);
}
.vwp-empty__body {
  margin: 0 0 16px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--al-ink-soft);
}

/* ---- Popup styling (overrides Leaflet defaults) ------------------ */

.leaflet-popup-content-wrapper {
  border-radius: var(--vw-radius);
  box-shadow: var(--vw-shadow);
  padding: 2px;
}
.leaflet-popup-content {
  margin: 12px 14px;
  font-family: var(--ff-body);
  font-size: 13px;
  line-height: 1.45;
  color: var(--al-ink);
}
.vwp-popup__title {
  font-weight: 700;
  font-size: 14px;
  color: var(--al-ink);
  margin: 0 0 4px;
}
.vwp-popup__meta {
  color: var(--al-ink-soft);
  font-size: 12.5px;
  margin: 0 0 6px;
}
.vwp-popup__band {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 8px;
  font-weight: 600;
  font-size: 12.5px;
}
.vwp-popup__band-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  flex: 0 0 auto;
}
.vwp-popup__hist {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 36px;
  margin: 6px 0 8px;
}
.vwp-popup__hist-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.vwp-popup__hist-bar {
  width: 100%;
  background: var(--vw-band-empty);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height 0.2s ease;
}
.vwp-popup__hist-num {
  font-size: 10px;
  color: var(--al-ink-soft);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.vwp-popup__privacy {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px dashed var(--al-rule);
  font-size: 11.5px;
  color: var(--al-ink-soft);
  line-height: 1.4;
  font-style: italic;
}

/* ---- Cluster icon styling --------------------------------------- */

.vwp-cluster {
  border-radius: 50%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* ---- Responsive ------------------------------------------------- */

@media (max-width: 1024px) {
  .vwp-header__inner {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .vwp-header__cta {
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .vwp-header {
    padding: 16px var(--gutter-mobile) 12px;
  }
  .vwp-filters {
    padding: 0 var(--gutter-mobile) 12px;
  }
  .vwp-title {
    font-size: 26px;
  }
  .vwp-lede {
    font-size: 14px;
  }
  .vwp-map {
    height: 70vh;
    min-height: 420px;
  }
  .vwp-legend-card {
    left: 10px;
    bottom: 10px;
    padding: 10px 12px;
    max-width: calc(100vw - 20px);
  }
  .vwp-legend-card__title {
    font-size: 10.5px;
  }
  .vwp-legend-card__row {
    font-size: 12px;
  }
  .vwp-pill {
    font-size: 13px;
    padding: 7px 12px;
  }
}

/* ---- Reduced motion -------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .vwp-pill,
  .vwp-back,
  .vwp-popup__hist-bar,
  .leaflet-fade-anim .leaflet-tile,
  .leaflet-zoom-anim .leaflet-zoom-animated {
    transition: none !important;
    animation: none !important;
  }
  .vwp-loading::before {
    animation: none;
  }
}
