/* Скрыть год, если внутри его Collection List пусто */
@media (max-width: 991px){
  .year-press-wrapper:has(.w-dyn-empty){ display: none !important; }
}

 /* секция-носитель на весь экран */
  .section-media{
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
  }

  /* обёртка под iframe */
  .cms-video-bg{
    position: absolute;
    inset: 0;
    z-index: 1;
    background: #000;
    pointer-events: none; /* чтобы клики проходили к слоям сверху (если есть) */
  }

  /* делаем iframe как background-size: cover для 16:9 */
  .cms-video-bg iframe{
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 56.25vw;      /* 9/16 */
    min-height: 100vh;
    min-width: 177.78vh;  /* 16/9 * 100vh */
    border: 0;
  }
  
  /* ---------------- ГАЛЕРЕЯ ---------------- */

/* по умолчанию скрыта (важно для мобилок) */
.gallery-scroll{ display:none; }

/* версия для мобилок, если у тебя есть отдельный блок с вертикальными фото */
.gallery-mobile{ display:block; }

.gallery-mobile img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 4px; /* промежуток между фото */
}

.gallery-mobile img:last-child {
  margin-bottom: 0; /* убираем отступ у последнего */
}

/* показываем горизонтальный скролл только ≥768px */
@media (min-width:768px){
  .gallery-scroll{
    display:flex;
    overflow-x:auto;
    overflow-y:hidden;
    gap:10px;

    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
    scroll-behavior:smooth;

    -ms-overflow-style:none;
    scrollbar-width:none;

    /* «виртуальные» края для scroll-snap */
    scroll-padding-left:30px;
    scroll-padding-right:30px;
  }
  .gallery-scroll::-webkit-scrollbar{ display:none; }

  .thumb-horizontal,.thumb-vertical{ flex:0 0 auto; scroll-snap-align:start; }
  .thumb-horizontal img,.thumb-vertical img{ width:100%; height:100%; object-fit:cover; display:block; }

  /* fallback, если scroll-snap не сработал */
  .gallery-scroll > :first-child { margin-left:30px; }
  .gallery-scroll > :last-child  { margin-right:30px; }
}

/* подправим края на планшете */
@media (min-width:768px) and (max-width:991px){
  .gallery-scroll{ scroll-padding-left:20px; scroll-padding-right:20px; }
  .gallery-scroll > :first-child { margin-left:20px; }
  .gallery-scroll > :last-child  { margin-right:20px; }
}

/* если нужен явный показ мобильной версии только <768px */
@media (min-width:768px){
  .gallery-mobile{ display:none; }
}
  /* ---------------- ЛАЙТБОКС ---------------- */
  .w-lightbox-close { 
    background: none !important;
    width: auto !important; 
    height: auto !important;
    top: 28px !important; 
    right: 24px !important;
    z-index: 99999 !important;
    cursor: pointer;
  }
  .w-lightbox-close .w-icon-close,
  .w-lightbox-close svg { 
    display: none !important;
  }
  .w-lightbox-close::before{
    content: "close";
    display: inline-block;
    font-size: 16px;
    line-height: 1;
    text-transform: lowercase;
    color: #fff;
    font-weight: 300;
    font-family: 'Inter Tight', sans-serif;
  }

  @media (max-width: 479px){
    .w-lightbox-close::before{ font-size: 16px; }
    .w-lightbox-close{ top: 28px !important; right: 16px !important; }
  }

/* Added in the move to Grav: the Webflow template places only four text
   paragraphs; any further ones go in the same column. */
.text-wrap > .extra-paragraph { grid-column: 7 / 11; }
@media (max-width: 991px) { .text-wrap > .extra-paragraph { grid-column: 5 / 9; } }
