/**
 * Interactive Portfolio Map — Front-end Styles
 *
 * @package InteractivePortfolioMap
 */

/* ==========================================================================
   Map Wrapper
   ========================================================================== */

.ipm-map-wrapper {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.ipm-map-container {
    position: relative;
    width: 100%;
}

.ipm-map-container svg {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   State Paths — Default
   ========================================================================== */

.ipm-map-container svg path {
    fill: #b0bec5; /* neutral grey — matches screenshot */
    stroke: #ffffff;
    stroke-width: 1.5;
    transition: fill 0.2s ease, filter 0.2s ease;
    cursor: default;
}

/* States that have locations — visually distinct */
.ipm-map-container svg path.has-locations {
    fill: #78909c;
    cursor: pointer;
}

/* Hover effect on states with locations */
.ipm-map-container svg path.has-locations:hover {
    fill: #546e7a;
    fill: #cf3338;
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.3));
}

/* Active / selected state */
.ipm-map-container svg path.has-locations.active {
    fill: #37474f;
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.4));
}

/* ==========================================================================
   Pin Markers (PNG images rendered by JS inside SVG)
   ========================================================================== */

.ipm-pins {
    pointer-events: none; /* Let clicks pass through to state paths */
}

.ipm-pin {
    transition: transform 0.2s ease;
}

/* Pin image — the custom map-marker.png */
.ipm-pin-image {
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
    transition: filter 0.2s ease;
}

/* Pin entrance animation */
@keyframes ipm-pin-drop {
    0% {
        opacity: 0;
        transform: translateY(-15px);
    }
    60% {
        opacity: 1;
        transform: translateY(2px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.ipm-pin {
    animation: ipm-pin-drop 0.4s ease-out both;
}

/* Stagger pin animations */
.ipm-pin:nth-child(1) { animation-delay: 0.05s; }
.ipm-pin:nth-child(2) { animation-delay: 0.1s; }
.ipm-pin:nth-child(3) { animation-delay: 0.15s; }
.ipm-pin:nth-child(4) { animation-delay: 0.2s; }
.ipm-pin:nth-child(5) { animation-delay: 0.25s; }
.ipm-pin:nth-child(6) { animation-delay: 0.3s; }
.ipm-pin:nth-child(7) { animation-delay: 0.35s; }
.ipm-pin:nth-child(8) { animation-delay: 0.4s; }
.ipm-pin:nth-child(9) { animation-delay: 0.45s; }
.ipm-pin:nth-child(10) { animation-delay: 0.5s; }
.ipm-pin:nth-child(n+11) { animation-delay: 0.55s; }

/* ==========================================================================
   Slide-in Panel
   ========================================================================== */

.ipm-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
    z-index: 999999;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding: 28px 24px;
    box-sizing: border-box;
}

.ipm-panel.is-open {
    transform: translateX(0);
}

.ipm-panel-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    padding: 4px 8px;
    transition: color 0.15s ease;
    z-index: 1;
}

.ipm-panel-close:hover {
    color: #c62828;
}

.ipm-panel-title {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    padding-right: 40px; /* space for close button */
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 12px;
    font-family: 'Montserrat';
}

.ipm-panel-content {
    font-size: 15px;
    line-height: 1.6;
    color: #444;
}

/* ==========================================================================
   Panel Overlay
   ========================================================================== */

.ipm-panel-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    z-index: 999998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ipm-panel-overlay.is-visible {
    display: block;
    opacity: 1;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.ipm-panel-content .ipm-loading {
    text-align: center;
    padding: 40px 0;
    color: #999;
    font-style: italic;
}

.ipm-panel-content .ipm-no-results {
    text-align: center;
    padding: 30px 0;
    color: #888;
}

/* ==========================================================================
   Location Cards in Panel
   ========================================================================== */

.ipm-location-card {
    border-bottom: 1px solid #eee;
    padding: 18px 0;
}

.ipm-location-card:first-child {
    padding-top: 0;
}

.ipm-location-card:last-child {
    border-bottom: none;
}

.ipm-location-card h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Location thumbnail */
.ipm-location-thumb {
    margin-bottom: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.ipm-location-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

/* Location excerpt */
.ipm-location-excerpt {
    margin: 0 0 12px 0;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

/* ==========================================================================
   Related Portfolio Pages
   ========================================================================== */

.ipm-related-portfolios {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.ipm-related-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 8px;
}

ul.ipm-portfolio-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

ul.ipm-portfolio-list li.ipm-portfolio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.ipm-portfolio-item + .ipm-portfolio-item {
    border-top: 1px solid #f5f5f5;
}

.ipm-portfolio-thumb-link {
    flex-shrink: 0;
    display: block;
    width: 48px;
    height: 48px;
    border-radius: 4px;
    overflow: hidden;
}

.ipm-portfolio-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    display: block;
}

.ipm-portfolio-link {
    color: #cf3338;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.3;
    transition: color 0.15s ease;
}

.ipm-portfolio-link:hover {
    color: #cf3338;
    text-decoration: underline;
}


path#HI {
    display:none;
}


/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 600px) {
    .ipm-panel {
        width: 100%;
        max-width: 100%;
    }

    .ipm-panel-title {
        font-size: 20px;
    }
}
