/* ТСН «Благодатное» — публичная часть */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Outfit:wght@500;600;700&display=swap');

:root {
  --bs-primary: #2d6a4f;
  --bs-primary-rgb: 45, 106, 79;
  --bs-body-color: #1c1917;
  --bs-body-bg: #f4f1ec;

  --bg: #f0ebe3;
  --bg-elevated: #faf8f4;
  --text: #1c1917;
  --text-soft: #44403c;
  --muted: #78716c;
  --accent: #2d6a4f;
  --accent-2: #1b4332;
  --accent-glow: rgba(45, 106, 79, 0.35);
  --earth: #6b4423;
  --earth-light: #8b6914;
  --leaf: #40916c;
  --border: rgba(28, 25, 23, 0.08);
  --shadow: 0 4px 24px rgba(28, 25, 23, 0.06);
  --shadow-lg: 0 20px 50px rgba(28, 25, 23, 0.12);
  --radius: 16px;
  --radius-sm: 12px;
  --header-h: 64px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --font: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Outfit', var(--font);
  --home-slider-h: min(78vh, 640px);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 1.02rem;
  -webkit-font-smoothing: antialiased;
}

main {
  position: relative;
  z-index: 1;
}

.site-bg-deco {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.site-bg-deco span {
  position: absolute;
  width: min(42vw, 380px);
  height: min(42vw, 380px);
  border-radius: 50%;
  filter: blur(78px);
  opacity: 0.22;
}

.site-bg-deco span:nth-child(1) {
  background: var(--leaf);
  top: 8%;
  left: -10%;
  animation: deco-drift-a 24s ease-in-out infinite;
}

.site-bg-deco span:nth-child(2) {
  background: var(--earth-light);
  bottom: 2%;
  right: -8%;
  animation: deco-drift-b 28s ease-in-out infinite;
}

.site-bg-deco span:nth-child(3) {
  background: var(--accent);
  top: 42%;
  right: 12%;
  width: min(30vw, 280px);
  height: min(30vw, 280px);
  opacity: 0.16;
  animation: deco-drift-c 32s ease-in-out infinite;
}

@keyframes deco-drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(36px, 20px) scale(1.05); }
}

@keyframes deco-drift-b {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-28px, -32px); }
}

@keyframes deco-drift-c {
  0%, 100% { transform: translate(0, 0); }
  40% { transform: translate(-20px, 24px); }
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 1.5rem);
}

.flex { display: flex; gap: 1rem; }
.flex.between { justify-content: space-between; }
.flex.center { align-items: center; }

a {
  color: var(--accent-2);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ——— Шапка ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(250, 248, 244, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.35s var(--ease-out);
}

.site-header.is-scrolled {
  box-shadow: var(--shadow);
}

.site-header .container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 861px) {
  .site-header .container .nav {
    margin-left: auto;
  }
}

@media (max-width: 860px) {
  .site-header .container {
    flex-wrap: wrap;
  }
  .site-header .container .logo {
    flex: 1;
  }
  .site-header .container .nav-toggle {
    flex-shrink: 0;
  }
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  background: linear-gradient(120deg, var(--accent), var(--earth));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: rgba(28, 25, 23, 0.07);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.3s var(--ease-out), opacity 0.2s;
}

.site-header.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.nav a {
  color: var(--text-soft);
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}

.nav a:hover {
  color: var(--accent-2);
  background: rgba(45, 106, 79, 0.12);
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    flex-wrap: nowrap;
    padding: 1rem;
    background: rgba(250, 248, 244, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    gap: 0.15rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.45s var(--ease-out), opacity 0.25s;
  }
  .site-header.nav-open .nav {
    max-height: 420px;
    opacity: 1;
    pointer-events: auto;
  }
  .nav a { border-radius: 12px; }
}

/* ——— Главный слайдер (на всю ширину) ——— */
.home-main-wrap {
  position: relative;
  width: 100%;
}

.home-main-swiper {
  width: 100%;
  height: var(--home-slider-h);
  background: #1a1512;
}

.home-main-swiper .swiper-slide {
  position: relative;
  overflow: hidden;
}

.home-slide-media {
  position: absolute;
  inset: 0;
}

.home-slide-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 8s var(--ease-out);
}

.home-main-swiper .swiper-slide-active .home-slide-media img {
  transform: scale(1);
}

.home-slide-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(26, 21, 18, 0.75) 0%,
    rgba(26, 21, 18, 0.35) 38%,
    rgba(26, 21, 18, 0.2) 100%
  );
  pointer-events: none;
}

.home-slide-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.home-slide-text {
  max-width: min(36rem, 92vw);
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.home-slide-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.85rem, 5vw, 2.85rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 0.75rem;
}

.home-slide-sub {
  margin: 0 0 1.35rem;
  font-size: 1.05rem;
  line-height: 1.55;
  opacity: 0.95;
  max-width: 32rem;
}

.home-slide-btn {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  font-weight: 600;
  box-shadow: 0 8px 28px rgba(45, 106, 79, 0.45);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
}

.home-slide-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(45, 106, 79, 0.5);
}

.home-main-swiper .home-main-pagination {
  bottom: 1.35rem !important;
}

.home-main-swiper .home-main-pagination .swiper-pagination-bullet {
  background: #fff;
  opacity: 0.4;
  width: 10px;
  height: 10px;
  transition: opacity 0.2s, transform 0.2s;
}

.home-main-swiper .home-main-pagination .swiper-pagination-bullet-active {
  opacity: 1;
  transform: scale(1.2);
  background: var(--leaf);
}

.home-main-swiper .home-main-prev,
.home-main-swiper .home-main-next {
  color: #fff;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  backdrop-filter: blur(8px);
  transition: background 0.2s, transform 0.2s;
}

.home-main-swiper .home-main-prev:hover,
.home-main-swiper .home-main-next:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.06);
}

.home-main-swiper .home-main-prev::after,
.home-main-swiper .home-main-next::after {
  font-size: 1.1rem;
  font-weight: 700;
}

@media (max-width: 860px) {
  :root {
    --home-slider-h: min(70vh, 520px);
  }
  .home-main-swiper .home-main-prev,
  .home-main-swiper .home-main-next {
    display: none;
  }
}

/* ——— Hero (запасной баннер) ——— */
.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 5rem) 0 clamp(2.5rem, 6vw, 4rem);
  overflow: hidden;
  color: #fff;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 15% 35%, rgba(64, 145, 108, 0.45), transparent 52%),
    radial-gradient(ellipse 55% 70% at 85% 25%, rgba(107, 105, 35, 0.35), transparent 48%),
    linear-gradient(145deg, #1b4332 0%, #2d6a4f 42%, #3f2e1f 100%);
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.6;
  z-index: 0;
  animation: hero-drift 28s linear infinite;
}

@keyframes hero-drift {
  from { transform: translate(0, 0); }
  to { transform: translate(-60px, -60px); }
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.85rem, 5vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 1rem;
  max-width: 18ch;
  animation: hero-title-in 0.9s var(--ease-out) both;
}

@keyframes hero-title-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

.lead {
  margin: 0;
  font-size: 1.05rem;
  max-width: 36rem;
  opacity: 0.92;
  line-height: 1.65;
  animation: hero-title-in 0.9s var(--ease-out) 0.1s both;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 1rem;
  animation: hero-title-in 0.9s var(--ease-out) both;
}

.hero-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 12px #34d399;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.85); }
}

/* ——— Секции ——— */
.section {
  padding: clamp(2.5rem, 5vw, 3.75rem) 0;
}

.section.alt {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  color: var(--text);
  position: relative;
  display: inline-block;
}

.section h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--earth-light));
}

/* Появление при скролле (класс вешает JS) */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.prose {
  max-width: 52rem;
  color: var(--text-soft);
}

.prose p:first-child { margin-top: 0; }

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ——— Галерея / Swiper ——— */
.gallery-wrap {
  margin-top: 0.5rem;
  position: relative;
}

.gallery-swiper {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #1a1512;
  padding-bottom: 2.5rem;
}

.gallery-swiper .swiper-slide {
  height: auto;
}

.gallery-slide {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
}

.gallery-slide a {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.gallery-slide a::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 21, 18, 0.55), transparent 45%);
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}

.gallery-slide a:hover::after { opacity: 1; }

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.gallery-slide a:hover img {
  transform: scale(1.04);
}

.gallery-slide figcaption {
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  color: var(--text-soft);
  border-top: 1px solid var(--border);
}

.gallery-swiper .swiper-button-prev,
.gallery-swiper .swiper-button-next {
  color: #fff;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  transition: background 0.2s, transform 0.2s;
}

.gallery-swiper .swiper-button-prev:hover,
.gallery-swiper .swiper-button-next:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.05);
}

.gallery-swiper .swiper-button-prev::after,
.gallery-swiper .swiper-button-next::after {
  font-size: 1rem;
  font-weight: 700;
}

.gallery-swiper .swiper-pagination-bullet {
  background: #fff;
  opacity: 0.35;
  transition: opacity 0.2s, transform 0.2s;
}

.gallery-swiper .swiper-pagination-bullet-active {
  opacity: 1;
  transform: scale(1.15);
  background: var(--accent);
}

/* ——— Карта ——— */
.map-section .map-wrap {
  height: min(72vh, 580px);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 1rem;
  box-shadow: var(--shadow);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  margin-bottom: 0.25rem;
}

.legend .lg {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: rgba(45, 106, 79, 0.1);
  border-radius: 999px;
  font-size: 0.88rem;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.swatch.sale { background: #2ecc71; }
.swatch.sold { background: #94a3b8; }

/* ——— Контакты ——— */
.contacts-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.75rem;
}

.contacts-list li {
  padding: 1rem 1.15rem;
  background: rgba(45, 106, 79, 0.08);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
}

.contacts-list li:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* ——— Подвал ——— */
.site-footer {
  padding: 1.25rem 0;
  font-size: 0.88rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent-2);
}

/* Leaflet контролы поверх карты */
/* Bootstrap: кнопки в палитре сайта */
.btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-2);
  --bs-btn-hover-border-color: var(--accent-2);
  --bs-btn-active-bg: var(--accent-2);
  --bs-btn-active-border-color: var(--accent-2);
  --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}

