.story-photos {
    --photo-gap: clamp(8px, 1.5vw, 16px);
    display: grid;
    gap: var(--photo-gap);
    margin-block: 36px;
}

.story-photo-row {
    display: flex;
    align-items: flex-start;
    gap: var(--photo-gap);
}

.story-photo {
    position: relative;
    flex: var(--photo-ratio, 1) 1 0;
    min-width: 0;
    margin: 0;
}

.story-photo-open {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
}

.story-photo-open:enabled { cursor: zoom-in; }
.story-photo-open:disabled { opacity: 1; }
.story-photo-open:focus-visible { outline-offset: -4px; }
.story-photo .ai-label { pointer-events: none; }

.story-photo img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.story-photo-single { justify-content: center; }
.story-photo-single .story-photo { flex: 0 1 auto; max-width: 100%; }
.story-photo-single .story-photo-open { width: auto; max-width: 100%; }
.story-photo-single img { width: auto; max-width: 100%; max-height: min(74svh, 680px); object-fit: contain; }

.story-lightbox {
    width: min(1060px, calc(100vw - 20px));
    max-height: calc(100dvh - 20px);
    margin: auto;
    padding: 8px;
    background: #101214;
    color: #f5f3ee;
    overflow: auto;
}

.story-lightbox::backdrop { background: #000e; }
body:has(.story-lightbox[open]) { overflow: hidden; }
.story-lightbox-bar, .story-lightbox-nav { display: flex; align-items: center; gap: 12px; }
.story-lightbox-bar { justify-content: space-between; padding: 0 4px 8px 12px; }
.story-lightbox-nav { justify-content: center; padding-top: 8px; }
.story-lightbox-count { font-variant-numeric: tabular-nums; }

.story-lightbox button {
    min-width: 48px;
    min-height: 44px;
    border: 1px solid #596068;
    border-radius: 8px;
    background: #202529;
    color: inherit;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}

.story-lightbox button:hover { background: #344047; }
.story-lightbox-nav button { min-width: 64px; }
.story-lightbox-stage { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; touch-action: pan-y pinch-zoom; }
.story-lightbox-photo { position: relative; max-width: 100%; margin: 0; }

.story-lightbox-photo img {
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - 144px);
    width: auto;
    height: auto;
    object-fit: contain;
}

@media (max-width: 600px) {
    .story-photo-row { display: grid; grid-template-columns: minmax(0, 1fr); }
    .story-photo-single { justify-content: stretch; }
    .story-photo-single .story-photo { justify-self: center; }
}
