/* FRONT-END STYLES FOR WEBSITE PROJECTS MAP */

/* Overall section */
.wpm-map-section {
    background: #ffffff;
    padding: 40px 0;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.wpm-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 20px;
}

/* Sidebar card */
.wpm-sidebar {
    width: 90px;
    background: #ffffff;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.16);
    border-radius: 4px;
    padding: 12px;
}

/* Search */
.wpm-search-box {
    position: relative;
    margin-bottom: 16px;
}

.wpm-search-input {
    width: 100%;
    padding: 12px 52px 12px 12px;
    border: 2px solid #007db6;
    font-size: 15px;
    outline: none;
    border-radius: 3px;
}

.wpm-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    opacity: 0.6;
}

/* Filters */
.wpm-filter-dropdown {
    margin-bottom: 14px;
    position: relative;
}

.wpm-filter-dropdown select {
    width: 100%;
    padding: 12px 48px 12px 12px;
    font-size: 15px;
    border: 2px solid #007db6;
    cursor: pointer;
    background: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.wpm-filter-dropdown::after {
    content: "▼";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    pointer-events: none;
}

/* Projects list */
.wpm-projects-list {
    margin-top: 15px;
}

.wpm-project-item {
    padding: 20px 0;
    border-top: 2px solid #d9d9d9;
    cursor: pointer;
}

.wpm-project-content {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.wpm-project-image {
    width: 95px;
    height: 95px;
    border-radius: 3px;
    flex-shrink: 0;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.wpm-project-icons {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    align-items: flex-start;
}

.wpm-icon-box {
    width: 32px;
    height: 32px;
    background: #007db6;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    border-radius: 3px;
}

.wpm-project-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
}

.wpm-project-name--small {
    font-size: 16px;
}

.wpm-project-date {
    color: #5b6975;
    font-size: 15px;
    margin: 0 0 4px;
}

.wpm-project-link {
    color: #007db6;
    font-size: 15px;
    text-decoration: none;
}

.wpm-project-link:hover {
    text-decoration: underline;
}

.wpm-project-link--disabled {
    opacity: 0.4;
    cursor: default;
}

/* Map area */
.wpm-map-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Map title above the map */
.wpm-map-title {
    font-size: 24px;
    font-weight: 600;
    color: #003760;
    margin: 0 0 16px;
    text-align: center;
    position: relative;
    padding-bottom: 8px;
}

.wpm-map-title::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, #c7d7de 0%, #007db6 50%, #c7d7de 100%);
    opacity: 0.9;
}

.wpm-map-container {
    position: relative;
    width: 100%;
    max-width: 1500px;
    overflow: visible;
}


.wpm-map-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-origin: center center;
    transition: transform 0.16s ease-out;
    cursor: grab;
}

.wpm-map-inner.wpm-dragging {
    cursor: grabbing;
}

/* Zoom controls */
.wpm-map-zoom-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 5;
}

.wpm-zoom-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid #c3ced7;
    background: #ffffff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.wpm-zoom-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.wpm-ontario-map {
    width: 100%;
    height: auto;
    display: block;
}

.wpm-map-pins {
    position: absolute;
    inset: 0;
}

.wpm-map-pin {
    position: absolute;
    transform: translate(-50%, -100%);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.wpm-map-pin:hover {
    transform: translate(-50%, -100%) scale(1.06);
}

/* Popup card */
.wpm-popup {
    position: absolute;
    left: 60%;
    top: 69%;
    transform: translateY(-50%);
    width: 380px;
    min-width: 320px;
    max-width: 420px;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    z-index: 10;
}


.wpm-popup-close {
    position: absolute;
    right: 12px;
    top: 8px;
    background: none;
    border: none;
    font-size: 22px;
    opacity: 0.5;
    cursor: pointer;
}

.wpm-popup-divider {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid #d9d9d9;
}

/* Utility */
.wpm-hidden {
    display: none;
}

/* Responsive */
@media (max-width: 992px) {
    .wpm-container {
        flex-direction: column;
        align-items: center;
    }

    .wpm-sidebar {
        width: 100%;
        max-width: 480px;
        margin: 0 auto 24px auto;
    }

    .wpm-map-container {
    position: relative;
    width: 100%;
    max-width: 1500px;
    overflow: visible;
}

}

    .wpm-sidebar {
        width: 100%;
        max-width: 480px;
        margin: 0 auto 24px auto;
    }

    .wpm-map-container {
    position: relative;
    width: 100%;
    max-width: 1500px;
    overflow: visible;
}


    .wpm-popup {
    position: absolute;
    left: 60%;
    top: 69%;
    transform: translateY(-50%);
    width: 380px;
    min-width: 320px;
    max-width: 420px;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    z-index: 10;
}

}
    .wpm-popup {
    position: absolute;
    left: 60%;
    top: 69%;
    transform: translateY(-50%);
    width: 380px;
    min-width: 320px;
    max-width: 420px;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    z-index: 10;
}

}

.wpm-icon-box img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

@keyframes wpm-bounce {
    0%,100% { transform: translate(-50%, -100%); }
    50% { transform: translate(-50%, -110%); }
}

.wpm-map-pin {
    animation: wpm-bounce 1.8s ease-in-out infinite;
}

.wpm-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: 14px;
}

.wpm-page-btn {
    border: 1px solid #c3ced7;
    background: #ffffff;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
}

.wpm-page-btn[disabled] {
    opacity: 0.4;
    cursor: default;
}

.wpm-page-info {
    flex: 1;
    text-align: center;
    color: #5b6975;
}

/* Ensure project image and icons align to top */
.wpm-project-image { margin-top: 0 !important; }
.wpm-project-icons { margin-top: 0 !important; align-items: flex-start !important; }


/* FINAL ALIGNMENT FIX */
.wpm-project-image {
    position: relative !important;
    top: -15px !important;
    margin-top: 0 !important;
    align-self: flex-start !important;
}

/* Position popup to the RIGHT of the map marker */
.wpm-popup {
    position: absolute;
    left: 60%;
    top: 69%;
    transform: translateY(-50%);
    width: 380px;
    min-width: 320px;
    max-width: 420px;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    z-index: 10;
}


/* Mobile-specific popup adjustments: make card shorter & more readable */
@media (max-width: 768px) {
    .wpm-popup {
    position: absolute;
    left: 60%;
    top: 69%;
    transform: translateY(-50%);
    width: 380px;
    min-width: 320px;
    max-width: 420px;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    z-index: 10;
}


    .wpm-popup .wpm-project-icons {
        gap: 4px;
        margin-bottom: 6px;
    }

    .wpm-popup .wpm-icon-box {
        width: 26px;
        height: 26px;
    }

    .wpm-popup .wpm-project-name {
        font-size: 16px;
        line-height: 1.25;
    }

    .wpm-popup .wpm-project-date,
    .wpm-popup .wpm-project-link {
        font-size: 14px;
    }
}

/* Mobile: show popup as centered card overlay (bigger and readable) */
@media (max-width: 768px) {
    .wpm-popup {
    position: absolute;
    left: 60%;
    top: 69%;
    transform: translateY(-50%);
    width: 380px;
    min-width: 320px;
    max-width: 420px;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    z-index: 10;
}


    .wpm-popup .wpm-project-name {
        font-size: 18px;
        line-height: 1.3;
    }

    .wpm-popup .wpm-project-date,
    .wpm-popup .wpm-project-link {
        font-size: 15px;
    }
}



/******************************************************
 * POPUP DESIGN — IDENTICAL TO BOF MOCKUP (DESKTOP + MOBILE)
 ******************************************************/

/* Desktop & general popup styling */
.wpm-popup {
    position: absolute;
    left: 60%;
    top: 69%;
    transform: translateY(-50%);
    width: 380px;
    min-width: 320px;
    max-width: 420px;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    z-index: 10;
}


/* Top icons row */
.wpm-popup .wpm-popup-icons,
.wpm-popup .wpm-project-icons {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    align-items: center;
}

.wpm-popup .wpm-icon-box {
    width: 32px;
    height: 32px;
    background: #007db6;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpm-popup .wpm-icon-box img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Project title */
.wpm-popup .wpm-project-name {
    font-size: 18px;
    font-weight: 700;
    margin: 4px 0 2px;
    color: #003060;
    line-height: 1.3;
}

/* Project date */
.wpm-popup .wpm-project-date {
    font-size: 14px;
    margin: 0 0 4px;
    color: #333333;
}

/* More info link */
.wpm-popup .wpm-project-link,
.wpm-popup .wpm-popup-more {
    font-size: 15px;
    color: #007db6;
    text-decoration: none;
}

.wpm-popup .wpm-project-link:hover {
    text-decoration: underline;
}

/* Divider */
.wpm-popup .wpm-popup-divider {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid #d9d9d9;
}

/******************************************************
 * MOBILE — centered, wide popup card
 ******************************************************/
@media (max-width: 768px) {

    .wpm-popup {
    position: absolute;
    left: 60%;
    top: 69%;
    transform: translateY(-50%);
    width: 380px;
    min-width: 320px;
    max-width: 420px;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    z-index: 10;
}


    .wpm-popup .wpm-project-name {
        font-size: 20px;
        line-height: 1.35;
    }

    .wpm-popup .wpm-project-date {
        font-size: 16px;
    }

    .wpm-popup .wpm-project-link {
        font-size: 16px;
    }

    .wpm-popup .wpm-icon-box {
        width: 34px;
        height: 34px;
    }

    .wpm-popup .wpm-icon-box img {
        width: 22px;
        height: 22px;
    }
}

/******************************************************
 * POPUP CLOSE BUTTON STYLE
 ******************************************************/
.wpm-popup-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    z-index: 10000;
}

.wpm-popup-close:hover {
    color: #000;
}

/* Prevent layout glitch: hide section until JS finishes initial render */
.wpm-map-section {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.wpm-map-section.wpm-ready {
    opacity: 1;
}

/* ========= Enhanced frontend UI & animations ========= */

/* Smooth entrance for the whole section once JS is ready */
.wpm-map-section {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

.wpm-map-section.wpm-ready {
    opacity: 1;
    transform: translateY(0);
}

/* Sidebar card refinement */
.wpm-sidebar {
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid #e0e6ec;
}

/* Search input focus state */
.wpm-search-input {
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.wpm-search-input:focus {
    outline: none;
    border-color: #0099cc;
    box-shadow: 0 0 0 2px rgba(0, 153, 204, 0.18);
}

/* Filter dropdown focus/hover states */
.wpm-filter-dropdown select {
    transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.wpm-filter-dropdown select:focus {
    outline: none;
    border-color: #0099cc;
    box-shadow: 0 0 0 2px rgba(0, 153, 204, 0.18);
    background-color: #f7fbfd;
}

/* Project list hover treatment */
.wpm-project-item {
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.wpm-project-item:hover {
    background-color: #f6fbff;
    border-color: #c2d9ec;
    transform: translateY(-1px);
}

/* Popup subtle fade-in without breaking map positioning */
.wpm-popup {
    position: absolute;
    left: 60%;
    top: 69%;
    transform: translateY(-50%);
    width: 380px;
    min-width: 320px;
    max-width: 420px;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    z-index: 10;
}


.wpm-popup:not(.wpm-hidden) {
    opacity: 1;
}

/* Slight emphasis on active pagination arrows (if present) */
.wpm-pagination button {
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.wpm-pagination button:hover {
    background-color: #0099cc;
    color: #ffffff;
    border-color: #0099cc;
}

/* Slight hover on map pins */
.wpm-map-pin {
    transition: transform 0.18s ease;
}

.wpm-map-pin:hover {
    transform: translate(-50%, -100%) scale(1.06);
}

/* Mobile: ensure section still feels light and clean */
@media (max-width: 768px) {
    .wpm-sidebar {
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
        border-radius: 12px;
    }
}



/* INSTANT LOADING — disable transitions on load */
.wpm-map-section {
    opacity: 0;
    transform: translateY(0);
    transition: none !important;
}

.wpm-map-section.wpm-ready {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* Popup instant visibility */
.wpm-popup {
    position: absolute;
    left: 60%;
    top: 69%;
    transform: translateY(-50%);
    width: 380px;
    min-width: 320px;
    max-width: 420px;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    z-index: 10;
}



/* Mobile layout fixes: center map & keep it from overflowing */
@media (max-width: 768px) {
    .wpm-container {
        max-width: 100%;
        padding: 0 16px;
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .wpm-sidebar {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    }

    .wpm-map-area {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .wpm-map-title {
        width: 100%;
        max-width: 420px;
        text-align: center;
    }

    .wpm-map-container {
    position: relative;
    width: 100%;
    max-width: 1500px;
    overflow: visible;
}


    .wpm-ontario-map {
        width: 100%;
        height: auto;
    }
}


/* Mobile on-map arrow controls */
.wpm-map-controls {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 5;
    display: block; /* visible on all viewports; primarily useful on mobile */
}

.wpm-map-controls-grid {
    display: grid;
    grid-template-columns: repeat(3, 32px);
    grid-template-rows: repeat(2, 32px);
    gap: 6px;
}

.wpm-map-arrow {
    border-radius: 999px;
    background: #ffffff;
    color: #003760;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid #003760;
    box-shadow: none;
}

.wpm-map-arrow:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 1px;
}

.wpm-map-arrow-empty {
    background: transparent;
    pointer-events: none;
}

/* Show arrow controls only on tablets/phones */



/* D-pad analog feel */
.wpm-map-controls-grid {
    padding: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
}

/* Make empty cells fully transparent */
.wpm-map-arrow-empty {
    background: transparent;
    box-shadow: none;
}


/* --- SVG D-pad cross controls --- */
.wpm-map-controls {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 5;
    width: 80px;
    height: 80px;
    display: block; /* ensure visible */
}

.wpm-dpad-svg {
    position: absolute;
    width: 80px;
    height: 80px;
    pointer-events: none; /* let buttons capture input */
    opacity: 0.96;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}

.wpm-dpad-button {
    position: absolute;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

/* Up: top arm */
.wpm-dpad-up {
    top: 0;
    left: 25px;
    width: 30px;
    height: 26px;
}

/* Down: bottom arm */
.wpm-dpad-down {
    bottom: 4px;
    left: 25px;
    width: 30px;
    height: 26px;
}

/* Left: left arm */
.wpm-dpad-left {
    top: 27px;
    left: 0;
    width: 30px;
    height: 30px;
}

/* Right: right arm */
.wpm-dpad-right {
    top: 27px;
    right: 0;
    width: 30px;
    height: 30px;
}

/* Slight highlight when pressing (optional) */
.wpm-dpad-button:active {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.15) inset;
}


/* 4-circle arrow D-pad */
.wpm-map-controls {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 5;
}

.wpm-dpad-4circles {
    position: relative;
    width: 110px;
    height: 110px;
}

.wpm-dpad-circle {
    position: absolute;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.85);
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.2);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:20px;
    color:#003760;
    box-shadow:0 2px 6px rgba(0,0,0,0.25);
}

/* positions */
.wpm-dpad-up { top:0; left:33px; }
.wpm-dpad-left { top:33px; left:0; }
.wpm-dpad-right { top:33px; right:0; }
.wpm-dpad-down { bottom:0; left:33px; }



/* Compact 4-circle arrow D-pad (fixed) */
.wpm-map-controls {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 5;
}

.wpm-dpad-4circles {
    position: relative;
    width: 80px;
    height: 80px;
}

.wpm-dpad-circle {
    position: absolute;
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.9);
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.15);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:16px;
    color:#0D698B; /* softer blue, not black */
    box-shadow:0 1px 4px rgba(0,0,0,0.2);
}

/* positions */
.wpm-dpad-up { top:0; left:25px; }
.wpm-dpad-left { top:25px; left:0; }
.wpm-dpad-right { top:25px; right:0; }
.wpm-dpad-down { bottom:0; left:25px; }

@media (max-width: 480px) {
    .wpm-dpad-4circles {
        width: 70px;
        height: 70px;
    }
    .wpm-dpad-circle {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
    .wpm-dpad-up { top:0; left:22px; }
    .wpm-dpad-left { top:22px; left:0; }
    .wpm-dpad-right { top:22px; right:0; }
    .wpm-dpad-down { bottom:0; left:22px; }
}


/* Override D-pad styling: smaller, white arrows with outline */
.wpm-map-controls {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 20;
}

.wpm-dpad-4circles {
    position: relative;
    width: 72px;
    height: 72px;
}

.wpm-dpad-circle {
    position: absolute;
    width: 26px;
    height: 26px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.8);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:14px;
    color:#ffffff; /* white arrows */
    text-shadow: 0 0 2px rgba(0,0,0,0.8);
    box-shadow:0 1px 4px rgba(0,0,0,0.3);
}

/* positions tuned tighter so they don't go off-screen */
.wpm-dpad-up { top:0; left:23px; }
.wpm-dpad-left { top:23px; left:0; }
.wpm-dpad-right { top:23px; right:0; }
.wpm-dpad-down { bottom:0; left:23px; }

@media (max-width: 480px) {
    .wpm-dpad-4circles {
        width: 64px;
        height: 64px;
    }
    .wpm-dpad-circle {
        width: 24px;
        height: 24px;
        font-size: 13px;
    }
    .wpm-dpad-up { top:0; left:20px; }
    .wpm-dpad-left { top:20px; left:0; }
    .wpm-dpad-right { top:20px; right:0; }
    .wpm-dpad-down { bottom:0; left:20px; }
}

/* lighter grey dpad buttons */
.wpm-dpad-circle {
    background: rgba(0,0,0,0.20) !important; /* lighter grey */
    border: 1px solid rgba(255,255,255,0.9) !important;
}

/* map marker styling */
.wpm-map-marker {
    stroke: #0099CC !important; /* blue outline */
    stroke-width: 2px !important;
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.4)) !important; /* shadow */
}


/* === Arrow-only D-pad (no circles), aligned & with light border === */
.wpm-map-controls {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 20;
}

.wpm-dpad-4circles {
    position: relative;
    width: 80px;
    height: 80px;
}

/* Invisible hit areas */
.wpm-dpad-circle {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    padding: 0;
}

/* Layout */
.wpm-dpad-up    { top: 0;   left: 24px; }
.wpm-dpad-left  { top: 24px; left: 0; }
.wpm-dpad-right { top: 24px; right: 0; }
.wpm-dpad-down  { bottom: 0; left: 24px; }

/* Base arrow pseudo-element */
.wpm-dpad-circle::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.6)); /* soft border/halo */
}

/* Up arrow */
.wpm-dpad-up::before {
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 11px solid #ffffff;
}

/* Down arrow */
.wpm-dpad-down::before {
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 11px solid #ffffff;
}

/* Left arrow */
.wpm-dpad-left::before {
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right: 11px solid #ffffff;
}

/* Right arrow */
.wpm-dpad-right::before {
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 11px solid #ffffff;
}



/* === BOF tweak: Make the left sidebar narrower so the map dominates (desktop only) === */
@media (min-width: 992px) {
    .wpm-container {
        align-items: flex-start;
    }

    .wpm-sidebar {
        flex: 0 0 28%;
        max-width: 28%;
    }

    .wpm-map-area {
        flex: 0 0 72%;
        max-width: 72%;
    }
}


/* MOBILE POPUP FIX – Center popup on small screens WITHOUT touching desktop */
@media (max-width: 768px) {
    .wpm-map-container {
        overflow: visible !important;
    }

    .wpm-popup {
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90% !important;
        max-width: 380px !important;
        min-width: 260px !important;
        border-radius: 16px;
        z-index: 9999 !important;
    }

    .wpm-popup-backdrop {
        position: fixed !important;
        inset: 0 !important;
        background: rgba(0,0,0,0.25) !important;
        display: block !important;
        pointer-events: auto !important;
        z-index: 9990 !important;
    }
}



/* Collapse behavior for project list & pagination */
.wpm-projects-list.wpm-collapsed,
.wpm-pagination.wpm-collapsed {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.25s ease, opacity 0.25s ease;
}

/* Customizable marker colors via CSS variables on .wpm-map-container */
.wpm-map-container {
    --wpm-marker-outer: #ffffff;
    --wpm-marker-inner: #047bc1;
}

.wpm-map-container .wpm-pin-outer {
    fill: var(--wpm-marker-outer, #ffffff);
}
.wpm-map-container .wpm-pin-inner {
    fill: var(--wpm-marker-inner, #047bc1);
}


/* === BOF custom override: compass top-right + grey, clickable project titles === */

/* Place compass (D-pad) near the zoom controls in the top-right */
.wpm-map-controls {
    position: absolute;
    top: 12px;
    right: 60px; /* leaves space for zoom controls at right: 12px */
    left: auto;
    bottom: auto;
    z-index: 6;
}

/* Grey compass buttons */
.wpm-dpad-circle {
    background: #f0f0f0;
    border-color: #b0b0b0;
    box-shadow: none;
}

/* Make project titles behave like links visually when clickable */
.wpm-project-name a {
    color: inherit;
    text-decoration: none;
}

.wpm-project-name a:hover {
    text-decoration: underline;
}


/* Popup layout mirrors sidebar cards */
.wpm-popup-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.wpm-popup-image {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.wpm-popup-info {
    flex: 1;
}

/* Mid-level glow around map markers for better visibility */
.wpm-map-pin,
.wpm-marker {
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.45))
            drop-shadow(0 0 8px rgba(0,0,0,0.35));
}


/* ===== Map containment + fullscreen (V2) ===== */

/* Contain the zoomed/panned transform inside the map box */
.wpm-map-container {
  position: relative;
  overflow: hidden !important;
  max-width: 1500px;
  width: 100%;
}

/* IMPORTANT: let map-inner size itself to the SVG/map content (prevents blank-space mismatch) */
.wpm-map-inner {
  height: auto !important;
}

/* Fullscreen: use flex to center the map without changing its internal coordinate system */
.wpm-map-container.ontario-map--fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #ffffff;
  padding: 0 !important;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* In fullscreen, keep the map-inner behaving like normal (same width rules) */
.wpm-map-container.ontario-map--fullscreen .wpm-map-inner {
  width: 100%;
  max-width: 1500px;
  position: relative;
}

/* Lock page scroll when fullscreen is open */
body.ontario-map-open {
  overflow: hidden;
}

/* Fullscreen toggle button */
.wpm-map-container .ontario-map-fullscreen-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 50;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  background: #003060;
  color: #ffffff;
}

/* Keep controls on top of everything */
.wpm-map-container .wpm-map-controls {
  z-index: 40;
}


/* ===== Fullscreen (whole section) ===== */
.wpm-map-section.wpm--fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  background: #ffffff !important;
  padding: 12px 12px 18px !important;
  overflow: hidden !important;
}

body.wpm-fs-open {
  overflow: hidden;
}

/* In fullscreen, let the container fill height */
.wpm-map-section.wpm--fullscreen .wpm-container {
  height: 100%;
  max-width: none;
  margin: 0;
}

/* Keep sidebar visible and scrollable if long */
.wpm-map-section.wpm--fullscreen .wpm-sidebar {
  height: 100%;
  overflow: auto;
}

/* Ensure map area fills remaining height */
.wpm-map-section.wpm--fullscreen .wpm-map-area {
  height: 100%;
}

/* Contain map in its box as before */
.wpm-map-section.wpm--fullscreen .wpm-map-container {
  max-width: none;
  width: 100%;
  height: calc(100% - 56px); /* leaves room for title */
}

/* Title spacing in fullscreen */
.wpm-map-section.wpm--fullscreen .wpm-map-title {
  margin: 0 0 10px 0;
}

/* Fullscreen open button (inside map container) */
.wpm-map-container .wpm-fs-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 60;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.35);
  cursor: pointer;
  background: rgba(255,255,255,0.18);
  color: #003060;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.wpm-map-container .wpm-fs-toggle:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.28);
  box-shadow: 0 14px 30px rgba(0,0,0,0.16);
}

.wpm-map-container .wpm-fs-toggle:active{
  transform: translateY(0px);
}

/* Fullscreen close button (top-right of screen) */
.wpm-map-section .wpm-fs-close {
  display: none;
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 10000;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.35);
  cursor: pointer;
  background: rgba(255,255,255,0.16);
  color: #003060;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.20);
  font-size: 26px;
  line-height: 40px;
  text-align: center;
}

.wpm-map-section .wpm-fs-close:hover{
  background: rgba(255,255,255,0.26);
  transform: translateY(-1px);
}

/* Make sure map controls stay visible */
.wpm-map-container .wpm-map-controls {
  z-index: 70;
}


/* ===== Fullscreen overrides V2 (sidebar + map aligned) ===== */
.wpm-map-section.wpm--fullscreen{
  padding: 0 !important;
}

.wpm-map-section.wpm--fullscreen .wpm-container{
  height: 100vh !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 12px !important;
  gap: 12px !important;
  align-items: stretch !important;
}

.wpm-map-section.wpm--fullscreen .wpm-sidebar{
  width: 380px !important;
  max-width: 40vw !important;
  height: 100% !important;
  overflow: auto !important;
}

.wpm-map-section.wpm--fullscreen .wpm-map-area{
  flex: 1 1 auto !important;
  height: 100% !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

.wpm-map-section.wpm--fullscreen .wpm-map-title{
  margin: 0 0 8px 0 !important;
  font-size: 20px !important;
  line-height: 1.2 !important;
}

.wpm-map-section.wpm--fullscreen .wpm-map-container{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  max-width: none !important;
}

/* Keep the map canvas same sizing behaviour as normal so pin % coords stay right */
.wpm-map-section.wpm--fullscreen .wpm-map-inner{
  width: 100% !important;
  height: auto !important;
}

/* Close button sits on top-right of the fullscreen section */
.wpm-map-section.wpm--fullscreen .wpm-fs-close{
  top: 10px !important;
  right: 12px !important;
}

/* Ensure controls are visible */
.wpm-map-section.wpm--fullscreen .wpm-map-controls{
  z-index: 80 !important;
}


/* ===== Fullscreen overrides V3 (keep original proportions) =====
   Goal: fullscreen is just an overlay; layout + map sizing stay the same as normal.
*/
.wpm-map-section.wpm--fullscreen{
  padding: 0 !important;
  background: rgba(255,255,255,0.98) !important;
  overflow: auto !important; /* allow scrolling like a normal page */
}

.wpm-map-section.wpm--fullscreen .wpm-container{
  max-width: 1600px !important;   /* same as normal */
  width: 100% !important;
  margin: 0 auto !important;
  padding: 24px !important;        /* similar to normal spacing */
  height: auto !important;         /* do NOT force 100vh */
  align-items: flex-start !important;
}

/* Keep sidebar + map area behaving exactly like normal */
.wpm-map-section.wpm--fullscreen .wpm-sidebar{
  height: auto !important;
  overflow: visible !important;
}

.wpm-map-section.wpm--fullscreen .wpm-map-area{
  height: auto !important;
}

/* Keep the map container max width same as normal to preserve proportions */
.wpm-map-section.wpm--fullscreen .wpm-map-container{
  max-width: 1500px !important;
  width: 100% !important;
  height: auto !important;
}

/* Keep inner canvas sizing normal (prevents stretched % pin drift) */
.wpm-map-section.wpm--fullscreen .wpm-map-inner{
  height: auto !important;
}

/* Move close button to top-right of viewport */
.wpm-map-section.wpm--fullscreen .wpm-fs-close{
  position: fixed !important;
  top: 12px !important;
  right: 12px !important;
  z-index: 10001 !important;
}

/* Keep open button visible in fullscreen too (optional) */
.wpm-map-section.wpm--fullscreen .wpm-fs-toggle{
  display: none !important;
}


/* ===== Fullscreen V4: offset below sticky nav + larger layout (keeps pin proportions) ===== */
.wpm-map-section.wpm--fullscreen{
  /* dynamic header height can be set via JS as --wpm-navH; fallback 90px */
  top: var(--wpm-navH, 90px) !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  height: calc(100vh - var(--wpm-navH, 90px)) !important;
}

/* Make fullscreen layout a bit wider/larger (still proportional) */
.wpm-map-section.wpm--fullscreen .wpm-container{
  max-width: 1900px !important;   /* bigger than normal */
}

/* Bigger map box in fullscreen */
.wpm-map-section.wpm--fullscreen .wpm-map-container{
  max-width: 1750px !important;   /* bigger than normal */
  width: 100% !important;
}

/* Keep close button below nav as well */
.wpm-map-section.wpm--fullscreen .wpm-fs-close{
  top: calc(var(--wpm-navH, 90px) + 12px) !important;
}


/* ===== Popup always on top (not clipped by map overflow / transforms) ===== */
.wpm-popup {
  position: fixed !important;
  z-index: 10050 !important;
}

.wpm-popup-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10040 !important;
}


/* ===== Re-enable overflow so popups are not cut off ===== */
.wpm-map-container{
  overflow: visible !important;
}

/* Keep SVG clipping only */
.wpm-map-inner{
  overflow: hidden;
}


/* ===== UI tweaks ===== */

/* Fullscreen button: white background, black text */
.wpm-map-container .wpm-fs-toggle,
.wpm-map-container .ontario-map-fullscreen-toggle {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #000000 !important;
  box-shadow: none !important;
}

/* Remove arrows / map controls (no longer needed) */
.wpm-map-controls {
  display: none !important;
}


/* ===== Remove zoom +/- and reset controls ===== */
.wpm-zoom-in,
.wpm-zoom-out,
.wpm-zoom-reset,
.wpm-map-controls button {
  display: none !important;
}








/* ===== FINAL (lower): Close (X) further lowered to fully clear site nav ===== */
.wpm-map-section.wpm--fullscreen .wpm-fs-close{
  position: fixed !important;
  /* push well below site header */
  top: calc(var(--wpm-navH, 90px) + 80px) !important;

  /* align near map container edge */
  right: calc((100vw - min(1900px, 100vw)) / 2 + 16px) !important;
}


/* Disable fullscreen button on mobile/narrow */
@media (max-width: 768px){
  .wpm-fs-toggle, .wpm-fs-close{ display:none !important; }
}


/* ===== Lower fullscreen close (X) a bit more ===== */
.wpm-map-section.wpm--fullscreen .wpm-fs-close{
  top: calc(var(--wpm-navH, 90px) + 110px) !important;
}








/* ===== Adjust fullscreen section: raised a tiny bit more ===== */
.wpm-map-section.wpm--fullscreen{
  top: calc(var(--wpm-navH, 90px) + 6px) !important;
  height: calc(100vh - (var(--wpm-navH, 90px) + 6px)) !important;
}


/* ===== Mobile popup centered & constrained ===== */
@media (max-width: 768px){
  .wpm-popup{
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
  }
}


/* --- Marker variants (BOF vs IOFP) + active highlight --- */
.wpm-map-pin.wpm-pin-iofp .wpm-pin-inner { fill: #1aa876 !important; }

.wpm-map-pin.wpm-pin-active {
  transform: translate(-50%, -100%) scale(1.45);
  filter: drop-shadow(0 10px 26px rgba(0,0,0,0.28));
  z-index: 50;
}

/* Make the selected pin feel "locked" and obvious */
.wpm-map-pin.wpm-pin-active .wpm-pin-inner{ fill: #0099CC !important; }
.wpm-map-pin.wpm-pin-active .wpm-pin-text{ font-size: 17px; }

/* Pulsing ring behind the selected pin */
.wpm-map-pin.wpm-pin-active::before{
  content: "";
  position: absolute;
  left: 50%;
  top: 18px; /* aligns with the circle center in the SVG */
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(0,153,204,0.14);
  box-shadow: 0 0 0 0 rgba(0,153,204,0.32);
  animation: wpmPinPulse 1.25s ease-out infinite;
  pointer-events: none;
}

@keyframes wpmPinPulse{
  0%   { transform: translate(-50%, -50%) scale(0.85); box-shadow: 0 0 0 0 rgba(0,153,204,0.30); opacity: 0.95; }
  70%  { transform: translate(-50%, -50%) scale(1.35); box-shadow: 0 0 0 16px rgba(0,153,204,0.00); opacity: 0.55; }
  100% { transform: translate(-50%, -50%) scale(1.55); box-shadow: 0 0 0 22px rgba(0,153,204,0.00); opacity: 0; }
}



/* Panel-selected pin (when a project is clicked from the left list)
   Stays BIG + pulsing until the user clicks elsewhere */
.wpm-map-pin.wpm-pin-panel-selected{
  transform: translate(-50%, -100%) scale(1.80);
  filter: drop-shadow(0 18px 40px rgba(0,0,0,0.36));
  z-index: 65;
}

/* Make the pulse ring stronger/larger in panel-selected state */
.wpm-map-pin.wpm-pin-active.wpm-pin-panel-selected::before{
  width: 58px;
  height: 58px;
  background: rgba(0,153,204,0.18);
  animation-duration: 1.05s;
}

/* Extra outer glow ring */
.wpm-map-pin.wpm-pin-panel-selected::after{
  content: "";
  position: absolute;
  left: 50%;
  top: 18px;
  width: 62px;
  height: 62px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.55);
  box-shadow: 0 0 0 10px rgba(0,153,204,0.12);
  pointer-events: none;
}
/* Extra "pop" animation ONLY when selecting from the left panel */
.wpm-map-pin.wpm-pin-attention{
  filter: drop-shadow(0 14px 30px rgba(0,0,0,0.32));
}
.wpm-map-pin.wpm-pin-attention svg{
  transform-origin: 50% 85%;
  animation: wpmPinPop 1.05s cubic-bezier(.2,.9,.25,1) 1;
}
@keyframes wpmPinPop{
  0%   { transform: scale(1); }
  30%  { transform: scale(1.28); }
  55%  { transform: scale(1.10); }
  100% { transform: scale(1); }
}

.wpm-project-item.wpm-project-active {
  outline: 2px solid rgba(0, 153, 204, 0.45);
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}


/* Mobile: show map first, then filters/list */
@media (max-width: 768px){
  .wpm-container{ flex-direction: column; }
  .wpm-map-container{ order: 1; }
  .wpm-sidebar{ order: 2; width: 100%; }
}

/* Brief visual nudge when a marker selects a list item */
.wpm-project-flash{ animation: wpmFlash 0.9s ease; }
@keyframes wpmFlash{
  0%{ transform: translateY(0); }
  30%{ transform: translateY(-2px); }
  100%{ transform: translateY(0); }
}
