/* RALI — bannière premium (v7) : une grande image et trois boutons « vignette + texte + chevron ».
   Maquette 1280 x 360 : la grande image garde ses proportions ; la colonne de droite (environ 22 %) a la même
   hauteur et y répartit les vignettes. Sur ordinateur, les tailles suivent la largeur de la bannière (unités cqw). */
.rali-premium {
    container-type: inline-size;
    display: flex;
    margin: 0 auto;
    max-width: 1280px;
    width: 100%;
}

.rali-premium__main {
    display: block;
    flex: var(--rali-premium-main) 1 0;
    line-height: 0;
    min-width: 0;
}

.rali-premium img {
    display: block;
    height: auto;
    max-width: none;
    width: 100%;
}

.rali-premium__side {
    background: #fff;
    display: flex;
    box-sizing: border-box;
    /* largeur fixée (marges comprises) pour que la grande image garde ses proportions */
    flex: 0 0 calc(100% * var(--rali-premium-side) / (var(--rali-premium-main) + var(--rali-premium-side)));
    flex-direction: column;
    gap: 2cqw;
    min-width: 0;
    padding: 1.25cqw 2.2cqw 1.25cqw 2.3cqw;
}

.rali-premium__button {
    align-items: center;
    color: #1a1a1a;
    display: flex;
    flex: 1 1 0;
    gap: 1.2cqw;
    min-height: 0;
    text-decoration: none;
}

.rali-premium__button:hover,
.rali-premium__button:focus,
.rali-premium__button:visited {
    color: #1a1a1a;
    text-decoration: none;
}

.rali-premium__thumb {
    align-self: stretch;
    border-radius: 1cqw;
    container-type: inline-size;
    display: block;
    flex: 1 1 auto;
    overflow: hidden;
    position: relative;
}

.rali-premium .rali-premium__thumb img {
    height: 100%;
    inset: 0;
    object-fit: cover;
    position: absolute;
    width: 100%;
}

/* Voile sombre sous le texte, puis le texte : blanc, gras, centré ; sa taille suit la largeur de la vignette. */
.rali-premium__label {
    align-items: center;
    background: rgba(0, 0, 0, .3);
    color: #fff;
    display: flex;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 8.2cqw;
    font-weight: 700;
    inset: 0;
    justify-content: center;
    line-height: 1.25;
    overflow-wrap: anywhere;
    padding: 0 6cqw;
    position: absolute;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

/* Cadre rouge au survol et au clavier, posé par-dessus la photo. */
.rali-premium__thumb::after {
    border: 2px solid transparent;
    border-radius: inherit;
    content: '';
    inset: 0;
    pointer-events: none;
    position: absolute;
    transition: border-color .15s ease;
}

.rali-premium__chevron {
    flex: none;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 2cqw;
    font-weight: 700;
    line-height: 1;
    transition: color .15s ease;
}

.rali-premium a.rali-premium__button:focus-visible {
    outline: none;
}

.rali-premium a.rali-premium__button:focus-visible .rali-premium__thumb::after {
    border-color: #ed1c25;
    border-width: max(2px, .25cqw);
}

.rali-premium a.rali-premium__button:focus-visible .rali-premium__chevron {
    color: #ed1c25;
}

@media (hover: hover) and (min-width: 768px) {
    .rali-premium a.rali-premium__button:hover .rali-premium__thumb::after {
        border-color: #ed1c25;
        border-width: max(2px, .25cqw);
    }

    .rali-premium a.rali-premium__button:hover .rali-premium__chevron {
        color: #ed1c25;
    }
}

/* Mobile : bannière pleine largeur, les trois vignettes côte à côte dessous, sans chevron ni survol. */
@media (max-width: 767px) {
    .rali-premium {
        display: block;
    }

    .rali-premium__side {
        flex-basis: auto;
        flex-direction: row;
        gap: 8px;
        padding: 8px;
    }

    .rali-premium__button {
        display: block;
        min-width: 0;
    }

    .rali-premium__thumb {
        aspect-ratio: 1920 / 1000;
        border-radius: 10px;
    }

    .rali-premium__label {
        font-size: 9.2cqw;
        line-height: 1.2;
        padding: 0 4cqw;
    }

    .rali-premium__chevron {
        display: none;
    }

    .rali-premium a.rali-premium__button:focus-visible .rali-premium__thumb::after {
        border-width: 2px;
    }
}

/* Bandeau défilant (Rali_Banner) juste au-dessus : collé à la bannière. */
.page-wrapper .rali-bandeau:has(~ .rali-premium) {
    margin-bottom: 0;
}
