.community-live-section{
    background:#f6f9fa;
    border-top:1px solid #e1e8eb;
    border-bottom:1px solid #e1e8eb;
}

.community-live-actions{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:24px;
    margin:0 0 22px;
}

.community-live-actions p{
    max-width:720px;
    margin:0;
    color:#607681;
    line-height:1.55;
}

.community-live-map{
    width:100%;
    height:430px;
    border:1px solid #d6e2e7;
    background:#eef4f6;
}

.community-live-note{
    margin:10px 0 0;
    color:#728790;
    font-size:13px;
    line-height:1.45;
}

.community-live-list{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:16px;
    margin-top:24px;
}

.community-report-card{
    background:#fff;
    border:1px solid #d8e3e7;
}

.community-report-image{
    width:100%;
    aspect-ratio:16/9;
    object-fit:cover;
    display:block;
    border-bottom:1px solid #d8e3e7;
}

.community-report-body{
    padding:17px;
}

.community-report-top{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:10px;
}

.community-report-category{
    color:#1688aa;
    font-size:12px;
    font-weight:800;
    letter-spacing:.05em;
    text-transform:uppercase;
}

.community-report-time{
    color:#7b8d95;
    font-size:12px;
}

.community-report-card h3{
    margin:0 0 8px;
    color:#203f4d;
    font-size:21px;
    line-height:1.15;
}

.community-report-card p{
    margin:0;
    color:#58707a;
    line-height:1.5;
}

.community-report-author{
    margin-top:13px;
    padding-top:12px;
    border-top:1px solid #e5ecef;
    color:#71848c;
    font-size:13px;
}

.community-report-position{
    margin-top:10px;
    color:#83949b;
    font-size:12px;
}

.community-live-empty{
    grid-column:1/-1;
    padding:24px;
    background:#fff;
    border:1px solid #d8e3e7;
    color:#617681;
}

.community-map-popup{
    min-width:210px;
}

.community-map-popup strong{
    display:block;
    margin-bottom:4px;
    color:#203f4d;
    font-size:16px;
}

.community-map-popup span{
    display:block;
    margin-bottom:7px;
    color:#1688aa;
    font-size:12px;
    font-weight:700;
    text-transform:uppercase;
}

.community-map-popup p{
    margin:7px 0 0;
    line-height:1.4;
}

.community-map-popup img{
    width:100%;
    max-height:150px;
    object-fit:cover;
    margin-top:9px;
}

@media(max-width:900px){
    .community-live-list{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media(max-width:700px){
    .community-live-actions{
        display:block;
    }

    .community-live-actions .community-primary-button{
        width:100%;
        margin-top:17px;
        text-align:center;
        justify-content:center;
    }

    .community-live-map{
        height:340px;
    }

    .community-live-list{
        grid-template-columns:1fr;
    }
}

.community-live-marker{
    background:transparent!important;
    border:0!important;
}

.community-live-marker-pin{
    width:36px;
    height:36px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--marker-color);
    color:#fff;
    border:3px solid #fff;
    border-radius:50% 50% 50% 0;
    transform:rotate(-45deg);
    box-shadow:0 4px 10px rgba(17,48,60,.28);
}

.community-live-marker-pin svg{
    width:19px;
    height:19px;
    transform:rotate(45deg);
}

/* Marker meteorologici */
.community-live-marker{
    background:transparent!important;
    border:0!important;
}

.community-weather-dot{
    position:relative;
    width:42px;
    height:42px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    background:var(--marker-color);
    color:#fff;
    border:3px solid #fff;
    box-shadow:
        0 3px 10px rgba(20,50,62,.30);
}

.community-weather-dot svg{
    width:22px;
    height:22px;
}

/* Ultima segnalazione approvata: massimo 5 minuti */
.community-weather-dot.is-fresh::after{
    content:"";
    position:absolute;
    inset:-8px;
    border:3px solid var(--marker-color);
    border-radius:50%;
    animation:communityFreshPulse 1.35s ease-out infinite;
}

@keyframes communityFreshPulse{
    0%{
        transform:scale(.78);
        opacity:.95;
    }
    100%{
        transform:scale(1.38);
        opacity:0;
    }
}

.community-report-card.is-fresh{
    border-color:#43a3bd;
    box-shadow:0 0 0 2px rgba(67,163,189,.10);
}

.community-new-label{
    color:#1688aa;
    font-size:11px;
    letter-spacing:.06em;
}

@media(prefers-reduced-motion:reduce){
    .community-weather-dot.is-fresh::after{
        animation:none;
    }
}

/* Mappa Community: riquadro più alto, zoom invariato */
#communityLiveMap{
    height:600px !important;
    min-height:600px;
}

@media (min-width:900px){
    #communityLiveMap{
        height:640px !important;
        min-height:640px;
    }
}


/* Dettaglio segnalazione selezionata dalla mappa */
.community-live-list.is-selection{
    grid-template-columns:minmax(0,760px);
    justify-content:center;
}

.community-live-list.is-selection::before{
    content:"Seleziona una segnalazione sulla mappa per vedere i dettagli e la foto.";
    grid-column:1/-1;
    padding:20px;
    border:1px solid #d8e3e7;
    background:#fff;
    color:#617681;
    text-align:center;
}

.community-live-list.is-selection .community-report-card{
    display:none;
}

.community-live-list.is-selection.has-selection::before{
    display:none;
}

.community-live-list.is-selection.has-selection .community-report-card.is-selected{
    display:block;
}

@media(max-width:700px){
    .community-live-list.is-selection{
        grid-template-columns:1fr;
    }
}


/* Chiusura dettaglio segnalazione */
.community-report-card{
    position:relative;
}

.community-report-close{
    position:absolute;
    top:12px;
    right:12px;
    z-index:5;
    width:38px;
    height:38px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
    border:1px solid rgba(32,63,77,.18);
    border-radius:50%;
    background:rgba(255,255,255,.94);
    color:#203f4d;
    font:inherit;
    font-size:25px;
    line-height:1;
    cursor:pointer;
    box-shadow:0 2px 8px rgba(20,50,62,.15);
}

.community-report-close:hover{
    background:#fff;
}


/* =========================================================
   Community live - elenco completo segnalazioni
   ========================================================= */

.community-live-list.is-selection{
    grid-template-columns:repeat(3,minmax(0,1fr));
    justify-content:stretch;
}

.community-live-list.is-selection::before{
    display:none !important;
}

.community-live-list.is-selection .community-report-card,
.community-live-list.is-selection.has-selection .community-report-card{
    display:block;
}

.community-live-list .community-report-close{
    display:none;
}

.community-report-card.is-selected{
    border-color:#1688aa;
    box-shadow:0 0 0 2px rgba(22,136,170,.14);
}

/* Una sola segnalazione: card centrata */
.community-live-list:has(> .community-report-card:only-child){
    grid-template-columns:minmax(0,760px);
    justify-content:center;
}

/* Due segnalazioni: due colonne equilibrate */
.community-live-list:has(
    > .community-report-card:first-child:nth-last-child(2)
){
    grid-template-columns:repeat(2,minmax(0,1fr));
}

@media(max-width:900px){
    .community-live-list.is-selection{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .community-live-list:has(> .community-report-card:only-child){
        grid-template-columns:minmax(0,760px);
    }
}

@media(max-width:700px){
    .community-live-list.is-selection,
    .community-live-list:has(> .community-report-card:only-child),
    .community-live-list:has(
        > .community-report-card:first-child:nth-last-child(2)
    ){
        grid-template-columns:1fr;
    }
}

/* =========================================================
   COMMUNITY_MOBILE_COMPACT_V1
   Sito: elenco compatto solo su smartphone
   ========================================================= */

@media(max-width:700px){

    .community-live-list{
        gap:10px;
        margin-top:16px;
    }

    .community-report-card{
        overflow:hidden;
        cursor:pointer;
    }

    .community-report-card .community-report-image{
        display:none;
    }

    .community-report-card .community-report-body{
        padding:13px 15px;
    }

    .community-report-card .community-report-top{
        margin-bottom:5px;
    }

    .community-report-card h3{
        margin:0 0 5px;
        font-size:18px;
        line-height:1.15;
    }

    .community-report-card p{
        margin:0;
        overflow:hidden;
        display:-webkit-box;
        -webkit-box-orient:vertical;
        -webkit-line-clamp:1;
        line-clamp:1;
        font-size:13px;
        line-height:1.4;
    }

    .community-report-card .community-report-author,
    .community-report-card .community-report-position{
        display:none;
    }

    /* Card aperta */
    .community-report-card.is-open .community-report-image{
        display:block;
    }

    .community-report-card.is-open .community-report-body{
        padding:17px;
    }

    .community-report-card.is-open h3{
        margin-bottom:8px;
        font-size:21px;
    }

    .community-report-card.is-open p{
        display:block;
        overflow:visible;
        font-size:inherit;
        line-height:1.5;
    }

    .community-report-card.is-open .community-report-author,
    .community-report-card.is-open .community-report-position{
        display:block;
    }
}
