.winter-gallery { position: relative; padding: 3rem 0 2.75rem; color: #fff; }
.winter-gallery__intro { padding-inline: var(--compact-page-gutter); text-align: center; }
.winter-gallery__label { display: inline-flex; align-items: center; justify-content: center; margin: 0; min-height: 1.875rem; padding: .4375rem 1rem; border-radius: 1.25rem; background: rgb(255 255 255 / 20%); font-size: clamp(.75rem, .69rem + .25vw, .875rem); font-weight: 500; line-height: 1.11; }
.winter-gallery__label span { opacity: .8; }
.winter-gallery__title { margin: .9375rem auto 0; font-size: clamp(1.5rem, 1.3rem + 1vw, 1.875rem); font-weight: 600; line-height: 1.11; letter-spacing: 0; text-wrap: balance; }
.winter-gallery__stage { margin-top: 1.75rem; }
.winter-gallery__list { display: grid; grid-auto-flow: column; grid-auto-columns: min(82vw, 23rem); gap: 1rem; margin: 0; padding: 0 var(--compact-page-gutter); list-style: none; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--compact-page-gutter); scrollbar-width: none; touch-action: pan-x pan-y; }
.winter-gallery__list::-webkit-scrollbar { display: none; }
.winter-gallery__list:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.winter-gallery__photo { min-width: 0; overflow: hidden; border-radius: 1.5rem; scroll-snap-align: start; aspect-ratio: 350 / 502; }
.winter-gallery__photo img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.winter-gallery__photo--greeting img { object-position: 70% center; }
.winter-gallery__navigation { display: flex; justify-content: center; gap: .75rem; margin-top: 1.5rem; }
.winter-gallery__navigation[hidden] { display: none; }
.winter-gallery__navigation button { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 0; border-radius: 50%; background: #fff; color: #364a99; font-size: 1.125rem; cursor: pointer; }
.winter-gallery__navigation button:disabled { opacity: .45; cursor: default; }
.winter-gallery__navigation button:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.winter-gallery__list.is-dragging { cursor: grabbing; scroll-snap-type: none; }
@media (any-hover: hover) { .winter-gallery__list { cursor: grab; } }
/* Phone/tablet, after kvestkids.ru/ded-moroz-v-ofis (.ny-gallery): every
   photo in the same 3:2 frame; portraits open in full in the photo viewer,
   one photo and the edge of the next on phones, two side by side on tablets,
   and a pill with the arrows and a scroll progress bar between them. */
@container winter-stories (width < 75rem) {
  .winter-gallery { padding-block: 2.25rem 3rem; }
  .winter-gallery__title { font-size: calc(1.75rem * var(--winter-fit-heading)); line-height: 1.1; }
  .winter-gallery__stage { margin-top: 1.5rem; }
  .winter-gallery__list { grid-auto-columns: min(calc(100cqw - 2 * var(--compact-page-gutter) - 2.5rem), 30rem); gap: .75rem; }
  .winter-gallery__photo { aspect-ratio: 3 / 2; border-radius: 1.25rem; }
  .winter-gallery__photo--greeting img { object-position: center; }
  .winter-gallery__navigation {
    align-items: center;
    gap: .875rem;
    width: fit-content;
    margin: 1.75rem auto 0;
    padding: .375rem;
    border-radius: 999px;
    background: rgb(255 255 255 / 14%);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 22%);
  }
  .winter-gallery__progress { position: relative; width: 4.75rem; height: .1875rem; overflow: hidden; border-radius: 999px; background: rgb(255 255 255 / 30%); }
  .winter-gallery__progress > span { position: absolute; inset: 0 auto 0 0; width: var(--gallery-thumb, 25%); border-radius: inherit; background: #fff; translate: var(--gallery-offset, 0%) 0; }
}
@container winter-stories (48rem <= width < 75rem) {
  .winter-gallery { padding-block: 3rem 3.5rem; }
  .winter-gallery__title { font-size: calc(2rem * var(--winter-fit-heading)); }
  .winter-gallery__list { grid-auto-columns: calc((100cqw - 2 * var(--compact-page-gutter) - 1.25rem) / 2); gap: 1.25rem; }
}
@container winter-stories (width >= 75rem) {
  /* Desktop mosaic from Figma 5760:2434. */
  .winter-gallery__photo { aspect-ratio: auto; grid-row: 1 / 3; }
  .winter-gallery__photo--portrait { grid-column: 1; }
  .winter-gallery__photo--greeting { grid-column: 2; grid-row: 1; }
  .winter-gallery__photo--together { grid-column: 2; grid-row: 2; }
  .winter-gallery__photo--lights { grid-column: 3; }
  .winter-gallery__photo--square { grid-column: 4; }
  /* Further photos continue the mosaic: landscapes pair in one column. */
  .winter-gallery__list { grid-auto-columns: calc(21.875 * var(--winter-unit)); }
  .winter-gallery__photo--stacked { grid-row: auto; }
  .winter-gallery__photo--greeting img { object-position: center; }
  .winter-gallery { padding: calc(2.6875 * var(--winter-unit)) 0 calc(3.125 * var(--winter-unit)); }
  .winter-gallery__label { width: calc(14.0625 * var(--winter-unit)); min-height: calc(1.875 * var(--winter-unit)); padding: calc(.4375 * var(--winter-unit)) calc(.75 * var(--winter-unit)); border-radius: calc(1.25 * var(--winter-unit)); background: rgb(253 253 253 / 20%); font-size: calc(.875 * var(--winter-unit)); transform: translateX(calc(.03125 * var(--winter-unit))); }
  .winter-gallery__title { max-width: calc(55 * var(--winter-unit)); margin-top: calc(.9375 * var(--winter-unit)); font-size: calc(1.875 * var(--winter-unit)); }
  .winter-gallery__stage { margin-top: calc(1.8125 * var(--winter-unit) - .01875 * var(--winter-unit)); }
  .winter-gallery__list { grid-template-columns: calc(21.875 * var(--winter-unit)) calc(20.4375 * var(--winter-unit)) calc(21.875 * var(--winter-unit)) calc(21.875 * var(--winter-unit)); grid-template-rows: calc(15.25 * var(--winter-unit)) calc(15.0625 * var(--winter-unit)); gap: calc(1.25 * var(--winter-unit)); padding-inline: max(calc(50% - 36.25 * var(--winter-unit)), var(--compact-page-gutter)); scroll-padding-inline: max(calc(50vw - 36.25 * var(--winter-unit)), var(--compact-page-gutter)); }
  .winter-gallery__photo { border-radius: calc(1.875 * var(--winter-unit)); }
  .winter-gallery__photo--greeting, .winter-gallery__photo--lights, .winter-gallery__photo--square { margin-top: calc(.1875 * var(--winter-unit)); }
  .winter-gallery__photo--together { transform: translateX(calc(.125 * var(--winter-unit))); }
  /* Arrows return on desktop (client feedback), see the end of this file. */
}
/* Client feedback 12.10.2026: photos open and the desktop rail has arrows. */
.winter-gallery__open { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.winter-gallery__open:focus-visible { outline: 3px solid #fff; outline-offset: -3px; border-radius: inherit; }
.winter-gallery__list.is-dragging .winter-gallery__open { cursor: grabbing; }
@media (hover: hover) and (pointer: fine) {
  .winter-gallery__photo img { transition: scale .5s cubic-bezier(.2,.7,.2,1); }
  .winter-gallery__open:hover img { scale: 1.04; }
}
/* Desktop arrows as on the reference page: a round arrow on the rail edge over
   the next photo, which dissolves into the section blue (the reference fades
   into its white page). The previous arrow appears once the rail has moved. */
@container winter-stories (width >= 75rem) {
  .winter-gallery__stage { position: relative; }
  .winter-gallery__stage::before,
  .winter-gallery__stage::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    width: max(calc(50% - 36.25 * var(--winter-unit) + 8rem), 10rem);
    pointer-events: none;
    transition: opacity .3s ease;
  }
  .winter-gallery__stage::after { right: 0; background: linear-gradient(90deg, rgb(30 74 211 / 0%), rgb(30 74 211 / 88%) 45%, #1e4ad3 75%); }
  .winter-gallery__stage::before { left: 0; opacity: 0; background: linear-gradient(270deg, rgb(30 74 211 / 0%), rgb(30 74 211 / 88%) 45%, #1e4ad3 75%); }
  .winter-gallery__stage[data-can-prev]::before { opacity: 1; }
  .winter-gallery__stage:not([data-can-next])::after { opacity: 0; }
  .winter-gallery__navigation { position: absolute; z-index: 2; inset: 0; display: block; margin: 0; pointer-events: none; }
  .winter-gallery__navigation[hidden] { display: none; }
  .winter-gallery__progress { display: none; }
  .winter-gallery__navigation button {
    position: absolute;
    top: calc(50% - 1.5rem);
    pointer-events: auto;
    width: 3rem;
    height: 3rem;
    border: 0;
    background: #fff;
    font-size: 1.25rem;
    color: #2853d5;
    box-shadow: 0 .75rem 1.75rem -1rem #0b2a8f;
    backdrop-filter: blur(5px);
    transition: scale .2s ease, background-color .2s ease;
  }
  .winter-gallery__navigation button:hover { scale: 1.08; }
  .winter-gallery__navigation button:disabled { visibility: hidden; }
  .winter-gallery__navigation button:first-child { left: max(calc(50% - 36.25 * var(--winter-unit) - 1.375rem), 1rem); }
  .winter-gallery__navigation button:last-child { right: max(calc(50% - 36.25 * var(--winter-unit) - 1.375rem), 1rem); }
}
.winter-lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}
.winter-lightbox::backdrop { background: rgb(6 14 60 / 88%); backdrop-filter: blur(6px); }
.winter-lightbox__figure { display: grid; place-items: center; width: 100%; height: 100%; margin: 0; padding: 4.5rem 1rem; pointer-events: none; }
.winter-lightbox__image { max-width: min(100%, 80rem); max-height: calc(100dvh - 9rem); border-radius: 1.25rem; object-fit: contain; pointer-events: auto; }
.winter-lightbox__button { position: fixed; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 0; border-radius: 50%; background: #fff; color: #364a99; font-size: 1.25rem; cursor: pointer; }
.winter-lightbox__button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.winter-lightbox__button--close { top: 1rem; right: 1rem; font-size: 1.5rem; }
.winter-lightbox__button--prev { left: 1rem; top: calc(50% - 1.375rem); }
.winter-lightbox__button--next { right: 1rem; top: calc(50% - 1.375rem); }
.winter-lightbox__counter { position: fixed; left: 50%; bottom: 1.25rem; margin: 0; translate: -50% 0; font-size: .875rem; opacity: .8; }
@media (width < 48rem) {
  .winter-lightbox__button--prev, .winter-lightbox__button--next { top: auto; bottom: .75rem; }
}
