/*
 * Стили магазина: каталог, карточка методики, оплата, плитка рубрик.
 *
 * Вынесены из style.css — нужны на трёх страницах из тысячи трёхсот,
 * а грузились на всех и задерживали отрисовку каждой статьи.
 * Подключаются из functions.php там, где действительно нужны.
 */

/* ═══════════════════════════════════════════════════════════════
   МАГАЗИН: КАТАЛОГ И КАРТОЧКА МЕТОДИКИ
   ═══════════════════════════════════════════════════════════════ */

.ht-catalog__lead { margin-bottom: 26px; }

/* Строка каталога — корешок билета: обложка, описание и оторванная
   по перфорации часть с ценой. Порядок слева направо тот же, что
   человек проходит взглядом: что это → о чём → сколько → куда нажать. */
.ht-catalog { display: grid; gap: 16px; }

.ht-cat {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 190px;
  align-items: center; gap: 0 22px;
  background: var(--sf); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px 20px;
  transition: border-color .18s, box-shadow .18s;
}
.ht-cat:hover { border-color: var(--gold); box-shadow: var(--shadow); }

.ht-cat__cover { display: block; }
.ht-cat__cover img {
  width: 100%; height: 132px; object-fit: contain; object-position: center;
  background: var(--sunk); border: 1px solid var(--line-soft); display: block;
}

.ht-cat__body { min-width: 0; }
.ht-cat__title { font-size: 21px; line-height: 1.25; margin: 6px 0 7px; }
.ht-cat__title a { color: var(--ink); text-decoration: none; }
.ht-cat__title a:hover { color: var(--acc); }
.ht-cat__text {
  font-family: "Golos Text", "Golos fallback", sans-serif; font-size: 15px; line-height: 1.5;
  color: var(--sub); margin: 0;
}
.ht-cat__format {
  font-family: "Golos Text", "Golos fallback", sans-serif; font-size: 13px; color: var(--faint);
  margin: 8px 0 0;
}

/* Отрывная часть. Пунктир из полукругов — тот же приём, что у линейки
   .ht-perf, только поставленный вертикально. */
.ht-cat__buy {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding-left: 22px; align-self: stretch; justify-content: center;
  border-left: 1px solid var(--line);
  background-image: radial-gradient(circle at 0.5px 5.5px, var(--bg) 3.6px, transparent 3.7px);
  background-size: 9px 11px; background-repeat: repeat-y; background-position: -4px 0;
}
.ht-cat__price { margin: 0; text-align: center; line-height: 1.15; }
.ht-cat__price s { display: block; font-size: 14px; color: var(--faint); }
.ht-cat__price span {
  font-family: Spectral, "Spectral fallback", Georgia, serif; font-size: 26px; font-weight: 600;
  color: var(--ink); white-space: nowrap;
}
.ht-cat__more { text-align: center; white-space: nowrap; }

@media (max-width: 760px) {
  /* На телефоне отрывать нечего: обложка и текст встают рядом,
     цена с кнопкой уходят вниз на всю ширину. */
  .ht-cat { grid-template-columns: 96px minmax(0, 1fr); gap: 0 16px; padding: 14px 16px; }
  .ht-cat__cover img { height: 96px; }
  .ht-cat__buy {
    grid-column: 1 / -1; flex-direction: row; justify-content: space-between;
    align-items: center; padding: 14px 0 0; margin-top: 14px;
    border-left: 0; border-top: 1px solid var(--line);
    background-image: radial-gradient(circle at 5.5px 0.5px, var(--bg) 3.6px, transparent 3.7px);
    background-size: 11px 9px; background-repeat: repeat-x; background-position: 0 -4px;
  }
  .ht-cat__price { text-align: left; display: flex; align-items: baseline; gap: 10px; }
  .ht-cat__price s { display: inline; }
  .ht-cat__title { font-size: 19px; }
}

/* ── Карточка методики ──────────────────────────────────────── */

.ht-product__head {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 26px;
  align-items: start; margin-bottom: 30px;
}
.ht-product__cover { margin: 0; }
.ht-product__cover img {
  width: 100%; height: auto; max-height: 300px;
  object-fit: contain; object-position: top center;
  background: var(--sunk); border: 1px solid var(--line); display: block;
}
.ht-product__intro .entry-title { font-size: clamp(25px, 3.4vw, 34px); margin: 6px 0 12px; }
.ht-product__short {
  font-size: 17.5px; line-height: 1.55; color: var(--sub); margin: 0 0 12px;
}
.ht-product__format {
  font-family: "Golos Text", "Golos fallback", sans-serif; font-size: 13.5px; color: var(--faint);
  margin: 0 0 18px;
}

.ht-product__parts {
  background: var(--sunk); border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg); padding: 20px 24px; margin: 0 0 28px;
}
.ht-product__parts h2 {
  font-family: "Golos Text", "Golos fallback", sans-serif; font-size: 11px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--acc);
  margin: 0 0 12px;
}
.ht-product__parts ul { margin: 0; padding-left: 20px; }
.ht-product__parts li {
  font-family: "Golos Text", "Golos fallback", sans-serif; font-size: 15.5px; line-height: 1.5;
  color: var(--sub); margin-bottom: 7px;
}
.ht-product__parts li::marker { color: var(--gold-ink); }

/* ── Цена и кнопка ──────────────────────────────────────────── */

.ht-buy { margin: 0; }
.ht-buy--bottom {
  background: var(--sunk); border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg); padding: 20px 24px; margin-top: 6px;
}
.ht-buy__price { margin: 0 0 4px; display: flex; align-items: baseline; gap: 10px; }
.ht-buy__old { font-size: 16px; color: var(--faint); }
.ht-buy__now {
  font-family: Spectral, "Spectral fallback", Georgia, serif; font-size: 32px; font-weight: 600;
  color: var(--ink); white-space: nowrap;
}
.ht-buy__btn { padding: 14px 28px; font-size: 16px; }
.ht-buy__after,
.ht-buy__note {
  font-family: "Golos Text", "Golos fallback", sans-serif; line-height: 1.45; margin: 10px 0 0;
}
.ht-buy__after { font-size: 14.5px; color: var(--sub); }
.ht-buy__note  { font-size: 13px; color: var(--faint); }

@media (max-width: 700px) {
  .ht-product__head { grid-template-columns: 1fr; gap: 18px; }
  .ht-product__cover img { max-height: 260px; }
  .ht-pay .ht-buy__btn { display: block; min-width: 0; }
}

/* Выбор способа оплаты. Две части одной планки, а не две кнопки:
   так видно, что это выбор из двух, а действие дальше — одно. */
.ht-pay { margin-top: 14px; }
.ht-pay__switch {
  display: inline-flex; padding: 3px; margin: 0 0 12px;
  background: var(--sunk); border: 1px solid var(--line);
  border-radius: 99px; flex-wrap: wrap; gap: 2px;
}
.ht-pay__opt {
  appearance: none; border: 0; cursor: pointer;
  padding: 9px 16px; min-height: 38px; border-radius: 99px;
  font-family: "Golos Text", "Golos fallback", sans-serif; font-size: 13.5px; font-weight: 600;
  color: var(--sub); background: transparent;
  transition: background .16s, color .16s;
  -webkit-tap-highlight-color: transparent;
}
.ht-pay__opt:hover { color: var(--ink); }
.ht-pay__opt.is-on {
  background: var(--sf); color: var(--ink);
  box-shadow: 0 1px 2px rgba(28,19,16,.10);
}
:root[data-theme="dark"] .ht-pay__opt.is-on { box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.ht-pay .ht-buy__btn { display: inline-block; min-width: 230px; text-align: center; }

@media (max-width: 480px) {
  .ht-pay__switch { display: flex; width: 100%; }
  .ht-pay__opt { flex: 1 1 0; padding: 9px 10px; font-size: 12.5px; }
}

/* ── Согласие с офертой перед оплатой ──────────────────────── */
.ht-consent {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0 0 14px; cursor: pointer;
  font-family: "Golos Text", "Golos fallback", -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 13.5px; line-height: 1.45; color: var(--sub);
  max-width: 46ch;
}
.ht-consent__box {
  flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0;
  accent-color: var(--acc); cursor: pointer;
}
.ht-consent__text a { color: var(--acc); }
.ht-consent__text a:hover { text-decoration: none; }

/* Запертая кнопка гасится цветом, а не прозрачностью: сквозь
   полупрозрачную надпись «Оплатить» читалась с контрастом 2,4:1.
   Здесь получается 8:1 на тёмной теме и 6,8:1 на светлой — видно,
   что кнопка пока не работает, но прочесть её можно. */
.ht-btn.is-locked {
  background: var(--sunk); color: var(--sub);
  box-shadow: inset 0 0 0 1px var(--line);
}
.ht-btn.is-locked:hover { background: var(--sunk); color: var(--ink); }

.ht-consent__warn {
  font-family: "Golos Text", "Golos fallback", sans-serif; font-size: 13.5px;
  color: var(--acc); margin: 8px 0 0;
}

/* Цена в блоке «Другие методики» */
.ht-rel__price {
  font-family: Spectral, "Spectral fallback", Georgia, serif; font-size: 17px; font-weight: 600;
  color: var(--gold-ink); margin: 5px 0 0;
}
.ht-related__all {
  font-family: "Golos Text", "Golos fallback", sans-serif; font-size: 15px; margin: 18px 0 0;
}
.ht-related__all a { color: var(--acc); text-decoration: none; }
.ht-related__all a:hover { text-decoration: underline; }

/* ── Реквизиты и правовые ссылки в подвале ─────────────────── */
.ht-footer-legal,
.ht-footer-links {
  font-family: "Golos Text", "Golos fallback", -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 13px; line-height: 1.5; margin: 0 0 6px;
  color: rgba(243,231,211,.62);
}
.ht-footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.ht-footer-links a { color: rgba(243,231,211,.82); text-decoration: none; border-bottom: 1px solid rgba(243,231,211,.28); }
.ht-footer-links a:hover { color: #FFF; border-bottom-color: currentColor; }

/* ── Страница после оплаты ─────────────────────────────────── */
.ht-thanks__lead { font-size: clamp(18px, 2.4vw, 21px); }
.ht-thanks__hint { color: var(--faint); font-size: 15.5px; }

.ht-thanks__note {
  background: var(--sunk); border: 1px solid var(--line-soft);
  border-left: 3px solid var(--acc); border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 18px 22px; margin: 24px 0;
}
.ht-thanks__note > :last-child { margin-bottom: 0; }
.ht-thanks__note-title {
  font-family: "Golos Text", "Golos fallback", sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--acc); margin: 0 0 8px;
}

.ht-thanks__ways { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 6px; }
.ht-thanks__way { flex: 0 1 auto; }
.ht-thanks__back { margin-top: 26px; font-family: "Golos Text", "Golos fallback", sans-serif; font-size: 15px; }
/* На странице неудачи возврат к методикам — главное действие,
   а не сноска: человеку нужен понятный следующий шаг. */
.ht-thanks__cta { margin: 22px 0 6px; }
.ht-thanks__cta .ht-btn { padding: 14px 28px; font-size: 16px; }

@media (max-width: 520px) {
  .ht-thanks__ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ht-thanks__way { text-align: center; }
}

/* ── Договор и политика ────────────────────────────────────────
   Документ читают не как статью: сплошным текстом, с возвратами к
   нужному пункту. Поэтому шрифт мельче и без засечек, строки плотнее,
   а нумерованные разделы заметно отбиты — по ним ищут глазами.
   Буквица здесь ни к чему: это не начало рассказа.                */
.ht-legal .entry-content {
  font-family: "Golos Text", "Golos fallback", -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 15.5px; line-height: 1.62;
}
.ht-legal .entry-content > p:first-of-type::first-letter {
  float: none; font-size: inherit; line-height: inherit;
  padding: 0; color: inherit; font-weight: inherit;
}
.ht-legal .entry-content p { margin: 0 0 12px; color: var(--sub); }
.ht-legal .entry-content h2 {
  font-size: 20px; margin: 30px 0 12px; padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.ht-legal .entry-content h2:first-of-type { border-top: 0; padding-top: 0; }
.ht-legal .entry-content hr { margin: 40px 0; }
/* Кнопки исключаем: у них свой цвет текста, иначе надпись
   сливается с фоном самой кнопки. */
.ht-legal .entry-content a:not(.ht-btn) { color: var(--acc); }

/* Страницы после оплаты — не документы, им журнальный набор идёт.
   Правило цепляется за класс самой статьи, а не за имя шаблона:
   страниц с таким разговором две — удачная оплата и неудачная. */
.ht-legal .ht-thanks .entry-content {
  font-family: Spectral, "Spectral fallback", Georgia, serif; font-size: 17.5px; line-height: 1.7;
}
.ht-legal .ht-thanks .entry-content p { color: var(--ink); }
.ht-legal .ht-thanks .entry-content h2 { font-size: 24px; }

/* ── Видео в тексте ────────────────────────────────────────────
   Ролики у Екатерины вертикальные, снятые на телефон. Во всю ширину
   колонки такой занял бы два экрана, поэтому ограничиваем высоту и
   ставим по центру — как на исходной странице. */
.entry-content video,
.entry-content .wp-block-video video {
  display: block; max-width: 100%; height: auto;
  max-height: 70vh; margin-inline: auto;
  border: 1px solid var(--line); background: var(--sunk);
}
.entry-content .wp-block-video { margin: 26px 0; text-align: center; }
.entry-content .wp-block-video figcaption {
  font-family: "Golos Text", "Golos fallback", sans-serif; font-size: 14px;
  color: var(--faint); margin-top: 8px;
}

/* ── Перечень рубрик ───────────────────────────────────────────
   Разделов почти четыре десятка, и они очень разного размера: от
   трёхсот статей до одной. Поэтому не список, а плитка, и порядок по
   числу статей — сверху то, ради чего приходят чаще. */
/* Вступление на странице рубрик — подпись к плитке, а не начало
   рассказа, поэтому без буквицы. */
.ht-cats__lead > p:first-of-type::first-letter {
  float: none; font-size: inherit; line-height: inherit;
  padding: 0; color: inherit; font-weight: inherit;
}
.ht-cats__lead { margin-bottom: 24px; }

.ht-cats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 12px; margin: 0 0 24px;
  /* Карточка с вложенными рубриками выше остальных. Без этого соседняя
     тянулась бы под её высоту, и рядом зияла бы пустая половина. */
  align-items: start;
}

.ht-cat-card {
  background: var(--sf); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: border-color .18s, box-shadow .18s;
}
.ht-cat-card:hover { border-color: var(--gold); box-shadow: var(--shadow); }

.ht-cat-card__link {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 16px; text-decoration: none; color: var(--ink);
}
.ht-cat-card__text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

/* Картинка мелкая и служит опознавательным знаком, а не иллюстрацией,
   поэтому кадрируем: важна не композиция, а узнаваемое пятно. */
.ht-cat-card__pic { flex: 0 0 auto; }
.ht-cat-card__pic img {
  width: 60px; height: 60px; object-fit: cover; display: block;
  border-radius: var(--radius-lg); border: 1px solid var(--line-soft);
  background: var(--sunk);
}
.ht-cat-card__name {
  font-family: Spectral, "Spectral fallback", Georgia, serif; font-size: 18px; font-weight: 600;
  line-height: 1.25;
}
.ht-cat-card__link:hover .ht-cat-card__name { color: var(--acc); }

/* Счётчик в стиле номера выпуска — тот же приём, что в ленте. */
.ht-cat-card__count {
  align-self: flex-start;
  font-family: "Golos Text", "Golos fallback", sans-serif; font-size: 11.5px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--gold-ink); border: 1px solid var(--line);
  border-radius: 99px; padding: 3px 10px;
}

.ht-cats__total {
  font-family: "Golos Text", "Golos fallback", sans-serif; font-size: 14.5px; color: var(--faint);
  margin: 0;
}

@media (max-width: 560px) {
  .ht-cats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  /* На узком экране картинка встаёт над названием: рядом с ней на
     150 пикселях ширины тексту остаётся полторы буквы. */
  .ht-cat-card__link { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px; }
  .ht-cat-card__pic img { width: 100%; height: 84px; border-radius: var(--radius); }
  .ht-cat-card__pic { align-self: stretch; }
  .ht-cat-card__name { font-size: 16px; }
}

/* ── Подарок к покупке ───────────────────────────────────────── */
/* Золотая рамка, а не серая заливка «Что входит»: подарок должен
   читаться как отдельная вещь, а не как ещё один пункт списка. */

.ht-bonus {
  background: var(--sf); border: 1px solid var(--gold);
  border-radius: var(--radius-lg); padding: 18px 22px; margin: 0 0 28px;
}
.ht-bonus__label {
  font-family: "Golos Text", "Golos fallback", sans-serif; font-size: 11px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--gold-ink);
  margin: 0 0 8px;
}
.ht-bonus__what {
  font-family: Spectral, "Spectral fallback", Georgia, serif; font-size: 20px; font-weight: 600;
  line-height: 1.3; color: var(--ink); margin: 0 0 6px;
}
.ht-bonus__how {
  font-family: "Golos Text", "Golos fallback", sans-serif; font-size: 14.5px; line-height: 1.5;
  color: var(--sub); margin: 0;
}
.ht-bonus__how a { color: var(--acc); }

/* ── Карточка методики внутри статьи ─────────────────────────── */
/*
 * В каталоге строка узкая: короткое описание и цена справа. Здесь у
 * каждого комплекта свой рассказ в пять-шесть строк, и колонка в две
 * сотни точек его бы разорвала. Поэтому отрывная часть уходит вниз
 * на всю ширину — тот же приём, что у каталога на телефоне.
 *
 * Обложки разной ориентации: у комплектов четыре альбомных и две
 * вертикальных. Поэтому не подгоняем картинку под рамку, а вписываем
 * её в общую коробку — так список остаётся ровным, а обложка не
 * обрезается. Коробка чуть выше своей ширины: это середина между
 * двумя ориентациями, и ни одна не выглядит крошечной.
 */

.entry-content .ht-cat { align-items: start; margin: 0 0 16px; }

@media (min-width: 761px) {
  .entry-content .ht-cat {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 0 22px;
  }
  .entry-content .ht-cat__cover img { height: 170px; }
  .entry-content .ht-cat__buy {
    grid-column: 1 / -1;
    flex-direction: row; justify-content: space-between; align-items: center;
    padding: 14px 0 0; margin-top: 16px;
    border-left: 0; border-top: 1px solid var(--line);
    background-image: radial-gradient(circle at 5.5px 0.5px, var(--bg) 3.6px, transparent 3.7px);
    background-size: 11px 9px; background-repeat: repeat-x; background-position: 0 -4px;
  }
  .entry-content .ht-cat__price { text-align: left; display: flex; align-items: baseline; gap: 10px; }
  .entry-content .ht-cat__price s { display: inline; }
}

/*
 * На телефоне обложка встаёт над текстом и становится картинкой,
 * а не значком: рядом с рассказом в двадцать строк миниатюра в сто
 * точек висела в углу и терялась.
 */
@media (max-width: 760px) {
  .entry-content .ht-cat { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .entry-content .ht-cat__cover { width: 210px; justify-self: center; }
  .entry-content .ht-cat__cover img { height: 185px; }
}

/* Описание здесь в несколько абзацев, а не одной строкой. */
.entry-content .ht-cat__text p {
  font: inherit; color: inherit; margin: 0 0 10px;
}
.entry-content .ht-cat__text p:last-child { margin-bottom: 0; }

/* Подарок — золотом, как и всё «сверх обычного» на сайте. */
.ht-cat--gift { border-color: var(--gold); }
.ht-cat__gift {
  font-family: "Golos Text", "Golos fallback", sans-serif; font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink);
  line-height: 1.4; text-align: left; margin: 0;
}
