/* ============================================================
   Переменные темы: палитра и шрифты собраны в одном месте —
   чтобы поменять оттенок или шрифт, достаточно поправить значение здесь,
   а не искать по всему файлу.
   ============================================================ */
:root {
  --color-bg: #faf6f0;          /* тёплый кремовый фон страницы */
  --color-surface: #ffffff;     /* карточки, всплывающие блоки */
  --color-surface-muted: #f2ece2; /* мягкий акцентный фон (баннеры) */
  --color-text: #362f2b;        /* тёплый почти-чёрный, мягче чистого #000 */
  --color-text-muted: rgba(54, 47, 43, 0.65);
  --color-border: rgba(54, 47, 43, 0.12);

  --color-accent: #a6613f;      /* терракотовый — кнопки, акценты */
  --color-accent-dark: #8b4f34; /* тёмный терракотовый — hover */
  --color-secondary: #7c8a6e;   /* приглушённый шалфейный зелёный — вторичные акценты */

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  --radius: 12px;
  --shadow-soft: 0 4px 24px rgba(54, 47, 43, 0.06);
}

/* базовый сброс отступов и box-sizing — стандартная практика перед версткой */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth; /* плавный переход при клике по ссылкам меню (#about, #services и т.д.) */
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--color-text);
  background: var(--color-bg);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-bottom: 8px;
}

h3 {
  font-size: 1.3rem;
}

h4 {
  font-size: 1.1rem;
}

a {
  color: var(--color-accent);
}

.section {
  max-width: 960px;
  margin: 0 auto;
  padding: 96px 24px;
  scroll-margin-top: 84px; /* отступ при переходе по ссылке из меню — компенсирует высоту sticky-шапки */
}

/* --- шапка --- */
.header {
  position: sticky;
  top: 0;
  background: rgba(250, 246, 240, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-border);
  z-index: 10;
}

.nav {
  position: relative; /* точка отсчёта для выпадающего мобильного меню (.nav__links при max-width: 768px) */
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 24px;
}

.nav__logo {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
}

/* бургер-кнопка: скрыта на десктопе, показывается только в мобильном media-запросе ниже */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav__toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* когда меню открыто — превращаем три полоски в крестик */
.nav__toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav__toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav__links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.nav__links a {
  text-decoration: none;
  color: var(--color-text);
  transition: color 0.2s ease;
}

.nav__links a:hover {
  color: var(--color-accent);
}

.nav__cta {
  background: var(--color-accent);
  color: #fff !important;
  padding: 10px 20px;
  border-radius: 30px;
}

.nav__cta:hover {
  background: var(--color-accent-dark);
}

/* --- Hero --- */
.hero {
  text-align: center;
  padding: 140px 24px 100px;
  max-width: 780px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  letter-spacing: -0.01em;
}

.hero p {
  margin-top: 20px;
  font-size: 1.15rem;
  color: var(--color-text-muted);
}

/* --- кнопки --- */
.btn {
  display: inline-block;
  margin-top: 24px;
  padding: 15px 32px;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 500;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  background: var(--color-accent-dark);
  transform: translateY(-1px);
}

.btn--outline {
  margin-top: 0;
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn--outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: transparent;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
}

/* --- подвал --- */
.footer {
  text-align: center;
  padding: 48px 20px;
  font-size: 14px;
  color: var(--color-text-muted);
}

/* --- блок "Обо мне": фото + текст рядом --- */
.about {
  display: flex;
  gap: 56px;
  align-items: center;
}

.about__photo img {
  width: 300px;
  border-radius: var(--radius);
  display: block;
  box-shadow: var(--shadow-soft);
}

.about__text {
  flex: 1;
}

.about__text p {
  margin-top: 16px;
}

.credentials {
  list-style: none;
  margin-top: 20px;
}

.credentials li {
  padding-left: 22px;
  position: relative;
  margin-bottom: 14px;
  color: var(--color-text-muted);
}

.credentials li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-size: 0.85em;
}

/* --- карточки услуг --- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(54, 47, 43, 0.1);
}

.card h3 {
  margin-bottom: 12px;
  font-size: 1.15rem;
  color: var(--color-accent-dark);
}

.card p {
  color: var(--color-text-muted);
  font-size: 0.97rem;
}

/* --- список методов терапии --- */
.methods {
  list-style: none;
  margin-top: 20px;
}

.methods li {
  padding-left: 22px;
  position: relative;
  margin-bottom: 10px;
}

.methods li::before {
  content: "●";
  position: absolute;
  left: 0;
  font-size: 8px;
  top: 8px;
  color: var(--color-secondary);
}

/* --- сноски-дисклеймеры --- */
.disclaimer {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: 28px;
  font-style: italic;
}

/* --- баннер призыва к действию (бесплатная консультация / подписка) --- */
.cta-banner {
  background: var(--color-surface-muted);
  border-radius: var(--radius);
  padding: 40px;
  margin-top: 48px;
  text-align: center;
}

.cta-banner h3 {
  color: var(--color-accent-dark);
}

.cta-banner p {
  margin-top: 10px;
}

.cta-banner__note {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: 8px;
}

.cta-banner--subscribe {
  max-width: 960px;
  margin: 0 auto;
  background: var(--color-surface-muted);
  border-radius: var(--radius);
}

/* --- галереи (прошедшие мероприятия / отзывы) --- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.gallery__item {
  position: relative;
  cursor: zoom-in;
}

.gallery__item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  transition: opacity 0.2s ease;
}

.gallery__item img:hover {
  opacity: 0.88;
}

.gallery--reviews .gallery__item img {
  height: 260px;
  object-fit: contain; /* отзывы — это скриншоты переписки, их не обрезаем */
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.gallery__caption {
  display: block;
  font-size: 13px;
  text-align: center;
  margin-top: 8px;
  color: var(--color-text-muted);
}

.events-list {
  margin-top: 20px;
}

.event-item {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
}

.event-item h4 {
  color: var(--color-accent-dark);
}

.event-item__date {
  font-weight: 600;
  color: var(--color-secondary);
  margin: 6px 0 14px;
}

.event-item__contact {
  margin-top: 14px;
  font-size: 14px;
  color: var(--color-text-muted);
}

/* --- FAQ --- */
.faq-item {
  padding: 22px 0;
  border-bottom: 1px solid var(--color-border);
}

.faq-item h4 {
  margin-bottom: 8px;
}

.faq-item p {
  color: var(--color-text-muted);
}

/* --- лайтбокс: увеличенный показ фото по клику --- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30, 26, 23, 0.92);
  z-index: 100;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
}

/* --- таблица цен --- */
.prices-list {
  margin-top: 28px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--color-border);
}

.price-row__title {
  font-weight: 600;
}

.price-row__value {
  color: var(--color-accent-dark);
  font-weight: 600;
  white-space: nowrap;
}

/* --- форма контактов --- */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 480px;
  margin-top: 24px;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.contact-form input,
.contact-form textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.2s ease;
}

.contact-form textarea {
  min-height: 100px;
  resize: vertical;
}

/* ошибки валидации: скрыты, пока пусты; текст и рамка поля подсвечиваются в JS через class has-error */
.form-error {
  display: block;
  min-height: 18px;
  margin-top: 6px;
  font-size: 13px;
  color: #b3452f;
}

.form-field.has-error input,
.form-field.has-error textarea {
  border-color: #b3452f;
}

.form-success {
  display: none;
  margin-top: 4px;
  font-size: 0.95rem;
  color: var(--color-secondary);
  font-weight: 500;
}

.form-success.visible {
  display: block;
}

.form-error--general {
  min-height: 0;
  font-weight: 500;
}

/* honeypot-поле спрятано визуально, но остаётся в разметке —
   так его "видят" и заполняют только автоматические боты, не люди */
.form-field--honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form button {
  align-self: flex-start;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  padding: 14px 32px;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.contact-form button:hover {
  background: var(--color-accent-dark);
}

/* --- адаптивность (Этап A4) --- */
@media (max-width: 768px) {
  .section {
    padding: 64px 20px;
  }

  .nav__toggle {
    display: flex; /* на мобильных показываем бургер вместо горизонтального списка ссылок */
  }

  /* меню-список превращается в выпадающую панель на всю ширину под шапкой */
  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 8px 24px 16px;

    /* скрыта по умолчанию: max-height 0 вместо display:none — так работает плавная анимация раскрытия */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav__links.active {
    max-height: 420px; /* с запасом больше, чем реально занимает список пунктов */
  }

  .nav__links li {
    width: 100%;
  }

  .nav__links a {
    display: block;
    padding: 12px 0;
  }

  .nav__cta {
    display: inline-block;
    margin: 8px 0 4px;
  }

  .about {
    flex-direction: column;
    text-align: center;
  }

  .about__photo img {
    width: 220px;
  }

  .price-row {
    flex-direction: column;
    gap: 4px;
  }
}

/* доп. подстройка для совсем маленьких экранов (старые/бюджетные телефоны) */
@media (max-width: 420px) {
  .hero {
    padding: 110px 20px 72px;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .gallery__item img {
    height: 160px;
  }

  .cta-banner {
    padding: 28px 20px;
  }

  .contact-links {
    flex-direction: column;
  }
}

/* --- scroll-reveal: лёгкое появление блоков при прокрутке (Этап A5) ---
   Класс .reveal ставится в HTML на нужные блоки, класс .in-view добавляется
   через JS (IntersectionObserver в main.js), когда блок появляется во вьюпорте. */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* уважаем настройку "уменьшить анимацию" в ОС/браузере — не всем комфортно смотреть на движение */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
