/* page-editorial.css — ce qui reste volontairement ici (pas Tailwind) :
   - dégradé du bloc contenu (linear-gradient + !important)
   - body::after (calque blanc fixe sous le hero)
   - footer body.page-liste-cartes
   - carousel éditorial simple (contenu dans la colonne, comme les images fixes)
   - bloc texte riche : sélecteurs [style*="font-size:…"]
   Legacy full-bleed : archive/editorial-slider/
   Le container desktop (clamp padding + max-width) est dans page-editorial.php. */

/* Hero : intro + flèche en bas du viewport (fixed + spacer en flux pour le scroll). */
.editorial-hero-bottom-stack {
    bottom: clamp(2rem, 5vh, 3.5rem);
    gap: 1.5rem;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.editorial-scroll-arrow {
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.editorial-scroll-arrow:hover,
.editorial-scroll-arrow:focus-visible {
    opacity: 0.85;
}

/* Équivalent ancien 24px / 32px / 40px, fluide mais plafonné à 40px */
.editorial-intro-text {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
}

@media (min-width: 1024px) {
    .editorial-page:has(.page-liste-cartes-title-filters--lieux) .editorial-hero-bottom-stack {
        bottom: clamp(2.5rem, 6vh, 4rem);
    }

    .editorial-page:has(.page-liste-cartes-title-filters--soutenir) .editorial-hero-bottom-stack {
        padding-right: clamp(6rem, 22vw, 12rem);
    }
}

#editorial-main-content {
    scroll-margin-top: 6rem;
}

/* -------------------------------------------------------------------------
   Contenu des blocs : bien en dessous du hero (évite que le container remonte en haut)
   ------------------------------------------------------------------------- */
/* Dégradé + z-index : bat page-liste-cartes.css (z-20) pour rester au-dessus de la nav verticale (z-60). */
.editorial-page .page-liste-cartes-content.editorial-content {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0, #ffffff 180px, #ffffff 100%) !important;
    z-index: 80 !important;
}

/* Couche blanche fixe sous le hero : évite de voir l’image en bas de page.
   Sur body (ce CSS est chargé uniquement sur la page éditoriale) pour que
   position:fixed soit bien relatif au viewport. */
body::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    /* Calque blanc fixe : on le démarre à 100vh pour que le background hero
       couvre bien toute la hauteur initiale de l'écran. */
    top: 100vh;
    bottom: 0;
    min-height: 100vh;
    background: #ffffff !important;
    z-index: 5; /* hero z=1, contenu z=10 */
    pointer-events: none;
}

/* Footer : doit rester blanc (sinon l’image réapparaît dessous) */
body.page-liste-cartes .site-footer,
body.page-liste-cartes .site-footer.bg-gray-100 {
    background: #ffffff !important;
}

/* Le hero est fixed (z-index:1) : le footer doit passer au-dessus */
body.page-liste-cartes .site-footer {
    position: relative;
    z-index: 120;
}

/* Carousel éditorial : une image à la fois, hauteur fixée par l’image la plus panoramique (JS). */
.editorial-images--slider-contained {
    position: relative;
    width: 100%;
    max-width: 100%;
}

/* Évite le flash / saut avant calcul de hauteur ; pas d’animation reveal sur le carousel. */
.editorial-images--slider-contained:not(.is-layout-ready) {
    visibility: hidden;
}

.editorial-images--slider-contained.is-layout-ready {
    visibility: visible;
}

.editorial-images--slider-contained .editorial-slide.reveal-on-scroll,
.editorial-images--slider-contained.reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

.editorial-images--slider-contained .editorial-slider-viewport {
    width: 100%;
    overflow: hidden;
}

.editorial-images--slider-contained .editorial-slider-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    backface-visibility: hidden;
}

.editorial-images--slider-contained .editorial-slide {
    display: flex;
    flex: 0 0 100%;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 100%;
    margin: 0;
    background-color: #fff;
    overflow: hidden;
}

.editorial-images--slider-contained .editorial-slide-image {
    display: block;
    width: 100%;
    height: 100%;
    vertical-align: top;
}

/* Image la plus panoramique (ou plus large) : remplit le cadre, rognage latéral si besoin. */
.editorial-images--slider-contained .editorial-slide-image--cover {
    object-fit: cover;
    object-position: center;
}

/* Portrait / plus haute : pas de rognage vertical, centrée dans le cadre. */
.editorial-images--slider-contained .editorial-slide-image--contain {
    object-fit: contain;
    object-position: center;
}

.editorial-images--slider-contained .editorial-slider-arrow {
    position: absolute;
    top: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
    transition: opacity 0.2s ease;
}

.editorial-images--slider-contained .editorial-slider-arrow--prev {
    left: 0;
}

.editorial-images--slider-contained .editorial-slider-arrow--next {
    right: 0;
}

.editorial-images--slider-contained .editorial-slider-arrow:hover:not(:disabled),
.editorial-images--slider-contained .editorial-slider-arrow:focus-visible:not(:disabled) {
    opacity: 0.85;
}

.editorial-images--slider-contained .editorial-slider-arrow:disabled {
    cursor: pointer;
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .editorial-images--slider-contained .editorial-slider-track {
        transition: none;
    }
}

/* Bloc texte : formats du menu (Paragraphe / Titre / Citation) */
.editorial-bloc-texte h3 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-primary, #171717);
    margin: 0.35em 0 0;
}

.editorial-bloc-texte h3:first-child {
    margin-top: 0;
}

.editorial-bloc-texte h4 {
    font-size: 22px;
    font-weight: 400;
    line-height: 1.1;
    color: var(--color-page-secondary, var(--color-accent, var(--color-primary, #171717)));
    margin: 0.35em 0 0;
}

.editorial-bloc-texte h4:empty {
    display: none;
    margin: 0;
}

.editorial-bloc-texte h4:first-child {
    margin-top: 0;
}

.editorial-bloc-texte h4 + span,
.editorial-bloc-texte h4 + em,
.editorial-bloc-texte h4 + p {
    display: block;
    margin-top: 0.5rem;
}

.editorial-bloc-texte p {
    font-weight: 400;
    line-height: 1.35;
    margin: 0;
}

.editorial-bloc-texte p + p {
    margin-top: 0.5em;
}

.editorial-bloc-texte sup,
.editorial-bloc-texte sub {
    display: inline;
}

.editorial-bloc-texte sup {
    vertical-align: 0.35em;
    font-size: 0.72em;
}

.editorial-bloc-texte sub {
    vertical-align: sub;
    font-size: 0.75em;
}

.editorial-bloc-texte sup p,
.editorial-bloc-texte sub p {
    display: inline;
    margin: 0;
}

.editorial-bloc-texte p.editorial-text-spacer {
    margin: 0.35em 0;
}

/* Retours à la ligne : <br> visibles (comme sur page liste-cartes) */
.editorial-bloc-texte br,
.prose .editorial-bloc-texte br {
    display: block !important;
    margin-top: 0.65em;
}

/* Citation + attribution : forcer l’attribution à la ligne suivante (span après la citation 22px) */
.editorial-bloc-texte span[style*="font-size: 22px"] {
    display: block;
    white-space: normal;
    word-wrap: break-word;
}

.editorial-bloc-texte span[style*="font-size: 22px"] + span {
    display: block;
    margin-top: 0.5rem;
}

/* Même logique quand l'attribution est encapsulée dans <em> */
.editorial-bloc-texte span[style*="font-size: 22px"] + em {
    display: block;
    margin-top: 0.5rem;
}

/* Espace entre une attribution et la citation suivante (retour visuel du BO) */
.editorial-bloc-texte span + span[style*="font-size: 22px"],
.editorial-bloc-texte em + span[style*="font-size: 22px"] {
    display: block;
    margin-top: 1rem;
}

/* Titres courts (ex: Individuels en 16px) : forcer un retour à la ligne */
.editorial-bloc-texte span[style*="font-size: 16px"] {
    display: inline;
    white-space: normal;
    word-wrap: break-word;
}

/* Variante où le "titre" est saisi en <span style="font-size:16px"><strong>...</strong></span> */
.editorial-bloc-texte > span[style*="font-size: 16px"] {
    display: inline-block;
    width: 100%;
}

.editorial-bloc-texte > span[style*="font-size: 16px"] > strong {
    display: block;
    white-space: normal;
}

/* Titres en texte riche (ex: Groupes / Fermeture annuelle) :
   parfois le BO sort du HTML avec <strong> direct dans le div (pas dans un <p>).
   Forcer un retour à la ligne après le titre. */
.editorial-bloc-texte > strong {
    display: block;
    white-space: normal;
    margin-bottom: 0.35em;
}

.editorial-bloc-texte hr + strong {
    display: block;
    white-space: normal;
    margin-top: 0.15em;
    margin-bottom: 0.35em;
}

/* Titres de blocs (ex: Individuels) : forcer à occuper une ligne entière */
.editorial-bloc-texte p > strong:first-child {
    display: inline-block;
    width: 100%;
}

/* Bloc partenariats : au survol d’un logo lié, les autres passent à 50 % d’opacité. */
.editorial-partenaire-logo {
    transition: opacity 0.2s ease;
}

.editorial-partenariats-logos:has(.editorial-partenaire-link:hover) .editorial-partenaire-logo,
.editorial-partenariats-logos:has(.editorial-partenaire-link:focus-visible) .editorial-partenaire-logo {
    opacity: 0.5;
}

.editorial-partenariats-logos .editorial-partenaire-link:hover .editorial-partenaire-logo,
.editorial-partenariats-logos .editorial-partenaire-link:focus-visible .editorial-partenaire-logo {
    opacity: 1;
}

/* Séparateur épais sous tout le bloc : styles migrés en classes Tailwind */

