.gallery-wrapper {
  max-width: 1930px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 320px;
  gap: 10px;
}

.gallery-item1 {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: #ddd;
}

.gallery-item1.big {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-item1 img,
.gallery-item1 video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item1 video:hover {
  transform: scale(1.01);
}

/* СТИЛЬ КНОПКИ */
.load-more-wrapper {
  text-align: center;
  margin-top: 30px;
}

.load-more-btn {
  background: orange;
  color: white;
  padding: 15px 45px;
  font-size: 16px;
  font-family: serif;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

/* Оверлей и описание */
.gallery-item1 .overlay1 {
  font-family: 'Playfair Display', serif;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.3s ease;
  font-size: 1rem;
  font-weight: 500;
}

.gallery-item1:hover .overlay1 {
  opacity: 1;
}

.gallery-item1 .orange-line {
  margin-top: 8px;
  height: 3px;
  width: 40%;
  background-color: orange;
}

/* ВИДЕО-ОБЁРТКА */
.video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.video-wrapper .overlay1 {
  pointer-events: none;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  background: rgba(0,0,0,0.4);
  transition: 0.3s ease;
  color: white;
  font-size: 1rem;
  font-weight: 500;
}

.video-wrapper:hover .overlay1 {
  opacity: 1;
}

/* СТИЛИ ДЛЯ FANCYBOX */
.fancybox__caption {
  background: #f9f9f9;
  color: #111;
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  padding: 16px 24px;
  text-align: center;
  border-top: 2px solid orange;
}

.fancybox__caption .orange-line {
  margin-top: 8px;
  height: 3px;
  width: 40%;
  background-color: orange;
}

/* МОБИЛЬНАЯ АДАПТАЦИЯ */
@media (max-width: 1200px) {
  .gallery-wrapper {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .gallery-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .gallery-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 6px;
    margin: 0 auto;
  }

  .gallery-item1 {
    flex: 0 0 100%;
    max-width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
  }

  .gallery-item1.big {
    flex: 0 0 100%;
    max-width: 100%;
    aspect-ratio: 4 / 3;
  }

  .gallery-item1 img,
  .gallery-item1 video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .overlay1 {
    font-size: 14px;
    padding: 8px 10px;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    position: absolute;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .gallery-item1:hover .overlay1 {
    opacity: 1;
  }

  .orange-line {
    width: 40px;
    height: 2px;
    background-color: orange;
    margin: 6px auto 0 auto;
  }
}
.gallery-item1 .overlay1 {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gallery-item1:hover .overlay1,
.gallery-item1.visible-overlay1 .overlay1 {
  opacity: 1;
}
.play-button {
  position: absolute;
  z-index: 3;
  font-size: 48px;
  color: white;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.play-icon {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  font-size: 48px;
  color: white;
  transform: translate(-50%, -50%);
  pointer-events: none;
  text-shadow: 0 0 8px rgba(0,0,0,0.6);
}

