/* Popup da home (includes/aviso-popup.php). Só é carregado quando há popup ativo. */
.aviso-popup {
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 16px;
    border: 0;
    background: transparent;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-tap-highlight-color: transparent;
}
.aviso-popup[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}
.aviso-popup::backdrop { background: rgba(0, 27, 51, .82); } /* --navy-900 */
.aviso-popup:focus { outline: none; }

.aviso-popup-painel { position: relative; margin: auto; line-height: 0; }

.aviso-popup-arte {
    display: block;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .5);
}
.aviso-popup-arte:focus { outline: none; }
.aviso-popup-arte:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }

/* A menor entre: a largura da tela; a que a altura disponível permite na proporção da arte; e um teto de 900 px de altura. */
.aviso-popup-arte img {
    display: block;
    height: auto;
    width: 90vw;
    width: min(calc(100vw - 32px), calc((100vh - 32px) * var(--aviso-prop)), calc(900px * var(--aviso-prop)));
    width: min(calc(100vw - 32px), calc((100dvh - 32px) * var(--aviso-prop)), calc(900px * var(--aviso-prop)));
}

.aviso-popup-fechar {
    position: absolute;
    top: 10px;
    right: 10px;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    color: var(--navy, #003664);
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
    display: flex;
    align-items: center;
    justify-content: center;
}
.aviso-popup-fechar:hover { background: #fff; }
.aviso-popup-fechar:focus { outline: none; }
.aviso-popup-fechar:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.aviso-popup-fechar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

@media (prefers-reduced-motion: no-preference) {
    .aviso-popup[open] { animation: aviso-popup-entra .22s ease-out; }
    .aviso-popup[open] .aviso-popup-painel { animation: aviso-popup-sobe .28s cubic-bezier(.2, .8, .2, 1); }
}
@keyframes aviso-popup-entra { from { opacity: 0; } }
@keyframes aviso-popup-sobe { from { opacity: 0; transform: translateY(14px) scale(.98); } }
