﻿.story-map-section {
    --story-map-accent: #51b4a6;
    position: relative;
    width: 100%;
    background-color: #071a3c;
}

.story-map-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.story-map {
    position: relative;
    width: 100%;
}

.story-map-image {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

.story-hotspot {
    position: absolute;
    left: var(--hotspot-x);
    top: var(--hotspot-y);
    z-index: 10;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    transform: translate(-50%, -50%);
    cursor: pointer;
}

    .story-hotspot:hover,
    .story-hotspot:focus-visible,
    .story-hotspot.is-open {
        z-index: 50;
    }

.story-hotspot-dot {
    position: absolute;
    inset: 11px;
    z-index: 2;
    border: 3px solid #fff;
    border-radius: 50%;
    background-color: var(--story-map-accent);
    box-shadow: 0 3px 10px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 0, 0, .12);
}

.story-hotspot-pulse {
    position: absolute;
    inset: 4px;
    border: 2px solid var(--story-map-accent);
    border-radius: 50%;
    animation: storyHotspotPulse 1.7s ease-out infinite;
}

.story-callout {
    position: absolute;
    width: clamp(240px, 21vw, 330px);
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 18px;
    background: rgba(255, 255, 255, .97);
    color: #222;
    box-shadow: 0 16px 38px rgba(0, 0, 0, .28);
    font-size: .95rem;
    line-height: 1.45;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease, transform .22s ease;
    pointer-events: none;
}

    .story-callout::before {
        content: "";
        position: absolute;
        width: 16px;
        height: 16px;
        background: rgba(255, 255, 255, .97);
        transform: rotate(45deg);
    }

.story-callout-content strong,
.story-callout-content b {
    font-weight: 700;
}

/* Callout a destra */

.story-hotspot-right .story-callout {
    left: calc(100% + 14px);
    top: 50%;
    transform: translate(8px, -50%) scale(.96);
}

    .story-hotspot-right .story-callout::before {
        left: -8px;
        top: calc(50% - 8px);
    }

/* Callout a sinistra */

.story-hotspot-left .story-callout {
    right: calc(100% + 14px);
    top: 50%;
    transform: translate(-8px, -50%) scale(.96);
}

    .story-hotspot-left .story-callout::before {
        right: -8px;
        top: calc(50% - 8px);
    }

/* Callout sopra */

.story-hotspot-top .story-callout {
    left: 50%;
    bottom: calc(100% + 14px);
    transform: translate(-50%, -8px) scale(.96);
}

    .story-hotspot-top .story-callout::before {
        left: calc(50% - 8px);
        bottom: -8px;
    }

/* Callout sotto */

.story-hotspot-bottom .story-callout {
    left: 50%;
    top: calc(100% + 14px);
    transform: translate(-50%, 8px) scale(.96);
}

    .story-hotspot-bottom .story-callout::before {
        left: calc(50% - 8px);
        top: -8px;
    }

/* Apertura desktop */

.story-hotspot-right:hover .story-callout,
.story-hotspot-right:focus-visible .story-callout,
.story-hotspot-right.is-open .story-callout {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%) scale(1);
}

.story-hotspot-left:hover .story-callout,
.story-hotspot-left:focus-visible .story-callout,
.story-hotspot-left.is-open .story-callout {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%) scale(1);
}

.story-hotspot-top:hover .story-callout,
.story-hotspot-top:focus-visible .story-callout,
.story-hotspot-top.is-open .story-callout {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0) scale(1);
}

.story-hotspot-bottom:hover .story-callout,
.story-hotspot-bottom:focus-visible .story-callout,
.story-hotspot-bottom.is-open .story-callout {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0) scale(1);
}

.story-map-mobile-hint,
.story-mobile-panel {
    display: none;
}

.story-mobile-panel {
    position: relative;
    margin: 16px;
    padding: 22px 48px 22px 22px;
    border-radius: 18px;
    background: #fff;
    color: #222;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
    line-height: 1.5;
}

.story-mobile-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(81, 180, 166, .12);
    color: #276f65;
}

@@keyframes storyHotspotPulse {
    0% {
        transform: scale(.65);
        opacity: 1;
    }

    100% {
        transform: scale(1.65);
        opacity: 0;
    }
}

@@media (max-width: 991.98px) {
    /*
             * L'immagine è molto panoramica.
             * Su mobile la manteniamo abbastanza larga e permettiamo
             * lo scorrimento orizzontale.
             */
    .story-map {
        width: 1100px;
    }

    .story-map-scroll {
        border-bottom: 1px solid rgba(255, 255, 255, .15);
    }

    .story-callout {
        display: none;
    }

    .story-map-mobile-hint {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 10px 15px;
        background: rgba(0, 0, 0, .22);
        color: rgba(255, 255, 255, .88);
        font-size: .85rem;
        text-align: center;
    }

    .story-mobile-panel:not([hidden]) {
        display: block;
    }
}

@@media (prefers-reduced-motion: reduce) {
    .story-hotspot-pulse {
        animation: none;
    }

    .story-callout {
        transition: none;
    }
}

