/* Страница «Сколько стоит свадьба» (/wedding-cost/): калькулятор и таблицы.
   Остальные секции — общие `pub-*` из _public.css. */

/* Две колонки: слева параметры и статьи, справа итог. Итог прилипает при
   прокрутке — статьи отмечают, глядя на сумму. На телефоне итог встаёт между
   параметрами и статьями: там его видно сразу после выбора гостей и города */
.wc-calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  grid-template-areas:
    "title side"
    "controls side"
    "items side"
    "note side";
  gap: 0 40px;
  align-items: start;
  padding: clamp(20px, 3.5vw, 32px);
  border: 1px solid var(--w-border);
  border-radius: 18px;
  background: #fff;
}

.wc-calc__title {
  grid-area: title;
  margin: 0;
  font-family: var(--w-font-body);
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--w-black);
}

/* Друг под другом: в строку ползунок сжимался до точки рядом с городом */
.wc-calc__controls {
  grid-area: controls;
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.wc-tiers {
  width: max-content;
  max-width: 100%;
}

.wc-calc__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--w-grey);
}

.wc-calc__input {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
}

.wc-calc__input input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--w-accent);
}

.wc-calc__input input[type="number"] {
  width: 64px;
  padding: 6px 8px;
  border: 1px solid var(--w-border-strong);
  border-radius: 10px;
  font-size: 1rem;
  text-align: center;
}

/* ---------- Итог ---------- */

.wc-calc__side {
  grid-area: side;
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: 14px;
  background: var(--w-accent-subtle);
}

.wc-calc__caption {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--w-grey);
}

.wc-calc__estimate {
  margin: 4px 0 0;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--w-accent);
}

.wc-calc__summary {
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: var(--w-grey-dark);
}

.wc-calc__plan {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--w-accent-border);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--w-grey);
}

.wc-calc__cta {
  margin-top: 16px;
  width: 100%;
}

.wc-calc__link {
  margin-top: 10px;
  font-size: 0.875rem;
  text-align: center;
  color: var(--w-accent);
}

.wc-calc__note {
  grid-area: note;
}

.wc-calc__note a {
  color: inherit;
  text-decoration: underline;
}

.wc-calc__note,
.wc-caption {
  margin: 16px 0 0;
  font-size: 0.875rem;
  color: var(--w-grey-light);
}

/* Таблица на телефоне прокручивается сама, страница — нет */
.wc-table-wrap {
  overflow-x: auto;
}

.wc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.975rem;
}

.wc-table th,
.wc-table td {
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--w-border);
}

.wc-table th {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--w-grey-light);
}

/* ---------- Город: три кнопки в одну строку ---------- */

.wc-tiers {
  display: flex;
  height: 38px;
  padding: 3px;
  border: 1px solid var(--w-border-strong);
  border-radius: 999px;
}

/* Радиокнопка спрятана, но остаётся в фокусе клавиатуры — кнопкой служит
   подпись */
.wc-tier input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wc-tier span {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--w-grey-dark);
  cursor: pointer;
}

.wc-tier input:checked + span {
  background: var(--w-accent);
  color: #fff;
}

.wc-tier input:focus-visible + span {
  outline: 2px solid var(--w-accent);
  outline-offset: 2px;
}

/* ---------- Статьи: одна строка на статью ---------- */

.wc-items {
  grid-area: items;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--w-border-light);
}

.wc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  border-bottom: 1px solid var(--w-border-light);
  font-size: 0.9375rem;
}

.wc-item__label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 0;
  cursor: pointer;
}

.wc-item__label input {
  flex: none;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--w-accent);
}

.wc-item__title {
  font-weight: 600;
  color: var(--w-black);
}

.wc-item__sum {
  flex: none;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--w-grey-dark);
}

/* Снятая статья остаётся на месте: вернуть её — одно нажатие */
.wc-item--off .wc-item__title,
.wc-item--off .wc-item__sum {
  font-weight: 500;
  color: var(--w-grey-light);
}

/* ---------- Таблицы цен и текст под ними ---------- */

.wc-table td span {
  display: block;
  font-size: 0.8125rem;
  color: var(--w-grey-light);
}

/* Первая колонка справочника — название и «что входит»: ей переносы нужны,
   остальным колонкам с числами — нет */
.wc-table td.wc-table__item {
  min-width: 220px;
  white-space: normal;
}

.wc-table td.wc-table__item span {
  margin-top: 2px;
  line-height: 1.4;
  color: var(--w-grey);
}

.wc-h3 {
  margin: 44px 0 16px;
  font-family: var(--w-font-body);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--w-black);
}

.wc-gap p {
  max-width: 46em;
  margin: 0 0 12px;
  line-height: 1.65;
  color: var(--w-grey-dark);
}

/* ---------- Исследования: факт и его источник ---------- */

.wc-research {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wc-research li {
  padding: 18px 22px;
  border: 1px solid var(--w-border);
  border-radius: 16px;
  background: var(--w-surface);
}

.wc-research__figure {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--w-accent);
}

.wc-research__text {
  margin: 6px 0 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--w-grey-dark);
}

.wc-research__source {
  margin: 10px 0 0;
  font-size: 0.8125rem;
  color: var(--w-grey);
}

.wc-research__source a {
  color: inherit;
  text-decoration: underline;
}

@media (max-width: 840px) {
  .wc-calc {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "title" "controls" "side" "items" "note";
  }

  .wc-calc__side {
    position: static;
    margin-top: 18px;
  }

}

@media (max-width: 720px) {
  .wc-research {
    grid-template-columns: minmax(0, 1fr);
  }

  .wc-tiers {
    width: auto;
  }

  .wc-tier {
    flex: 1;
  }

  .wc-tier span {
    justify-content: center;
    padding: 0 6px;
    font-size: 0.8125rem;
  }

  .wc-item {
    font-size: 0.875rem;
  }
}
