/* For smaller, one-off styling needs that don't fit elsewhere */

.overflow-hidden {
    overflow: hidden;
}

.overflow-clip {
    overflow: clip;
}

button.expand {
    align-self: center;
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 900;
    font-family: 'Nunito';
    width: 16px;
    min-width: 16px;
    height: 16px;
    min-height: 16px;
    border-radius: 50%;
}

.aspect-ratio-1 {
    aspect-ratio: 1;
}

.z-index-999 {
    z-index: 999;
}

div.active button.filter {
    background-color: var(--wp--preset--color--black) !important;
    color: var(--wp--preset--color--white) !important;
    border-color: var(--wp--preset--color--black) !important;
}

.resources-filters a.active,
.resources-grid a.active {
    background-color: var(--wp--preset--color--black) !important;
    color: var(--wp--preset--color--white) !important;
    border-color: var(--wp--preset--color--black) !important;
}

.treated img,
img.treated {
    filter: saturate(0);
    mix-blend-mode: multiply;
}

/* Sidebar animations */
/* —> For opacity on listings when icon is hovered */
#sidebar .listings ul li {
    transition: opacity 0.2s ease;
    * {
        pointer-events: none;
    }
    button {
        display: none !important;;
    }
    img {
        height: 15px;
        transform: translateY(1px);
    }
    /* Toggle class via JS, style via CSS */
    &&.active {
        &&:hover a {
            text-decoration: underline;
            text-decoration-thickness: 1px;
            text-decoration-style: solid;
            text-underline-offset: 4px;
        }
        h3 {
            font-size: var(--wp--preset--font-size--large) !important;
        }
        .inner,
        button {
            display: flex !important;
        }
        img {
            height: 20px;
            transform: translateY(2px);
        }
        * {
            pointer-events: all;
        }
    }
}
/* When hovering directly */
#sidebar .listings ul li:not(.active):hover {
    opacity: 0.5 !important;
}

#sidebar .listings ul li.active  {
    opacity: 1 !important;
}

.unselectable {
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;     /* IE 10 and Edge */
  user-select: none;         /* Standard syntax */
}

.cursor-pointer {
    cursor: pointer;
}

/* Map filters */
#sidebar {
    #sidebar-filters li:hover {
        background-color: rgba(0, 0, 0, 0.05);
    }
    /* All filter sections with the data attribute defined are hidden on load */
    [data-sidebar-filter] {
        height: 0;
        overflow: hidden;
        transition: all 0.2s ease;
    }
    /* If the button in the header is 'active', show all filter sections */
    #sidebar-filters div:first-child:has(button.active) ~ [data-sidebar-filter] {
        height: auto;
    }
    /* Use proper animation if supported */
    @supports (height: calc-size(auto, size)) {
        #sidebar-filters div:first-child:has(button.active) ~ [data-sidebar-filter] {
            height: calc-size(auto, size);
        }
    }
    /* Hide the list inside each filter section */
    [data-sidebar-filter] > ul {
        height: 0;
        overflow: hidden;
        transition: all 0.2s ease;
    }
    /* If button is 'active', show section */
    [data-sidebar-filter]:has(button.active) > ul {
        height: auto;
    }
    /* Use proper animation if supported */
    @supports (height: calc-size(auto, size)) {
        [data-sidebar-filter]:has(button.active) > ul {
            height: calc-size(auto, size);
        }
    }
}

/* Homepage toggle */
.home-toggle {
    .active {
        text-decoration: underline;
        text-decoration-thickness: 1px;
        text-decoration-style: dotted;
        text-underline-offset: 3px;
    }
}
.home-toggle[data-view="index"] {
    ~ div[data-view="index"] {
        display: block !important;
    }
    ~ div[data-view="map"] {
        display: none !important;
    }
}
.home-toggle[data-view="map"] {
    ~ div[data-view="map"] {
        display: flex !important;
    }
    ~ div[data-view="index"] {
        display: none !important;
    }
}

.marker {
    cursor: pointer;
}

.listing-label {
    @media screen and (min-width: 782px) {
        width: 100px;
        min-width: 100px;
    }
}

@media screen and (max-width: 781px) {
    [data-view="map"] {
        flex-wrap: wrap;
        height: fit-content !important;
        #map,
        #sidebar {
            width: 100% !important;
            height: 50dvh !important;
        }
        #sidebar {
            border-left: 0 !important;
            border-top: 1px dashed !important;
        }
    }
}