/* Palmira Garden — atmosphere block
   Figma: https://www.figma.com/design/KcPohgKZDnl1YD5griwQgD (node 25:2) */

/* AJAX-маунт: плавное появление после подгрузки */
.pg-atmosphere-mount .pg-atmosphere {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease-out, transform 700ms ease-out;
  will-change: opacity, transform;
}
.pg-atmosphere-mount.is-ready .pg-atmosphere {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .pg-atmosphere-mount .pg-atmosphere,
  .pg-atmosphere-mount.is-ready .pg-atmosphere {
    transition: none;
    transform: none;
    opacity: 1;
  }
}

.pg-atmosphere {
  --pg-text: #222;
  --pg-text-muted: #444;
  --pg-text-soft: #666;
  --pg-card-bg: #f5f8f7;
  --pg-card-border: #e5ebe9;
  --pg-brand: #124734;
  --pg-white: #fff;

  font-family: "Geometria", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--pg-text);
  background: var(--pg-white);
  padding: 60px 20px;
  box-sizing: border-box;
}

.pg-atmosphere *,
.pg-atmosphere *::before,
.pg-atmosphere *::after { box-sizing: border-box; }

.pg-atmosphere__inner {
  max-width: 1170px;
  margin: 0 auto;
}

/* Header */
.pg-atmosphere__header {
  text-align: center;
  margin-bottom: 40px;
}

.pg-atmosphere__title {
  font-size: 30px;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--pg-text);
  margin: 0 0 16px;
}

.pg-atmosphere__subtitle {
  font-size: 20px;
  line-height: 1.35;
  font-weight: 400;
  color: var(--pg-text-muted);
  margin: 0 auto;
  max-width: 800px;
}

/* Features card */
.pg-features {
  background: var(--pg-card-bg);
  border: 1px solid var(--pg-card-border);
  border-radius: 20px;
  padding: 32px 40px;
  margin-bottom: 24px;
}

.pg-features__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 36px;
}

.pg-features__title {
  font-size: 28px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--pg-text);
  margin: 0;
  flex: 1 1 auto;
}

.pg-features__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pg-brand);
  color: var(--pg-white);
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 15px 30px;
  border-radius: 6px;
  white-space: nowrap;
  transition: background .2s ease, transform .2s ease;
}

.pg-features__cta:hover {
  background: #0e3a2a;
  transform: translateY(-1px);
}

/* 4×2 grid of features */
.pg-features__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: auto;
  column-gap: 32px;
  row-gap: 0;
}

/* divider between rows */
.pg-features__grid > .pg-feature:nth-child(n + 5) {
  border-top: 1px solid var(--pg-card-border);
  margin-top: 24px;
  padding-top: 24px;
}

.pg-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 4px 0;
}

.pg-feature__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.pg-feature__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pg-feature__title {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
  color: #333;
}

.pg-feature__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 400;
  color: var(--pg-text-soft);
}

/* Gallery / slider */
.pg-gallery {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 1170 / 485;
  background: #e8ebe9;
  min-height: 280px;
}

.pg-gallery__track {
  position: relative;
  width: 100%;
  height: 100%;
}

.pg-gallery__slide {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}

.pg-gallery__slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.pg-gallery__dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}

.pg-gallery__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.pg-gallery__dot.is-active {
  background: var(--pg-white);
  transform: scale(1.2);
}

.pg-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--pg-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s ease;
}

.pg-gallery__nav:hover { background: rgba(255, 255, 255, 0.25); }
.pg-gallery__nav--prev { left: 14px; }
.pg-gallery__nav--next { right: 14px; }

/* ===== Responsive ===== */

/* Tablet landscape: 4 колонки остаются, уменьшаем gap */
@media (max-width: 1200px) {
  .pg-features__grid { column-gap: 20px; }
}

/* Tablet: 2 колонки, разделители между рядами пар */
@media (max-width: 900px) {
  .pg-atmosphere { padding: 50px 20px; }
  .pg-atmosphere__title { font-size: 26px; }
  .pg-atmosphere__subtitle { font-size: 18px; }
  .pg-atmosphere__subtitle br { display: none; }

  .pg-features { padding: 28px 28px; }
  .pg-features__top {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
  }
  .pg-features__title { font-size: 24px; }

  .pg-features__grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 24px;
    row-gap: 0;
  }

  /* Сброс десктопных разделителей (которые были после 4-й карточки) */
  .pg-features__grid > .pg-feature:nth-child(n + 5) {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
  }

  /* Разделитель между рядами пар: каждая 3-я и 5-я и 7-я (т.е. начиная со 2-го ряда) */
  .pg-features__grid > .pg-feature:nth-child(2n + 3),
  .pg-features__grid > .pg-feature:nth-child(2n + 3) + .pg-feature {
    border-top: 1px solid var(--pg-card-border);
    margin-top: 20px;
    padding-top: 20px;
  }
}

/* Mobile: 2 колонки, иконка сверху над текстом */
@media (max-width: 640px) {
  .pg-atmosphere { padding: 36px 16px; }
  .pg-atmosphere__title {
    font-size: 20px;
    line-height: 1.3;
  }
  .pg-atmosphere__subtitle {
    font-size: 15px;
    line-height: 1.45;
  }
  .pg-atmosphere__subtitle br { display: none; }
  .pg-atmosphere__title br { display: none; }

  .pg-features {
    padding: 20px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
  }
  .pg-features__title {
    font-size: 18px;
    line-height: 1.3;
  }
  /* На мобиле заголовок должен переноситься — br оставляем */
  .pg-features__cta {
    padding: 13px 22px;
    font-size: 12px;
    width: 100%;
  }

  .pg-features__grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 12px;
    row-gap: 0;
  }

  /* Сброс десктопных разделителей */
  .pg-features__grid > .pg-feature:nth-child(n + 5) {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
  }

  /* Разделитель между рядами пар: карточки начиная с 3-й (т.е. со 2-го ряда) */
  .pg-features__grid > .pg-feature:nth-child(2n + 3),
  .pg-features__grid > .pg-feature:nth-child(2n + 3) + .pg-feature {
    border-top: 1px solid var(--pg-card-border);
    margin-top: 18px;
    padding-top: 18px;
  }

  /* Иконка сверху, текст снизу */
  .pg-feature {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .pg-feature__icon {
    margin-top: 0;
    width: 22px;
    height: 22px;
  }
  .pg-feature__title {
    font-size: 13px;
    line-height: 1.3;
  }
  .pg-feature__text {
    font-size: 12px;
    line-height: 1.4;
  }

  /* Галерея: фиксированная высота вместо слишком узкого aspect-ratio */
  .pg-gallery {
    aspect-ratio: auto;
    height: 260px;
    min-height: 260px;
    border-radius: 12px;
  }
  .pg-gallery__nav {
    width: 32px;
    height: 32px;
  }
  .pg-gallery__nav--prev { left: 10px; }
  .pg-gallery__nav--next { right: 10px; }
}

/* Small phones */
@media (max-width: 380px) {
  .pg-features__grid {
    grid-template-columns: 1fr;
    row-gap: 16px;
  }
  .pg-gallery {
    height: 220px;
    min-height: 220px;
  }
}
