:root {
    interpolate-size: allow-keywords;
}

body {
    width: 100vw;
    height: 100vh;
    padding: 0;
    margin: 0;
    font-family: sans-serif;
}

#map {
    width: 100%;
    height: 100%;
}

.maplibregl-popup-content {
    backdrop-filter: blur(2px);
    background-color: rgb(255 255 255 / 50%);
    border: 1px solid #dbd4d4;
    box-shadow: 3px 3px 4px #00000045;
}

.maplibregl-ctrl-top-right,
.maplibregl-ctrl-bottom-right {
    right: calc(clamp(250px, 25vw, 500px));
}

#map:fullscreen .maplibregl-ctrl-top-right, 
#map:fullscreen .maplibregl-ctrl-bottom-right {
    right: 0;
}

.sidebar {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 25vw;
    max-width: 500px;
    min-width: 250px;
    background-color: #ffffffc4;
    z-index: 1;
    backdrop-filter: blur(3px);
    box-shadow: -2px 0 3px 2px #00000036;
    overflow: auto;

    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-content: space-around;
    justify-content: flex-start;
}

.sidebar .info {
    margin: 0 10px;
    font-size: 0.9em;
}

.sidebar .disclaimer {
    font-size: 0.8em;
    color: #555;
}

.sidebar .legend {
    margin: 10px;
    flex-grow: 1;
}

.sidebar .legend ul {
    margin: 0;
    padding: 0;
    list-style-image: none;
    list-style: none;
}

.legend .icons li {
    display: flex;
    flex-direction: row;
    align-content: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 5px;
    /* line-height: 1.2; */
    /* background-color: #e6e6e6; */
    align-items: center;
    font-size: 0.9em;

}

.icons li .iconwrapper {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

.icons li .iconwrapper img,
.icons li .iconwrapper svg {
    /* max-height: 100%; */
    /* max-width: 100%; */
    object-fit: contain;
    width: 100%;
    height: 100%;
    user-select: none;
}

.legend .icons li:nth-child(odd) {
    background-color: #00000017;
}

.legend .layer {
    border: 1px solid #00b9ed4d;
    border-radius: 5px;
    margin: 10px 0;
    /* padding: 5px 0; */
    background-color: #00b0ff12;
}

.layerInfo {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    /* gap: 10px; */
    /* font-size: 1.3em; */
    padding: 5px;
}

.layerInfo input {
    flex-shrink: 0;
    margin: 0 8px;
    width: 20px;
    height: 20px;
}

.layerTitle {
    font-weight: bold;
    /* font-size: 1.2em; */
    /* text-align: center; */
    flex-grow: 1;
    cursor: pointer;
    user-select: none;
}

.layer .icons {
    height: auto;
    overflow: hidden;
    transition: height 0.5s;
}

.layer:has(.layerInfo > input:not(:checked)) .icons,
.icons.hide-icons {
    /* display: none; */
    /* max-height: 0px; */
    height: 0px;
}

.pdx_reporter_popup .maplibregl-popup-content {
    backdrop-filter: blur(8px);
}

.pdx_reporter_popup h2,
.pdx_reporter_popup p {
    margin: 0;
    margin-bottom: 3px;
}

@media screen and (max-width: 700px) {

    .sidebar {
        width: auto;
        inset: 0;
        background-color: white;
        top: 50%;
        z-index: 1000;
    }
    
    .maplibregl-ctrl-top-right, .maplibregl-ctrl-bottom-right {
        right: 0;
    }

    #map {
        height: 50%;
    }
}
