.detail-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 138px;
    gap: 8px;
}

.detail-gallery__figure { min-width: 0; margin: 0; }
.detail-gallery__figure:first-child { grid-column: span 2; grid-row: span 2; }

.detail-gallery__item {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-accent-soft);
    padding: 0;
    cursor: zoom-in;
}

.detail-gallery__item img {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
    object-fit: cover;
    transition: transform 180ms ease;
}

.detail-gallery__item:hover img { transform: scale(1.025); }
.detail-gallery__item:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.detail-gallery__index { position: absolute; right: 7px; bottom: 7px; min-width: 24px; border-radius: 6px; background: rgba(24, 32, 42, 0.78); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 6px; }

.lightbox { width: 100%; max-width: none; height: 100%; max-height: none; border: 0; background: transparent; padding: 0; }
.lightbox::backdrop { background: rgba(12, 16, 22, 0.82); backdrop-filter: blur(3px); }
.lightbox__shell { width: 100%; height: 100%; display: grid; grid-template-columns: 54px minmax(0, 1fr) 54px; align-items: center; gap: 12px; padding: 28px; position: relative; }
.lightbox__figure { min-width: 0; max-width: 1120px; max-height: calc(100vh - 56px); display: grid; justify-self: center; margin: 0; }
.lightbox__figure img { width: 100%; max-height: calc(100vh - 104px); border-radius: 8px; object-fit: contain; }
.lightbox__caption { min-height: 32px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; font-size: 12px; padding-top: 8px; text-align: center; }
.lightbox__caption a { color: #fff; }
.lightbox__close,
.lightbox__nav { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 8px; background: rgba(18, 24, 32, 0.72); color: #fff; cursor: pointer; }
.lightbox__close { position: absolute; top: 20px; right: 20px; z-index: 2; font-size: 28px; }
.lightbox__nav { font-size: 30px; }
.lightbox__nav:hover,
.lightbox__close:hover { background: var(--color-accent-strong); }

@media (max-width: 700px) {
    .detail-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 112px; }
    .detail-gallery__figure:first-child { grid-column: span 2; grid-row: span 2; }
    .lightbox__shell { grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 5px; padding: 14px 8px; }
    .lightbox__nav { width: 38px; height: 44px; }
    .lightbox__close { top: 12px; right: 12px; }
    .lightbox__caption { flex-wrap: wrap; }
}
