/**
 * Shared lot map styles (main + cove).
 * Scoped with [data-map] and data-* hooks; map-specific CSS loads after this file.
 */

/* [data-listing].unfocused,
[data-pin].unfocused {
    filter: grayscale(1);
    opacity: .4;
}
*/

[data-pin].unfocused {
    z-index: 0;
}

[data-pin].focused {
    animation: pulse-animation 2s infinite;
}

[data-tooltip] {
    position: absolute;
    top: var(--y, 0);
    left: var(--x, 0);
    transform: translate(-50%, -60%);
    z-index: 1000;
    animation: fade-in .25s ease forwards;
    min-width: 100px;
    pointer-events: none;
}

[data-tooltip]:hover ~ [data-pins] [data-pin] {
    opacity: 0 !important;
    pointer-events: none !important;
}

@media screen and (max-width: 768px) {
    [data-tooltip] {
        transform: translate(-50%, -55%);
    }
}

/* Map shell defaults */
[data-map] {
    --height: 90vh;
    grid-template-columns: 230px auto;
    grid-template-rows: 100%;
    align-content: stretch;
    isolation: isolate;
    position: relative;
    transform-origin: 0 0;
    transition: transform 0.3s ease-out;
}

[data-map] h2 {
    font-family: 'Teko', sans-serif;
    font-weight: 400 !important;
    font-size: 1.5rem !important;
    color: #3B4946;
    margin-top: 0;
}

[data-map] [class*="__map"] {
    display: flex;
    align-items: center;
}

[data-map] [data-map-container] {
    width: 100%;
    height: auto;
    position: relative;
}

[data-map] [class*="__graphic"] {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

[data-map] [data-pins] {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

[data-map] [class*="__graphic"] img {
    width: 100% !important;
    height: 100%;
}

[data-map] [class*="__listings-list"] {
    list-style: none !important;
    margin: 0;
    padding: 0;
}

[data-map] [data-pin] {
    --w: 25px;
    position: absolute;
    font-size: 10px;
    font-weight: bold;
    width: var(--w);
    height: auto;
    aspect-ratio: 1;
    border-radius: 100vw;
    background-color: #fff;
    color: #fff;
    display: grid;
    place-content: center;
    top: var(--y);
    left: var(--x);
    transform: translate(-50%, -49%);
    transform-origin: center;
    cursor: pointer;
    z-index: 2;
    pointer-events: auto;
    transition: all .25s ease, background-color 0s;
}

[data-map] [data-pin]:hover,
[data-map] [data-pin].focused {
    background-color: #fff !important;
    color: #3b4946 !important;
}

[data-pin].sold {
    background-color: #B44F31;
}

[data-pin].under-contract {
    background-color: #FFA500;
    color: #3b4946;
}

[data-pin].reserved {
    background-color: #FFD700;
    color: #3b4946;
}

[data-pin].spec-home {
    background-color: #FFF3B0;
    color: #3b4946;
}

[data-pin].available {
    background-color: #98D970;
    color: #3b4946;
}

[data-map] [class*="__listings"] {
    display: flex;
    max-height: 100%;
    overflow: hidden;
    position: relative;
}

[data-map] [class*="__listings-container"] {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 32px;
    height: 100%;
}

[data-map] [class*="__listings-container"]::-webkit-scrollbar {
    display: none;
}

[data-map] [class*="__listing"] {
    width: 100%;
    cursor: pointer;
    background-color: #719e8b14;
    border-radius: 8px;
    padding: 0 1rem;
    transition: all .25s ease;
    list-style-type: none !important;
}

[data-map] [class*="__listing"]:not(:last-of-type) {
    margin-bottom: 24px;
}

[data-map] .tooltip__content {
    background-color: white;
    color: black;
    padding: 16px;
    position: relative;
    border-radius: 4px;
    border: 1px solid rgb(221, 221, 221);
    box-shadow: rgb(0 0 0 / 12%) 0px 6px 16px;
    min-width: 120px;
    z-index: 1001;
    pointer-events: auto;
}

[data-map] .tooltip__content p {
    font-family: var(--header-font);
    font-size: 24px;
    margin-bottom: 10px;
    padding-bottom: 10px !important;
    border-bottom: 1px solid #ccc;
    line-height: 1;
    font-weight: 500;
    color: var(--dark);
    text-transform: uppercase;
}

[data-map] .tooltip__content ul {
    margin-bottom: 0;
    margin-left: 4px;
}

[data-map] .tooltip__content ul li {
    list-style: none;
    font-size: 14px;
    color: #666b55;
    line-height: 1;
}

[data-map] .tooltip__content ul li:first-child {
    padding-bottom: 6px;
}

[data-map] .tooltip__content ul li span {
    font-weight: 600;
    color: var(--dark);
}

[data-map] .tooltip__content button {
    all: unset;
    cursor: pointer;
    padding: 4px 16px 2px;
    font-family: "Teko", sans-serif;
    border-radius: 4px;
    color: white;
    background-color: #719e8b;
    font-size: 16px;
    width: 100%;
    display: block;
    box-sizing: border-box;
    text-align: center;
}

[data-map] .tooltip__caret {
    position: absolute;
    width: 12px;
    height: auto;
    top: 99%;
    left: 0;
    right: 0;
    display: block;
    margin: 0 auto;
    color: white;
}

@media screen and (max-width: 768px) {
    [data-map] {
        display: flex;
        flex-direction: column-reverse;
    }

    [data-map] [class*="__listings-container"] {
        overflow-x: auto;
        overflow-y: hidden;
        padding: 16px;
    }

    [data-map] [class*="__listings-list"] {
        display: flex;
        overflow: auto;
        flex-wrap: wrap;
        gap: 8px;
        padding-bottom: 1rem;
    }

    [data-map] [class*="__listing"] {
        white-space: nowrap;
        margin-bottom: 0 !important;
        width: auto;
        padding: 0 8px;
    }

    [data-map] [class*="__listing"] h2 {
        margin-bottom: -3px !important;
    }

    [data-map] ul[class*="__listings-list"]::-webkit-scrollbar-thumb {
        background-color: var(--colorB);
    }
}

.sr-only {
    border: 0 !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    -webkit-clip-path: inset(50%) !important;
    clip-path: inset(50%) !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    width: 1px !important;
    white-space: nowrap !important;
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0px rgba(255, 255, 255, 0.5);
    }

    100% {
        box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
    }
}

@keyframes fade-in {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}
