/* Map chrome in the explorer.land style: round white controls, cluster
   bubbles with a soft halo (in the brand canopy lime). Shared by the homepage and map page (js/map.js). */
/* explorer.land uses Roboto in its map chrome; self-hosted here to match the site's
   own self-hosted fonts (no third-party Google Fonts request). */
@font-face {
  font-family: "Roboto Map";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/Roboto-latin.woff2") format("woff2");
}
:root {
  --map-place: #CAD668; --map-place-halo: rgba(202, 214, 104, 0.38); --map-place-ink: #012231;
  /* explorer.land control palette + type (sampled from their live map) */
  --map-accent: #FF5722;        /* orange — active toggles & action links */
  --map-ink: #537786;           /* slate — titles, labels, control icons */
  --map-head: #37474f;          /* darker ink — section headings */
  --map-shadow: 1px 2px 10px rgba(0, 0, 0, 0.1);
  --map-font: "Roboto Map", "Roboto", "Manrope", system-ui, sans-serif;
}

/* round white control buttons (top-right): explorer.land style — soft shadow, slate icon */
.map-round-btn {
  display: grid; place-items: center; padding: 0;
  width: 36px; height: 36px;
  border-radius: 50%; border: none;
  background: #fff; color: var(--map-ink);
  box-shadow: var(--map-shadow);
  cursor: pointer; transition: background .15s, color .15s;
}
/* stack the round top-right controls with a gap */
.leaflet-top.leaflet-right .leaflet-control { margin-bottom: 8px; }
.map-round-btn:hover { background: #f6f8f8; color: #30505f; }
.map-round-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.map-round-btn[aria-pressed="true"], .map-round-btn[aria-expanded="true"] { background: var(--map-accent); color: #fff; }
.map-round-btn:focus-visible { outline: 2px solid var(--map-accent); outline-offset: 2px; }

/* recenter / "show all" round button: bottom-right, below the zoom group (explorer.land) */
.leaflet-bottom.leaflet-right .map-recenter { margin-top: 10px; }

/* zoom control (bottom-right): one white rounded-rect group with a hairline divider */
.leaflet-bar { border: none !important; border-radius: 9px !important; box-shadow: var(--map-shadow) !important; overflow: hidden; background: #fff; }
.leaflet-bar a {
  width: 36px !important; height: 34px !important; line-height: 34px !important;
  border: none !important; border-radius: 0 !important;
  background: #fff; color: var(--map-ink); font: 400 19px/34px var(--map-font);
}
.leaflet-bar a + a { border-top: 1px solid #eceff0 !important; }
.leaflet-bar a:hover { background: #f6f8f8; color: #30505f; }
.leaflet-bar a.leaflet-disabled { color: #c3ccd1; background: #fff; }
.leaflet-bar a:focus-visible { outline: 2px solid var(--map-accent); outline-offset: -2px; }

/* cluster bubble with a translucent halo */
.map-cluster {
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--map-place-halo);
  cursor: pointer;
  transition: transform .15s;
}
.map-cluster span {
  display: grid; place-items: center;
  width: calc(100% - 8px); height: calc(100% - 8px);
  border-radius: 50%;
  background: var(--map-place); color: var(--map-place-ink); /* navy on lime: white text fails contrast */
  font: 700 12px/1 var(--map-font);
}
.map-cluster:hover { transform: scale(1.08); }
.map-cluster:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* legend dot follows the new place colour */
.legend-place { background: var(--map-place) !important; }

/* OpenForests + Mapbox wordmarks, bottom-left, white */
.map-brand { display: flex; align-items: flex-end; gap: 14px; line-height: 0; margin: 0 0 10px 14px !important; }
.map-brand a { display: block; opacity: 0.92; transition: opacity .15s; }
.map-brand a:hover { opacity: 1; }
/* the filter turns the green ring white too */
.map-brand-of img { height: 48px; width: auto; filter: brightness(0) invert(1) drop-shadow(0 0 1px rgba(0, 0, 0, 0.6)) drop-shadow(0 1px 4px rgba(0, 0, 0, 0.5)); }
/* official logo is already white with its own outline; sit it on the wordmark baseline */
.map-brand-mb img { height: 21px; width: auto; margin-bottom: 4px; }
/* --- other map chrome in the explorer.land language: legend card + hover/preview
   cards share the control palette (white, 8px radius, soft shadow, slate text).
   Doubled selectors beat the base rules in style.css regardless of load order. --- */
/* legend card, lifted above the wordmark */
.map-page .map-legend-overlay.map-legend-overlay {
  bottom: 72px; background: #fff; border-radius: 8px; box-shadow: var(--map-shadow);
  color: var(--map-ink); padding: 10px 13px;
}
/* hover + touch-preview cards */
.map-hovercard.map-hovercard { border-radius: 8px !important; box-shadow: var(--map-shadow) !important; }
.map-hovercard .hovercard-text span { color: #8fa3ab; }

/* thematic-layers panel — explorer.land style: titled white card, toggle switches,
   slate text, orange accents, a footer with opacity + reset. */
.map-layers { position: relative; }
.map-layers-panel {
  position: absolute; top: 0; right: 44px;
  width: min(344px, calc(100vw - 72px)); max-height: min(76vh, 520px); overflow-y: auto;
  background: #fff; border-radius: 8px; box-shadow: var(--map-shadow);
  font-family: var(--map-font);
}

/* header: icon + title + collapse + close (explorer CardTitle: 64px, 1px lighten-3 border) */
.map-layers-head { display: flex; align-items: center; gap: 0; padding: 0 8px 0 16px; height: 56px; border-bottom: 1px solid #EFF3F4; }
.map-layers-ic { width: 18px; height: 18px; flex-shrink: 0; margin-right: 14px; fill: none; stroke: var(--map-ink); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.map-layers-title { flex: 1; font: 600 20px/1.2 var(--map-font); color: var(--map-ink); }
.map-layers-collapse, .map-layers-x { display: grid; place-items: center; width: 34px; height: 34px; border: 0; background: none; border-radius: 50%; color: #A5BDC7; cursor: pointer; }
.map-layers-collapse { font: 400 15px/1 var(--map-font); }
.map-layers-x { font: 400 24px/1 var(--map-font); }
.map-layers-collapse svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.map-layers-collapse:hover, .map-layers-x:hover { background: #EFF3F4; color: #779CAB; }
.map-layers-collapse svg { transition: transform .2s; }
.map-layers-panel.is-collapsed .map-layers-collapse svg { transform: rotate(180deg); }
.map-layers-panel.is-collapsed > :not(.map-layers-head) { display: none; }
.map-layers-panel.is-collapsed .map-layers-head { border-bottom: none; }

/* sections (Vuetify subtitle-2 heads, caption subheads, v-divider separators) */
.map-layers-sec { padding: 14px 16px 6px; }
.map-layers-sec + .map-layers-sec { border-top: 1px solid rgba(0, 0, 0, .12); }
.map-layers-h { margin: 0 0 8px; font: 500 14px/1.375rem var(--map-font); letter-spacing: .0071em; color: var(--map-ink); }

/* base-map panel: group subheadings (Satellite Imagery / Stylized) + "(default)" note */
.map-sub { margin: 8px 0 4px; font: 400 12px/1.25rem var(--map-font); letter-spacing: .0333em; color: #757575; }
.map-sub:first-of-type { margin-top: 2px; }
.map-opt-note { font-style: normal; color: #757575; font: 400 12px/1 var(--map-font); letter-spacing: .0333em; }

/* basemap radios (Vuetify v-radio: 16px label) */
.map-layers-opt { display: flex; align-items: center; gap: 12px; padding: 6px 0; cursor: pointer; font: 400 16px/1.5 var(--map-font); color: var(--map-ink); }
.map-layers-opt input { accent-color: var(--map-accent); margin: 0; flex-shrink: 0; width: 18px; height: 18px; }
.map-layers-opt:hover span { color: #374F59; }

/* thematic layer rows: toggle · label · info (explorer.land live metrics) */
.map-row { display: flex; align-items: center; gap: 14px; padding: 9px 16px; }
.map-tab-body .map-row-lbl { font: 500 14px/22px var(--map-font); color: var(--map-ink); }
.map-row-lbl { flex: 1; font: 500 14px/22px var(--map-font); color: var(--map-ink); }
.map-row-i { flex-shrink: 0; width: 20px; height: 20px; padding: 0; border: 0; background: none; color: #A5BDC7; cursor: pointer; display: grid; place-items: center; border-radius: 50%; }
.map-row-i svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.map-row-i:hover { color: var(--map-accent); }

/* toggle switch: explorer's v-switch is a 38x20 track with an ~18px thumb */
.map-switch { position: relative; flex-shrink: 0; width: 38px; height: 20px; cursor: pointer; }
.map-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.map-switch-tk { position: absolute; inset: 0; border-radius: 999px; background: #cdd8dd; transition: background .18s; }
.map-switch-tk::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .18s; }
.map-switch input:checked + .map-switch-tk { background: var(--map-accent); }
.map-switch input:checked + .map-switch-tk::after { transform: translateX(18px); }
.map-switch input:focus-visible + .map-switch-tk { outline: 2px solid var(--map-accent); outline-offset: 2px; }

/* thematic tabs: full-width Active | Library (14px, inactive tab has a grey fill) */
.map-tabs { display: flex; border-bottom: 1px solid #EFF3F4; }
.map-tab { flex: 1; text-align: center; position: relative; padding: 0; height: 48px; border: 0; background: #F4F6F7; cursor: pointer; font: 500 14px/48px var(--map-font); letter-spacing: .02em; color: #537786; }
.map-tab:hover { color: #374F59; }
.map-tab.is-on { background: #fff; color: var(--map-accent); font-weight: 700; }
.map-tab.is-on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--map-accent); }
.map-tab:focus-visible { outline: 2px solid var(--map-accent); outline-offset: -2px; }
.map-tab-body { padding: 6px 0; }
.map-empty { margin: 16px; font: 400 14px/1.5 var(--map-font); color: #779CAB; }
.map-empty b { color: var(--map-ink); }

/* library rows: label · info · add/added button */
.map-lib-row .map-row-lbl { flex: 1; }
.map-add { flex-shrink: 0; min-width: 70px; height: 28px; padding: 0 12px; border: 1px solid var(--map-accent); border-radius: 4px; background: none; color: var(--map-accent); font: 500 13px/1 var(--map-font); cursor: pointer; transition: background .15s, color .15s; }
.map-add:hover { background: rgba(255, 87, 34, .08); }
.map-add.is-added { background: var(--map-accent); color: #fff; }
.map-add.is-added:hover { background: #f4491d; border-color: #f4491d; }
.map-add:focus-visible { outline: 2px solid var(--map-accent); outline-offset: 2px; }

/* Elements buttons (Vuetify v-btn small, depressed, text-none) in the Base Map panel */
.map-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 8px; }
.map-chip { height: 28px; min-width: 50px; padding: 0 12px; border: 0; border-radius: 4px; background: #E0E0E0; color: rgba(0, 0, 0, .87); font: 500 14px/1 var(--map-font); cursor: pointer; transition: background .2s, color .2s; }
.map-chip:hover { background: #d5d5d5; }
.map-chip[aria-pressed="true"] { background: var(--map-accent); color: #fff; }
.map-chip[aria-pressed="true"]:hover { background: #f4491d; }
.map-chip:focus-visible { outline: 2px solid var(--map-accent); outline-offset: 2px; }

/* footer: view-aware text buttons (Reset layers / Add layers / Back) — Vuetify CardActions */
.map-layers-foot { display: flex; align-items: center; gap: 6px; padding: 8px; border-top: 1px solid #EFF3F4; }
.map-foot-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border: 0; background: none; border-radius: 4px; font: 500 13px/1 var(--map-font); letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; cursor: pointer; transition: background .15s, color .15s; }
.map-foot-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.map-foot-muted { color: #A5BDC7; }
.map-foot-muted:hover { color: #779CAB; background: #EFF3F4; }
.map-foot-accent { color: var(--map-accent); margin-left: auto; }
.map-foot-accent:hover { background: rgba(255, 87, 34, .08); }
.map-foot-btn:focus-visible { outline: 2px solid var(--map-accent); outline-offset: 2px; }
