/* ============================================================
   Рецептатор — каталог рецептов (/recipes/…)
   Генерируется catalog.py. Токены наследуются из styles.css;
   собственных цветов здесь нет — только раскладка.
   Префикс .rc- / .cat- — чтобы не конфликтовать с .rcard демо-карточки.
   ============================================================ */

.rc { padding: 40px 0 20px; }
.rc-wrap { max-width: 1060px; }

/* ---------------- хлебные крошки ---------------- */
.crumbs {
  font-size: 14px;
  color: var(--ink-faint);
  margin-bottom: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

/* ---------------- шапка раздела ---------------- */
.cat-head { margin-bottom: 28px; max-width: 46em; }
.cat-head h1 { font-size: clamp(32px, 5vw, 50px); margin: 14px 0 0; }
.cat-lede { color: var(--ink-soft); font-size: 18px; margin: 16px 0 0; }

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 0 32px;
}
.chip-link {
  display: inline-block;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
.chip-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ---------------- сетка карточек ---------------- */
.rgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.rc-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.rc-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in oklch, var(--accent) 35%, var(--line));
}
.rc-card-img { display: block; aspect-ratio: 4 / 3; background: var(--surface-2); }
.rc-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rc-card-ph {
  display: block;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    115deg, var(--surface-2), var(--surface-2) 14px, var(--bg-2) 14px, var(--bg-2) 28px);
}
.rc-card-body { display: block; padding: 17px 19px 20px; }
.rc-card-title {
  display: block;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.rc-card-sub {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.45;
}
.rc-card-meta {
  display: block;
  margin-top: 13px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-faint);
  letter-spacing: .01em;
}

/* ---------------- пагинация ---------------- */
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 44px 0 0;
}
.pager a, .pg-cur {
  min-width: 40px;
  padding: 9px 12px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.pager a { color: var(--ink-soft); background: var(--surface); }
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pg-cur { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ============================================================
   Карточка рецепта
   ============================================================ */

.rc-head { max-width: 40em; }
.rc-head h1 { font-size: clamp(34px, 5.4vw, 54px); }
.rc-lede { color: var(--ink-soft); font-size: 19px; margin: 18px 0 0; }

.rc-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tag {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--accent-2);
  background: color-mix(in oklch, var(--accent-2) 11%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--accent-2) 22%, transparent);
}
.tag:hover { background: color-mix(in oklch, var(--accent-2) 20%, var(--surface)); }

.rc-hero {
  margin: 30px 0 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.rc-hero img { width: 100%; height: auto; display: block; aspect-ratio: 4 / 3; object-fit: cover; }

.rc-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0 0;
}
.rc-fact {
  flex: 1 1 160px;
  padding: 14px 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.rc-fact-k {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-faint);
}
.rc-fact-v { display: block; margin-top: 5px; font-weight: 600; font-size: 16px; }
.rc-fact-v a { color: var(--accent); text-decoration: none; }
.rc-fact-v a:hover { text-decoration: underline; }

.rc-intro {
  margin: 26px 0 0;
  font-size: 17.5px;
  line-height: 1.62;
  color: var(--ink-soft);
  max-width: 44em;
}

/* --------- ингредиенты + шаги --------- */
.rc-cols {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 40px;
  margin: 44px 0 0;
  align-items: start;
}
.rc-cols h2 {
  font-size: 24px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.rc-ing {
  position: sticky;
  top: 88px;
  padding: 24px 26px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.rc-ing ul { list-style: none; margin: 0; padding: 0; }
.rc-ing li {
  padding: 10px 0 10px 26px;
  position: relative;
  border-bottom: 1px solid var(--line-soft);
  font-size: 16px;
}
.rc-ing li:last-child { border-bottom: 0; padding-bottom: 0; }
.rc-ing li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 18px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
}

.rc-steps ol { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.rc-steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 24px 52px;
  font-size: 17px;
  line-height: 1.6;
}
.rc-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
}
.rc-steps li:last-child { padding-bottom: 0; }

.rc-notes {
  margin-top: 30px;
  padding: 20px 24px;
  border-left: 3px solid var(--accent-2);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.rc-notes h2 { font-size: 19px; border: 0; padding: 0; margin-bottom: 8px; }
.rc-notes p { margin: 0; color: var(--ink-soft); }

/* --------- конверсионный блок --------- */
.rc-cta {
  margin: 56px 0 0;
  padding: 34px 36px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-lg);
  text-align: center;
}
[data-theme="dark"] .rc-cta { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.rc-cta h2 { font-size: clamp(24px, 3.4vw, 34px); color: inherit; }
.rc-cta p {
  margin: 14px auto 22px;
  max-width: 40em;
  font-size: 17px;
  color: color-mix(in oklch, var(--bg) 72%, var(--ink-soft));
}
[data-theme="dark"] .rc-cta p { color: var(--ink-soft); }

.rc-similar { margin: 60px 0 0; }
.rc-similar h2 { font-size: 28px; margin-bottom: 22px; }

/* ---------------- адаптив ---------------- */
@media (max-width: 900px) {
  .rc-cols { grid-template-columns: 1fr; gap: 34px; }
  .rc-ing { position: static; }
}
@media (max-width: 560px) {
  .rc { padding-top: 26px; }
  .rgrid { grid-template-columns: 1fr; gap: 18px; }
  .rc-cta { padding: 28px 22px; }
  .rc-facts { gap: 9px; }
  .rc-fact { flex-basis: 46%; padding: 12px 14px; }
}
