/**
 * MMB Michigan Map - Frontend styles
 * Pins are now native SVG <circle> elements; hover/active states via CSS on those.
 */

.mmb-map-container {
    --mmb-popup-bg: #ffffff;
    --mmb-popup-text: #1d3557;
    --mmb-popup-border: rgba(0, 0, 0, 0.08);
    --mmb-popup-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    --mmb-link-color: #1d3557;
    --mmb-link-hover: #e63946;
    --mmb-filter-bg: #f4f8fb;
    --mmb-filter-active-bg: #1d3557;
    --mmb-filter-active-text: #ffffff;

    max-width: 100%;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
}

.mmb-map-container *,
.mmb-map-container *::before,
.mmb-map-container *::after {
    box-sizing: border-box;
}

/* Filter buttons */
.mmb-map-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px 0;
    padding: 0;
}

.mmb-filter-btn {
    background: var(--mmb-filter-bg);
    color: var(--mmb-link-color);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.2;
    font-family: inherit;
}

.mmb-filter-btn:hover {
    background: #e0eaf2;
}

.mmb-filter-btn.is-active {
    background: var(--mmb-filter-active-bg);
    color: var(--mmb-filter-active-text);
}

/* Map stage - sizes itself to fit the SVG, no fixed aspect ratio */
.mmb-map-stage {
    position: relative;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0; /* Removes any inline whitespace under the SVG */
}

.mmb-map-svg-wrap {
    position: relative;
    width: 100%;
    line-height: 0;
}

.mmb-map-svg-wrap svg {
    width: 100%;
    height: auto;
    display: block;
}

.mmb-map-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1d3557;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* SVG-native pins - hover/active via CSS on the group elements.
   Transform on the group is used for positioning, so we use filter for visual feedback. */
.mmb-svg-pin {
    transition: filter 0.18s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.mmb-svg-pin:hover,
.mmb-svg-pin:focus-visible {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45)) brightness(1.05);
}

.mmb-svg-pin.is-active {
    filter: drop-shadow(0 0 8px rgba(230, 57, 70, 0.6)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
    animation: mmb-pulse 1.6s ease-in-out infinite;
}

@keyframes mmb-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.75; }
}

/* Popup */
.mmb-map-popup {
    position: absolute;
    background: var(--mmb-popup-bg);
    color: var(--mmb-popup-text);
    border: 1px solid var(--mmb-popup-border);
    border-radius: 8px;
    box-shadow: var(--mmb-popup-shadow);
    width: 280px;
    max-width: calc(100% - 24px);
    padding: 16px 18px 18px;
    z-index: 100;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    font-size: 15px;
    line-height: 1.45;
}

.mmb-map-popup.is-open {
    opacity: 1;
    transform: translateY(0);
}

.mmb-map-popup.is-mobile {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 22px 20px 28px;
    transform: translateY(100%);
    z-index: 9999;
}

.mmb-map-popup.is-mobile.is-open {
    transform: translateY(0);
}

.mmb-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #646970;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    border-radius: 50%;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.mmb-popup-close:hover {
    background: #f0f0f0;
    color: #1d3557;
}

.mmb-popup-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--mmb-popup-text);
    padding-right: 30px;
    line-height: 1.25;
}

.mmb-popup-description {
    margin: 0 0 14px 0;
    color: #1d3557;
    font-size: 14px;
    line-height: 1.5;
}

.mmb-popup-link {
    display: inline-block;
    background: var(--mmb-link-color);
    color: #fff !important;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.15s ease, transform 0.15s ease;
    border: none;
}

.mmb-popup-link:hover,
.mmb-popup-link:focus-visible {
    background: var(--mmb-link-hover);
    color: #fff !important;
    transform: translateY(-1px);
    text-decoration: none !important;
}

.mmb-map-popup.is-mobile .mmb-popup-link {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px 18px;
    font-size: 16px;
}

.mmb-map-popup.is-mobile::before {
    content: '';
    position: fixed;
    inset: 0 0 0 0;
    background: rgba(29, 53, 87, 0.4);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.mmb-map-popup.is-mobile.is-open::before {
    opacity: 1;
}

/* Location list */
.mmb-map-list-wrap {
    margin-top: 24px;
}

.mmb-map-list-details {
    background: #f4f8fb;
    border-radius: 8px;
    padding: 14px 18px;
}

.mmb-map-list-details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--mmb-link-color);
    font-size: 15px;
    padding: 4px 0;
    list-style: revert;
}

.mmb-map-list-details[open] summary {
    margin-bottom: 12px;
}

.mmb-map-list h4 {
    margin: 16px 0 8px 0;
    font-size: 16px;
    color: var(--mmb-popup-text);
    border-bottom: 1px solid #c0d4e0;
    padding-bottom: 4px;
}

.mmb-map-list h4:first-child {
    margin-top: 0;
}

.mmb-map-list ul {
    list-style: disc;
    padding-left: 22px;
    margin: 0 0 10px 0;
}

.mmb-map-list li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.mmb-map-list li a {
    color: var(--mmb-link-color);
    text-decoration: underline;
    margin-left: 6px;
    font-weight: 500;
}

.mmb-map-list li a:hover {
    color: var(--mmb-link-hover);
}

@media (max-width: 700px) {
    .mmb-map-stage {
        aspect-ratio: 5 / 6;
        border-radius: 6px;
    }

    .mmb-filter-btn {
        font-size: 13px;
        padding: 7px 14px;
    }

    .mmb-popup-title {
        font-size: 17px;
    }
}
