/* TODO: move to theme build assets, and set colors by :root variables
 *
 */
.mini-legend {
    position: fixed;
    z-index: 99;
    left: auto;
    right: 50px;
    bottom: 33px;
    width: 250px;
    padding: 10px;
    border-radius: 5px;
    background: #fff;
    border-top: 2px solid rgba(0,0,0,.2);
    border-left: 2px solid rgba(0,0,0,.2);
    border-right: 2px solid rgba(0,0,0,.2);
    border-bottom: 2px solid rgba(0,0,0,.2);
    background-clip: padding-box;
    /* will-change: all; */
    /* transition: .15s ease all; */
}

.mini-legend {
    padding: 5px;
    display: block;
    width: 40px;
    height: 40px;
    margin: 0px;
}

.mini-legend.visible {
    opacity: 1;
    z-index: 1;
    padding: 10px;
    width: unset;
    height: unset;
}

.legend-toggle .legend-display-toggle {
    display: block;
    width: 25px;
    height: 25px;
    margin: 0px;
}

.mini-legend:not(.visible) .legend-toggle .legend-close-button {
    display: none;
}

.mini-legend.visible .legend-display-toggle {
    display: none;
}

.legend-toggle:not(.visible) .legend-close-button {
    display: block;
}

.mini-legend:not(.visible) .legend-wrap {
    display: none;
}


.mini-legend button {
    display: block;
    width: 100%;
    background: 0;
    border: 0;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 16px;
    font-weight: bold;
    text-align: left;
}

.mini-legend button svg {
    float: left;
    width: 20px !important;
    height: 20px !important;
    background-color: white;
    padding: 2px;
    border: 1px solid #ccc;
    margin: 0 10px 0 0 !important;
}

.mini-legend button img {
    float: left;
    width: 28px !important;
    height: 28px !important;
    margin: 0 6px 0 -4px !important;
}

.mini-legend button img[src*="intersection"] {
    top: -10px;
    position: relative;
}

.mini-legend button:hover,
.mini-legend button.active {
    background: rgba(200,200,200,0.5);
}

.mini-legend-category {
}

button[data-layer-is-visible="true"] {
    border-left: 2px solid rgb(0 88 0 / 59%);
    border-radius: 0;
}

button[data-layer-is-visible="false"] {
    border-left: 2px solid rgba(200,200,200,.5);
    border-radius: 0;
}

.mini-legend-category .mini-legend img, .mini-legend-category .mini-legend svg {
    /* transform: scale(.5); */
    width: 30px;
    height: auto;
    margin: 5px 8px 10px 0;
}

.mini-legend .legend-image {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}



.mini-legend .legend-text {
    line-height: 1.1em;
    font-size: 14px;
    font-weight: bold;
}

.mini-legend button svg {
    will-change: auto;
    transition: all .15s ease;
}

.mini-legend button {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
}

.mini-legend button * {
    will-change: auto;
    transition: .15s all ease;
}

.mini-legend .category-name {
    margin-bottom: .5em;
    color: var(--primary) !important;
    font-weight: bold !important;
    margin-top: .75em;
    text-transform: uppercase;
    font-size: 14px;
}

.mini-legend h3 {
    margin-bottom: 0em !important;
    margin-top: 0em !important;
}


.mini-legend img.legend-close {
  filter: invert(1);
  opacity: .35;
  width: 20px;
  height: 20px;
  margin: 8px;
  position: absolute;
  right: 0px;
  top: 0px;
}

.legend-display-toggle {
    display: none;
}

@media only screen and (max-height: 510px) {
    @media only screen and (orientation: landscape) {
        .mini-legend.visible {
            right: 50px;
        }
    }
}



@media only screen and (max-height: 510px) {
    .mini-legend.visible {
        right: 50px;
        height: 280px !important;
        overflow: scroll;
        width: 300px;
    }
}


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

}

@media only screen and (max-width: 768px) {
    .mini-legend {
        opacity: 1;
        z-index: 10;
        width: 40px;
        overflow: hidden;
        height: 40px;
        left: unset;
        bottom: unset;
        right: 10px;
        top: 60px;
    }


    .mini-legend .legend-wrap {
        display: none;
    }

    .mini-legend.visible {
        width: unset;
        height: unset;
        max-width: 190px !important;
        max-height: 340px;
        overflow: scroll;
    }

    .mini-legend.visible .legend-wrap {
        display: unset;
    }

    .mini-legend h3 {
        margin-right: 1.5em;
    }

}

.base-layers .mini-legend-category {
    flex-direction: row;
    display: flex;
}

.base-layers .mini-legend-category button {
    min-height: 60px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    background-repeat: no-repeat;
    background-position: cover;
}

button[data-layer-is-visible="true"] .label {
    color: var(--accent);
}

button[data-layer-is-visible="false"] .label {
    color: var(--primary);
}


.base-layers button[data-layer-is-visible="true"] {
    opacity: 1;
    border: none !important;
}

.base-layers button[data-layer-is-visible="false"] {
    opacity: .5 !important;
    border: none !important;
}

.base-layers button .label {
    background-color: white;
    padding: 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: .75px;
    font-size: 14px;
}

.base-layers button {
    max-width: calc(95%);
    margin: 0 2.5px;
}

.base-layers button:first-child {
    margin-left: 0px;
}

.base-layers button:last-child {
    margin-right: 0px;
}

@media only screen and (max-width: 768px) {
    .base-layers .mini-legend-category {
        flex-direction: column;
    }

    .base-layers button {
        max-width: 100%;
        margin: 5px 0px;
    }


    .base-layers button:first-child {
        margin-top: 0px;
    }

    .base-layers button:last-child {
        margin-bottom: 0px;
    }

}

@media only screen and (min-width: 768px) {
    div#map.drawStart + .mini-legend {
        bottom: 90px;
    }
}
