/**
 * Blocco Mappa — pin, popup, altezze.
 * Il resto del layout usa le classi di Testo e Testo + Immagine.
 */

.map-block--hero {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.map-block--hero .map-block__frame,
.map-block--hero .map-block__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.map-block--content .map-block__frame {
    margin-top: 1.5rem;
    width: 100%;
}

.map-block--content .text-content + .map-block__frame {
    margin-top: 1.5rem;
}

.map-block--content .map-block__frame:first-child {
    margin-top: 0;
}

.map-block--split .map-block__frame {
    width: 100%;
}

.map-block--split.map-block--solo .map-block__frame {
    grid-column: 1 / -1;
}

.map-block__canvas {
    width: 100%;
    height: 100%;
    background: var(--color-bg-alt, #f5f5f5);
    z-index: 0;
}

.map-block .text-image-text p,
.map-block .text-text p {
    margin: 0 0 1rem;
}

.map-block .text-image-text p:last-child,
.map-block .text-text p:last-child {
    margin-bottom: 0;
}

.map-block .text-image-text br,
.map-block .text-text br {
    display: block;
    content: "";
    margin-top: 0.4em;
}

.leaflet-div-icon.map-pin {
    background: transparent;
    border: 0;
}

.map-pin__shape {
    display: block;
    width: 32px;
    height: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 42'%3E%3Cpath fill='%23e10600' d='M16 0C7.16 0 0 7.16 0 16c0 11.2 16 26 16 26s16-14.8 16-26C32 7.16 24.84 0 16 0z'/%3E%3Ccircle cx='16' cy='15.5' r='5.5' fill='%23fff'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.28));
}

.map-popup-wrap .leaflet-popup-content-wrapper {
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    padding: 0;
}

.map-popup-wrap .leaflet-popup-content {
    margin: 0;
    width: 340px !important;
}

.map-popup-wrap .leaflet-popup-tip {
    box-shadow: none;
}

.map-popup__image {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.map-popup__body {
    padding: 1rem 1.15rem 1.2rem;
    text-align: center;
}

.leaflet-container .map-popup__title {
    margin: 0 0 0.45rem;
    font-family: var(--font-title);
    font-size: 1.45rem;
    line-height: 1.2;
    font-weight: 400;
    font-style: normal;
    color: #000;
}

.leaflet-container .map-popup__text {
    margin: 0 0 0.9rem;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 400;
    color: var(--color-text, #000);
    max-height: 9.5rem;
    overflow-y: auto;
}

.map-popup__body .map-popup__text:last-child {
    margin-bottom: 0;
}

.map-popup__body .map-popup__title,
.map-popup__body .map-popup__text {
    text-align: left;
}

.leaflet-container a.map-popup__go {
    width: auto;
    display: inline-flex;
    margin: 0 auto;
    color: #000;
    background-color: #fff;
    font-family: var(--font-body) !important;
    font-weight: 400 !important;
    font-size: 1.2rem !important;
}

 .leaflet-control-attribution {
    display:none;
  }

@media (max-width: 768px) {
    .map-block--hero.map-block--full {
        height: 70vh !important;
    }

    .map-block--hero.map-block--full .map-block__frame {
        height: 100% !important;
    }

    .map-popup-wrap .leaflet-popup-content {
        width: min(300px, 78vw) !important;
    }

    .map-block--split .text-image-container {
        grid-template-columns: 1fr;
    }

    .map-block--split .map-block__frame,
    .map-block--split .text-image-content {
        order: unset;
    }

    .map-block--split .map-block__frame {
        order: 1;
    }

    .map-block--split .text-image-content {
        order: 2;
    }
}

@media (max-width: 480px) {
    .map-block--content .text-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
