.detail-shell {
    max-width: 1280px;
    margin: auto;
    padding: 36px
}

.back-link {
    text-decoration: none;
    color: var(--muted);
    font-size: 14px
}

.detail-layout {
    display: grid;
    grid-template-columns:minmax(340px, .72fr) minmax(0, 1.28fr);
    align-items: start;
    gap: 72px;
    margin: 28px 0 100px
}

.detail-cover {
    height: 650px;
    background: var(--cream);
    border-radius: 24px;
    overflow: hidden
}

.detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.detail-info {
    padding: 0
}

.detail-info h1 {
    font-size: clamp(3.2rem, 6vw, 5.6rem);
    margin: 20px 0 12px
}

.detail-meta {
    font-size: 18px;
    color: var(--muted)
}

.detail-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--forest)
}

.detail-description {
    margin: 28px 0;
    font-size: 17px;
    border-top: 1px solid var(--line);
    padding-top: 28px
}

.secondary-link {
    display: block;
    margin-top: 18px;
    font-weight: 700;
    color: var(--forest)
}

.photo-open {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
    position: relative;
    color: white
}

.photo-open--cover span {
    position: absolute;
    right: 18px;
    bottom: 18px;
    padding: 8px 13px;
    border-radius: 999px;
    background: #17291fcc;
    font: 600 12px Manrope, sans-serif;
    opacity: 0;
    transform: translateY(5px);
    transition: .25s
}

.photo-open--cover:hover span, .photo-open--cover:focus-visible span {
    opacity: 1;
    transform: none
}

.photo-open:focus-visible {
    outline: 3px solid var(--terracotta);
    outline-offset: -5px
}

.long-description {
    display: grid;
    grid-template-columns:1fr;
    gap: 28px;
    margin: 0 0 110px;
    padding: 72px;
    background: var(--cream);
    border-radius: 28px
}

.long-description h2 {
    margin: 12px 0 0;
    font-size: clamp(2.25rem, 3.2vw, 3.5rem);
    overflow-wrap: anywhere
}

.long-description__text {
    font-size: clamp(17px, 1.5vw, 20px);
    line-height: 1.85
}

.long-description__text p:last-child {
    margin-bottom: 0
}

.parents-section {
    padding-bottom: 110px
}

.parents {
    display: grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 864px
}

.parents .dog-card {
    width: 100%;
    height: 100%
}

.parents .dog-card__photo {
    height: 300px
}

.parents .dog-card__body {
    min-height: 142px
}

.large-gallery {
    padding-bottom: 100px
}

.gallery-total {
    color: var(--muted);
    font-size: 14px
}

.large-gallery__grid {
    display: grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap: 22px
}

.large-gallery figure {
    height: 500px;
    margin: 0;
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    background: var(--cream)
}

.large-gallery__lead {
    grid-column: 1/-1;
    height: 680px !important
}

.large-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease
}

.large-gallery figure:hover img {
    transform: scale(1.02)
}

.large-gallery figcaption {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 16px;
    width: max-content;
    max-width: calc(100% - 36px);
    padding: 8px 12px;
    border-radius: 10px;
    background: #17291fcc;
    color: white;
    font-size: 13px;
    pointer-events: none
}

.lightbox[hidden] {
    display: none
}

.lightbox {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    grid-template-columns:80px minmax(0, 1fr) 80px;
    align-items: center;
    padding: 56px 28px 42px;
    background: #101713ed;
    backdrop-filter: blur(10px);
    animation: lightbox-in .2s ease
}

.lightbox__figure {
    height: calc(100vh - 110px);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center
}

.lightbox__figure img {
    max-width: 100%;
    max-height: calc(100% - 42px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 70px #0008
}

.lightbox__figure figcaption {
    margin-top: 14px;
    color: #e9eee9;
    font-size: 14px
}

.lightbox__close, .lightbox__arrow {
    border: 1px solid #ffffff4d;
    background: #15231dcc;
    color: white;
    cursor: pointer;
    transition: .2s
}

.lightbox__close:hover, .lightbox__arrow:hover {
    background: white;
    color: var(--ink)
}

.lightbox__close {
    position: absolute;
    right: 24px;
    top: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 30px;
    line-height: 1
}

.lightbox__arrow {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 21px;
    justify-self: center
}

.lightbox__counter {
    position: absolute;
    left: 24px;
    top: 27px;
    color: #d7ded9;
    font-size: 13px;
    letter-spacing: .12em
}

.lightbox-open {
    overflow: hidden
}

@keyframes lightbox-in {
    from {
        opacity: 0
    }
    to {
        opacity: 1
    }
}

@media (max-width: 850px) {
    .detail-shell {
        padding: 18px 20px 48px
    }

    .detail-layout {
        display: flex;
        flex-direction: column;
        gap: 0;
        margin: 14px 0 52px
    }

    .detail-info {
        display: contents
    }

    .detail-info .status {
        order: 1;
        align-self: flex-start
    }

    .detail-info h1 {
        order: 2;
        margin: 12px 0 6px;
        font-size: clamp(3rem, 15vw, 4.5rem)
    }

    .detail-meta {
        order: 3;
        margin-bottom: 0;
        font-size: 16px
    }

    .detail-price {
        order: 4;
        margin: 10px 0 0
    }

    .detail-cover {
        order: 5;
        height: min(112vw, 560px);
        margin-top: 22px;
        padding-top: 22px;
        border-top: 1px solid var(--line);
        border-radius: 0;
        background: transparent;
        overflow: visible
    }

    .detail-cover > * {
        overflow: hidden;
        border-radius: 20px
    }

    .detail-description {
        order: 6;
        margin: 20px 0 18px;
        padding-top: 0;
        border-top: 0;
        font-size: 16px
    }

    .detail-description p {
        margin-bottom: 0
    }

    .detail-info .btn {
        order: 7
    }

    .detail-info .secondary-link {
        order: 8;
        margin-top: 14px
    }

    .long-description {
        grid-template-columns:1fr;
        gap: 22px;
        padding: 44px 30px;
        margin-bottom: 80px
    }

    .long-description h2 {
        white-space: normal
    }

    .parents {
        grid-template-columns:repeat(2, 1fr)
    }

    .large-gallery figure {
        height: 380px
    }

    .large-gallery__lead {
        height: 520px !important
    }
}

@media (max-width: 560px) {
    .detail-cover {
        height: min(112vw, 480px)
    }

    .parents {
        grid-template-columns:1fr
    }

    .long-description {
        padding: 34px 22px
    }

    .large-gallery__grid {
        grid-template-columns:1fr;
        gap: 14px
    }

    .large-gallery figure, .large-gallery__lead {
        grid-column: auto;
        height: 420px !important
    }
}

@media (max-width: 640px) {
    .lightbox {
        grid-template-columns:1fr;
        padding: 70px 14px 74px
    }

    .lightbox__figure {
        height: calc(100vh - 144px)
    }

    .lightbox__arrow {
        position: absolute;
        bottom: 16px
    }

    .lightbox__arrow--prev {
        left: calc(50% - 64px)
    }

    .lightbox__arrow--next {
        right: calc(50% - 64px)
    }

    .lightbox__close {
        right: 14px;
        top: 14px
    }

    .lightbox__counter {
        left: 16px;
        top: 22px
    }
}

@media (prefers-reduced-motion: reduce) {
    .lightbox {
        animation: none
    }

    .large-gallery img {
        transition: none
    }
}
