/*
 * Лендинг `P-01`. Порядок блоков и их состав — из прототипа
 * «Landing - TopBro.dc.html» с блоком «Живой календарь» из
 * «TopBro Landing.dc.html» (решение из `docs/ui-map.md`).
 *
 * Высоты фотоблоков (220px у портрета, 340px у плитки работ) взяты из
 * прототипа: размеров под макет в дизайн-системе нет — там типографика,
 * отступы и радиусы. Всё остальное — токены.
 */

/* ─── Герой ──────────────────────────────────────────────────────────────── */

.hero {
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  position: relative;
  padding-top: var(--space-9);
  padding-bottom: var(--space-9);
}

.hero__photo-note {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  font-size: var(--text-caption-size);
  letter-spacing: var(--text-caption-tracking);
  color: var(--neutral-500);
}

.hero__title {
  font-size: var(--text-display-size);
  line-height: var(--text-display-line);
  font-weight: var(--text-display-weight);
  letter-spacing: var(--text-display-tracking);
  margin-bottom: var(--space-5);
  max-width: 900px;
}

.hero__text {
  font-size: var(--text-body-l-size);
  line-height: var(--text-body-l-line);
  color: var(--neutral-100);
  max-width: 520px;
  margin-bottom: var(--space-6);
}

.hero__actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ─── Плитки доверия ─────────────────────────────────────────────────────── */

.trust {
  padding-top: var(--space-7);
  padding-bottom: var(--space-7);
  border-top: var(--border-width) solid var(--neutral-700);
}

.trust__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

.trust__item {
  text-align: center;
}

.trust__value {
  font-size: var(--text-h3-size);
  line-height: var(--text-h3-line);
  font-weight: var(--text-h3-weight);
  letter-spacing: var(--text-h3-tracking);
}

.trust__label {
  font-size: var(--text-body-s-size);
  color: var(--color-text-secondary-inverse);
  margin-top: var(--space-1);
}

/* ─── Четыре шага ────────────────────────────────────────────────────────── */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

.step__num {
  font-size: var(--text-h1-size);
  line-height: var(--text-h1-line);
  font-weight: var(--text-h1-weight);
  letter-spacing: var(--text-h1-tracking);
  color: var(--neutral-100);
  margin-bottom: var(--space-3);
}

.step__title {
  font-size: var(--text-body-l-size);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-2);
}

/* ─── Услуги ─────────────────────────────────────────────────────────────── */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.service-card {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
}

.service-card__text {
  margin: var(--space-2) 0 var(--space-4);
  flex: 1;
}

.service-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-4);
}

.service-card__price {
  font-size: var(--text-body-l-size);
  font-weight: var(--font-weight-bold);
}

.service-card__link {
  align-self: flex-start;
}

/* ─── Мастера ────────────────────────────────────────────────────────────── */

.masters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

.master-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.master-card__photo {
  display: block;
  height: 220px;
  background: var(--neutral-100);
}

.master-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.master-card__photo-note {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-caption-size);
  letter-spacing: var(--text-caption-tracking);
  color: var(--color-text-secondary);
}

.master-card__body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.master-card__name {
  font-size: var(--text-body-m-size);
  font-weight: var(--font-weight-bold);
}

.master-card__spec {
  margin-bottom: var(--space-2);
}

.master-card__bio {
  font-size: var(--text-caption-size);
  line-height: var(--text-body-s-line);
  letter-spacing: 0;
  font-weight: var(--font-weight-regular);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
  flex: 1;
}

/* ─── Живой календарь ────────────────────────────────────────────────────── */

.live {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7);
  align-items: center;
}

.live__title {
  font-size: var(--text-h2-size);
  line-height: var(--text-h2-line);
  font-weight: var(--text-h2-weight);
  letter-spacing: var(--text-h2-tracking);
  margin: var(--space-4) 0;
}

.live__text {
  font-size: var(--text-body-m-size);
  line-height: var(--text-body-m-line);
  color: var(--color-text-secondary);
  max-width: 420px;
}

.live__card {
  padding: var(--space-5);
}

.live__card-head {
  font-size: var(--text-body-s-size);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.live__slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}

.slot {
  display: block;
  padding: var(--space-3) 0;
  text-align: center;
  border-radius: var(--radius-md);
  font-size: var(--text-body-s-size);
  font-weight: var(--font-weight-medium);
  background: var(--slot-free-bg);
  border: var(--border-width) solid var(--slot-free-border);
  color: var(--slot-free-text);
}

.slot:hover {
  background: var(--slot-selected-bg);
  border-color: var(--slot-selected-border);
  color: var(--slot-selected-text);
}

.live__empty {
  font-size: var(--text-body-s-size);
  color: var(--color-text-secondary);
}

.live__empty a {
  display: inline-block;
  margin-top: var(--space-3);
}

/* ─── Работы ─────────────────────────────────────────────────────────────── */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.gallery__item {
  position: relative;
  height: 340px;
  border-radius: var(--radius-lg);
  background: var(--neutral-100);
  display: flex;
  align-items: flex-end;
  padding: var(--space-4);
}

.gallery__name {
  font-size: var(--text-h4-size);
  line-height: var(--text-h4-line);
  font-weight: var(--text-h4-weight);
}

/* ─── Отзывы ─────────────────────────────────────────────────────────────── */

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.review {
  position: relative;
  background: var(--neutral-800);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.review__quote {
  position: absolute;
  top: var(--space-4);
  right: var(--space-5);
  font-size: var(--text-h1-size);
  font-weight: var(--font-weight-bold);
  line-height: 1;
  color: var(--neutral-600);
}

.review__text {
  font-size: var(--text-body-m-size);
  line-height: var(--text-body-m-line);
  color: var(--neutral-100);
  margin-bottom: var(--space-5);
  max-width: 85%;
}

.review__author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.review__avatar {
  width: var(--space-6);
  height: var(--space-6);
  border-radius: var(--radius-pill);
  background: var(--neutral-600);
  flex: 0 0 auto;
}

.review__name {
  font-size: var(--text-body-s-size);
  font-weight: var(--font-weight-bold);
}

.review__master {
  font-size: var(--text-caption-size);
  color: var(--color-text-secondary-inverse);
}

/* ─── Контакты ───────────────────────────────────────────────────────────── */

.contacts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7);
}

/*
 * Шаг между группами — `--space-4`, а не `--space-5`.
 *
 * Групп четыре, и в каждой одна-две строки: адрес, телефон, часы, соцсети.
 * При 24px между ними и 32px от заголовка колонка растягивалась так, что
 * карта рядом вытягивалась вслед за ней — половину секции занимал пустой
 * прямоугольник. Подпись прижата к своему значению вплотную (`--space-1`):
 * «АДРЕС» и сам адрес — одна вещь, и отделять их тем же отступом, что и
 * соседние группы, значит стирать различие между «внутри» и «между».
 */
.contacts__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.contacts__label {
  margin-bottom: var(--space-1);
}

.contacts__value {
  font-size: var(--text-body-m-size);
}

.contacts__hours {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 280px;
}

.contacts__hours-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-body-s-size);
  color: var(--color-text-secondary);
}

.contacts__hours-row b {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
}

.contacts__map {
  min-height: 320px;
  border-radius: var(--radius-lg);
  background: var(--neutral-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-body-s-size);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
}

.contacts__map:hover {
  color: var(--color-text-primary);
}

/* ─── Частые вопросы ─────────────────────────────────────────────────────── */

.faq {
  max-width: 800px;
  margin: 0 auto;
}

.faq__item {
  border-bottom: var(--border-width) solid var(--color-border);
}

/*
 * Поля строки — `--space-4`, а не `--space-5`.
 *
 * Пять свёрнутых вопросов при 24px сверху и снизу давали шаг в 82 пикселя, и
 * список занимал экран целиком, хотя читают в нём одну строку. 16px
 * оставляют строке воздух и держат её выше 44 точек, то есть попасть пальцем
 * по-прежнему есть куда — это проверено, высота строки 66 пикселей.
 */
.faq__item summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-4) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-body-m-size);
  font-weight: var(--font-weight-bold);
}

.faq__item summary::-webkit-details-marker {
  display: none;
}

.faq__item summary::after {
  content: '+';
  font-size: var(--text-h4-size);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-secondary);
  flex: 0 0 auto;
}

.faq__item[open] summary::after {
  content: '–';
}

/* Ответ отбивается от следующего вопроса тем же шагом, что и сам вопрос:
   разные отступы сверху и снизу у открытой строки читаются как сбой. */
.faq__answer {
  padding-bottom: var(--space-4);
  font-size: var(--text-body-s-size);
  line-height: var(--text-body-s-line);
  color: var(--color-text-secondary);
}

/* ─── Финальный призыв ───────────────────────────────────────────────────── */

.final-cta {
  text-align: center;
}

.final-cta__title {
  font-size: var(--text-h1-size);
  line-height: var(--text-h1-line);
  font-weight: var(--text-h1-weight);
  letter-spacing: var(--text-h1-tracking);
  margin-bottom: var(--space-5);
}

.final-cta__text {
  color: var(--color-text-secondary-inverse);
  margin-bottom: var(--space-6);
}

/* ─── Узкий экран ────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .hero__title {
    font-size: var(--text-h1-size);
    line-height: var(--text-h1-line);
  }

  .trust__grid,
  .steps,
  .services-grid,
  .gallery-grid,
  .reviews-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .masters-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .live,
  .contacts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .trust__grid,
  .steps,
  .services-grid,
  .masters-grid,
  .gallery-grid,
  .reviews-grid {
    grid-template-columns: 1fr;
  }

  .live__slots {
    grid-template-columns: repeat(3, 1fr);
  }
}
