/*
 * Sports-venue maps on content pages (app/Views/venues/_map.php, public/assets/app/venues-map.js; docs/VENUES.md).
 * Uses the --fb-* / --c-* tokens of app.css + content.css, so light/dark follow the site theme. The map tiles
 * themselves stay the light OpenFreeMap style (same as the gym map); pins carry a white outline that reads on both.
 */
.vmap { margin: 8px 0 28px; min-width: 0; }
.vmap__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.vmap__chips[hidden] { display: none; }
.vmap__chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px 0 10px; border-radius: 999px;
    border: 1px solid var(--fb-border); background: var(--fb-surface); color: var(--fb-text);
    font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
    transition: border-color var(--fb-dur-fast, .15s), background-color var(--fb-dur-fast, .15s);
}
.vmap__chip img { width: 18px; height: 23px; flex: none; }
.vmap__chip small { font-size: 13px; font-weight: 600; color: var(--fb-text-muted); font-variant-numeric: tabular-nums; }
.vmap__chip:hover { border-color: var(--c-link); }
.vmap__chip[aria-pressed="true"] { border-color: var(--c-link); background: var(--fb-primary-soft); box-shadow: inset 0 0 0 1px var(--c-link); }
.vmap__chip:focus-visible { outline: 3px solid var(--c-link); outline-offset: 2px; }

.vmap__canvas {
    position: relative; width: 100%; height: clamp(300px, 56vh, 480px); overflow: hidden;
    border: 1px solid var(--fb-border); border-radius: 20px; background: var(--fb-surface-secondary);
    box-shadow: var(--c-card-shadow);
    /* Safari does not clip a WebGL canvas with overflow + border-radius alone: clip-path + own layer keep the corners round */
    clip-path: inset(0 round 20px); isolation: isolate; transform: translateZ(0);
}
.vmap__canvas canvas { border-radius: 20px; }
.vmap--single .vmap__canvas { height: clamp(220px, 36vh, 300px); }
.vmap__placeholder { position: absolute; inset: 0; display: grid; place-items: center; gap: 8px; padding: 16px; text-align: center; color: var(--fb-text-secondary); }
.vmap__loading { font-size: 15px; }
.vmap__note { margin: 8px 0 0; font-size: 14px; }

/* pins: DOM markers (<button> with the sport's SVG). The marker's own transform positions it; never animate it. */
.vmap-pin {
    display: block; width: 32px; height: 42px; padding: 0; border: 0; background: none; cursor: pointer;
    filter: drop-shadow(0 2px 2px rgba(8, 36, 74, .35));
}
span.vmap-pin { cursor: default; }
.vmap-pin img { display: block; width: 32px; height: 42px; pointer-events: none; transition: transform .15s var(--c-ease, ease); transform-origin: 50% 100%; }
.vmap-pin:hover img, .vmap-pin:focus-visible img { transform: scale(1.12); }
.vmap-pin:focus-visible { outline: 3px solid var(--c-link); outline-offset: 2px; border-radius: 8px; }
.vmap-pin[hidden] { display: none; }

/* popup: themed card */
.vmap .maplibregl-popup-content {
    padding: 12px 34px 12px 14px; border-radius: 12px; background: var(--fb-surface); color: var(--fb-text);
    box-shadow: 0 6px 24px rgba(8, 36, 74, .22); font-size: 15px; line-height: 1.4;
}
.vmap .maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--fb-surface); }
.vmap .maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--fb-surface); }
.vmap .maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--fb-surface); }
.vmap .maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--fb-surface); }
.vmap .maplibregl-popup-close-button { width: 32px; height: 32px; font-size: 20px; color: var(--fb-text-secondary); border-radius: 0 12px 0 8px; }
.vmap-pop { display: grid; gap: 4px; justify-items: start; }
.vmap-pop__name { font-size: 16px; }
.vmap-pop__meta { color: var(--fb-text-secondary); font-size: 14px; }
.vmap-pop__pass { margin-left: 0; }
.vmap-pop__link { margin-top: 4px; font-weight: 600; color: var(--c-link); }
.vmap-pop__actions { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.vmap-pop__actions .vmap-pop__link { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 12px; border-radius: 10px;
    background: #08244A; color: #fff; text-decoration: none; font-weight: 650; }
.vmap-pop__actions .vmap-pop__link:hover, .vmap-pop__actions .vmap-pop__link:visited { color: #fff; }
.vmap-pop__actions .vmap-pop__link--go { background: linear-gradient(135deg, #0072F2, #0493AA); }

/* the map style is light in every theme: keep the MapLibre controls light too, and frame the map in dark mode */
.vmap .maplibregl-ctrl-group { border-radius: 10px; }
.vmap .maplibregl-ctrl-group button { width: 36px; height: 36px; }
.vmap .maplibregl-cooperative-gesture-screen { font-size: 17px; }

@media (prefers-reduced-motion: reduce) {
    .vmap__chip, .vmap-pin img { transition: none; }
    .vmap-pin:hover img, .vmap-pin:focus-visible img { transform: none; }
}
