/*
 * Integration contract: WordPress prints shortcodes as direct children of
 * either the classic entry content or the block-theme post content wrapper.
 * Neutralize only that wrapper when the global Home header is its first node.
 */
body.uoph-has-header-carousel > #site-header.site-header {
    padding-block: 0 !important;
}

body.uoph-has-header-carousel :is(.entry-content, .wp-block-post-content):has(> .uoph-public-home-header:first-child) {
    margin-block-start: 0 !important;
    padding-block-start: 0 !important;
}

body.uoph-has-header-carousel .entry-content > .uoph-public-home-header:first-child + .uoph-atelier,
body.uoph-has-header-carousel .wp-block-post-content > .uoph-public-home-header:first-child + .uoph-atelier {
    margin-block-start: 0 !important;
}

.uoph-header-carousel {
    --uoph-carousel-bg: #e9e3d6;
    --uoph-carousel-card-width: clamp(15rem, 43.5vw, 31.5rem);
    --uoph-carousel-gap: clamp(1rem, 2.5vw, 2.5rem);
    --uoph-carousel-gutter: clamp(1rem, 4vw, 4rem);
    --uoph-carousel-radius: clamp(2rem, 4vw, 4rem);
    --uoph-carousel-white: #fff;
    --uoph-carousel-ink: #191816;
    --uoph-carousel-font: "UOPH Gilroy", "UOPH Gilroy Fallback", Arial, Helvetica, sans-serif;

    position: relative;
    inline-size: 100vw !important;
    width: 100vw !important;
    max-inline-size: none !important;
    max-width: none !important;
    min-block-size: 100svh;
    margin-block: 0 !important;
    margin-inline: calc(50% - 50vw) !important;
    padding-inline: 0 !important;
    overflow: hidden;
    color: var(--uoph-carousel-ink);
    background: transparent;
    font-family: var(--uoph-carousel-font);
    box-sizing: border-box;
}

.uoph-header-carousel *,
.uoph-header-carousel *::before,
.uoph-header-carousel *::after {
    box-sizing: border-box;
}

.uoph-header-carousel__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: var(--uoph-carousel-card-width);
    align-items: center;
    gap: var(--uoph-carousel-gap);
    min-block-size: 100svh;
    padding-block: clamp(2rem, 7vh, 5rem);
    padding-inline: max(
        var(--uoph-carousel-gutter),
        calc((100% - var(--uoph-carousel-card-width)) / 2)
    );
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scroll-padding-inline: max(
        var(--uoph-carousel-gutter),
        calc((100% - var(--uoph-carousel-card-width)) / 2)
    );
    scroll-snap-type: inline mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    cursor: grab;
}

.uoph-header-carousel__track::-webkit-scrollbar {
    display: none;
}

.uoph-header-carousel__track.is-dragging {
    scroll-behavior: auto;
    scroll-snap-type: none;
    cursor: grabbing;
    user-select: none;
}

.uoph-header-carousel__slide {
    inline-size: var(--uoph-carousel-card-width);
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

.uoph-header-carousel__container {
    inline-size: 100%;
}

.uoph-header-carousel button.uoph-header-carousel__card {
    all: unset;
    position: relative;
    isolation: isolate;
    display: block !important;
    width: 100% !important;
    inline-size: 100% !important;
    min-width: 0 !important;
    min-inline-size: 0 !important;
    max-width: none !important;
    max-inline-size: none !important;
    height: auto !important;
    block-size: auto !important;
    aspect-ratio: 3 / 4 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: var(--uoph-carousel-radius) !important;
    appearance: none !important;
    background: #fff !important;
    box-shadow: none;
    box-sizing: border-box !important;
    cursor: zoom-in;
}

.uoph-header-carousel__card:focus-visible {
    outline: 0.2rem solid currentColor;
    outline-offset: 0.2rem;
}

.uoph-header-carousel__expand-indicator {
    position: absolute;
    z-index: 3;
    inset-block-start: clamp(0.78125rem, 1.5vw, 1.25rem);
    inset-inline-end: clamp(0.78125rem, 1.5vw, 1.25rem);
    display: grid;
    place-items: center;
    inline-size: 56.390625px;
    block-size: 56.390625px;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    pointer-events: none;
    scale: 0.75;
    transform-origin: top right;
}

.uoph-header-carousel__expand-indicator svg {
    display: block;
    inline-size: 26.53676471px;
    block-size: 26.53676471px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform: rotate(90deg);
}

.uoph-header-carousel__card--dark .uoph-header-carousel__expand-indicator {
    border-color: #191816;
    color: #191816;
}

.uoph-header-carousel__card-headline {
    position: absolute;
    z-index: 3;
    inset-block-start: 1.875rem;
    inset-inline-start: 1.875rem;
    display: block;
    width: calc(100% - 6.25rem);
    max-width: calc(100% - 6.25rem);
    margin: 0;
    overflow: visible;
    color: #fff;
    font-family: "UOPH Gilroy", "UOPH Gilroy Fallback", Arial, Helvetica, sans-serif;
    font-size: clamp(1.5rem, 2.25vw, 2.25rem);
    font-weight: 400;
    line-height: 1.1;
    text-align: start;
    pointer-events: none;
}

.uoph-header-carousel__card--dark .uoph-header-carousel__card-headline {
    color: #191816;
}

.uoph-header-carousel__picture {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.uoph-header-carousel__image {
    position: absolute;
    z-index: 1;
    inset-block: 0;
    inset-inline-start: 50%;
    display: block;
    width: auto !important;
    inline-size: auto !important;
    height: 100% !important;
    block-size: 100% !important;
    max-width: none !important;
    max-inline-size: none !important;
    object-fit: cover;
    object-position: center;
    transform: translateX(-50%);
    user-select: none;
    -webkit-user-drag: none;
}

.uoph-header-carousel__lightbox-headline {
    display: none;
}

.uoph-gallery-lightbox .uoph-gallery-lightbox__picture.uoph-header-carousel__lightbox-source {
    position: relative;
}

.uoph-gallery-lightbox .uoph-header-carousel__lightbox-headline {
    position: absolute;
    z-index: 1;
    inset-block: 0;
    inset-inline: auto 0;
    display: grid;
    place-items: center;
    inline-size: 33.333333%;
    padding: clamp(1.5rem, 4vw, 4rem);
    color: #191816;
    background: radial-gradient(
        ellipse 115% 42% at 72% 55%,
        rgb(255 255 255 / 94%) 0%,
        rgb(255 255 255 / 82%) 56%,
        rgb(255 255 255 / 0%) 100%
    );
    font-family: "UOPH Gilroy", "UOPH Gilroy Fallback", Arial, Helvetica, sans-serif;
    font-size: clamp(0.75rem, 1.7vw, 1.875rem);
    font-weight: 400;
    line-height: 1.05;
    text-align: center;
    pointer-events: none;
}

.uoph-header-carousel__card::after {
    content: "";
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
    background: none;
}

.uoph-header-carousel__card--dark::after {
    background: none;
}

.uoph-public-home-header {
    position: absolute;
    z-index: 100;
    inset-block-start: 0;
    inset-inline: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    block-size: 16svh;
    pointer-events: none;
}

.uoph-public-home-header__logo {
    display: block;
    inline-size: var(--uoph-brand-logo-inline-size);
    block-size: auto;
    aspect-ratio: 717 / 502;
}

.uoph-header-carousel__cta-row {
    position: absolute;
    z-index: 8;
    inset-inline-start: 50%;
    inset-block-start: var(--uoph-carousel-cta-center, 90%);
    display: flex;
    justify-content: center;
    translate: -50% -50%;
}

html body .uoph-header-carousel button.uoph-header-carousel__cta,
html body .uoph-header-carousel button.uoph-header-carousel__cta:hover,
html body .uoph-header-carousel button.uoph-header-carousel__cta:focus,
html body .uoph-header-carousel button.uoph-header-carousel__cta:focus-visible,
html body .uoph-header-carousel button.uoph-header-carousel__cta:active {
    font-family: "UOPH Gilroy", "UOPH Gilroy Fallback", Arial, Helvetica, sans-serif !important;
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
}

@media (min-width: 80rem) and (hover: hover) and (pointer: fine) {
    .uoph-header-carousel {
        --uoph-carousel-card-width: min(
            clamp(16.5rem, 47.85vw, 34.65rem),
            57.2svh
        );
    }
}

@media (max-width: 47.99rem) {
    .uoph-header-carousel {
        --uoph-carousel-card-width: min(
            calc(100vw - 4.25rem),
            calc(63svh - 2.71875rem)
        );
        --uoph-carousel-gap: 0.625rem;
        --uoph-carousel-radius: 2.25rem;
    }

    .uoph-header-carousel__track {
        padding-block: 3.6875rem calc(3.5rem + 56.4px + 0.3125rem);
    }

    .uoph-header-carousel__cta-row {
        inset-block-start: auto;
        inset-block-end: 1.75rem;
        translate: -50% 0;
    }

    .uoph-header-carousel button.uoph-header-carousel__card {
        aspect-ratio: 3 / 5 !important;
    }

}

@media (prefers-reduced-motion: reduce) {
    .uoph-header-carousel__track {
        scroll-behavior: auto;
    }

    .uoph-header-carousel__cta-icon,
    .uoph-header-carousel__cta {
        transition: none;
    }
}

.uoph-header-carousel__expanded {
    --uoph-overlay-duration: 240ms;
    --uoph-overlay-easing: cubic-bezier(0.2, 0, 0, 1);
    --uoph-carousel-bg: #e9e3d6;
    --uoph-carousel-ink: #191816;
    position: fixed;
    inset: 0;
    z-index: 100001;
    inline-size: 100dvw;
    block-size: 100dvh;
    max-inline-size: none;
    max-block-size: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    color: var(--uoph-carousel-ink);
    background: var(--uoph-carousel-bg);
    pointer-events: none;
    transition: opacity var(--uoph-overlay-duration) var(--uoph-overlay-easing);
    box-sizing: border-box;
}

.uoph-header-carousel__expanded *,
.uoph-header-carousel__expanded *::before,
.uoph-header-carousel__expanded *::after {
    box-sizing: border-box;
}

body.uoph-editorial-overlay-open {
    overflow: hidden !important;
}

.uoph-header-carousel__expanded[hidden] {
    display: none;
}

.uoph-header-carousel__expanded.is-open {
    opacity: 1;
    pointer-events: auto;
}

.uoph-header-carousel__expanded-toolbar {
    position: sticky !important;
    inset-block-start: 0 !important;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-block-size: calc(56.4px + max(2rem, env(safe-area-inset-top)));
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 1rem max(1rem, env(safe-area-inset-left));
    background: transparent;
    background-image: none;
    pointer-events: none;
}

.uoph-header-carousel__expanded button.uoph-header-carousel__expanded-close {
    grid-column: 3;
    justify-self: end;
    border-color: var(--uoph-carousel-ink) !important;
    color: var(--uoph-carousel-ink) !important;
    background: var(--uoph-carousel-bg) !important;
    background-image: none !important;
    pointer-events: auto;
}

.uoph-header-carousel__expanded button.uoph-header-carousel__expanded-close:hover,
.uoph-header-carousel__expanded button.uoph-header-carousel__expanded-close:focus,
.uoph-header-carousel__expanded button.uoph-header-carousel__expanded-close:focus-visible,
.uoph-header-carousel__expanded button.uoph-header-carousel__expanded-close:active {
    border-color: var(--uoph-carousel-ink) !important;
    color: var(--uoph-carousel-ink) !important;
    background: var(--uoph-carousel-bg) !important;
    background-image: none !important;
}

.uoph-header-carousel__expanded button.uoph-header-carousel__expanded-close:focus-visible {
    outline: 2px solid var(--uoph-carousel-ink) !important;
    outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
    .uoph-header-carousel__expanded button.uoph-header-carousel__expanded-close:hover { transform: rotate(90deg); }
}

.uoph-header-carousel__expanded-scene {
    inline-size: min(90rem, 100%);
    min-block-size: 100vh;
    margin-inline: auto;
    padding: clamp(2.5rem, 5vw, 5rem) max(1.5rem, 7vw) clamp(8rem, 14vw, 13rem);
    opacity: 0;
    transform: scale(0.98);
    transition: opacity var(--uoph-overlay-duration) var(--uoph-overlay-easing), transform var(--uoph-overlay-duration) var(--uoph-overlay-easing);
}

.uoph-header-carousel__expanded.is-open .uoph-header-carousel__expanded-scene {
    opacity: 1;
    transform: scale(1);
}

.uoph-header-carousel__expanded-intro,
.uoph-header-carousel__expanded-articles {
    text-align: center;
}

.uoph-header-carousel__expanded-intro h2 {
    max-inline-size: 52rem;
    margin: 0 auto;
    font: 800 clamp(3.625rem, 8vw, 9.25rem) / 0.9 "UOPH Gilroy", "UOPH Gilroy Fallback", Arial, Helvetica, sans-serif;
    letter-spacing: -0.055em;
}

.uoph-header-carousel__expanded-intro h2:focus:not(:focus-visible) {
    outline: none;
}

.uoph-header-carousel__expanded-intro h2:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 0.5rem;
}

.uoph-header-carousel__expanded-intro p,
.uoph-header-carousel__expanded-article p {
    font-family: "UOPH Gilroy", "UOPH Gilroy Fallback", Arial, Helvetica, sans-serif;
    font-weight: 400;
}

.uoph-header-carousel__expanded-intro p {
    max-inline-size: 45rem;
    margin: clamp(1.5rem, 3vw, 2.75rem) auto 0;
    font-size: clamp(1.5rem, 2.4vw, 2.625rem);
}

.uoph-header-carousel__expanded-intro-media {
    inline-size: min(45rem, 100%);
    margin: clamp(3rem, 6vw, 6rem) auto 0;
}

.uoph-header-carousel__expanded-intro-image {
    display: block;
    inline-size: 100%;
    max-inline-size: 100%;
    block-size: auto;
    margin-inline: auto;
    object-fit: contain;
}

.uoph-header-carousel__expanded-articles {
    inline-size: min(70rem, 100%);
    margin: clamp(3rem, 6vw, 6rem) auto 0;
}

.uoph-header-carousel__expanded-article {
    display: flex;
    min-block-size: clamp(22rem, 48vh, 38rem);
    padding-block: clamp(4rem, 7vw, 7rem);
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.uoph-header-carousel__expanded-article + .uoph-header-carousel__expanded-article {
    border-block-start: 1px solid rgb(25 24 22 / 18%);
}
.uoph-header-carousel__expanded-article h3 { margin: 0; font: 400 clamp(2rem, 4.4vw, 4.75rem) / 1 "UOPH Gilroy", "UOPH Gilroy Fallback", Arial, Helvetica, sans-serif; }
.uoph-header-carousel__expanded-article p { max-inline-size: 44rem; margin: 1.5rem auto 0; font-size: clamp(1.125rem, 1.8vw, 1.75rem); line-height: 1.35; }

@media (prefers-reduced-motion: reduce) {
    .uoph-header-carousel__expanded,
    .uoph-header-carousel__expanded-scene { transition: none !important; transform: none !important; }
}
