/* Шоу-кейс блока «Галерея»: четыре способа показать прошлые мероприятия */

body.gallery-lab .labbar__nav a,
body.gallery-lab .labfoot a:focus-visible { border-radius: 0; }

.gal-foot { padding-bottom: clamp(24px, 3vw, 44px); }

/* — заголовок и лид — */

.gal-head {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 3.55fr);
  gap: clamp(36px, 4.8vw, 92px);
  align-items: start;
  padding-top: clamp(48px, 6vw, 92px);
}

.gal-title {
  margin: 0;
  font-family: var(--heading);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1;
  letter-spacing: -.014em;
  color: var(--ink);
}

.gal-title__first { color: var(--violet); }

.gal-lead {
  margin: 4px 0 0;
  max-width: 40ch;
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.gal-stage { margin-top: clamp(42px, 4.6vw, 66px); }

.gal-inner {
  width: 100%;
  max-width: var(--stage);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.gal-num {
  font-size: 10px;
  letter-spacing: .12em;
  color: #b1741c;
}

/* — общие кнопки — */

.gal-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--hairline-strong);
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  transition: border-color .22s ease, color .22s ease, background-color .22s ease;
}

.gal-btn:hover {
  border-color: var(--ink);
}

.gal-btn:disabled {
  opacity: .28;
  cursor: default;
}

.gal-btn:focus-visible {
  outline: 1px solid var(--violet);
  outline-offset: 3px;
}

/* — 01 мозаика — */

.gal-mosaic {
  columns: 3;
  column-gap: clamp(8px, .7vw, 10px);
}

.gal-mosaic__item {
  display: inline-block;
  width: 100%;
  margin: 0 0 clamp(20px, 2vw, 28px);
  break-inside: avoid;
}

.gal-mosaic__frame {
  overflow: hidden;
  background: #dcdbd5;
}

.gal-mosaic__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}

.gal-mosaic__item:hover img { transform: scale(1.03); }

.gal-mosaic__item.is-tall .gal-mosaic__frame { aspect-ratio: 4 / 5; }
.gal-mosaic__item.is-square .gal-mosaic__frame { aspect-ratio: 1 / 1; }
.gal-mosaic__item.is-wide .gal-mosaic__frame { aspect-ratio: 3 / 2; }

.gal-mosaic__item figcaption {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 10px;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* — 02 витрина — */

.gal-showcase__view {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2.05 / 1;
  background: #dcdbd5;
}

.gal-showcase__view img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity .3s ease;
}

.gal-showcase__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 16px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--hairline);
}

.gal-showcase__caption {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
}

.gal-showcase__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.gal-count {
  margin-right: 8px;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.gal-count b { font-weight: 400; color: var(--ink); }

.gal-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.gal-thumb {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: clamp(58px, 5.8vw, 82px);
  overflow: hidden;
  opacity: .5;
  transition: opacity .25s ease;
}

.gal-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gal-thumb::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: transparent;
  transition: background-color .25s ease;
}

.gal-thumb:hover { opacity: .82; }

.gal-thumb[aria-pressed="true"] { opacity: 1; }

.gal-thumb[aria-pressed="true"]::after { background: #b1741c; }

.gal-thumb:focus-visible {
  outline: 1px solid var(--violet);
  outline-offset: 2px;
}

/* — 03 лента — */

.gal-rail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}

.gal-rail-hint {
  font-size: 10px;
  line-height: 1;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.gal-rail-arrows {
  display: flex;
  gap: 8px;
}

.gal-rail {
  display: flex;
  gap: clamp(8px, .7vw, 10px);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-left: max(var(--pad), calc((100vw - var(--stage)) / 2 + var(--pad)));
  scroll-padding-left: max(var(--pad), calc((100vw - var(--stage)) / 2 + var(--pad)));
  cursor: grab;
}

@media (pointer: fine) {
  .gal-rail { scroll-snap-type: none; }
}

.gal-rail.is-dragging { cursor: grabbing; }

.gal-rail::-webkit-scrollbar { display: none; }

.gal-rail:focus-visible {
  outline: 1px solid var(--violet);
  outline-offset: 4px;
}

.gal-rail__item {
  flex: 0 0 clamp(360px, 44vw, 640px);
  min-width: 0;
  margin: 0;
  scroll-snap-align: start;
}

.gal-rail__frame {
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: #dcdbd5;
}

.gal-rail__frame picture {
  display: block;
  width: 100%;
  height: 100%;
}

.gal-rail__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s cubic-bezier(.2, .7, .2, 1);
  -webkit-user-drag: none;
  user-select: none;
}

.gal-rail__item:hover img { transform: scale(1.025); }

.gal-rail.is-dragging .gal-rail__item img { transition: none; transform: none; }

.gal-rail__item figcaption {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 12px;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.gal-rail-track {
  position: relative;
  height: 1px;
  margin-top: 18px;
  background: var(--hairline);
  cursor: pointer;
}

.gal-rail-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -14px;
  height: 29px;
}

.gal-rail-track.is-scrubbing { background: rgba(23, 22, 19, .28); }

.gal-rail-track span {
  position: absolute;
  top: 0;
  left: 0;
  height: 1px;
  background: var(--ink);
}

/* — 04 кадр — */

.gal-stage--frame {
  --gal-night:
    radial-gradient(140% 100% at 74% 26%, rgba(38, 154, 143, .60) 0%, rgba(38, 154, 143, 0) 56%),
    radial-gradient(80% 58% at 104% 0%, rgba(80, 178, 137, .50) 0%, rgba(80, 178, 137, 0) 62%),
    radial-gradient(80% 70% at 2% 62%, rgba(108, 90, 216, .58) 0%, rgba(108, 90, 216, 0) 60%),
    radial-gradient(90% 66% at 52% 108%, rgba(63, 102, 199, .48) 0%, rgba(63, 102, 199, 0) 64%),
    radial-gradient(64% 52% at 0% 0%, rgba(48, 74, 158, .50) 0%, rgba(48, 74, 158, 0) 65%),
    linear-gradient(107deg, #252b60 0%, #1d2c58 46%, #1d4257 100%);
  padding-block: clamp(36px, 4.6vw, 68px);
  color: var(--cream);
  background: var(--gal-night);
}

.gal-frame__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(244, 227, 198, .2);
}

.gal-frame__caption {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.4;
  color: var(--cream);
}

.gal-frame__caption .gal-num { color: var(--gold); }

.gal-frame__count {
  flex: none;
  font-size: 11px;
  letter-spacing: .12em;
  color: rgba(244, 227, 198, .58);
  white-space: nowrap;
}

.gal-frame__count b { font-weight: 400; color: var(--cream); }

.gal-frame__view {
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 2.15 / 1;
  max-height: 62vh;
  background: rgba(244, 227, 198, .06);
}

.gal-frame__view img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity .3s ease;
}

.gal-frame__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(244, 227, 198, .36);
  background: rgba(20, 27, 61, .5);
  color: var(--cream);
  font-size: 17px;
  line-height: 1;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: border-color .22s ease, color .22s ease, background-color .22s ease;
}

.gal-frame__nav--prev { left: 16px; }
.gal-frame__nav--next { right: 16px; }

.gal-frame__nav:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(20, 27, 61, .72);
}

.gal-frame__nav:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 3px;
}

.gal-frame__ticks {
  display: flex;
  gap: 6px;
  margin-top: 18px;
}

.gal-tick {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  height: 22px;
  min-width: 0;
}

.gal-tick::before {
  content: "";
  display: block;
  width: 100%;
  height: 2px;
  background: rgba(244, 227, 198, .22);
  transition: background-color .25s ease;
}

.gal-tick:hover::before { background: rgba(244, 227, 198, .5); }

.gal-tick[aria-pressed="true"]::before { background: var(--gold); }

.gal-tick:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
}

/* — обложка шоу-кейса — */

.gal-index .concepts__link:hover .concepts__num { color: var(--violet); }

@media (max-width: 1020px) {
  .gal-mosaic { columns: 2; }
}

@media (max-width: 1100px) {
  .gal-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .gal-lead { max-width: 52ch; }
}

@media (max-width: 700px) {
  .gal-head { padding-top: 38px; }

  .gal-title { font-size: clamp(24px, 7.5vw, 40px); }

  .gal-stage { margin-top: 34px; }

  .gal-mosaic { columns: 1; }

  .gal-mosaic__item { margin-bottom: 20px; }

  .gal-showcase__view { aspect-ratio: 4 / 3; }

  .gal-showcase__bar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }

  .gal-showcase__controls {
    width: 100%;
    justify-content: flex-end;
  }

  .gal-count { margin-right: auto; }

  .gal-thumbs {
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .gal-thumbs::-webkit-scrollbar { display: none; }

  .gal-thumb {
    flex: 0 0 92px;
    height: 62px;
  }

  .gal-rail__item { flex-basis: 78vw; }

  .gal-rail-hint { font-size: 9px; letter-spacing: .1em; }

  .gal-btn { width: 40px; height: 40px; font-size: 15px; }

  .gal-frame__view { aspect-ratio: 4 / 3; }

  .gal-frame__nav { width: 42px; height: 42px; font-size: 15px; }

  .gal-frame__nav--prev { left: 10px; }
  .gal-frame__nav--next { right: 10px; }

  .gal-frame__head { gap: 16px; }

  .gal-frame__caption { gap: 9px; }
}


@media (prefers-reduced-motion: reduce) {
  .gal-mosaic__item img,
  .gal-showcase__view img,
  .gal-frame__view img,
  .gal-rail__item img,
  .gal-thumb,
  .gal-btn,
  .gal-tick::before { transition: none; }
}
