/* Le texte suit le flux de lecture. La réserve d'image garantit que le cadre
   reste rempli pendant toute la course, même en revenant vers le haut. */
html.es2i-public main figure.es-panorama {
    --es-panorama-course: clamp(4rem, 9vw, 9rem);
    display: grid;
    align-content: end;
    isolation: isolate;
    position: relative;
    width: 100%;
    min-height: clamp(24rem, 43vw, 42rem);
    margin: 0;
    padding: 0;
    overflow: clip;
    background: #0a2d3a;
    color: white;
}

.es-panorama > picture {
    position: absolute;
    z-index: -2;
    inset: 0;
    display: block;
    overflow: hidden;
}

html.es2i-public main .es-panorama > picture > img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    object-fit: cover;
    object-position: var(--es-panorama-focus, 50% 50%);
}

.es-panorama::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(0deg, rgb(5 24 33 / .73), transparent 58%),
                linear-gradient(90deg, rgb(5 24 33 / .71), rgb(5 24 33 / .42) 41%, transparent 74%);
}

html.es2i-public main .es-panorama > figcaption {
    box-sizing: border-box;
    width: min(100%, 79rem);
    margin: 0 auto;
    padding: clamp(2rem, 4.6vw, 4.65rem) var(--es-edge, 5vw);
    color: white;
}

html.es2i-public main #wrap .es-panorama figcaption :is(p, a, strong, span),
html.es2i-public main .es-panorama figcaption :is(p, a, strong, span) {
    color: inherit;
}

html.es2i-public main #wrap .es-panorama figcaption p,
html.es2i-public main .es-panorama figcaption p {
    max-width: 23ch;
    margin: 0;
    font: 600 clamp(2rem, 1.18rem + 2.8vw, 4.15rem)/1.04 var(--es-face, "ES2I Barlow Semi Condensed", sans-serif);
    letter-spacing: -.023em;
    text-wrap: balance;
    overflow-wrap: break-word;
}

html.es2i-public main #wrap .es-panorama figcaption a,
html.es2i-public main .es-panorama figcaption a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: .5rem;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.35;
    text-decoration: underline;
    text-underline-offset: .27em;
}

@media (max-width: 47.99rem) {
    html.es2i-public main figure.es-panorama {
        --es-panorama-course: clamp(2.8rem, 12vw, 5rem);
        min-height: clamp(23rem, 106vw, 29rem);
    }
    html.es2i-public main .es-panorama > picture > img {
        object-position: var(--es-panorama-focus-mobile, var(--es-panorama-focus, 50% 50%));
    }
    .es-panorama::after {
        background: linear-gradient(0deg, rgb(5 24 33 / .93), rgb(5 24 33 / .66) 29%, transparent 72%);
    }
}

html.es2i-public main #wrap .es-panorama-credit {
    position: absolute;
    right: var(--es-edge, 4vw);
    bottom: .55rem;
    font: 500 .75rem/1.4 system-ui, sans-serif;
}
html.es2i-public main #wrap .es-panorama-credit a {
    display: inline-block;
    padding: .3rem .55rem;
    border-radius: .2rem;
    color: white;
    background: rgb(5 24 33 / .82);
    text-decoration: underline;
    text-underline-offset: .15em;
}

@keyframes es-panorama-traversee {
    from { transform: translateY(var(--es-panorama-course)); }
    to { transform: translateY(calc(-1 * var(--es-panorama-course))); }
}

@keyframes es-panorama-ouverture {
    from { clip-path: inset(0 3.5%); }
    to { clip-path: inset(0); }
}

@media screen and (prefers-reduced-motion: no-preference) {
    /* Les deux lecteurs existants retirent cet état si l’éditeur, le mode
       statique, l’économie de données ou la réduction de mouvement sont actifs. */
    html.es2i-public:is([data-es2i-motion="on"], :has(.es2i-home.eh-motion)) main .es-panorama:not(.es-photo-collectif, .es-reportage) {
        --es-panorama-animer: 1;
        view-timeline: --es-panorama block;
    }
    html.es2i-public:is([data-es2i-motion="on"], :has(.es2i-home.eh-motion)) main .es-panorama:not(.es-photo-collectif, .es-reportage) > picture > img {
        top: calc(-1 * var(--es-panorama-course));
        height: calc(100% + 2 * var(--es-panorama-course));
        transform: translateY(calc(var(--es-panorama-repli, 0) * var(--es-panorama-course)));
    }
    @supports (animation-timeline: --es-panorama) {
        html.es2i-public:is([data-es2i-motion="on"], :has(.es2i-home.eh-motion)) main .es-panorama:not(.es-photo-collectif, .es-reportage) > picture > img {
            animation: es-panorama-traversee 1s linear both;
            animation-timeline: --es-panorama;
            animation-range: cover 0% cover 100%;
        }
        html.es2i-public:is([data-es2i-motion="on"], :has(.es2i-home.eh-motion)) main .es-panorama:not(.es-photo-collectif, .es-reportage) > picture {
            animation: es-panorama-ouverture 1s ease-out both;
            animation-timeline: --es-panorama;
            animation-range: entry 0% entry 75%;
        }
    }
}

html.es2i-public main figure.es-photo-collectif {
    display: block;
    min-height: 0;
    background: #0a2d3a;
}
:is(.es-photo-collectif, .es-reportage)::after { content: none; }
:is(.es-photo-collectif, .es-reportage) > picture { position: static; z-index: auto; }
html.es2i-public main :is(.es-photo-collectif, .es-reportage) > picture > img {
    position: static;
    height: auto;
    object-fit: contain;
}
html.es2i-public main .es-photo-collectif > figcaption {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .3rem 1.5rem;
    padding-block: clamp(1.15rem, 2.4vw, 2.5rem);
}
html.es2i-public main #wrap .es-photo-collectif figcaption p {
    max-width: none;
    font-size: clamp(1.5rem, 2.65vw, 2.65rem);
}
html.es2i-public main #wrap .es-photo-collectif figcaption a { margin: 0; }
html.es2i-public main #wrap img.es-collectif-agence { object-fit: contain; }

html.es2i-public main figure.es-reportage {
    grid-template-columns: minmax(0, 5fr) minmax(0, 3fr);
    align-items: center;
    min-height: 0;
    background: #0b334a;
}
html.es2i-public main .es-reportage > figcaption {
    width: 100%;
    padding: clamp(1.6rem, 4vw, 4.5rem);
}
html.es2i-public main #wrap .es-reportage figcaption p {
    max-width: 20ch;
    font-size: clamp(1.65rem, 3.2vw, 3.45rem);
    line-height: 1.1;
}
html.es2i-public main #wrap .es-reportage figcaption a {
    margin-top: .9rem;
    color: #aae5db;
}
html.es2i-public main #wrap .es-reportage figcaption a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}
@media (max-width: 47.99rem) {
    html.es2i-public main figure.es-reportage { grid-template-columns: minmax(0, 1fr); }
    html.es2i-public main .es-reportage > figcaption { padding: 1.45rem var(--es-edge, 5vw); }
}
