.mapboxCustomMapContainer
{
    display: flex;
    gap: 15px;
}
#mapboxCustomMap {
    width: 100%;
    width: 70%;
    height: 1045px;
    border-radius: 0;
    overflow: hidden;
}

.marker-directory {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 0;
    margin: 0;
    width: 30%;
}

.marker-directory .marker-item {
    display: flex;
    align-items: center;
    width: 100%;
    background-color: #fff;
    border-radius: 0;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s, transform 0.2s;
    text-decoration: none;
    color: inherit;
    /* padding: 32px 25px 54px 25px; */
    box-shadow: 0px 10px 40px 0px rgba(6, 22, 58, 0.1);
    border: none;
    background-image: url(https://copperhill.gov/wp-content/uploads/2025/10/copperhill-pick-axe-blue-small-faded.png);
    background-repeat: no-repeat;
    background-size: 60px;
    background-position: calc(100% + 10px) calc(100% + 10px);
}

.marker-directory .marker-item:hover,
.marker-directory .marker-item.is-hovered {
   background-color: #DF1919;
   background-image: url(https://copperhill.gov/wp-content/uploads/2025/10/copperhill-pick-axe-white-red-small-faded.png);
}

.marker-directory .marker-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
    border: 2px solid #e63946;
}

.marker-directory .marker-item .marker-info h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
    transition: 0.4s;
}
.marker-directory .marker-item.is-hovered h4,
.marker-directory .marker-item:hover h4{
  color: #fff;
}

.marker-directory .marker-item .marker-info h4:after{
    content: "";
    display: block;
    width: 50px;
    height: 1px;
    background: rgba(6, 22, 58, 0.2);
    margin: 9px 0 5px 0;
    transition: 0.4s;
}

.marker-directory .marker-item.is-hovered .marker-info h4:after,
.marker-directory .marker-item:hover .marker-info h4:after{
  background: rgba(255, 255, 255, 0.5);
    width: 100px;
}

.marker-directory .marker-item .marker-info p {
    margin: 0;
    font-size: 14px;
    color: #465166;
    transition: 0.4s;
}
.marker-directory .marker-item.is-hovered p,
.marker-directory .marker-item:hover p{
  color: #fff;
}

@media screen and (max-width: 767px) {
    .mapboxCustomMapContainer
    {
        flex-direction: column;
    }
    #mapboxCustomMap,
    .marker-directory {
    width: 100%;
    }
     #mapboxCustomMap {
      height: 800px;
    }
    .marker-directory .marker-item {
        width: 100%
    }
}
.mapboxgl-popup img {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    margin-bottom: 5px;
    border-radius: 6px;
}

.marker-wrapper {
    width: 30px;       /* keep wrapper size fixed */
    height: 30px;
    position: relative; /* let Mapbox handle absolute positioning */
}

/* CSS for marker */
/* Outer container: Fixed size, centered, handles opacity for zoom */
.custom-marker {
    /* Only centering transform here, no scaling */
    transform: translate(-50%, -50%); 
    /* Transition for opacity when zooming, not for transform */
    transition: opacity 0.3s ease; 
    opacity: 1;
    display: flex; /* Use flexbox to center the inner image */
    justify-content: center;
    align-items: center;
    z-index: 10; /* Base z-index for the container */
    cursor: pointer; /* Indicate it's clickable */
}

/* Inner element: This is the actual image that will scale */
.custom-marker-image {
    width: 25px; /* Takes full size of its parent (.custom-marker) */
    height: 25px;
    background-size: contain; /* Ensure background image fits */
    background-repeat: no-repeat;
    background-position: center; /* Center the image within its bounds */
    border-radius: 50%; /* If you want circular images */
    /* Transition for scaling */
    transition: transform 0.2s ease-in-out;
    transform: scale(1); /* Initial scale of the image */
    will-change: transform; /* Hint for browser performance */
}

/* Hover effect for the inner image */
.custom-marker-image.hovered {
    transform: scale(1.4); /* Scale only the background image to 140% */
    /* No translate needed here, as it scales from its center within the parent */
}

/* Hide marker on zoom */
.custom-marker.hidden {
    opacity: 0;
    pointer-events: none; /* Make it unclickable when hidden */
}
.mapboxgl-popup-content {
  width: 300px;
}
.mapboxgl-popup
{
    z-index: 12;
    max-width: 300px !important;
}
button.mapboxgl-popup-close-button {
    background: #df181a;
    color: #fff;
    top: -15px;
    border-radius: 50px;
    line-height: 1;
    height: 25px;
    width: 25px;
    right: -15px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    align-content: center;
    justify-content: center;
    font-weight: 700;
    transition: all 0.2s, transform 0.2s;
}
button.mapboxgl-popup-close-button:hover{
    background: var(--e-global-color-primary);
}
.marker-popup-content-image {
    margin-bottom: 10px;
}
.marker-popup-content h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}
.marker-popup-content-year {
    font-size: 14px;
    margin-bottom: 3px;
}
.marker-popup-content-address
{
    font-size: 14px;
}
.marker-popup-content-address a
{
    display: block;
}
.marker-popup-content-address strong
{
    display: none;
}
.marker-popup-content-desc {
    margin-top: 10px;
    font-size: 14px;
}
.marker-popup-content-details {
    margin-top: 15px;
}
.marker-popup-content-details a
 {
    display: inline-block;
    color: var(--e-global-color-primary) !important;
    text-decoration: none !important;
    border-color: var(--e-global-color-primary);
    border-style: solid;
    border-width: 2px;
    line-height: 1;
    font-weight: 700;
    padding: 8px 13px;
    font-size: 14px;
    transition: all 0.2s, transform 0.2s;
}
.marker-popup-content-details a:hover,
.marker-popup-content-details a:active,
.marker-popup-content-details a:focus{
        background: #df181a;
    border-color: #df181a;
    color: #fff !important;
}
.mapboxgl-popup-tip
{
    display: none !important;
}
.mapboxgl-popup-content {
    box-shadow: 0px 10px 40px 0px rgba(6, 22, 58, 0.1);
    border-radius: 0;
}
.location-at-a-glance {
    text-transform: uppercase;
    background: #06163a;
    color: #fff;
    font-weight: 700;
    padding: 10px;
    text-align: center;
    width: 100%;
}
/* Custom Anchored Popup Styles */
.custom-anchored-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    max-width: 350px;
    max-height: 80vh;
    pointer-events: none; /* Allow clicking through the overlay */
}

.custom-popup-content {
    background: white;
    pointer-events: auto; /* Re-enable pointer events on the content */
    position: relative;
    max-width: 400px;
    animation: popupFadeIn 0.2s ease-out;
    box-shadow: 0px 10px 40px 0px rgba(6, 22, 58, 0.1);
    padding: 20px;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.custom-popup-close {
    position: absolute;
    top: -10px;
    right: -10px;
    background: rgb(223 24 26);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 4px 9px 6px 9px;
}

.custom-popup-close:hover {
    background: #06163a;
}
/* In your stylesheet */
.maplibregl-marker {
    pointer-events: auto !important;
    cursor: pointer;
}
/* Mobile adjustments */
@media (max-width: 768px) {
    .custom-anchored-popup {
        width: 100%;
        max-width: 90%;
        max-height: 70vh;
    }
    
    .custom-popup-content {
        max-width: 100%;
    }
}