/* Live map demo (#explore): MapLibre map + control panel. Both themes via site.css tokens. */

.geo { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 0; border: 1px solid var(--border); border-radius: calc(var(--r) * 2); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.geo-map-wrap { position: relative; min-height: 640px; background: var(--surface-2); }
.geo .geo-map { position: absolute; inset: 0; }  /* beats .maplibregl-map { position: relative } */
.geo-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); padding: 24px; text-align: center; }
.geo-loading[hidden] { display: none; }
.geo-legend { position: absolute; left: 12px; top: 12px; display: flex; flex-wrap: wrap; gap: 6px 14px; max-width: calc(100% - 72px); padding: 8px 12px; font-size: .7rem; letter-spacing: .04em; color: var(--fg); background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--border); border-radius: var(--r); backdrop-filter: blur(6px); pointer-events: none; }
.geo-legend span { display: inline-flex; align-items: center; gap: 6px; }
.geo-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.geo-legend .lg-ramp { width: 34px; background: linear-gradient(90deg, var(--tile-off), #E3B394, #E9875F, var(--laterite)); }
.geo-legend .lg-pick { border-radius: 50%; background: var(--laterite-deep); box-shadow: 0 0 0 2px #fff; }
.geo-legend .lg-comp { width: 9px; height: 9px; border-radius: 50%; background: var(--fg); }
.geo-legend .lg-flood { background: #3F7FA6; opacity: .7; }

.geo-panel { display: flex; flex-direction: column; gap: 20px; padding: 22px; border-left: 1px solid var(--border); max-height: 640px; overflow-y: auto; min-width: 0; }
.geo-panel .label { margin-bottom: 10px; }
.geo-ask-row { display: flex; gap: 8px; }
.geo-ask-row input { flex: 1; min-width: 0; font: 400 .95rem/1.3 var(--font-body); padding: 10px 12px; color: var(--fg); background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); }
.geo-ask-row input::placeholder { color: var(--muted); opacity: .85; }
.geo-ask-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.geo-ask-note { margin: 10px 0 0; min-height: 2.6em; }
.geo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.geo-chips .chip { padding: 8px 12px; font-size: .84rem; }
.geo-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: .88rem; }
.geo-toggles label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.geo-toggles input { accent-color: var(--laterite); width: 16px; height: 16px; }

.geo-picks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.geo-picks button { width: 100%; display: grid; grid-template-columns: 26px auto 1fr; align-items: center; gap: 10px; padding: 8px 10px; text-align: left; font: inherit; font-size: .85rem; color: var(--fg); background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; transition: border-color .2s; }
.geo-picks button:hover { border-color: var(--accent); }
.gp-rank { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font: 600 .75rem/1 var(--font-mono); color: #fff; background: var(--laterite-deep); }
.gp-id { font-size: .78rem; color: var(--muted); }
.gp-meta { justify-self: end; font-variant-numeric: tabular-nums; }

.geo-site { padding: 14px; background: var(--bg); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r); }
.geo-site p { margin: 8px 0 0; }
.gs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.gs-grid b { display: block; font: 700 1.25rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.gs-grid span { display: block; font-size: .72rem; line-height: 1.3; color: var(--muted); margin-top: 4px; }
.geo-foot { margin: 0; }

/* MapLibre chrome in the site's themes */
.geo .maplibregl-ctrl-group { background: var(--surface); border: 1px solid var(--border); box-shadow: none; }
.geo .maplibregl-ctrl-group button + button { border-top-color: var(--border); }
:root[data-theme="dark"] .geo .maplibregl-ctrl-icon { filter: invert(1); }
.geo .maplibregl-ctrl-attrib { background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--muted); font-size: 11px; }
.geo .maplibregl-ctrl-attrib a { color: var(--muted); }
:root[data-theme="dark"] .geo .maplibregl-ctrl-attrib-button { filter: invert(1); }
.geo .maplibregl-cooperative-gesture-screen { font-family: var(--font-body); }
.geo-pop .maplibregl-popup-content { padding: 8px 10px; font: 400 .8rem/1.4 var(--font-body); color: var(--fg); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.geo-pop .maplibregl-popup-tip { display: none; }

@media (max-width: 1080px) {
  .geo { grid-template-columns: 1fr; }
  .geo-map-wrap { min-height: 520px; }
  .geo-panel { max-height: none; border-left: 0; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; gap: 20px 28px; }
  .geo-ask, .geo-foot { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .geo { margin-inline: calc(var(--gutter) * -1); border-radius: 0; border-inline: 0; }
  .geo-map-wrap { min-height: 440px; }
  .geo-panel { grid-template-columns: 1fr; padding: 18px var(--gutter); }
  .geo-legend { font-size: .64rem; gap: 4px 10px; padding: 6px 8px; left: 8px; top: 8px; max-width: calc(100% - 60px); }
  .gs-grid b { font-size: 1.1rem; }
}
