/*
 * ioann-karpovka lightbox (2026-11-16, Костя item 3.0): full-screen viewer of the «whole photo» galleries.
 * Markup: components/lightbox.blade.php, behaviour: js/lightbox.js. The photo is always shown whole (contain).
 * Mobile = `not all and (min-width: 768px)`; never a max-width query (task 36).
 */
.ik-lightbox {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgb(12 22 54 / .96);
    color: var(--iskm-cream-50);
    overflow: hidden;
}
.ik-lightbox[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.ik-lightbox::backdrop { background: rgb(12 22 54 / .96); }
/* The photo box is the stage minus the room for the close cross (top) and the arrows (sides); the photo fills it with
   object-fit: contain, so it never overflows onto the caption bar whatever its size or orientation. */
.ik-lightbox__stage { position: relative; min-height: 0; touch-action: pan-y; --ik-lb-top: 72px; --ik-lb-side: 88px; --ik-lb-bottom: 8px; }
.ik-lightbox__img {
    position: absolute;
    top: var(--ik-lb-top);
    left: var(--ik-lb-side);
    width: calc(100% - 2 * var(--ik-lb-side));
    height: calc(100% - var(--ik-lb-top) - var(--ik-lb-bottom));
    object-fit: contain;
    user-select: none;
}
.ik-lightbox__close { position: absolute; top: 16px; right: 16px; }
.ik-lightbox__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--iskm-cream-50);
    color: var(--iskm-navy);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-float);
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.ik-lightbox__arrow--prev { left: 20px; }
.ik-lightbox__arrow--next { right: 20px; }
.ik-lightbox__arrow[hidden] { display: none; }
.ik-lightbox__arrow:focus-visible { outline: 2px solid var(--iskm-ochre); outline-offset: 3px; }
.ik-lightbox__arrow:active { background: var(--iskm-navy); color: var(--iskm-cream-50); }
.ik-lightbox__bar { display: flex; align-items: baseline; justify-content: center; gap: 16px; padding: 12px 24px 20px; text-align: center; }
.ik-lightbox__caption { margin: 0; max-width: 800px; font: 400 15px/1.45 var(--font-body); color: var(--iskm-cream-50); overflow-wrap: break-word; }
.ik-lightbox__caption:empty { display: none; }
.ik-lightbox__counter { flex-shrink: 0; font: 500 14px/1 var(--font-body); font-variant-numeric: tabular-nums; color: var(--iskm-navy-200); }
.ik-lightbox__counter:empty { display: none; }
html.ik-lightbox-open { overflow: hidden; }

@media (hover: hover) {
    .ik-lightbox__arrow:hover { background: var(--iskm-navy); color: var(--iskm-cream-50); }
}
@media not all and (min-width: 768px) {
    /* The photo uses the whole width; the arrows sit over it at the bottom corners, swipe works too. */
    .ik-lightbox__stage { --ik-lb-top: 64px; --ik-lb-side: 0px; }
    .ik-lightbox__close { top: 10px; right: 10px; }
    .ik-lightbox__arrow { top: auto; bottom: 12px; transform: none; width: 44px; height: 44px; }
    .ik-lightbox__arrow--prev { left: 12px; }
    .ik-lightbox__arrow--next { right: 12px; }
    .ik-lightbox__bar { flex-direction: column; align-items: center; gap: 8px; padding: 10px 68px 22px; min-height: 68px; }
}
