/**
 * Popup promozionale della home page.
 *
 * Il markup nasce con l'attributo `hidden`: è il JS a decidere se e quando
 * mostrarlo, in base alle date e a quello che l'utente ha già chiuso.
 *
 * @author Matteo Morena
 */

.ls-home-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease;
}

.ls-home-popup[hidden] {
    display: none;
}

.ls-home-popup.is-visible {
    opacity: 1;
    visibility: visible;
}

.ls-home-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .72);
    cursor: pointer;
}

.ls-home-popup__dialog {
    position: relative;
    max-width: min(92vw, 720px);
    transform: translateY(12px);
    transition: transform .25s ease;
}

.ls-home-popup.is-visible .ls-home-popup__dialog {
    transform: translateY(0);
}

.ls-home-popup__link {
    display: block;
    line-height: 0;
}

.ls-home-popup__image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 85vh;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}

.ls-home-popup__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    line-height: 1;
    color: #1d2327;
    background: #fff;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
    cursor: pointer;
    transition: transform .15s ease;
}

.ls-home-popup__close:hover,
.ls-home-popup__close:focus {
    transform: scale(1.08);
    color: #000;
}

.ls-home-popup__close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

@media (max-width: 782px) {
    .ls-home-popup {
        padding: 24px 16px;
    }

    .ls-home-popup__dialog {
        max-width: 90vw;
    }

    .ls-home-popup__image {
        max-height: 80vh;
    }

    .ls-home-popup__close {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .ls-home-popup,
    .ls-home-popup__dialog,
    .ls-home-popup__close {
        transition: none;
    }
}
