/**
 * Pertuade — Age Gate · CSS responsive viewport-aware (2026-05-12)
 * Cohérent DA V3 : cream / noir / lime / Cormorant + Archivo.
 * Stratégie : clamp() vh-based + max-height dvh + overflow-y fallback.
 * Le HTML est rendu par inc/age-gate.php (critical CSS inline anti-FOUC).
 */

/* ============================================
   AGE GATE — Responsive viewport-aware
   ============================================ */

/* Wrapper plein écran */
.pertuade-age-gate {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 2vh, 2rem);
    background: rgba(245, 241, 234, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-family: 'Archivo', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1A1A1A;
    -webkit-font-smoothing: antialiased;
    opacity: 1;
    transition: opacity 0.5s ease, visibility 0s;
}

.pertuade-age-gate.is-visible {
    display: flex;
}

.pertuade-age-gate.is-hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0s 0.5s;
    pointer-events: none;
}

/* Conteneur intérieur — taille adaptive, jamais plus haut que le viewport */
.pertuade-age-gate-inner {
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100dvh - 1.5rem); /* dvh = dynamic viewport height (iOS URL bar aware) */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: clamp(1.5rem, 4vh, 3rem) clamp(1.5rem, 4vw, 3rem);
    background: white;
    border-radius: 8px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.06),
        0 20px 60px rgba(0, 0, 0, 0.12);
    gap: clamp(0.75rem, 2.5vh, 1.75rem);
}

/* Logo adaptif */
.pertuade-age-gate-logo {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    line-height: 1;
}
.pertuade-age-gate-logo-img {
    display: block;
    width: auto;
    height: auto;
    max-height: clamp(80px, 14vh, 160px);
    max-width: clamp(180px, 35vw, 320px);
    object-fit: contain;
}
.pertuade-age-gate-logo svg {
    width: clamp(32px, 5vh, 44px);
    height: auto;
    fill: #1A1A1A;
    display: block;
}
/* Fallback wordmark (si attachment 102 absent) */
.pertuade-age-gate-wordmark-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}
.pertuade-age-gate-wordmark-wrap .wordmark {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-size: clamp(1.125rem, 2.2vh, 1.5rem);
    letter-spacing: -0.005em;
    line-height: 1;
}
.pertuade-age-gate-wordmark-wrap .wordmark-sub {
    font-size: clamp(0.5rem, 1vh, 0.5625rem);
    color: #8A7F6E;
    margin-top: 6px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    font-weight: 400;
}

/* Titre principal — Cormorant */
.pertuade-age-gate-question {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: clamp(1.5rem, 3.5vh, 2.5rem);
    line-height: 1.1;
    letter-spacing: -0.015em;
    color: #1A1A1A;
    margin: 0;
    max-width: 480px;
}
.pertuade-age-gate-question em {
    font-style: italic;
    font-weight: 300;
}

/* Sous-titre disclaimer alcool */
.pertuade-age-gate-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(0.875rem, 1.8vh, 1.125rem);
    color: #5C5345;
    margin: 0;
    max-width: 420px;
    line-height: 1.45;
}

/* Actions container — stacked column par défaut */
.pertuade-age-gate-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.625rem, 1.5vh, 1rem);
    width: 100%;
    max-width: 280px;
    flex-wrap: nowrap;
    margin: 0;
}

/* Bouton OUI — primaire noir → lime hover */
.pertuade-age-gate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pertuade-age-gate-btn-yes {
    background: #1A1A1A;
    color: #F5F1EA;
    border: 1px solid #1A1A1A;
    padding: clamp(0.75rem, 2vh, 1rem) clamp(1.5rem, 3vw, 2.5rem);
    font-family: inherit;
    font-size: clamp(0.6875rem, 1.3vh, 0.8125rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 600;
    border-radius: 2px;
    width: 100%;
    min-width: 0;
}
.pertuade-age-gate-btn-yes:hover,
.pertuade-age-gate-btn-yes:focus-visible {
    background: #BFFF00;
    color: #1A1A1A;
    border-color: #BFFF00;
}

/* Bouton NON — texte simple souligné */
.pertuade-age-gate-btn-no {
    background: transparent;
    color: #1A1A1A;
    border: none;
    padding: clamp(0.375rem, 1vh, 0.5rem) 0.5rem;
    font-family: inherit;
    font-size: clamp(0.625rem, 1.2vh, 0.75rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: rgba(0, 0, 0, 0.2);
    text-decoration-thickness: 1px;
    margin-left: 0;
    transition: text-decoration-color 0.3s ease, color 0.3s ease;
}
.pertuade-age-gate-btn-no:hover,
.pertuade-age-gate-btn-no:focus-visible {
    color: #1A1A1A;
    text-decoration-color: #1A1A1A;
}

/* Mention santé */
.pertuade-age-gate-disclaimer {
    font-family: 'Archivo', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(0.6875rem, 1.3vh, 0.8125rem);
    color: #8A7F6E;
    letter-spacing: 0.05em;
    font-weight: 400;
    max-width: 520px;
    line-height: 1.5;
    margin: 0;
}

/* ============================================
   EDGE CASE — viewport très court
   (landscape mobile / fenêtre split-screen)
   ============================================ */
@media (max-height: 480px) {
    .pertuade-age-gate-inner {
        flex-direction: row;
        flex-wrap: wrap;
        text-align: left;
        gap: clamp(0.5rem, 1.5vh, 1rem) clamp(1rem, 3vw, 2rem);
        padding: 1rem 1.5rem;
        align-items: center;
        justify-content: center;
    }
    .pertuade-age-gate-logo {
        flex: 0 0 auto;
        max-width: 130px;
    }
    .pertuade-age-gate-logo-img {
        max-height: 80px;
        max-width: 130px;
    }
    .pertuade-age-gate-question {
        font-size: 1.25rem;
        flex: 1 1 200px;
        margin: 0;
    }
    .pertuade-age-gate-subtitle {
        font-size: 0.75rem;
        flex: 1 1 100%;
        margin: 0;
    }
    .pertuade-age-gate-actions {
        flex-direction: row;
        flex: 1 1 100%;
        max-width: none;
        justify-content: center;
        gap: 0.75rem;
    }
    .pertuade-age-gate-btn-yes {
        width: auto;
        flex: 0 0 auto;
        padding: 0.5rem 1.25rem;
    }
    .pertuade-age-gate-disclaimer {
        display: none;
    }
}

/* ============================================
   Mobile portrait (largeur étroite) — refine
   ============================================ */
@media (max-width: 600px) and (min-height: 481px) {
    .pertuade-age-gate-actions {
        max-width: 100%;
    }
}

/* Body lock quand age gate active — affirmé ici en plus du critical CSS */
html.pertuade-age-gate-active,
html.pertuade-age-gate-active body {
    overflow: hidden;
}
body.pertuade-age-gate-active {
    overflow: hidden;
}
