/* ==========================================================================
   SBO Touring Map — Styles
   ========================================================================== */

/* Container */
.stm-map-container {
    position: relative;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
}

.stm-map-wrapper {
    position: relative;
    width: 100%;
    line-height: 0;
}

.stm-map-wrapper svg {
    width: 100%;
    height: auto;
    display: block;
}

/* State/Province fills — use !important to override SVG embedded styles */
.stm-state {
    fill: #f0f0f0 !important;
    stroke: #ccc !important;
    stroke-width: 0.5 !important;
    transition: fill 0.15s ease;
}

.stm-state:hover {
    fill: #e8e8e8 !important;
}

/* --------------------------------------------------------------------------
   Country-adaptive display
   Hide the unused country group when only one country has stops.
   -------------------------------------------------------------------------- */
.stm-map--usa-only .stm-states--canada {
    display: none;
}

.stm-map--canada-only .stm-states--usa {
    display: none;
}

/* --------------------------------------------------------------------------
   Pin dots — colors applied via inline style to prevent theme CSS override
   -------------------------------------------------------------------------- */
.stm-pin {
    cursor: pointer;
}

.stm-pin__dot {
    transition: r 0.15s ease;
}

.stm-pin:hover .stm-pin__dot {
    r: 7;
}

/* Pulse animation for upcoming events */
.stm-pin__pulse {
    animation: stm-pulse 2s ease-out infinite;
    transform-origin: center;
}

@keyframes stm-pulse {
    0% {
        r: 5;
        opacity: 1;
    }
    100% {
        r: 14;
        opacity: 0;
    }
}

/* Past event pins — muted */
.stm-pin--past .stm-pin__dot {
    opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Popup
   -------------------------------------------------------------------------- */
.stm-popup {
    position: absolute;
    z-index: 100;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    min-width: 200px;
    max-width: 280px;
    font-size: 14px;
    line-height: 1.4;
    pointer-events: auto;
}

.stm-popup__close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.stm-popup__close:hover {
    color: #333;
}

.stm-popup__title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: #222;
    padding-right: 20px;
}

.stm-popup__date {
    margin: 0 0 4px;
    color: #666;
    font-size: 13px;
}

.stm-popup__venue {
    margin: 0 0 2px;
    color: #444;
}

.stm-popup__address {
    margin: 0 0 12px;
    color: #888;
    font-size: 12px;
}

.stm-popup__cta {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s ease;
}

.stm-popup__cta:hover {
    background: #c0392b;
    color: #fff;
}

/* --------------------------------------------------------------------------
   Legend
   -------------------------------------------------------------------------- */
.stm-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 12px 0 0;
    font-size: 13px;
    color: #666;
}

.stm-legend__item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stm-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* --------------------------------------------------------------------------
   Unmapped events list (events without coordinates)
   -------------------------------------------------------------------------- */
.stm-unmapped {
    padding: 16px 0 0;
}

.stm-unmapped__title {
    font-size: 14px;
    font-weight: 600;
    color: #444;
    margin: 0 0 8px;
    text-align: center;
}

.stm-unmapped__list {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
}

.stm-unmapped__item {
    padding: 4px 0;
    font-size: 14px;
    color: #555;
}

.stm-unmapped__link {
    color: inherit;
    text-decoration: none;
}

.stm-unmapped__link:hover {
    color: #e74c3c;
}

.stm-unmapped__date {
    font-weight: 600;
}

.stm-unmapped__venue {
    color: #888;
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   Noscript fallback
   -------------------------------------------------------------------------- */
.stm-noscript {
    font-size: 13px;
    color: #666;
    text-align: center;
    padding: 8px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
    .stm-popup {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: none;
        border-radius: 12px 12px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    }
}
