/* A quieter, gallery-like frame for enlarged archive photos. */
.photo-lightbox {
    width: min(1240px, calc(100vw - 48px));
    max-height: calc(100dvh - 48px);
    padding: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 18px;
    background: linear-gradient(145deg, #242427, #111113 70%);
    color: #fff;
    box-shadow: 0 32px 110px rgba(0,0,0,.58);
}
.photo-lightbox::backdrop {
    background: rgba(10,10,12,.84);
    backdrop-filter: blur(8px) saturate(.75);
}
.photo-lightbox form { top: 19px; right: 19px; }
.photo-lightbox-close {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.26);
    border-radius: 50%;
    background: rgba(18,18,20,.72);
    color: #fff;
    font: 300 27px/1 sans-serif;
    backdrop-filter: blur(8px);
    transition: background .18s ease, transform .18s ease;
}
.photo-lightbox-close:hover,
.photo-lightbox-close:focus-visible { background: #d20a19; transform: rotate(90deg); }
.photo-lightbox figure {
    gap: 0;
    max-height: calc(100dvh - 72px);
    overflow: hidden;
    border-radius: 10px;
    background: #0b0b0c;
}
.photo-lightbox img {
    width: auto;
    max-width: 100%;
    max-height: calc(100dvh - 145px);
    object-fit: contain;
    animation: photo-reveal .22s ease-out both;
}
.photo-lightbox figcaption {
    width: 100%;
    max-width: none;
    padding: 13px 56px 12px;
    border-top: 1px solid rgba(255,255,255,.09);
    background: linear-gradient(90deg, #171719, #222225, #171719);
    color: rgba(255,255,255,.84);
    font-size: 12px;
    line-height: 1.55;
    text-align: center;
}
.photo-lightbox[open] { animation: photo-lightbox-in .2s ease-out both; }
@keyframes photo-reveal { from { opacity: .65; transform: scale(.992); } to { opacity: 1; transform: scale(1); } }

@media (max-width: 640px) {
    .photo-lightbox {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
        padding: 6px;
        border-radius: 13px;
    }
    .photo-lightbox form { top: 12px; right: 12px; }
    .photo-lightbox-close { width: 38px; height: 38px; }
    .photo-lightbox figure { max-height: calc(100dvh - 32px); border-radius: 8px; }
    .photo-lightbox img { max-height: calc(100dvh - 95px); }
    .photo-lightbox figcaption { padding: 11px 46px 10px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
    .photo-lightbox-close { transition: none; }
    .photo-lightbox img { animation: none; }
    .photo-lightbox[open] { animation: none; }
}
