/* Project locations map (projects.html) */
.projects-map-wrap {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: #aadaff;
    box-shadow: 0 18px 50px rgba(11, 46, 70, 0.16), 0 2px 6px rgba(11, 46, 70, 0.08);
    border: 1px solid rgba(11, 46, 70, 0.08);
}

.projects-map {
    width: 100%;
    height: 600px;
    background: #aadaff;
    font-family: var(--body-font);
}

@media (max-width: 991px) {
    .projects-map {
        height: 480px;
    }
}

@media (max-width: 575px) {
    .projects-map {
        height: 440px;
    }
}

/* ---- Location pin ---- */
.pm-pin-holder {
    background: none;
    border: 0;
}

.pm-pin {
    display: block;
    width: 16px;
    height: 22px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    transform-origin: 50% 100%;
    transition: transform 0.18s ease;
    filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.4));
    animation: pm-drop 0.5s cubic-bezier(0.3, 1.4, 0.6, 1) backwards;
}

.pm-pin svg {
    display: block;
}

/* Larger invisible tap target on touch screens (the pin itself is tiny). */
@media (pointer: coarse) {
    .pm-pin {
        position: relative;
    }

    .pm-pin::before {
        content: "";
        position: absolute;
        inset: -6px -8px -2px;
    }
}

.pm-pin-body {
    fill: #ea2a2a;
    transition: fill 0.18s ease;
}

.pm-pin-shade {
    fill: #000;
    opacity: 0.12;
}

.pm-pin:hover,
.pm-pin:focus-visible,
.pm-pin.is-active {
    transform: scale(1.35);
    outline: none;
}

.pm-pin.is-active .pm-pin-body,
.pm-pin:hover .pm-pin-body {
    fill: #c81616;
}

@keyframes pm-drop {
    from {
        transform: translateY(-8px);
        opacity: 0;
    }
    to {
        transform: none;
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pm-pin {
        animation: none;
        transition: none;
    }
}

/* ---- Hover card ---- */
.pm-card {
    position: absolute;
    z-index: 1100;
    top: 0;
    left: 0;
    width: 300px;
    max-width: calc(100% - 20px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(11, 46, 70, 0.25), 0 2px 8px rgba(11, 46, 70, 0.1);
    padding: 14px 16px 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    pointer-events: none;
    font-family: var(--body-font);
}

/* While a finger slides across pins, let it reach pins under the card. */
.pm-card.is-open.is-scrubbing {
    pointer-events: none;
}

.pm-card.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
}

.pm-card-close {
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f4f6;
    color: #1a1a1a;
    font-size: 22px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
}

@media (pointer: coarse) {
    .pm-card-close {
        display: block;
    }

    .pm-card-head {
        padding-right: 34px;
    }
}

.pm-card-head {
    border-left: 3px solid #81b033;
    padding-left: 10px;
    margin-bottom: 4px;
}

/* Let the project list scroll with a finger swipe inside the card. */
.pm-card .map-tt-scroll {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

@media (max-width: 575px) {
    .pm-card {
        width: 260px;
        padding: 12px 14px 10px;
    }

    .pm-card .map-tt-scroll {
        max-height: 200px;
    }
}

.pm-card .map-tt-count {
    margin-bottom: 0;
}

.pm-card .map-tt-list li {
    padding: 5px 0;
    border-bottom: 1px solid #eef1f3;
}

.pm-card .map-tt-list li:last-child {
    border-bottom: 0;
}

/* ---- India / All locations toggle ---- */
.pm-view-toggle {
    position: absolute;
    z-index: 1000;
    top: 14px;
    right: 14px;
    display: flex;
    padding: 4px;
    gap: 4px;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(11, 46, 70, 0.18);
}

.pm-view-toggle button {
    border: 0;
    background: transparent;
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.pm-view-toggle button:hover {
    background: #f1f4f6;
}

.pm-view-toggle button.is-active {
    background: #1384b0;
    color: #fff;
}

@media (max-width: 575px) {
    .pm-view-toggle {
        top: 10px;
        right: 10px;
        padding: 3px;
        gap: 2px;
        box-shadow: 0 2px 8px rgba(11, 46, 70, 0.18);
    }

    .pm-view-toggle button {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* ---- Leaflet fallback polish ---- */
.projects-map .leaflet-control-zoom {
    border: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(11, 46, 70, 0.18);
}

.projects-map .leaflet-control-zoom a {
    width: 36px;
    height: 36px;
    line-height: 36px;
    color: #1a1a1a;
}

@media (max-width: 575px) {
    .projects-map .leaflet-control-zoom a {
        width: 30px;
        height: 30px;
        line-height: 30px;
        font-size: 18px;
    }

    .projects-map.leaflet-touch .leaflet-control-zoom {
        border: 0;
    }
}

/* Legend icon matching the pin */
.legend-swatch.legend-swatch-marker {
    width: 12px;
    height: 12px;
    background: #ea2a2a;
    border: 0;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: inset 0 0 0 3px #ea2a2a, inset 0 0 0 6px #fff;
}
