/* =====================================================
   MEDVIR — BLOCK BACKGROUND
   Modes : image | parallax | layers | video
   ===================================================== */

/* -----------------------------------------------------
   WRAPPER
   ----------------------------------------------------- */
   .medvir-bg {
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* -----------------------------------------------------
   COUCHE DE FOND — commune à parallax + layers
   ----------------------------------------------------- */
.medvir-bg__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* parallax desktop natif */
    z-index: 0;
}

/* Image fixe — pas d'effet parallax */
.medvir-bg__bg--static {
    background-attachment: scroll;
}

/* -----------------------------------------------------
   AVANT-PLAN — mode layers uniquement
   ----------------------------------------------------- */
.medvir-bg__fg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    will-change: transform;
    transition: transform 0.1s linear;
    z-index: 1;
    pointer-events: none;
}

/* -----------------------------------------------------
   VIDÉO YOUTUBE / VIMEO
   ----------------------------------------------------- */
.medvir-bg__video-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.medvir-bg__video-wrap iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Ratio 16/9 — couvre toujours le conteneur */
    width: 177.78vh;
    height: 56.25vw;
    min-width: 100%;
    min-height: 100%;
    pointer-events: none;
}

/* -----------------------------------------------------
   VOILE SOMBRE
   ----------------------------------------------------- */
.medvir-bg__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

/* -----------------------------------------------------
   CONTENU (InnerBlocks)
   ----------------------------------------------------- */
.medvir-bg__content {
    position: relative;
    z-index: 3;
}

/* -----------------------------------------------------
   TYPOGRAPHIE HELPER (optionnel — classes utilitaires)
   ----------------------------------------------------- */
.medvir-bg__title {
    color: #fff;
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .4);
    margin-bottom: 1rem;
}

.medvir-bg__subtitle {
    color: rgba(255, 255, 255, .9);
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
    margin-bottom: 1.5rem;
    max-width: 600px;
}

.medvir-bg__cta {
    font-size: 1.1rem;
    padding: .75rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}

.medvir-bg__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
}

/* -----------------------------------------------------
   RESPONSIVE
   ----------------------------------------------------- */
@media (max-width: 768px) {

    /* Légère compensation verticale sur mobile pour le bg fixe / parallax */
    .medvir-bg__bg:not(.medvir-bg__bg--static) {
        inset: -10%;
    }

    /* Iframe vidéo : ratio forcé en vw sur petit écran */
    .medvir-bg__video-wrap iframe {
        width: 300vw;
        height: 168.75vw;
    }
}