html:has(.article-details-page),
body:has(.article-details-page) {
    overflow-x: clip;
    overflow-y: visible;
}

html:has(.article-details-page):has(.about-photo-modal-backdrop),
body:has(.article-details-page):has(.about-photo-modal-backdrop) {
    overflow: hidden;
}

.article-details-page {
    position: relative;
    isolation: isolate;
    min-height: var(--size-hero-min-height);
    padding: var(--space-36) var(--space-28) var(--space-72);
    background-color: var(--color-home-bg);
}

.article-details-page::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    background-color: var(--color-home-bg);
    background-image: url("/images/collection-background.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    content: "";
    pointer-events: none;
}

.article-details {
    width: min(100%, 82rem);
    margin: 0 auto;
    padding-top: var(--space-108);
}

.article-details-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-8);
    margin: var(--space-12) 0 var(--space-28);
    color: rgba(255, 255, 255, 0.58);
    font-family: var(--font-family-ui-sans);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.article-details-breadcrumbs a,
.article-details-sources a,
.article-details-missing a {
    color: var(--color-home-accent);
    text-underline-offset: 0.22em;
}

.article-details-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    column-gap: var(--space-40);
    align-items: start;
}

.article-details-hero-photo {
    margin: 0;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.article-details-hero-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.article-details-hero h1 {
    margin: -0.3rem 0 0;
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    line-height: 1.08;
    text-wrap: balance;
}

.article-details-body {
    display: grid;
    row-gap: clamp(3.5rem, 7vw, 6.5rem);
    margin-top: var(--space-72);
}

.article-details-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.92fr);
    column-gap: clamp(2.5rem, 5vw, 5.5rem);
    align-items: start;
}

.article-details-section-image-first {
    grid-template-columns: minmax(20rem, 0.92fr) minmax(0, 1fr);
}

.article-details-copy {
    display: grid;
    grid-column: 1;
    row-gap: var(--space-16);
}

.article-details-section-image-first .article-details-copy {
    grid-column: 2;
}

.article-details-copy p {
    width: 100%;
    max-width: 58ch;
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-family: var(--font-family-ui-sans);
    font-size: 1rem;
    line-height: 1.78;
}

.article-details-copy p:has(+ p) {
    text-wrap: pretty;
}

.article-details-copy p:last-child {
    color: rgba(255, 255, 255, 0.92);
}

.article-details-section-wide,
.article-details-section-images-below {
    grid-template-columns: minmax(0, 1fr);
}

.article-details-section-images-below {
    row-gap: var(--space-28);
}

.article-details-section-images-below .article-details-copy,
.article-details-section-images-below .article-details-media {
    grid-column: 1;
}

.article-details-section-images-below .article-details-copy p {
    max-width: none;
}

.article-details-section-images-below .article-details-media {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: clamp(1rem, 2vw, 2rem);
    align-self: start;
    align-items: stretch;
}

.article-details-section-images-below .article-details-photo {
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: end;
    justify-self: center;
    height: 100%;
}

.article-details-section-images-below .about-photo-trigger {
    align-self: end;
    width: auto;
    max-width: 100%;
    height: auto;
}

.article-details-section-images-below .article-details-photo img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: clamp(16rem, 24vw, 22rem);
    background: none;
}

.article-details-section-images-below .article-details-photo figcaption {
    align-self: start;
    text-align: left;
}

.article-details-section-wide .article-details-copy {
    grid-column: 1;
    width: 100%;
    margin: 0;
}

.article-details-section-wide .article-details-copy p {
    max-width: none;
}

.article-details-section-wide .article-details-copy p:last-child {
    margin-top: var(--space-8);
    color: var(--color-home-accent);
    font-family: var(--font-family-display-serif);
    font-size: clamp(1.5rem, 2.8vw, 2.2rem);
    line-height: 1.3;
    text-align: center;
}

.article-details-media {
    display: grid;
    grid-column: 2;
    align-self: stretch;
    align-content: start;
    row-gap: var(--space-28);
}

@media (min-width: 56.251rem) {
    .article-details-media .article-details-photo:last-child {
        position: sticky;
        top: var(--space-24);
    }

    .article-details-section-images-below .article-details-photo {
        position: static;
    }
}

.article-details-section-image-first .article-details-media {
    grid-column: 1;
    grid-row: 1;
}

.article-details-photo {
    display: grid;
    justify-items: start;
    row-gap: var(--space-10);
    width: fit-content;
    max-width: 100%;
    margin: 0;
}

.article-details-photo .about-photo-trigger {
    width: auto;
    max-width: 100%;
}

.article-details-ending-gallery .article-details-photo {
    width: 100%;
}

.article-details-ending-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.5rem, 3vw, 3rem);
    align-items: start;
}

.article-details-ending-gallery .article-details-photo img {
    width: 100%;
    height: clamp(22rem, 44vw, 40rem);
    object-fit: contain;
    object-position: center top;
}

.article-details-ending-gallery:has(> :only-child) {
    grid-template-columns: minmax(0, 42rem);
    justify-content: center;
}

.article-details-ending-gallery:has(> :only-child) .article-details-photo img {
    height: auto;
    max-height: none;
}

.article-details-photo img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 48rem;
    object-fit: contain;
}

.article-details-photo figcaption {
    width: 0;
    min-width: 100%;
    color: rgba(255, 255, 255, 0.62);
    font-family: var(--font-family-ui-sans);
    font-size: 0.78rem;
    line-height: 1.55;
    text-align: left;
}

.article-details-sources {
    display: grid;
    row-gap: var(--space-16);
    width: 100%;
    max-width: none;
    padding-top: var(--space-28);
    border-top: 1px solid rgba(251, 215, 132, 0.34);
}

.article-details-sources h2 {
    margin: 0 0 var(--space-4);
    color: rgba(251, 215, 132, 0.95);
    font-family: var(--font-family-ui-sans);
    font-size: 0.78rem;
    font-weight: var(--font-weight-semi-bold);
    letter-spacing: 0.14em;
    line-height: 1.5;
    text-transform: uppercase;
}

.article-details-sources ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(2rem, 4vw, 4.5rem);
    row-gap: var(--space-14);
    margin: 0;
    padding-left: 1.4rem;
}

.article-details-sources li,
.article-details-sources li span,
.article-details-sources li a {
    color: rgba(255, 255, 255, 0.82);
    font-family: var(--font-family-ui-sans);
    font-size: 0.75rem;
    font-weight: var(--font-weight-regular);
    line-height: 1.65;
}

.article-details-sources li {
    padding-left: var(--space-8);
}

.article-details-sources li a {
    color: var(--color-home-accent);
    text-underline-offset: 0.22em;
}

.article-details-sources a:hover,
.article-details-sources a:focus-visible {
    text-decoration-thickness: 2px;
}

.article-details-missing {
    display: grid;
    justify-items: center;
    row-gap: var(--space-16);
    text-align: center;
}

.article-details-missing h1,
.article-details-missing p {
    margin: 0;
}

.article-details-missing p {
    color: rgba(255, 255, 255, 0.78);
    font-family: var(--font-family-ui-sans);
}

@media (max-width: 56.25rem) {
    .article-details-page {
        padding:
            var(--space-28)
            var(--space-22)
            max(
                var(--space-48),
                calc(
                    var(--site-footer-clearance, var(--space-72))
                    + var(--space-108)
                    + env(safe-area-inset-bottom, 0px)
                )
            );
    }

    .article-details {
        width: min(100%, 34rem);
        padding-top: var(--space-40);
    }

    .article-details-hero,
    .article-details-section,
    .article-details-section-image-first,
    .article-details-section-wide,
    .article-details-section-images-below .article-details-media {
        grid-template-columns: minmax(0, 1fr);
    }

    .article-details-hero {
        row-gap: var(--space-24);
    }

    .article-details-hero h1 {
        margin-top: 0;
        font-size: clamp(1.85rem, 8.5vw, 2.6rem);
    }

    .article-details-breadcrumbs {
        font-size: 0.68rem;
        letter-spacing: 0.04em;
        line-height: 1.5;
    }

    .article-details-body {
        row-gap: var(--space-48);
        margin-top: var(--space-40);
    }

    .article-details-section {
        row-gap: var(--space-28);
    }

    .article-details-copy,
    .article-details-section-image-first .article-details-copy,
    .article-details-media,
    .article-details-section-image-first .article-details-media {
        grid-column: 1;
        grid-row: auto;
    }

    .article-details-section-image-first .article-details-media {
        grid-row: 2;
    }

    .article-details-section-wide .article-details-copy {
        width: 100%;
    }

    .article-details-photo,
    .article-details-section-images-below .article-details-photo {
        justify-self: stretch;
        width: 100%;
        height: auto;
        grid-template-rows: auto auto;
    }

    .article-details-photo .about-photo-trigger,
    .article-details-section-images-below .about-photo-trigger {
        align-self: stretch;
        width: 100%;
    }

    .article-details-photo img,
    .article-details-section-images-below .article-details-photo img,
    .article-details-ending-gallery .article-details-photo img,
    .article-details-ending-gallery:has(> :only-child) .article-details-photo img {
        width: 100%;
        height: auto;
        max-height: none;
    }

    .article-details-photo figcaption,
    .article-details-section-images-below .article-details-photo figcaption {
        width: 100%;
        min-width: 0;
    }

    .article-details-section-wide .article-details-copy p:last-child {
        font-size: clamp(1.28rem, 6.4vw, 1.75rem);
    }

    .article-details-sources ol {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 36rem) {
    .article-details-ending-gallery {
        grid-template-columns: minmax(0, 1fr);
    }

    .article-details-ending-gallery .article-details-photo img {
        height: auto;
        max-height: none;
    }
}

.photo-preview-host .about-photo-modal {
    max-height: calc(100dvh - 2.5rem);
    border: 1px solid rgba(251, 215, 132, 0.34);
    border-radius: 0.65rem;
    background: rgba(3, 13, 9, 0.96);
    padding: var(--space-16) var(--space-16) var(--space-14);
    row-gap: var(--space-14);
}

.photo-preview-host .about-photo-modal img {
    max-height: calc(100dvh - 9.5rem);
}

.article-photo-modal-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: var(--space-12);
    border-top: 1px solid rgba(251, 215, 132, 0.34);
}

.photo-preview-host .about-photo-modal-close {
    min-height: 2.5rem;
    padding: var(--space-8) var(--space-16);
    border: 1px solid rgba(251, 215, 132, 0.45);
    background: transparent;
    color: var(--color-home-accent);
    font-family: var(--font-family-ui-sans);
    font-size: 0.68rem;
    font-weight: var(--font-weight-semi-bold);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        border-color 220ms ease,
        background-color 220ms ease,
        box-shadow 220ms ease;
}

.photo-preview-host .about-photo-modal-close:hover,
.photo-preview-host .about-photo-modal-close:focus-visible {
    border-color: var(--color-home-accent);
    background: rgba(251, 215, 132, 0.08);
    box-shadow: 0 0 16px rgba(251, 215, 132, 0.18);
    outline: none;
}

@media (max-width: 56.25rem) {
    .photo-preview-host .about-photo-modal-backdrop {
        padding:
            max(var(--space-12), env(safe-area-inset-top, 0px))
            max(var(--space-12), env(safe-area-inset-right, 0px))
            max(var(--space-12), env(safe-area-inset-bottom, 0px))
            max(var(--space-12), env(safe-area-inset-left, 0px));
    }

    .photo-preview-host .about-photo-modal {
        width: 100%;
        max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 1.5rem);
        padding: var(--space-12);
        row-gap: var(--space-12);
    }

    .photo-preview-host .about-photo-modal img {
        width: 100%;
        height: auto;
        max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 8rem);
    }

    .photo-preview-host .about-photo-modal-close {
        min-height: 2.75rem;
        padding: var(--space-10) var(--space-16);
    }
}

@media (prefers-reduced-motion: reduce) {
    .photo-preview-host .about-photo-modal-backdrop,
    .photo-preview-host .about-photo-modal,
    .photo-preview-host .about-photo-modal img {
        animation: none;
    }

    .photo-preview-host .about-photo-modal-backdrop.is-closing {
        animation: article-photo-backdrop-out 1ms linear both;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .photo-preview-host .about-photo-modal-backdrop {
        animation: article-photo-backdrop-in 420ms ease-out both;
    }

    .photo-preview-host .about-photo-modal {
        animation: article-photo-modal-in 560ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
    }

    .photo-preview-host .about-photo-modal img {
        animation: article-photo-image-in 640ms cubic-bezier(0.22, 0.61, 0.36, 1) 70ms both;
    }

    .photo-preview-host .about-photo-modal-backdrop.is-closing {
        animation: article-photo-backdrop-out 400ms ease-in both;
    }

    .photo-preview-host .about-photo-modal-backdrop.is-closing .about-photo-modal {
        animation: article-photo-modal-out 360ms ease-in both;
    }

    .photo-preview-host .about-photo-modal-backdrop.is-closing .about-photo-modal img {
        animation: article-photo-image-out 320ms ease-in both;
    }
}

@keyframes article-photo-backdrop-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes article-photo-modal-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes article-photo-image-in {
    from {
        opacity: 0;
        transform: scale(0.965);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes article-photo-backdrop-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes article-photo-modal-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
}

@keyframes article-photo-image-out {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.975);
    }
}
