/* ============================================================
   OROSEIMETEO
   MAPPA RETE METEO
   ============================================================ */

.rete-hero{
    padding:46px 0 34px;
    background:linear-gradient(
        135deg,
        #eef8fb 0%,
        #ffffff 58%,
        #edf7f2 100%
    );
    border-bottom:1px solid #dce9ee;
}

.rete-hero-inner{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:30px;
}

.rete-hero .eyebrow{
    display:block;
    margin-bottom:8px;
    color:#1481a7;
    font-size:12px;
    font-weight:900;
    letter-spacing:.08em;
    text-transform:uppercase;
}

.rete-hero h1{
    margin:0;
    color:#173f56;
    font-size:clamp(32px,5vw,50px);
    line-height:1.05;
}

.rete-hero p{
    max-width:720px;
    margin:13px 0 0;
    color:#6b8390;
    font-size:16px;
    line-height:1.55;
}


/* ============================================================
   CONTATORI
   ============================================================ */

.rete-stats{
    display:flex;
    gap:10px;
    flex:0 0 auto;
}

.rete-stats > div{
    min-width:115px;
    padding:14px 17px;
    background:#fff;
    border:1px solid #d8e7ec;
    border-radius:15px;
    box-shadow:0 8px 22px rgba(21,63,84,.05);
}

.rete-stats strong{
    display:block;
    color:#0e759c;
    font-size:27px;
    line-height:1;
}

.rete-stats span{
    display:block;
    margin-top:6px;
    color:#7d929c;
    font-size:10px;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.04em;
}


/* ============================================================
   SEZIONE
   ============================================================ */

.rete-section{
    padding:26px 0 55px;
    background:#f5f8fa;
}

.rete-toolbar{
    display:grid;
    grid-template-columns:
        minmax(190px,.7fr)
        minmax(300px,1.5fr)
        auto;
    align-items:end;
    gap:13px;
    margin-bottom:14px;
}

.rete-field label{
    display:block;
    margin-bottom:6px;
    color:#587180;
    font-size:11px;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.rete-field select,
.rete-field input{
    width:100%;
    min-height:46px;
    padding:0 13px;
    border:1px solid #cbdde4;
    border-radius:11px;
    background:#fff;
    color:#173f56;
    font:inherit;
    font-size:15px;
    outline:none;
}

.rete-field select:focus,
.rete-field input:focus{
    border-color:#48a0bd;
    box-shadow:0 0 0 3px rgba(72,160,189,.11);
}

.rete-search-row{
    display:flex;
    gap:8px;
}

.rete-search-row button{
    min-height:46px;
    padding:0 18px;
    border:0;
    border-radius:11px;
    background:#147fa6;
    color:#fff;
    font:inherit;
    font-size:13px;
    font-weight:900;
    cursor:pointer;
}

.rete-update{
    min-height:46px;
    padding:7px 0;
    text-align:right;
}

.rete-update span{
    display:block;
    color:#899ca5;
    font-size:10px;
    font-weight:800;
    text-transform:uppercase;
}

.rete-update strong{
    display:block;
    margin-top:3px;
    color:#36596b;
    font-size:13px;
}


/* ============================================================
   MAPPA
   ============================================================ */

.rete-map-card{
    position:relative;
    overflow:hidden;
    border:1px solid #cfdee4;
    border-radius:18px;
    background:#dfe9ed;
    box-shadow:0 12px 34px rgba(30,65,82,.08);
}

#reteMap{
    width:100%;
    height:min(72vh,760px);
    min-height:590px;
    background:#dfe9ed;
}

.rete-loading{
    position:absolute;
    z-index:800;
    top:16px;
    left:50%;
    transform:translateX(-50%);
    padding:9px 14px;
    border-radius:999px;
    background:rgba(255,255,255,.96);
    color:#365b6c;
    box-shadow:0 5px 18px rgba(0,0,0,.13);
    font-size:12px;
    font-weight:900;
    pointer-events:none;
}

.rete-loading.hidden{
    display:none;
}


/* ============================================================
   MARKER
   ============================================================ */

.rete-marker-icon{
    background:transparent !important;
    border:0 !important;
}

.rete-marker{
    width:36px;
    height:36px;
    display:flex;
    align-items:center;
    justify-content:center;
    border:2px solid rgba(255,255,255,.97);
    border-radius:50%;
    background:var(--rete-color,#1684a8);
    color:#fff;
    box-shadow:
        0 2px 7px rgba(0,0,0,.27),
        0 0 0 1px rgba(18,54,72,.10);
    font-size:10px;
    font-weight:950;
    line-height:1;
    letter-spacing:-.02em;
    text-shadow:0 1px 2px rgba(0,0,0,.25);
    transition:
        transform .14s ease,
        box-shadow .14s ease;
}

.rete-marker:hover{
    transform:scale(1.08);
}

.rete-marker.official{
    box-shadow:
        0 2px 7px rgba(0,0,0,.27),
        0 0 0 2px #164e69;
}

.rete-marker.collaborative{
    box-shadow:
        0 2px 7px rgba(0,0,0,.27),
        0 0 0 1.5px #5eb69f;
}


/* ============================================================
   LEGENDA
   ============================================================ */

.rete-legend{
    position:absolute;
    z-index:700;
    left:12px;
    bottom:12px;
    max-width:calc(100% - 24px);
    display:flex;
    flex-wrap:wrap;
    gap:5px;
    padding:8px;
    border-radius:11px;
    background:rgba(255,255,255,.94);
    box-shadow:0 4px 16px rgba(0,0,0,.13);
    backdrop-filter:blur(5px);
}

.rete-legend-item{
    display:flex;
    align-items:center;
    gap:5px;
    color:#466575;
    font-size:10px;
    font-weight:800;
    white-space:nowrap;
}

.rete-legend-dot{
    width:10px;
    height:10px;
    border-radius:50%;
    flex:0 0 auto;
}


/* ============================================================
   POPUP
   ============================================================ */

.rete-map-card .leaflet-popup-content-wrapper{
    border-radius:15px;
    box-shadow:0 10px 30px rgba(25,59,75,.20);
}

.rete-map-card .leaflet-popup-content{
    width:285px !important;
    margin:16px 17px;
}

.rete-popup{
    color:#173f56;
}

.rete-popup-head{
    padding-bottom:10px;
    margin-bottom:11px;
    border-bottom:1px solid #e2ebef;
}

.rete-popup-head h3{
    margin:0 0 4px;
    color:#173f56;
    font-size:18px;
    line-height:1.15;
}

.rete-popup-place{
    color:#7d929c;
    font-size:11px;
}

.rete-popup-tags{
    display:flex;
    flex-wrap:wrap;
    gap:5px;
    margin-top:8px;
}

.rete-popup-tag{
    display:inline-flex;
    padding:4px 7px;
    border-radius:999px;
    background:#eef5f7;
    color:#4c6b79;
    font-size:9px;
    font-weight:900;
    text-transform:uppercase;
}

.rete-popup-tag.verified{
    background:#e5f5eb;
    color:#30734a;
}

.rete-popup-main{
    margin-bottom:12px;
}

.rete-popup-main span{
    display:block;
    margin-bottom:3px;
    color:#83979f;
    font-size:10px;
    font-weight:800;
    text-transform:uppercase;
}

.rete-popup-main strong{
    color:#126f94;
    font-size:30px;
    line-height:1;
}

.rete-popup-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
}

.rete-popup-cell{
    padding:8px 9px;
    border-radius:9px;
    background:#f4f8fa;
}

.rete-popup-cell span{
    display:block;
    margin-bottom:2px;
    color:#879aa4;
    font-size:9px;
    font-weight:800;
    text-transform:uppercase;
}

.rete-popup-cell strong{
    color:#274f62;
    font-size:12px;
}

.rete-popup-daily{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:6px;
    margin-top:10px;
    padding-top:10px;
    border-top:1px solid #e6edef;
}

.rete-popup-daily div{
    text-align:center;
}

.rete-popup-daily span{
    display:block;
    color:#8a9ca4;
    font-size:8px;
    font-weight:800;
    text-transform:uppercase;
}

.rete-popup-daily strong{
    display:block;
    margin-top:2px;
    color:#536f7d;
    font-size:10px;
}

.rete-popup-update{
    margin-top:9px;
    color:#8a9da6;
    font-size:9px;
    text-align:right;
}


/* ============================================================
   SOTTO MAPPA
   ============================================================ */

.rete-bottom{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:28px;
    margin-top:14px;
    padding:14px 17px;
    border:1px solid #dce7eb;
    border-radius:13px;
    background:#fff;
}

.rete-bottom strong{
    display:block;
    color:#244e62;
    font-size:14px;
}

.rete-bottom span{
    display:block;
    margin-top:3px;
    color:#82969f;
    font-size:11px;
}

.rete-bottom p{
    max-width:590px;
    margin:0;
    color:#7b909b;
    font-size:11px;
    line-height:1.5;
}

.rete-message{
    margin-top:12px;
    padding:12px 14px;
    border-radius:11px;
    background:#fff1dd;
    color:#896523;
    font-size:12px;
    font-weight:800;
}


/* ============================================================
   LEAFLET
   ============================================================ */

.rete-map-card .leaflet-control-zoom a{
    color:#31566a;
}

.rete-map-card .leaflet-control-layers{
    border:0;
    border-radius:10px;
    box-shadow:0 3px 12px rgba(0,0,0,.16);
}

.rete-map-card .leaflet-control-attribution{
    font-size:8px;
}


/* ============================================================
   TABLET
   ============================================================ */

@media(max-width:800px){

    .rete-hero{
        padding:34px 0 25px;
    }

    .rete-hero-inner{
        display:block;
    }

    .rete-stats{
        margin-top:21px;
    }

    .rete-stats > div{
        flex:1 1 0;
        min-width:0;
    }

    .rete-toolbar{
        grid-template-columns:1fr;
    }

    .rete-update{
        padding:0;
        text-align:left;
    }

    #reteMap{
        height:68vh;
        min-height:520px;
    }

    .rete-bottom{
        display:block;
    }

    .rete-bottom p{
        margin-top:10px;
    }
}


/* ============================================================
   SMARTPHONE
   ============================================================ */

@media(max-width:520px){

    .rete-section{
        padding-top:18px;
    }

    .rete-map-card{
        border-radius:14px;
    }

    #reteMap{
        height:64vh;
        min-height:500px;
    }

    .rete-search-row{
        display:grid;
        grid-template-columns:1fr auto;
    }

    .rete-search-row button{
        padding:0 14px;
    }

    .rete-marker{
        width:30px;
        height:30px;
        border-width:2px;
        font-size:8.5px;
        box-shadow:
            0 2px 5px rgba(0,0,0,.25);
    }

    .rete-marker.official{
        box-shadow:
            0 2px 5px rgba(0,0,0,.25),
            0 0 0 2px #164e69;
    }

    .rete-marker.collaborative{
        box-shadow:
            0 2px 5px rgba(0,0,0,.25),
            0 0 0 1px #5eb69f;
    }

    .rete-map-card .leaflet-popup-content{
        width:235px !important;
        margin:14px;
    }

    .rete-popup-main strong{
        font-size:27px;
    }

    .rete-popup-cell{
        padding:7px 8px;
    }

    .rete-legend{
        right:9px;
        left:9px;
        bottom:9px;
        padding:7px;
    }

    .rete-legend-item{
        font-size:8.5px;
    }

    .rete-legend-dot{
        width:9px;
        height:9px;
    }
}


/* ============================================================
   PANNELLO GRANDE STAZIONE
   ============================================================ */

.rete-station-panel-shell{
    position:fixed;
    inset:0;
    z-index:10050;
    visibility:hidden;
    pointer-events:none;
}

.rete-station-panel-shell.open{
    visibility:visible;
}

.rete-station-panel-backdrop{
    position:absolute;
    inset:0;
    background:rgba(13,35,48,.34);
    opacity:0;
    transition:opacity .22s ease;
    pointer-events:auto;
}

.rete-station-panel-shell.open
.rete-station-panel-backdrop{
    opacity:1;
}

.rete-station-panel{
    position:absolute;
    top:0;
    right:0;
    width:min(460px,94vw);
    height:100dvh;
    background:#fff;
    box-shadow:-12px 0 38px rgba(13,45,62,.18);
    transform:translateX(102%);
    transition:transform .26s ease;
    pointer-events:auto;
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
}

.rete-station-panel-shell.open
.rete-station-panel{
    transform:translateX(0);
}

.rete-station-panel-content{
    padding:
        32px
        22px
        calc(32px + env(safe-area-inset-bottom));
}

.rete-station-panel-close{
    position:absolute;
    z-index:5;
    top:14px;
    right:14px;
    width:38px;
    height:38px;
    padding:0;
    border:0;
    border-radius:50%;
    background:#eef5f7;
    color:#294f61;
    font-size:28px;
    line-height:1;
    cursor:pointer;
}

.rete-station-panel-handle{
    display:none;
}


/* Titolo */

.rete-station-panel .rete-popup{
    width:100%;
}

.rete-station-panel .rete-popup-head{
    padding-right:45px;
    margin-bottom:20px;
}

.rete-station-panel .rete-popup-head h3{
    margin:0 0 5px;
    font-size:27px;
    line-height:1.15;
}

.rete-station-panel .rete-popup-place{
    font-size:13px;
}

.rete-station-panel .rete-popup-tags{
    margin-top:11px;
}


/* Valore principale */

.rete-station-panel .rete-popup-main{
    margin:0 0 18px;
    padding:20px;
    border-radius:17px;
    background:#f1f8fa;
}

.rete-station-panel .rete-popup-main span{
    display:block;
    margin-bottom:4px;
    font-size:11px;
    font-weight:900;
    letter-spacing:.05em;
    text-transform:uppercase;
    color:#668592;
}

.rete-station-panel .rete-popup-main strong{
    display:block;
    font-size:34px;
    line-height:1.05;
    color:#173f56;
}


/* Dati attuali */

.rete-station-panel .rete-popup-grid{
    display:grid;
    grid-template-columns:
        repeat(2,minmax(0,1fr));
    gap:10px;
    margin-bottom:20px;
}

.rete-station-panel .rete-popup-cell{
    min-height:74px;
    padding:13px;
    border:1px solid #e0eaee;
    border-radius:13px;
    background:#fff;
}

.rete-station-panel .rete-popup-cell span{
    display:block;
    margin-bottom:5px;
    color:#7b929d;
    font-size:10px;
    font-weight:900;
    text-transform:uppercase;
}

.rete-station-panel .rete-popup-cell strong{
    font-size:16px;
    line-height:1.25;
    color:#173f56;
}


/* Estremi giornalieri */

.rete-station-panel .rete-popup-daily{
    display:grid;
    grid-template-columns:
        repeat(2,minmax(0,1fr));
    gap:10px;
    padding-top:18px;
    border-top:1px solid #e1eaee;
}

.rete-station-panel .rete-popup-daily > div{
    padding:13px;
    border-radius:13px;
    background:#f6f9fa;
}

.rete-station-panel .rete-popup-daily span{
    display:block;
    margin-bottom:5px;
    font-size:10px;
    font-weight:900;
    text-transform:uppercase;
    color:#80949e;
}

.rete-station-panel .rete-popup-daily strong{
    font-size:16px;
    color:#173f56;
}

.rete-station-panel .rete-popup-update{
    margin-top:18px;
    padding-top:14px;
    border-top:1px solid #e1eaee;
    color:#80929b;
    font-size:11px;
}


/* Mobile: bottom sheet */

@media(max-width:700px){

    .rete-station-panel-backdrop{
        background:rgba(13,35,48,.27);
    }

    .rete-station-panel{
        top:auto;
        right:0;
        bottom:0;
        width:100%;
        height:min(82dvh,760px);
        border-radius:22px 22px 0 0;
        box-shadow:0 -12px 35px rgba(13,45,62,.18);
        transform:translateY(102%);
    }

    .rete-station-panel-shell.open
    .rete-station-panel{
        transform:translateY(0);
    }

    .rete-station-panel-handle{
        display:block;
        width:42px;
        height:4px;
        margin:9px auto 0;
        border-radius:99px;
        background:#ccd8dd;
    }

    .rete-station-panel-close{
        top:17px;
        right:15px;
    }

    .rete-station-panel-content{
        padding:
            17px
            15px
            calc(24px + env(safe-area-inset-bottom));
    }

    .rete-station-panel .rete-popup-head{
        padding-right:48px;
    }

    .rete-station-panel .rete-popup-head h3{
        font-size:24px;
    }

    .rete-station-panel .rete-popup-main{
        padding:17px;
    }

    .rete-station-panel .rete-popup-main strong{
        font-size:31px;
    }
}


/* ============================================================
   PANNELLO STAZIONE MOBILE FULLSCREEN V2
   Solo smartphone: desktop invariato
   ============================================================ */

@media(max-width:700px){

    .rete-station-panel{
        top:0;
        right:0;
        bottom:auto;
        left:0;

        width:100%;
        height:100dvh;
        max-height:none;

        border-radius:0;
        background:#f4f8fa;
        box-shadow:none;

        transform:translateY(102%);
    }

    .rete-station-panel-shell.open
    .rete-station-panel{
        transform:translateY(0);
    }


    /* niente maniglia: ora è una pagina piena */

    .rete-station-panel-handle{
        display:none;
    }


    /* contenuto */

    .rete-station-panel-content{
        padding:
            calc(18px + env(safe-area-inset-top))
            14px
            calc(24px + env(safe-area-inset-bottom));
    }


    /* chiusura */

    .rete-station-panel-close{
        position:fixed;
        top:calc(14px + env(safe-area-inset-top));
        right:14px;

        width:42px;
        height:42px;

        border-radius:50%;
        background:#eaf2f5;
        color:#234b60;

        font-size:27px;
        box-shadow:
            0 2px 8px
            rgba(25,64,83,.08);
    }


    /* intestazione stazione */

    .rete-station-panel
    .rete-popup-head{
        margin:0 0 12px;
        padding:
            4px
            52px
            14px
            2px;

        border-bottom:
            1px solid #dce8ed;
    }

    .rete-station-panel
    .rete-popup-head h3{
        margin:0 0 3px;
        font-size:27px;
        line-height:1.1;
    }

    .rete-station-panel
    .rete-popup-place{
        font-size:13px;
    }

    .rete-station-panel
    .rete-popup-tags{
        margin-top:9px;
        gap:6px;
    }

    .rete-station-panel
    .rete-popup-tag{
        padding:5px 8px;
        font-size:9px;
    }


    /* valore principale */

    .rete-station-panel
    .rete-popup-main{
        margin:0 0 13px;
        padding:14px 16px;

        min-height:auto;

        border:1px solid #dcebf0;
        border-radius:16px;

        background:#eaf5f8;
    }

    .rete-station-panel
    .rete-popup-main span{
        margin-bottom:3px;
        font-size:10px;
    }

    .rete-station-panel
    .rete-popup-main strong{
        font-size:31px;
        line-height:1.05;
    }


    /* titolo dati attuali */

    .rete-station-panel
    .rete-popup-grid::before{
        content:"Dati attuali";

        grid-column:1 / -1;

        display:block;
        margin:
            1px
            2px
            0;

        color:#5f7a88;

        font-size:11px;
        font-weight:900;
        letter-spacing:.04em;
        text-transform:uppercase;
    }


    /* griglia dati più compatta */

    .rete-station-panel
    .rete-popup-grid{
        display:grid;

        grid-template-columns:
            repeat(2,minmax(0,1fr));

        gap:8px;

        margin:0 0 15px;
    }

    .rete-station-panel
    .rete-popup-cell{
        min-height:58px;

        padding:9px 11px;

        border:
            1px solid #dce7eb;

        border-radius:13px;

        background:#fff;
    }

    .rete-station-panel
    .rete-popup-cell span{
        margin-bottom:3px;
        font-size:9px;
        line-height:1.2;
    }

    .rete-station-panel
    .rete-popup-cell strong{
        font-size:15px;
        line-height:1.15;
    }


    /* titolo estremi */

    .rete-station-panel
    .rete-popup-daily::before{
        content:"Estremi di oggi";

        grid-column:1 / -1;

        display:block;
        margin:
            0
            2px
            1px;

        color:#5f7a88;

        font-size:11px;
        font-weight:900;
        letter-spacing:.04em;
        text-transform:uppercase;
    }


    /* estremi */

    .rete-station-panel
    .rete-popup-daily{
        display:grid;

        grid-template-columns:
            repeat(2,minmax(0,1fr));

        gap:8px;

        padding:0;

        border-top:0;
    }

    .rete-station-panel
    .rete-popup-daily > div{
        min-height:55px;

        padding:9px 11px;

        border:
            1px solid #e0e9ed;

        border-radius:12px;

        background:#fff;
    }

    .rete-station-panel
    .rete-popup-daily span{
        margin-bottom:3px;
        font-size:9px;
    }

    .rete-station-panel
    .rete-popup-daily strong{
        font-size:15px;
        line-height:1.15;
    }


    /* aggiornamento */

    .rete-station-panel
    .rete-popup-update{
        margin-top:13px;
        padding-top:11px;

        text-align:center;

        font-size:10px;

        border-top:
            1px solid #dce7eb;
    }

}
