/* Shared map controls and the fullscreen container. */
.zl-map-frame .maplibregl-ctrl-top-right {
    top: 12px;
    right: 12px;
}

.zl-map-frame .maplibregl-ctrl-top-right .maplibregl-ctrl-group {
    margin: 0 0 8px;
    overflow: hidden;
    border: 1px solid #b9c8cf;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 9px #102b4340;
}

.zl-map-frame .maplibregl-ctrl-top-right .maplibregl-ctrl-group button {
    width: 44px;
    height: 44px;
    min-height: 0;
    padding: 0;
    border-radius: 0;
}

.zl-map-frame :is(.maplibregl-ctrl button, .zl-district-map__basemap button):focus-visible {
    outline: 2px solid #176a9c !important;
    outline-offset: -3px;
}

body.zl-map-fullscreen {
    overflow: hidden;
}

.zl-map-frame:is(:fullscreen, .maplibregl-pseudo-fullscreen) {
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
}

.zl-map-frame:is(:fullscreen, .maplibregl-pseudo-fullscreen) .maplibregl-ctrl-top-right {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
}

/* Lift the isolated homepage above the fixed mobile site navigation. */
.zl-map-fullscreen .zl-home:has(.maplibregl-pseudo-fullscreen) {
    position: relative;
    z-index: 100000;
}

.zl-home .zl-explorer__map-top {
    right: 66px;
}

.zl-home .zl-explorer__outline {
    border-color: #8a6009;
    background: #ffd53880;
}

.zl-home .zl-explorer__outline--selected {
    border-color: #a5560b;
    background: #dc791680;
}

.zl-home .zl-explorer__map-wrap:is(:fullscreen, .maplibregl-pseudo-fullscreen) .zl-explorer__map-top {
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    right: calc(max(12px, env(safe-area-inset-right)) + 54px);
}

.zl-home .zl-explorer__map-wrap:is(:fullscreen, .maplibregl-pseudo-fullscreen) .zl-explorer__legend {
    bottom: max(26px, env(safe-area-inset-bottom));
}

.zl-home .zl-explorer__map-wrap:is(:fullscreen, .maplibregl-pseudo-fullscreen) .zl-explorer__selection {
    bottom: calc(max(26px, env(safe-area-inset-bottom)) + 28px);
}

.zl-district-map {
    margin: 0 0 28px;
}

.zl-district-map > h2 {
    margin: 0 0 12px;
    font-size: clamp(20px, 2.2vw, 26px);
    line-height: 1.25;
}

.zl-district-map > :where(.zl-map-frame) {
    position: relative;
    height: clamp(340px, 54vh, 540px);
    overflow: hidden;
    isolation: isolate;
    border: 1px solid #cbd9df;
    border-radius: 12px;
    background: #e1ebe7;
}

.zl-district-map .zl-map-frame.maplibregl-pseudo-fullscreen {
    position: fixed;
}

.zl-district-map__canvas {
    width: 100%;
    height: 100%;
}

.zl-district-map__basemap, .zl-district-map__status {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    border: 1px solid #b9c8cf;
    border-radius: 8px;
    background: #fff;
    color: #183947;
    box-shadow: 0 2px 9px #102b4330;
}

.zl-district-map__basemap {
    display: flex;
    gap: 2px;
    padding: 3px;
}

.zl-district-map__basemap button {
    min-height: 38px;
    padding: 6px 12px;
    border: 0;
    border-radius: 5px;
    background: #fff;
    color: #183947;
    font: inherit;
    font-size: 13px;
}

.zl-district-map__basemap button[aria-pressed="true"] {
    color: #12517b;
    background: #e4f0f7;
}

.zl-district-map__status {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: max-content;
    max-width: calc(100% - 40px);
    padding: 10px 16px;
    text-align: center;
    font-size: 14px;
    pointer-events: none;
}

.zl-district-map__status[hidden] { display: none; }

.zl-district-map__popup {
    color: #3c505c;
    font-size: 12px;
    line-height: 1.4;
}

.zl-district-map__popup a {
    display: block;
    margin-top: 6px;
    color: #155c88;
    font-size: 14px;
    text-decoration: underline;
}
