/* Public component hosts/tokens; internal layout overrides live in arcgis-component-styles.js. */
#viewDiv {
    position: relative;
    isolation: isolate;
    min-height: 320px;
}

#ArcgisMap {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#MapOverlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#MapOverlay > * {
    position: absolute;
    pointer-events: auto;
}

#MapBottomLeft {
    position: absolute;
    left: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
}

#MapBottomLeft > * {
    pointer-events: auto;
}

#MapOverlay > #LoadingSpinner {
    inset: 0 0 auto;
    pointer-events: none;
}

.map-startup-error {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 16px;
    z-index: 10001;
}

.map-service-warning {
    position: absolute;
    bottom: 44px;
    left: 50%;
    transform: translateX(-50%);
    width: min(480px, calc(100% - 140px));
    z-index: 10001;
    pointer-events: none;
}

arcgis-map,
arcgis-slider,
arcgis-search,
arcgis-legend,
arcgis-basemap-toggle,
arcgis-fullscreen {
    --calcite-color-foreground-1: var(--bg);
    --calcite-color-foreground-2: var(--overview-bg);
    --calcite-color-text-1: var(--text);
    --calcite-color-text-2: var(--text);
    --calcite-color-text-3: var(--muted);
    --calcite-color-border-1: var(--divider);
    --calcite-color-brand: var(--maroon);
    --calcite-font-family: Roboto, sans-serif;
    --calcite-font-size: var(--map-component-font-size, 14px);
    font-family: Roboto, sans-serif;
    font-size: var(--map-component-font-size, 14px);
}

arcgis-search {
    --calcite-color-focus: transparent;
    --calcite-input-border-color: transparent;
    --calcite-input-shadow: none;
    --calcite-autocomplete-input-shadow: none;
    display: block;
    width: 100%;
    min-width: 220px;
    /* 43px + #SearchContainer's 1px border = 45px, the height of the filter selects (.select2-selection). */
    height: 43px;
    --calcite-autocomplete-input-background-color: var(--bg);
    --calcite-autocomplete-input-text-color: var(--text);
    --calcite-autocomplete-input-placeholder-text-color: var(--muted);
    --calcite-autocomplete-input-corner-radius: 4px;
    --calcite-autocomplete-input-border-color: transparent;
    --calcite-button-background-color: var(--bg);
    --calcite-button-text-color: var(--text);
}
#SearchContainer {
    border: 1px solid var(--map-btn-border) !important;
    border-radius: 4px !important;
}
#HeatmapLegendDiv {
    width: 420px !important;
    max-width: calc(100% - 76px);
}
#MapFullscreen { width:40px; height:40px; }

arcgis-legend {
    display: block;
    width: 100%;
    max-height: 45vh;
    overflow: auto;
    background: var(--bg);
    color: var(--text);
}

arcgis-basemap-toggle,
arcgis-fullscreen {
    display: block;
}

/* Keep long filter rows clear of the mode buttons on smaller desktops. */
@media (min-width: 1000px) and (max-width: 1499px) {
    #MapTools {
        top: 75px;
    }
}

@media (max-width: 999px) {
    #MapSearch {
        min-width: 0;
    }

    #HeatmapLegendDiv {
        max-width: calc(100% - 32px);
    }
}
arcgis-basemap-toggle {
    transform: scale(0.65);
    transform-origin: bottom right;
}