/*
 * Front-end Leaflet map on the contact template. Same footprint as the previous .map-image.
 * Dark style: OpenStreetMap tiles turned grey and inverted, square zoom buttons, dark attribution.
 * Leaflet's own CSS is lazy-loaded after this file, so overrides are scoped with `.contact-map.leaflet-container`
 * to win on specificity.
 */
.contact-map {
    position: relative;
    z-index: 0;
    isolation: isolate; /* keep Leaflet's internal z-indexes (up to 1000) below the fixed header */
    height: 100vh;
    margin: 0 0 30px;
    overflow: hidden;
    background: #262626;
}

@media all and (max-width: 660px) {
    .contact-map {
        margin: 0 0 68px;
    }
}

.contact-map.leaflet-container {
    font-family: "Font-Light", sans-serif;
    font-size: 12px;
    background: #262626;
}

/* Dark map: grey, inverted OpenStreetMap tiles. Fades in once the first tiles have loaded (class set in contact-map.js). */
.contact-map .leaflet-tile-pane {
    filter: grayscale(1) invert(1) brightness(0.85) contrast(0.85);
    opacity: 0;
    transition: opacity 0.75s;
}

.contact-map.is-ready .leaflet-tile-pane {
    opacity: 1;
}

/* ---------- Zoom control: separate square buttons, bottom right ---------- */
.contact-map.leaflet-container .leaflet-control-zoom {
    margin: 0 20px 16px 0;
}

.contact-map.leaflet-container .leaflet-bar {
    border: 0;
    box-shadow: none;
    background: none;
}

.contact-map.leaflet-container .leaflet-bar a,
.contact-map.leaflet-container .leaflet-bar a:first-child,
.contact-map.leaflet-container .leaflet-bar a:last-child {
    width: 36px;
    height: 36px;
    margin: 0 0 4px;
    border: 0;
    border-radius: 8px;
    background-color: #dadad9;
    color: #000;
    font: 20px/36px "Font-Light", sans-serif;
    text-indent: 0;
    transition: background-color 0.35s;
}

.contact-map.leaflet-container .leaflet-bar a:hover,
.contact-map.leaflet-container .leaflet-bar a:focus-visible {
    background-color: #fff;
}

.contact-map.leaflet-container .leaflet-bar a.leaflet-disabled {
    background-color: #dadad9;
    color: #000;
    opacity: 0.4;
}

/* ---------- Attribution ---------- */
.contact-map.leaflet-container .leaflet-control-attribution {
    background-color: rgba(0, 0, 0, 0.5);
    color: #a2a2a2;
    font-size: 10px;
}

.contact-map.leaflet-container .leaflet-control-attribution a {
    color: #dadad9;
}

/* ---------- Pin: ink with white outline and dot, soft pulse at the tip, drops in after the map fades in ---------- */
.contact-map .vg-osm-pin {
    background: none;
    border: 0;
    cursor: pointer;
}

.contact-map .vg-osm-pin__drop {
    display: block;
    opacity: 0;
    transform: translateY(-24px);
    transition: opacity 0.75s 0.3s, transform 0.75s 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-map.is-ready .vg-osm-pin__drop {
    opacity: 1;
    transform: none;
}

.contact-map .vg-osm-pin svg {
    display: block;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
    transition: transform 0.35s;
    transform-origin: 50% 100%;
}

.contact-map .vg-osm-pin:hover svg,
.contact-map .vg-osm-pin:focus-visible svg {
    transform: translateY(-4px);
}

.contact-map .vg-osm-pin:focus-visible {
    outline: 0;
}

.contact-map .vg-osm-pin:focus-visible svg {
    filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 3px rgba(255, 255, 255, 0.9));
}

/* Pulse ring under the pin tip. */
.contact-map .vg-osm-pin::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 28px;
    height: 14px;
    margin-left: -14px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.9);
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

.contact-map.is-ready .vg-osm-pin::after {
    animation: vg-osm-pulse 2.4s 1.2s ease-out infinite;
}

@keyframes vg-osm-pulse {
    0% {
        transform: scale(0.3);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .contact-map .leaflet-tile-pane,
    .contact-map .vg-osm-pin__drop,
    .contact-map .vg-osm-pin svg {
        transition: none;
    }

    .contact-map.is-ready .vg-osm-pin::after {
        animation: none;
    }
}
