/* page-gallery — галереи проектов (proekty / interery / eksterery).
   Как на Tilda: тёмный слайдер избранных проектов сверху,
   ниже белый фон с заголовком слева и сеткой карточек. */

.gallery-page {
  background: #fff;
  color: #1a1a1a;
  padding-bottom: 0;
}

/* --- Слайдер избранных проектов --- */
.gallery-slider {
  position: relative;
  height: clamp(300px, 44vw, 540px);
  overflow: hidden;
  background: #1c1c1c;
}

.gallery-slider__track,
.gallery-slider__slide {
  position: absolute;
  inset: 0;
}

.gallery-slider__slide {
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.gallery-slider__slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(40, 40, 40, 0.5);
}

.gallery-slider__slide--active {
  opacity: 1;
  pointer-events: auto;
}

.gallery-slider__content {
  max-width: 1200px;
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 26px;
}

.gallery-slider__title {
  font-size: 45px;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  margin: 0;
}

.gallery-slider__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 34px;
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  transition: background 0.3s ease, color 0.3s ease;
  margin-top: 15px;
}

.gallery-slider__cta:hover {
  background: #fff;
  color: #1a1a1a;
}

.gallery-slider__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  color: #cd9b3b;
  cursor: pointer;
  transition: color 0.25s ease;
}

.gallery-slider__arrow:hover {
  color: #fff;
}

.gallery-slider__arrow--prev {
  left: 8px;
}

.gallery-slider__arrow--next {
  right: 8px;
}

/* --- Заголовок раздела (белая зона, текст слева) --- */
.gallery-hero {
  padding: 44px 0 8px;
  text-align: left;
}

/* Мелкая строка (H1 на Tilda) */
.gallery-hero__eyebrow {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  color: #1a1a1a;
  margin: 0 0 4px;
}

/* Крупный заголовок раздела */
.gallery-hero__title {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 500;
  line-height: 1.2;
  color: #1a1a1a;
  margin: 0;
}

/* --- Сетки проектов --- */
.gallery-section {
  padding: 24px 0 56px;
}

.gallery-section--bbq {
  padding-top: 28px;
}

.gallery-section--more {
  padding-top: 8px;
}

.gallery-section__title {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 500;
  text-align: center;
  margin-bottom: 32px;
  color: #1a1a1a;
  letter-spacing: 0.04em;
}

.gallery-section--more .gallery-section__title {
  font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
}

.gallery-section .container {
  max-width: 1200px;
}

.gallery-card {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #f2f2f2;
}

.gallery-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.gallery-card__title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 20px 60px 20px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  color: #fff;
  /*background: linear-gradient(180deg, #0000004f, rgba(0, 0, 0, 6.82));*/
  background: linear-gradient(
          to bottom,
          rgba(0, 0, 0, 0) 0%,
          rgba(0, 0, 0, 0.15) 15%,
          rgba(0, 0, 0, 0.45) 35%,
          rgba(0, 0, 0, 0.82) 100%
  );
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-card:hover .gallery-card__img,
.gallery-card:focus-visible .gallery-card__img {
  transform: scale(1.05);
}

.gallery-card:hover .gallery-card__title,
.gallery-card:focus-visible .gallery-card__title {
  opacity: 1;
  transform: translateY(0);
}

.gallery-hero .container {
  max-width: 1200px;
}

@media (max-width: 1199px) {
  .gallery-slider__content {
    max-width: 800px;
  }

  .gallery-hero .container,
  .gallery-section .container {
    max-width: 950px;
  }

  .gallery-card__title {
    opacity: 1;
  }
}

@media (max-width: 899px) {
  .gallery-slider__content {
    max-width: 600px;
  }

  .gallery-hero .container, .gallery-section .container {
    max-width: 650px;
  }

  .gallery-card__title {
    padding: 10px 10px 25px 10px;
    font-size: 13px;
  }
}

@media (max-width: 599px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-slider__content {
    max-width: 300px;
  }

  .gallery-slider__title {
    font-size: 26px;
  }

  .gallery-slider {
    height: 500px;
  }

  .gallery-hero .container, .gallery-section .container {
    max-width: 350px;
  }

  .gallery-slider__arrow svg {
    width: 20px;
    height: 28px;
  }
}

@media (max-width: 640px) {
  .gallery-card__title {
    opacity: 1;
    transform: none;
  }

  .gallery-hero {
    padding: 32px 0 4px;
  }

  .gallery-section {
    padding-bottom: 40px;
  }

  .gallery-section--more .gallery-section__title {
    letter-spacing: 0.1em;
    margin-bottom: 24px;
  }
}

@media (max-width: 400px) {
  .gallery-slider__content {
    max-width: 250px;
  }
}