/* ioann-karpovka gallery (task 19): markup in components/gallery.blade.php, behaviour in js/gallery.js.
   Design: article figure (export lines 360-374) and the identical album figure (lines 617-633).
   The figure has no width of its own (the parent column sets it) and the same layout at every width, so there is
   no breakpoint query here; the only media query is (hover: hover), which does not use the 768px boundary. */
.ik-gallery { margin: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.ik-gallery__stage { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-card); overflow: hidden; background: var(--iskm-cream-300); touch-action: pan-y; }
.ik-gallery__img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }

/* «Whole photo» slider (contain, 2026-11-16): the photo is never cropped; the slide is a button opening the lightbox. */
.ik-gallery--contain .ik-gallery__img { object-fit: contain; object-position: center; }
.ik-gallery__open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.ik-gallery__open:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -4px; }

.ik-gallery__nav { position: absolute; left: 16px; right: 16px; top: 50%; transform: translateY(-50%); display: flex; justify-content: space-between; pointer-events: none; }
.ik-gallery__arrow { pointer-events: auto; width: 44px; height: 44px; 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-gallery__arrow:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.ik-gallery__arrow:active { background: var(--iskm-navy); color: var(--iskm-cream-50); }

.ik-gallery__counter { position: absolute; right: 16px; bottom: 16px; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--iskm-cream-50); color: var(--iskm-navy); font: 500 13px/1 var(--font-body); font-variant-numeric: tabular-nums; }

/* The strip is as wide as the column, like the design, so scrolled thumbs are clipped exactly at the column edge (task 61).
   The thumbnail focus ring is inset (see :focus-visible below), so nothing bleeds outside the strip. */
.ik-gallery__thumbs { display: flex; gap: 8px; padding-bottom: 4px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.ik-gallery__thumb { flex: none; width: 96px; height: 64px; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--iskm-cream-300); border: 2px solid transparent; opacity: .7; transition: opacity var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.ik-gallery__thumb.is-active { border-color: var(--iskm-navy); opacity: 1; }
.ik-gallery__thumb:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; opacity: 1; }
.ik-gallery__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

.ik-gallery__caption { margin: 0; font: 400 14px/1.4 var(--font-body); color: var(--iskm-mauve-700); overflow-wrap: break-word; }
.ik-gallery__caption[hidden] { display: none; }
/* The design figure always ends with a (possibly empty) figcaption, so the 12px gap stays when no caption is shown (task 62). */
.ik-gallery:not(:has(> .ik-gallery__caption:not([hidden]))) { padding-bottom: 12px; }

@media (hover: hover) {
    .ik-gallery__arrow:hover { background: var(--iskm-navy); color: var(--iskm-cream-50); }
    .ik-gallery__thumb:hover { opacity: 1; }
}
