/*
 * LM-WP-AVISOS-CSS-V1
 */

.lm-avisos-wp-page{
    width:100%;
}

.lm-aviso-intro{
    margin:7px 0 0;
    font-size:14px;
    opacity:.72;
}

.lm-aviso-region-switcher{
    display:flex;
    align-items:flex-end;
    gap:12px;
    flex-wrap:wrap;
    margin:0 auto 16px;
    max-width:1180px;
}

.lm-aviso-region-switcher label,
.lm-aviso-toolbar label{
    display:flex;
    flex-direction:column;
    gap:5px;
    font-size:12px;
    font-weight:600;
}

.lm-aviso-region-switcher select,
.lm-aviso-toolbar select{
    min-height:42px;
    border:1px solid rgba(120,140,160,.28);
    border-radius:10px;
    padding:7px 34px 7px 11px;
    background:var(--lm-card-bg,#fff);
    color:inherit;
}

.lm-aviso-toolbar{
    display:grid !important;
    grid-template-columns:
        minmax(145px,1fr)
        minmax(180px,1.25fr)
        minmax(145px,1fr);
    gap:10px !important;
    align-items:end;
}

.lm-aviso-valid{
    min-height:24px;
    margin:8px 0 10px;
    font-size:13px;
    text-align:center;
    opacity:.72;
}

.lm-aviso-map-shell{
    position:relative;
    height:min(68vh,720px);
    min-height:520px;
    overflow:hidden;
    cursor:grab;
    touch-action:none;
}

.lm-aviso-map-shell:active{
    cursor:grabbing;
}

#lm-aviso-map{
    width:100%;
    height:100%;
    display:block;
}

.lm-aviso-polygon{
    stroke:rgba(255,255,255,.88);
    stroke-width:1.1px;
    vector-effect:non-scaling-stroke;
    cursor:pointer;
    transition:
        opacity .12s ease,
        filter .12s ease;
}

.lm-aviso-polygon:hover{
    filter:brightness(.94);
}

.lm-aviso-polygon.is-selected{
    stroke:#17202a;
    stroke-width:2.5px;
}

.lm-aviso-nivel-verde{
    fill:#e9eef2;
}

.lm-aviso-nivel-amarelo{
    fill:#f3c623;
}

.lm-aviso-nivel-laranja{
    fill:#ef8b2c;
}

.lm-aviso-nivel-vermelho{
    fill:#d53f3f;
}

.lm-aviso-outline{
    stroke:rgba(35,55,70,.7);
    stroke-width:1.4px;
    vector-effect:non-scaling-stroke;
    pointer-events:none;
}

.lm-aviso-tooltip{
    position:fixed !important;
    z-index:999999;
    pointer-events:none;
    display:none;
    max-width:270px;
    white-space:normal;
}

.lm-aviso-tooltip.is-visible{
    display:block;
}

.lm-aviso-legend{
    position:absolute;
    left:12px;
    bottom:12px;
    display:flex;
    flex-wrap:wrap;
    gap:7px 11px;
    align-items:center;
    padding:8px 10px;
    border-radius:10px;
    border:1px solid rgba(100,120,140,.22);
    background:rgba(255,255,255,.92);
    backdrop-filter:blur(7px);
    font-size:11px;
    line-height:1.2;
    z-index:6;
}

.lm-aviso-leg{
    display:inline-flex;
    align-items:center;
    gap:5px;
    white-space:nowrap;
}

.lm-aviso-leg i{
    display:block;
    width:11px;
    height:11px;
    border-radius:3px;
    border:1px solid rgba(0,0,0,.13);
}

.lm-aviso-leg-sem i{
    background:#e9eef2;
}

.lm-aviso-leg-amarelo i{
    background:#f3c623;
}

.lm-aviso-leg-laranja i{
    background:#ef8b2c;
}

.lm-aviso-leg-vermelho i{
    background:#d53f3f;
}

.lm-aviso-detalhe{
    margin-top:16px;
    border:1px solid rgba(110,130,150,.22);
    border-radius:14px;
    background:var(--lm-card-bg,#fff);
    overflow:hidden;
}

.lm-aviso-detalhe-vazio{
    padding:18px;
    text-align:center;
    font-size:13px;
    opacity:.66;
}

.lm-aviso-detail-head{
    padding:16px 18px 12px;
    border-bottom:1px solid rgba(110,130,150,.16);
}

.lm-aviso-detail-head h2{
    margin:0;
    font-size:19px;
    line-height:1.25;
}

.lm-aviso-detail-sub{
    margin-top:4px;
    font-size:12px;
    opacity:.65;
}

.lm-aviso-cards{
    display:grid;
    grid-template-columns:
        repeat(auto-fit,minmax(260px,1fr));
    gap:10px;
    padding:12px;
}

.lm-aviso-card{
    border:1px solid rgba(110,130,150,.19);
    border-radius:12px;
    padding:13px 14px;
    background:rgba(248,250,252,.72);
}

.lm-aviso-card-top{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    margin-bottom:9px;
}

.lm-aviso-fenomeno{
    font-weight:700;
    font-size:14px;
}

.lm-aviso-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:24px;
    padding:3px 9px;
    border-radius:999px;
    font-size:11px;
    font-weight:700;
}

.lm-aviso-badge-amarelo{
    background:#f3c623;
    color:#242424;
}

.lm-aviso-badge-laranja{
    background:#ef8b2c;
    color:#fff;
}

.lm-aviso-badge-vermelho{
    background:#d53f3f;
    color:#fff;
}

.lm-aviso-desc{
    margin:0 0 8px;
    font-size:13px;
    line-height:1.45;
}

.lm-aviso-meta{
    display:grid;
    gap:3px;
    font-size:12px;
    line-height:1.4;
    opacity:.78;
}

.lm-aviso-sem-ativo{
    padding:16px 18px;
    font-size:13px;
}

.lm-aviso-disclaimer{
    margin-top:16px;
    padding:13px 15px;
    border:1px solid rgba(110,130,150,.18);
    border-radius:12px;
    font-size:11px;
    line-height:1.5;
    opacity:.68;
}

@media (max-width:700px){

    .lm-aviso-toolbar{
        grid-template-columns:1fr !important;
    }

    .lm-aviso-region-switcher{
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:8px;
    }

    .lm-aviso-region-switcher label:only-child{
        grid-column:1/-1;
    }

    .lm-aviso-map-shell{
        height:62vh;
        min-height:430px;
    }

    .lm-aviso-legend{
        right:8px;
        left:8px;
        bottom:8px;
        justify-content:center;
        gap:6px 10px;
    }

    .lm-aviso-cards{
        grid-template-columns:1fr;
        padding:9px;
    }

    .lm-aviso-detail-head{
        padding:14px;
    }
}

#lm-wp-native-viewer[data-lm-theme="dark"] .lm-aviso-legend,
[data-theme="dark"] .lm-aviso-legend{
    background:rgba(23,29,35,.92);
}

#lm-wp-native-viewer[data-lm-theme="dark"] .lm-aviso-card,
[data-theme="dark"] .lm-aviso-card{
    background:rgba(35,42,49,.72);
}


/* ============================================================
   LM-WP-AVISOS-V2-DARK-MODAL
   ============================================================ */


/* ------------------------------------------------------------
   Zoom V2
   ------------------------------------------------------------ */

#lm-aviso-zoom-out{
    display:none !important;
}


/* ------------------------------------------------------------
   DARK MODE
   ------------------------------------------------------------ */

.lm-avisos-wp-page[data-lm-theme="dark"]{
    color:#e8f0f7;
}

.lm-avisos-wp-page[data-lm-theme="dark"]
.lm-aviso-intro{
    color:rgba(220,232,242,.72);
}

.lm-avisos-wp-page[data-lm-theme="dark"]
.lm-aviso-region-switcher label,
#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-toolbar label{
    color:#d9e5ef;
}

.lm-avisos-wp-page[data-lm-theme="dark"]
.lm-aviso-region-switcher select,
#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-toolbar select{
    background:#1b2936 !important;
    border-color:rgba(145,174,199,.25) !important;
    color:#edf4f9 !important;
}

#lm-aviso-viewer[data-lm-theme="dark"]{
    color:#e8f0f7;
}

#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-valid{
    color:rgba(216,229,240,.74);
}

#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-map-shell{
    background:#17232e !important;
    border-color:rgba(139,169,194,.20) !important;
}

#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-nivel-verde{
    fill:#2b3945;
}

#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-polygon{
    stroke:rgba(18,27,35,.82);
}

#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-polygon.is-selected{
    stroke:#f2f7fa;
}

#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-outline{
    stroke:rgba(206,223,236,.64);
}

#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-legend{
    background:rgba(24,35,45,.94) !important;
    border-color:rgba(146,174,197,.20) !important;
    color:#e4edf4 !important;
}

#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-leg-sem i{
    background:#2b3945;
    border-color:rgba(190,208,221,.22);
}

#lm-aviso-viewer[data-lm-theme="dark"]
.lm-zoom-outside{
    color:#dfeaf2;
}

#lm-aviso-viewer[data-lm-theme="dark"]
.lm-zoom button{
    background:#223241 !important;
    border-color:rgba(149,179,203,.22) !important;
    color:#edf5fa !important;
}

#lm-aviso-viewer[data-lm-theme="dark"]
.lm-tooltip{
    background:#17232e !important;
    border-color:rgba(153,181,203,.24) !important;
    color:#edf5fa !important;
    box-shadow:
        0 10px 30px
        rgba(0,0,0,.32) !important;
}

.lm-avisos-wp-page[data-lm-theme="dark"]
.lm-aviso-disclaimer{
    color:rgba(216,228,237,.72);
    border-color:rgba(146,174,197,.18);
}


/* ------------------------------------------------------------
   MODAL — estrutura da homepage
   ------------------------------------------------------------ */

body.lm-avisos-modal-open{
    overflow:hidden !important;
}

.lm-avisos-modal{
    --line:rgba(97,120,140,.22);
    --card:#ffffff;
    --soft:#f5f8fa;
    --text:#203242;
    --muted:#708293;
    --blue:#268fcf;

    position:fixed;
    inset:0;
    z-index:9999999;

    display:flex;
    align-items:center;
    justify-content:center;

    padding:18px;

    box-sizing:border-box;
}

.lm-avisos-modal-backdrop{
    position:absolute;
    inset:0;

    background:
        rgba(9,18,27,.58);

    backdrop-filter:
        blur(3px);
}

.lm-avisos-modal-card{
    position:relative;
    z-index:2;

    width:min(620px,100%);
    max-height:88vh;

    overflow:auto;

    padding:22px;

    border:
        1px solid
        var(--line);

    border-radius:18px;

    background:
        var(--card);

    color:
        var(--text);

    box-shadow:
        0 28px 80px
        rgba(0,0,0,.30);

    box-sizing:border-box;
}

.lm-avisos-modal-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;

    gap:15px;
    margin-bottom:18px;
}

.lm-avisos-modal-kicker{
    color:var(--blue);

    font-size:10px;
    font-weight:900;

    letter-spacing:.08em;
}

.lm-avisos-modal-head h2{
    margin:4px 0 0 !important;
    padding:0 !important;

    color:var(--text) !important;

    font-size:23px !important;
    line-height:1.15 !important;
}

.lm-avisos-modal-subtitulo{
    margin-top:5px;

    color:var(--muted);

    font-size:11px;
}

.lm-avisos-modal-close{
    display:flex;
    align-items:center;
    justify-content:center;

    width:36px;
    min-width:36px;
    height:36px;

    padding:0;

    border:0;
    border-radius:10px;

    background:var(--soft);
    color:var(--text);

    font-size:24px;
    line-height:1;

    cursor:pointer;
}

.lm-avisos-modal-list{
    display:grid;
    gap:12px;
}

.lm-aviso-detalhe-item{
    padding:15px;

    border:
        1px solid
        var(--line);

    border-left:
        5px solid
        var(--lm-aviso-cor);

    border-radius:14px;

    background:
        var(--soft);
}

.lm-aviso-detalhe-top{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;

    gap:12px;
}

.lm-aviso-detalhe-identidade{
    display:flex;
    align-items:center;

    gap:11px;

    min-width:0;
}

.lm-aviso-warning-icon{
    position:relative;

    display:flex;
    align-items:flex-end;
    justify-content:center;

    width:30px;
    min-width:30px;
    height:28px;

    padding-bottom:4px;

    background:
        var(--lm-aviso-cor);

    clip-path:
        polygon(
            50% 0,
            100% 100%,
            0 100%
        );

    box-sizing:border-box;
}

.lm-aviso-warning-icon span{
    color:#fff;

    font-size:13px;
    font-weight:950;

    line-height:1;
}

.lm-aviso-detalhe-fenomeno{
    color:var(--text);

    font-size:14px;
    font-weight:850;

    line-height:1.2;
}

.lm-aviso-detalhe-nivel{
    margin-top:3px;

    color:var(--muted);

    font-size:10px;
    font-weight:750;

    text-transform:uppercase;

    letter-spacing:.035em;
}

.lm-aviso-universal-poluente{
    margin-top:12px;

    color:var(--text);

    font-size:13px;
    font-weight:850;
}

.lm-aviso-universal-descricao{
    margin-top:10px;

    color:var(--text);

    font-size:13px;
    line-height:1.45;
}

.lm-aviso-universal-periodo,
.lm-aviso-universal-pico{
    display:flex;
    align-items:baseline;
    justify-content:space-between;

    gap:12px;

    margin-top:8px;
}

.lm-aviso-universal-periodo span,
.lm-aviso-universal-pico span{
    color:var(--muted);

    font-size:10px;
    font-weight:700;
}

.lm-aviso-universal-periodo strong,
.lm-aviso-universal-pico strong{
    color:var(--text);

    font-size:12px;
    font-weight:800;

    text-align:right;
}

.lm-aviso-modal-sem{
    padding:18px;

    border:
        1px solid
        var(--line);

    border-radius:14px;

    background:var(--soft);

    color:var(--muted);

    font-size:13px;
    text-align:center;
}

.lm-avisos-modal-note{
    margin-top:16px;

    color:var(--muted);

    font-size:10px;
    line-height:1.4;
}


/* ------------------------------------------------------------
   MODAL DARK
   ------------------------------------------------------------ */

.lm-avisos-modal[data-theme="dark"]{
    --line:rgba(145,174,198,.20);
    --card:#192632;
    --soft:#22313e;
    --text:#edf4f9;
    --muted:#a7b7c5;
    --blue:#72c7fa;
}

.lm-avisos-modal[data-theme="dark"]
.lm-avisos-modal-backdrop{
    background:
        rgba(3,8,13,.72);
}

.lm-avisos-modal[data-theme="dark"]
.lm-aviso-warning-icon span{
    color:#ffffff;
}


@media(max-width:700px){

    .lm-avisos-modal{
        padding:10px;
    }

    .lm-avisos-modal-card{
        max-height:92vh;

        padding:17px;

        border-radius:16px;
    }

    .lm-avisos-modal-head h2{
        font-size:20px !important;
    }

    .lm-aviso-universal-periodo,
    .lm-aviso-universal-pico{
        gap:8px;
    }
}



/* ============================================================
   LM-WP-AVISOS-MAP-WHITE-WIDTH-ZOOM-V3
   ============================================================ */


/*
 * Mapa 10% mais estreito.
 */

#lm-aviso-viewer
.lm-aviso-map-shell{
    width:90% !important;
    margin-left:auto !important;
    margin-right:auto !important;
}


/*
 * O mapa mantém exatamente a aparência clara
 * mesmo quando o site está em dark mode.
 *
 * Apenas a interface exterior muda para dark.
 */

#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-map-shell{
    background:#ffffff !important;
}


#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-nivel-verde{
    fill:#e9eef2 !important;
}


#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-polygon{
    stroke:
        rgba(
            255,
            255,
            255,
            .88
        )
        !important;
}


#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-polygon.is-selected{
    stroke:#17202a !important;
}


#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-outline{
    stroke:
        rgba(
            35,
            55,
            70,
            .70
        )
        !important;
}


/*
 * V3:
 * botão zoom out volta a existir.
 */

#lm-aviso-zoom-out{
    display:flex !important;
}


/*
 * Evitar que regra V2 esconda o botão.
 */

#lm-aviso-viewer
#lm-aviso-zoom-out{
    visibility:visible !important;
    opacity:1 !important;
}


@media(max-width:700px){

    /*
     * Também mantemos a redução de 10%
     * no mobile, conforme pedido.
     */
    #lm-aviso-viewer
    .lm-aviso-map-shell{
        width:90% !important;
    }
}


/* ============================================================
   LM-AVISOS-ZOOM-MINUS-CENTER-V1
   ============================================================ */

#lm-aviso-viewer
#lm-aviso-zoom-out{
    display:grid !important;
    place-items:center !important;

    padding:0 !important;

    line-height:1 !important;
    text-align:center !important;

    vertical-align:middle !important;
}


/* ============================================================
   LM-AVISOS-MAP-WIDTH-50-TEST-V1
   Teste temporário para confirmar o elemento correto
   ============================================================ */

#lm-aviso-viewer
.lm-aviso-map-shell{
    width:50% !important;
    margin-left:auto !important;
    margin-right:auto !important;
}

@media(max-width:700px){

    #lm-aviso-viewer
    .lm-aviso-map-shell{
        width:50% !important;
    }

}


/* ============================================================
   LM-AVISOS-MAP-SHELL-100-V1
   A caixa branca volta à largura total
   ============================================================ */

#lm-aviso-viewer
.lm-aviso-map-shell{
    width:100% !important;
    margin-left:auto !important;
    margin-right:auto !important;
}

@media(max-width:700px){

    #lm-aviso-viewer
    .lm-aviso-map-shell{
        width:100% !important;
    }

}


/* ============================================================
   LM-AVISOS-INNER-MAP-WIDTH-V1

   Caixa branca = 100%
   Apenas o SVG/mapa fica mais estreito e centrado.
   ============================================================ */

#lm-aviso-viewer
#lm-aviso-map{
    width:80% !important;
    height:100% !important;

    display:block !important;

    margin-left:auto !important;
    margin-right:auto !important;
}


/* ============================================================
   LM-AVISOS-INNER80-DARKBOX-V1

   - caixa a 100%
   - mapa interno a 80%
   - em dark mode só a caixa fica escura
   - mapa/polígonos mantêm aparência clara
   ============================================================ */

/* Caixa sempre a 100% */
#lm-aviso-viewer
.lm-aviso-map-shell{
    width:100% !important;
    margin-left:auto !important;
    margin-right:auto !important;
}

/* Apenas o mapa interno fica a 80% */
#lm-aviso-viewer
#lm-aviso-map{
    width:80% !important;
    height:100% !important;
    display:block !important;
    margin-left:auto !important;
    margin-right:auto !important;
}

/* Dark mode: apenas a caixa exterior fica escura */
#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-map-shell{
    background:#17232e !important;
    border-color:rgba(139,169,194,.20) !important;
}

/* O mapa continua com aparência clara */
#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-nivel-verde{
    fill:#e9eef2 !important;
}

#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-polygon{
    stroke:rgba(255,255,255,.88) !important;
}

#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-outline{
    stroke:rgba(35,55,70,.70) !important;
}


/* ============================================================
   LM-AVISOS-MOBILE-INNER80-V2

   Desktop:
   mapa interno = 100%

   Mobile:
   mapa interno = 80%

   Caixa branca/escura = sempre 100%
   ============================================================ */

/* Desktop */
#lm-aviso-viewer
#lm-aviso-map{
    width:100% !important;
    height:100% !important;
    display:block !important;
    margin-left:auto !important;
    margin-right:auto !important;
}

/* Apenas mobile */
@media(max-width:700px){

    #lm-aviso-viewer
    #lm-aviso-map{
        width:80% !important;
        margin-left:auto !important;
        margin-right:auto !important;
    }

}


/* ============================================================
   LM-AVISOS-MOBILE-SVG-100-V3

   O dimensionamento visual mobile passa a ser feito
   pelo viewBox JS.

   O SVG continua a ocupar 100% da caixa.
   ============================================================ */

#lm-aviso-viewer
#lm-aviso-map{
    width:100% !important;
    height:100% !important;
    margin-left:0 !important;
    margin-right:0 !important;
}

@media(max-width:700px){

    #lm-aviso-viewer
    #lm-aviso-map{
        width:100% !important;
        height:100% !important;
    }

}


/* ============================================================
   LM-AVISOS-MOBILE-TOUCH-REGION-V2
   ============================================================ */

@media(max-width:700px){

    /*
     * Em 1x permite scroll vertical normal.
     * O JS muda para none automaticamente >1x.
     */
    #lm-aviso-viewer
    .lm-aviso-map-shell{
        touch-action:pan-y;
    }

    /*
     * Região com o mesmo respiro lateral
     * dos restantes controlos.
     */
    #lm-aviso-viewer
    .lm-aviso-region-switcher{
        box-sizing:border-box;
        padding-left:10px;
        padding-right:10px;
    }

}


/* ============================================================
   LM-AVISOS-REMOVE-BOTTOM-GAP-V1
   Remove espaço inferior/reservas vazias nesta página
   ============================================================ */

/*
 * Scope apenas para a página de avisos/template nativo.
 * Mantemos o footer normal, mas removemos folgas/reservas.
 */

body.page-template-page-templates-lm-avisos,
body.page-template-page-templates-lm-avisos-php{
    overflow-x:hidden;
}


/* wrapper principal da página */
body.page-template-page-templates-lm-avisos #main,
body.page-template-page-templates-lm-avisos-php #main,
body.page-template-page-templates-lm-avisos .main-wrap,
body.page-template-page-templates-lm-avisos-php .main-wrap,
body.page-template-page-templates-lm-avisos .content-wrap,
body.page-template-page-templates-lm-avisos-php .content-wrap,
body.page-template-page-templates-lm-avisos .the-page,
body.page-template-page-templates-lm-avisos-php .the-page,
body.page-template-page-templates-lm-avisos article.page,
body.page-template-page-templates-lm-avisos-php article.page{
    margin-bottom:0 !important;
    padding-bottom:0 !important;
    min-height:auto !important;
}


/* conteúdo do viewer */
body.page-template-page-templates-lm-avisos #lm-aviso-viewer,
body.page-template-page-templates-lm-avisos-php #lm-aviso-viewer{
    margin-bottom:0 !important;
    padding-bottom:0 !important;
}


/* último bloco do viewer não deixa folga extra */
body.page-template-page-templates-lm-avisos #lm-aviso-viewer > :last-child,
body.page-template-page-templates-lm-avisos-php #lm-aviso-viewer > :last-child{
    margin-bottom:0 !important;
}


/*
 * Reservas vazias de anúncios / wrappers vazios
 * dentro do conteúdo desta página.
 */
body.page-template-page-templates-lm-avisos .adwrap:empty,
body.page-template-page-templates-lm-avisos-php .adwrap:empty,
body.page-template-page-templates-lm-avisos .adsbygoogle:empty,
body.page-template-page-templates-lm-avisos-php .adsbygoogle:empty,
body.page-template-page-templates-lm-avisos .code-block:empty,
body.page-template-page-templates-lm-avisos-php .code-block:empty,
body.page-template-page-templates-lm-avisos .banner-wrap:empty,
body.page-template-page-templates-lm-avisos-php .banner-wrap:empty,
body.page-template-page-templates-lm-avisos .the-post > .block-wrap:empty,
body.page-template-page-templates-lm-avisos-php .the-post > .block-wrap:empty{
    display:none !important;
    margin:0 !important;
    padding:0 !important;
    min-height:0 !important;
    height:0 !important;
}


/*
 * Se existir um wrapper de publicidade de fim de conteúdo vazio,
 * colapsa sem afetar o footer moneytizer.
 */
body.page-template-page-templates-lm-avisos .post-bottom-share,
body.page-template-page-templates-lm-avisos-php .post-bottom-share,
body.page-template-page-templates-lm-avisos .below-post,
body.page-template-page-templates-lm-avisos-php .below-post{
    margin-bottom:0 !important;
    padding-bottom:0 !important;
}


/* footer encostado de forma uniforme */
body.page-template-page-templates-lm-avisos .main-footer,
body.page-template-page-templates-lm-avisos-php .main-footer{
    margin-top:0 !important;
}


/* espaço final do conteúdo antes do footer */
body.page-template-page-templates-lm-avisos .main-content,
body.page-template-page-templates-lm-avisos-php .main-content,
body.page-template-page-templates-lm-avisos .the-content,
body.page-template-page-templates-lm-avisos-php .the-content{
    margin-bottom:0 !important;
    padding-bottom:0 !important;
}


/* ============================================================
   LM-AVISOS-COLLAPSE-EMPTY-UPPER-FOOTER-V1

   O SmartMag imprime:
   .main-footer .upper-footer .wrap
   mesmo quando está vazio.

   O tema aplica 55px em cima + 55px em baixo.
   Nesta página colapsamos apenas esse bloco vazio.
   ============================================================ */

body.page-template-lm-avisos
.main-footer
.upper-footer,

body.page-template-page-templateslm-avisos-php
.main-footer
.upper-footer{
    display:none !important;
    height:0 !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 !important;
}


/*
 * Segurança adicional:
 * mesmo que outra regra volte a mostrar o wrapper,
 * não pode reservar altura.
 */
body.page-template-lm-avisos
.main-footer
.upper-footer > .wrap,

body.page-template-page-templateslm-avisos-php
.main-footer
.upper-footer > .wrap{
    height:0 !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 !important;
}


/* ============================================================
   LM-AVISOS-FOOTER-MATCH-MAPS-V1

   Mesmo acabamento inferior usado nos mapas.
   ============================================================ */

/* Página: sem altura/margem artificial */
body.page-template-lm-avisos
.lm-avisos-wp-page,
body.page-template-page-templateslm-avisos-php
.lm-avisos-wp-page{
    min-height:0 !important;
    margin-bottom:0 !important;
    padding-bottom:14px !important;
}


/* Viewer sem espaço inferior próprio */
body.page-template-lm-avisos
#lm-aviso-viewer,
body.page-template-page-templateslm-avisos-php
#lm-aviso-viewer{
    margin-bottom:0 !important;
    padding-bottom:0 !important;
}


/* Upper footer vazia: igual aos mapas */
body.page-template-lm-avisos
.main-footer
.upper-footer,
body.page-template-page-templateslm-avisos-php
.main-footer
.upper-footer{
    display:none !important;
    height:0 !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 !important;
}


/* Footer principal: sem reserva adicional */
body.page-template-lm-avisos
.main-footer,
body.page-template-page-templateslm-avisos-php
.main-footer{
    margin-top:0 !important;
    padding-top:0 !important;
    min-height:0 !important;
}


/* Lower footer: exatamente como nos mapas */
body.page-template-lm-avisos
.main-footer
.lower-footer,
body.page-template-page-templateslm-avisos-php
.main-footer
.lower-footer{
    margin:0 !important;
    padding:18px 0 !important;
    min-height:0 !important;
}


/* ============================================================
   LM-AVISOS-REGION-ALIGN-V1

   Desktop:
   - Região alinhada com os restantes controlos
   - seletor ligeiramente maior

   Mobile:
   - margem lateral real no bloco Região
   ============================================================ */


/* ---------------- DESKTOP ---------------- */

@media(min-width:701px){

    #lm-aviso-viewer
    .lm-aviso-region-switcher{
        width:calc(100% - 40px) !important;
        max-width:none !important;
        margin:
            0 20px 16px
            !important;

        box-sizing:border-box;
    }

    #lm-aviso-viewer
    .lm-aviso-region-switcher label{
        width:240px;
        max-width:240px;
    }

    #lm-aviso-viewer
    .lm-aviso-region-switcher select{
        width:240px;
        min-width:240px;
        min-height:46px;
        font-size:15px;
        padding:
            8px 36px 8px 13px;
    }

}


/* ---------------- MOBILE ---------------- */

@media(max-width:700px){

    #lm-aviso-viewer
    .lm-aviso-region-switcher{
        width:calc(100% - 24px) !important;
        max-width:none !important;

        margin:
            0 12px 16px
            !important;

        padding:0 !important;

        box-sizing:border-box;
    }

    #lm-aviso-viewer
    .lm-aviso-region-switcher label{
        width:100%;
        max-width:none;
    }

    #lm-aviso-viewer
    .lm-aviso-region-switcher select{
        width:100%;
        max-width:none;
        box-sizing:border-box;
    }

}


/* ============================================================
   LM-AVISOS-REGION-REAL-SELECTOR-V2

   O region-switcher é irmão do #lm-aviso-viewer,
   não descendente dele.
   ============================================================ */


/* ======================== DESKTOP ======================== */

@media(min-width:701px){

    .lm-avisos-wp-page
    > .lm-aviso-region-switcher{
        width:calc(100% - 120px) !important;
        max-width:1180px !important;

        margin:
            0 auto 16px
            !important;

        box-sizing:border-box !important;
    }


    .lm-avisos-wp-page
    > .lm-aviso-region-switcher
    label{
        width:260px !important;
        max-width:260px !important;
    }


    .lm-avisos-wp-page
    > .lm-aviso-region-switcher
    select{
        width:260px !important;
        min-width:260px !important;

        min-height:46px !important;

        padding:
            8px 38px 8px 13px
            !important;

        font-size:15px !important;

        box-sizing:border-box !important;
    }

}


/* ======================== MOBILE ======================== */

@media(max-width:700px){

    .lm-avisos-wp-page
    > .lm-aviso-region-switcher{
        width:calc(100% - 24px) !important;
        max-width:none !important;

        margin:
            0 12px 16px
            !important;

        padding:0 !important;

        display:grid !important;
        grid-template-columns:1fr !important;

        box-sizing:border-box !important;
    }


    .lm-avisos-wp-page
    > .lm-aviso-region-switcher
    label{
        width:100% !important;
        max-width:none !important;
    }


    .lm-avisos-wp-page
    > .lm-aviso-region-switcher
    select{
        width:100% !important;
        min-width:0 !important;
        max-width:none !important;

        box-sizing:border-box !important;
    }

}


/* ============================================================
   LM-AVISOS-REGION-SAME-VIEWER-V4

   Desktop:
   Região usa exatamente o mesmo eixo horizontal
   do contentor .lm-test / #lm-aviso-viewer.

   Mobile fica intocado.
   ============================================================ */

@media(min-width:701px){

    .lm-avisos-wp-page
    > .lm-aviso-region-switcher{

        width:100% !important;
        max-width:1120px !important;

        margin:
            0 auto 16px
            !important;

        padding:0 !important;

        box-sizing:border-box !important;
    }

}



/* ============================================================
   LM-AVISOS-SVG-ZOOM-RASTO-V1

   Evita artefactos de composição/repaint durante zoom/pan
   com milhares de paths SVG.

   - mantém non-scaling-stroke
   - remove filtros SVG no hover
   - reduz o contorno pesado do polígono selecionado
   ============================================================ */

.lm-aviso-polygon{
    filter:none !important;
}

.lm-aviso-polygon:hover{
    filter:none !important;
    opacity:.92;
}

.lm-aviso-polygon.is-selected{
    stroke:rgba(35,55,70,.90) !important;
    stroke-width:1.6px !important;
}

#lm-aviso-viewer[data-lm-theme="dark"]
.lm-aviso-polygon.is-selected{
    stroke:rgba(35,55,70,.90) !important;
    stroke-width:1.6px !important;
}


/* ============================================================
   LM-AVISOS-OUTLINE-FILL-NONE-V1

   O outline é apenas linha.
   SVG usa fill preto por defeito quando fill não é definido,
   podendo gerar fragmentos pretos durante zoom/repaint.
   ============================================================ */

.lm-aviso-outline{
    fill:none !important;
}


/* LM-AVISOS-LISTA-ABAIXO-MAPA-V1 */
.lm-aviso-lista-panel{
    margin:20px 0;
    padding:18px;
    border:1px solid rgba(110,130,150,.22);
    border-radius:14px;
    background:rgba(248,250,252,.42);
}
.lm-aviso-lista-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:14px;
    margin-bottom:14px;
}
.lm-aviso-lista-head h2{
    margin:0;
    font-size:20px;
    line-height:1.25;
}
.lm-aviso-lista-head p{
    margin:5px 0 0;
    opacity:.72;
    font-size:13px;
}
#lm-aviso-lista-count{
    flex:0 0 auto;
    opacity:.72;
    font-size:13px;
}
.lm-aviso-lista-pesquisa{
    display:block;
    max-width:520px;
    margin:0 0 14px;
    font-size:13px;
    font-weight:600;
}
.lm-aviso-lista-pesquisa span{
    display:block;
    margin-bottom:6px;
}
.lm-aviso-lista-pesquisa input{
    box-sizing:border-box;
    width:100%;
    min-height:42px;
    padding:9px 12px;
    border:1px solid rgba(110,130,150,.3);
    border-radius:10px;
    color:inherit;
    background:rgba(128,145,165,.08);
    font:inherit;
}
.lm-aviso-lista-itens{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
    gap:10px;
}
.lm-aviso-lista-item{
    min-width:0;
    padding:13px 14px;
    border:1px solid rgba(110,130,150,.2);
    border-radius:12px;
    background:rgba(248,250,252,.72);
}
.lm-aviso-lista-item-topo{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
}
.lm-aviso-lista-local{
    font-size:15px;
    line-height:1.3;
}
.lm-aviso-lista-concelho{
    display:block;
    margin-top:3px;
    opacity:.68;
    font-size:12px;
}
.lm-aviso-lista-fenomeno{
    margin-top:10px;
    font-weight:700;
}
.lm-aviso-lista-periodo{
    margin-top:4px;
    opacity:.76;
    font-size:13px;
}
.lm-aviso-lista-vazio{
    grid-column:1/-1;
    margin:0;
    padding:18px 4px;
    opacity:.72;
}
#lm-wp-native-viewer[data-lm-theme="dark"] .lm-aviso-lista-panel,
[data-theme="dark"] .lm-aviso-lista-panel{
    background:rgba(23,29,35,.35);
}
#lm-wp-native-viewer[data-lm-theme="dark"] .lm-aviso-lista-item,
[data-theme="dark"] .lm-aviso-lista-item{
    background:rgba(35,42,49,.72);
}
#lm-wp-native-viewer[data-lm-theme="dark"] .lm-aviso-lista-pesquisa input,
[data-theme="dark"] .lm-aviso-lista-pesquisa input{
    background:rgba(35,42,49,.72);
}
@media(max-width:600px){
    .lm-aviso-lista-panel{padding:14px}
    .lm-aviso-lista-head{display:block}
    #lm-aviso-lista-count{display:block;margin-top:6px}
}


/* LM-AVISOS-PESQUISA-VER-MAIS-V1 */
.lm-aviso-pesquisa-local{
    display:block;
    flex:1 1 220px;
    min-width:200px;
    font-size:13px;
    font-weight:600;
}
.lm-aviso-pesquisa-local span{
    display:block;
    margin-bottom:6px;
}
.lm-aviso-pesquisa-local input{
    box-sizing:border-box;
    width:100%;
    min-height:42px;
    padding:9px 12px;
    border:1px solid rgba(110,130,150,.3);
    border-radius:10px;
    color:inherit;
    background:rgba(128,145,165,.08);
    font:inherit;
}
.lm-aviso-lista-toggle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    margin-top:14px;
    min-height:42px;
    padding:9px 18px;
    border:0;
    border-radius:10px;
    background:#1684b8;
    color:#fff;
    font:inherit;
    font-weight:700;
    cursor:pointer;
}
.lm-aviso-lista-toggle[hidden]{
    display:none!important;
}
#lm-wp-native-viewer[data-lm-theme="dark"] .lm-aviso-pesquisa-local input,
[data-theme="dark"] .lm-aviso-pesquisa-local input{
    background:rgba(35,42,49,.72);
}
@media(max-width:600px){
    .lm-aviso-pesquisa-local{
        flex-basis:100%;
        min-width:0;
    }
    .lm-aviso-lista-toggle{
        width:100%;
    }
}


/* LM-AVISOS-PESQUISA-SUGESTOES-V1 */
.lm-aviso-pesquisa-local {
    position: relative;
    grid-column: 1 / -1;
}
.lm-aviso-localidade-sugestoes {
    position: absolute;
    z-index: 50;
    top: calc(100% - 1px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid rgba(110,130,150,.30);
    border-radius: 0 0 12px 12px;
    background: #fff;
    color: #263746;
    box-shadow: 0 10px 24px rgba(0,0,0,.18);
}
.lm-aviso-localidade-opcao {
    display: block;
    width: 100%;
    padding: 11px 14px;
    border: 0;
    border-bottom: 1px solid rgba(110,130,150,.16);
    background: transparent;
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.lm-aviso-localidade-opcao:hover,
.lm-aviso-localidade-opcao:focus {
    background: rgba(30,130,190,.12);
}
.lm-aviso-localidade-sem-resultados {
    display: block;
    padding: 12px 14px;
    opacity: .72;
}
#lm-aviso-lista-toggle {
    display: block;
    margin: 14px auto 0;
}
#lm-aviso-lista-toggle[hidden] {
    display: none !important;
}
#lm-wp-native-viewer[data-lm-theme="dark"] .lm-aviso-localidade-sugestoes,
[data-theme="dark"] .lm-aviso-localidade-sugestoes {
    background: #1b2632;
    color: #eef3f7;
    border-color: rgba(180,200,220,.25);
}


/* LM-AVISOS-PESQUISA-AO-LADO-DIA-V1 */
@media (min-width: 701px) {
    .lm-aviso-toolbar > .lm-aviso-pesquisa-local {
        grid-column: auto;
    }
}

/* LM-AVISOS-MODAL-MOUSE-V2 */
#lm-aviso-localidade-sugestoes[hidden] {
    display:none !important;
}
#lm-aviso-localidade-sugestoes:not([hidden]) {
    display:block !important;
}
#lm-aviso-localidade-sugestoes .lm-aviso-localidade-opcao {
    display:block !important;
    width:100% !important;
    min-height:46px;
    color:inherit !important;
    background:transparent !important;
    white-space:normal !important;
    text-align:left;
    touch-action:manipulation;
}
#lm-aviso-localidade-sugestoes .lm-aviso-localidade-opcao:hover,
#lm-aviso-localidade-sugestoes .lm-aviso-localidade-opcao:focus {
    background:rgba(120,140,160,.15) !important;
}
