.project-detail__header {
    padding: clamp(6rem, 12vw, 9rem) 0 clamp(2.5rem, 6vw, 4.5rem);
    text-align: center;
}

.project-detail__eyebrow {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-detail__title {
    margin-bottom: 0.5rem;
}

.project-detail__subtitle {
    margin: 0;
    font-size: clamp(1.125rem, 2vw, 1.5rem);
}

.project-detail__content {
    padding-top: clamp(2rem, 5vw, 4rem);
    padding-bottom: clamp(2rem, 5vw, 4rem);
}

.project-detail__hero,
.project-detail__overview,
.project-detail__body,
.project-detail__quote,
.project-detail__client-logo {
    max-width: 58rem;
    margin-inline: auto;
}

.project-detail__overview,
.project-detail__body,
.project-detail__gallery,
.project-detail__quote,
.project-detail__client-logo,
.project-detail__actions {
    margin-top: clamp(2.5rem, 6vw, 5rem);
}

.project-detail h2 {
    margin-bottom: 1.25rem;
}

.project-figure {
    margin: 0;
}

.project-figure a {
    display: block;
    border: 1px solid rgba(0, 0, 0, 0.14);
    background: #ffffff;
    overflow: hidden;
}

.project-figure img {
    display: block;
    width: 100%;
    height: auto;
}

.project-figure figcaption {
    margin-top: 0.65rem;
    font-size: 0.9375rem;
    line-height: 1.45;
}

.project-detail__jump-link {
    font-weight: 700;
}

.project-detail__quote {
    padding: clamp(1.5rem, 4vw, 3rem);
    border-left: 0.35rem solid var(--page-color-secondary);
    background: #ffffff;
}

.project-detail__quote blockquote,
.project-detail__quote p {
    margin: 0;
}

.project-detail__client-logo {
    text-align: center;
}

.project-detail__client-logo img {
    width: auto;
    max-width: min(18rem, 80%);
    max-height: 8rem;
    height: auto;
}

.project-detail__actions {
    text-align: center;
}

.project-pagination {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding-top: 1rem;
    padding-bottom: clamp(3rem, 8vw, 6rem);
}

.project-pagination a {
    display: flex;
    min-height: 7rem;
    padding: 1.25rem;
    flex-direction: column;
    justify-content: center;
    border: 2px solid var(--page-color-secondary);
    color: inherit;
    text-decoration: none;
}

.project-pagination__next a {
    text-align: right;
}

.project-pagination__direction {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.project-pagination__title {
    margin-top: 0.35rem;
    font-size: 1.15rem;
}

@media (max-width: 767.98px) {
    .project-pagination {
        grid-template-columns: 1fr;
    }

    .project-pagination__next a {
        text-align: left;
    }
}

/* Only the featured homepage screenshot is cropped, from the top. */
.project-figure--hero a {
    aspect-ratio: 20 / 11;
    overflow: hidden;
}

.project-figure--hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

/* Preserve the project-color treatment without adding thumbnail borders. */
.pg-project-detail .nk-image-box-overlay {
    background-color: var(--page-color-primary) !important;
    background-color: color-mix(in srgb, var(--page-color-primary) 95%, transparent) !important;
    color: #fff;
}


/*
 * Keep PhotoSwipe controls inside the site's decorative page border.
 * This does not change PhotoSwipe, Isotope, gallery sizing, or image behavior.
 */
.pg-project-detail {
    --eb-page-border-size: 20px;
}

/* The page border is decorative and must never intercept gallery controls. */
.pg-project-detail .nk-page-border,
.pg-project-detail .nk-page-border > div {
    pointer-events: none;
}

/* Move the top controls—including counter, zoom, and close—inside the border. */
#gallery .pswp__top-bar {
    top: var(--eb-page-border-size);
    left: var(--eb-page-border-size);
    width: calc(100% - var(--eb-page-border-size) - var(--eb-page-border-size));
    z-index: 20;
}

/* Move previous/next controls inside the left and right borders. */
#gallery .pswp__button--arrow--left {
    left: var(--eb-page-border-size);
    z-index: 20;
}

#gallery .pswp__button--arrow--right {
    right: var(--eb-page-border-size);
    z-index: 20;
}

/* Keep captions above and inside the bottom border. */
#gallery .pswp__caption {
    right: var(--eb-page-border-size);
    bottom: var(--eb-page-border-size);
    left: var(--eb-page-border-size);
    width: auto;
    z-index: 20;
}

/* Keep all interactive PhotoSwipe UI above the image and overlay layers. */
#gallery .pswp__ui,
#gallery .pswp__counter,
#gallery .pswp__button,
#gallery .pswp__preloader {
    z-index: 21;
}

@media (max-width: 767.98px) {
    .pg-project-detail {
        --eb-page-border-size: 10px;
    }
}

/*
 * Detail-page gallery overlays.
 * Isotope still controls masonry sizing, placement, gaps and animation.
 */
.pg-project-detail .nk-isotope-item .project-gallery-card {
    position: relative;
    border: 0 !important;
    background: transparent;
}

.pg-project-detail .project-gallery-card__link {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: block;
}

.pg-project-detail .project-gallery-card > img {
    display: block;
    width: 100%;
    height: auto;
    border: 0;
    transform: none !important;
    transition: none !important;
}

.pg-project-detail .project-gallery-card:hover > img,
.pg-project-detail .project-gallery-card:focus-within > img {
    transform: none !important;
}

.pg-project-detail .project-gallery-card__overlay {
    z-index: 2;
    pointer-events: none;
    background-color: var(--page-color-primary) !important;
    background-color: color-mix(in srgb, var(--page-color-primary) 93%, transparent) !important;
    color: #fff;
}

.pg-project-detail .project-gallery-card__overlay-content {
    width: min(88%, 24rem);
    margin-inline: auto;
    text-align: center;
}

.pg-project-detail .project-gallery-card__caption {
    font-size: clamp(1rem, 1.7vw, 1.25rem);
    font-weight: 600;
    line-height: 1.4;
}

.pg-project-detail .project-gallery-card__caption > :last-child {
    margin-bottom: 0;
}

.pg-project-detail .project-gallery-card__prompt {
    display: inline-block;
    margin-top: 0.9rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pg-project-detail .project-gallery-card__zoom {
    display: inline-block;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: clamp(2.75rem, 5vw, 4rem);
    font-weight: 300;
    line-height: 1;
}

/* The full screenshot is now the focusable PhotoSwipe link. */
.pg-project-detail .project-gallery-card__link:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -6px;
}

.pg-project-detail .project-gallery-card:focus-within .nk-image-box-overlay {
    opacity: 1;
    visibility: visible;
}

/* Restore the more expressive previous/next project hover and focus states. */
.project-pagination a {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: #fff;
    transition: color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.project-pagination a::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--page-color-secondary);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 220ms ease;
}

.project-pagination__next a::before {
    transform-origin: right center;
}

.project-pagination a > span {
    position: relative;
    z-index: 1;
}

.project-pagination a:hover,
.project-pagination a:focus-visible {
    color: #fff;
    transform: translateY(-4px);
    box-shadow: 0 0.8rem 1.6rem rgba(0, 0, 0, 0.16);
}

.project-pagination a:hover::before,
.project-pagination a:focus-visible::before {
    transform: scaleX(1);
}

.project-pagination a:focus-visible {
    outline: 3px solid var(--page-color-primary);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .project-pagination a,
    .project-pagination a::before {
        transition: none;
    }

    .project-pagination a:hover,
    .project-pagination a:focus-visible {
        transform: none;
    }
}
