/**
 * Consenso ai contenuti di terze parti — banner e avviso "Carica video"
 * (assets/js/consent.js). Sfondo scuro coerente col sito; "Rifiuta" e "Accetta" hanno lo stesso peso visivo.
 */

/* ---------------------------------------------------------------------
 * Banner
 * ------------------------------------------------------------------ */
.mecena-consent {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-cookie, 9000);
    background: rgba(15, 15, 15, 0.97);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1.25rem max(1.25rem, env(safe-area-inset-right)) calc(1.25rem + env(safe-area-inset-bottom, 0px)) max(1.25rem, env(safe-area-inset-left));
    color: var(--colore-testo, #fff);
    font-family: var(--font-principale, 'Jost', sans-serif);
    animation: mecena-consent-in 0.35s ease-out;
}

@keyframes mecena-consent-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mecena-consent__inner {
    position: relative;
    max-width: 68.75rem;
    margin: 0 auto;
    padding-right: 2.5rem; /* spazio per la X */
    display: grid;
    gap: 0.5rem 2rem;
    grid-template-columns: 1fr auto;
    align-items: center;
}

.mecena-consent__title {
    grid-column: 1 / -1;
    margin: 0;
    font-size: var(--testo-sm, 0.95rem);
    font-weight: var(--font-peso-medium, 500);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.mecena-consent__text {
    margin: 0;
    font-size: var(--testo-sm, 0.95rem);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.85);
}

.mecena-consent__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.mecena-consent__btn,
.mecena-gate__btn {
    min-height: 44px;
    min-width: 7.5rem;
    padding: 0.6rem 1.25rem;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 2px;
    font: inherit;
    font-size: var(--testo-sm, 0.95rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mecena-consent__btn:hover,
.mecena-gate__btn:hover {
    background: #fff;
    color: #000;
}

.mecena-consent__link,
.mecena-gate__link {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--testo-sm, 0.95rem);
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 0.75rem 0;
}

.mecena-consent__link:hover,
.mecena-gate__link:hover {
    color: #fff;
}

.mecena-consent__close {
    position: absolute;
    top: -0.35rem;
    right: -0.5rem;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 0;
    cursor: pointer;
}

.mecena-consent__close:hover {
    color: #fff;
}

@media (max-width: 767px) {
    .mecena-consent__inner {
        grid-template-columns: 1fr;
    }

    .mecena-consent__actions {
        width: 100%;
    }

    .mecena-consent__btn {
        flex: 1 1 0;
    }
}

/* ---------------------------------------------------------------------
 * Avviso al posto di un video di terzi
 * ------------------------------------------------------------------ */
.mecena-embed {
    position: relative;
    width: 100%;
}

/* Il contenitore 16:9 del blocco editoriale ha già l'altezza: il segnaposto/iframe lo riempie */
.slide-editorial__video-wrap .mecena-embed {
    position: absolute;
    inset: 0;
    height: 100%;
}

.mecena-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.mecena-gate {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.25rem;
    text-align: center;
    background: rgba(8, 8, 8, 0.88);
    color: #fff;
    font-family: var(--font-principale, 'Jost', sans-serif);
}

.mecena-gate__text {
    margin: 0;
    max-width: 34rem;
    font-size: var(--testo-sm, 0.95rem);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.88);
}

.mecena-gate__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
    .mecena-consent {
        animation: none;
    }
}
