/* ============================================================
   Рецептник — дизайн-система «тёплый кулинарный журнал»
   ============================================================ */

:root {
  /* Палитра */
  --paper: #faf6f0;
  --paper-deep: #f1e9dd;
  --cream: #fffdfa;
  --ink: #2d1f15;
  --ink-soft: #6f5d4d;
  --ink-faint: #a08f7d;
  --terra: #c0593f;
  --terra-deep: #a8492f;
  --terra-wash: #f6e4dc;
  --line: #e7dccb;
  --gold: #c89b3c;
  --green: #5f7a52;

  /* Тени */
  --shadow-sm: 0 1px 2px rgba(58, 38, 22, 0.06);
  --shadow: 0 8px 24px -12px rgba(58, 38, 22, 0.28);
  --shadow-lg: 0 22px 48px -20px rgba(58, 38, 22, 0.4);

  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1140px;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Mulish', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ------------------------------------------------------------ Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  /* мягкая бумажная подложка: тёплые пятна света */
  background-image:
    radial-gradient(900px 500px at 12% -5%, #fff5ea 0%, transparent 55%),
    radial-gradient(800px 600px at 95% 0%, #f7ebdd 0%, transparent 50%);
  background-attachment: fixed;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  cursor: pointer;
}
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* ------------------------------------------------------------ Типографика */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.display {
  font-family: var(--font-display);
}

/* ------------------------------------------------------------ Каркас */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 22px;
}
main {
  flex: 1;
  padding-block: 40px 72px;
}
.section-gap {
  margin-top: 56px;
}

/* ------------------------------------------------------------ Хедер */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 240, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.32rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand__mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--terra);
  color: #fff;
  border-radius: 11px;
  font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}
.nav a {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.94rem;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover {
  background: var(--paper-deep);
  color: var(--ink);
}
.nav a.active {
  color: var(--terra);
  background: var(--terra-wash);
}
.header-spacer {
  flex: 1;
}
.admin-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--green);
  background: #eaf0e4;
  padding: 5px 11px;
  border-radius: 999px;
}

/* ------------------------------------------------------------ Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 800;
  font-size: 0.95rem;
  transition: transform 0.12s, background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:active {
  transform: translateY(1px);
}
.btn--primary {
  background: var(--terra);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn--primary:hover {
  background: var(--terra-deep);
}
.btn--ghost {
  background: var(--cream);
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover {
  border-color: var(--terra);
  color: var(--terra);
}
.btn--danger {
  background: transparent;
  border-color: #e3c6bf;
  color: var(--terra-deep);
}
.btn--danger:hover {
  background: var(--terra-wash);
}
.btn--sm {
  padding: 8px 14px;
  font-size: 0.88rem;
}

/* ------------------------------------------------------------ Hero (главная) */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
  padding: 18px 0 12px;
}
.hero__kicker {
  display: inline-block;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  color: var(--terra);
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.7rem);
  font-optical-sizing: auto;
}
.hero h1 em {
  font-style: italic;
  color: var(--terra);
}
.hero p {
  margin-top: 18px;
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 46ch;
}
.hero__actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero__stats {
  margin-top: 30px;
  display: flex;
  gap: 30px;
}
.stat__n {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}
.stat__l {
  font-size: 0.82rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.hero__art {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 26px;
  background:
    linear-gradient(150deg, #e9c9a0, #d68c5f 55%, #b5532f);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero__art::after {
  content: '🍷  🥘  🍸  🥗  🍰';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  letter-spacing: 14px;
  opacity: 0.92;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.25));
}

/* ------------------------------------------------------------ Заголовок секции */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.section-head h2 {
  font-size: 1.8rem;
}
.section-head a {
  color: var(--terra);
  font-weight: 800;
  font-size: 0.92rem;
}
.section-head a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------ Сетка карточек */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 24px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: #ddcdb6;
}
.card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--paper-deep);
  overflow: hidden;
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card__media img {
  transform: scale(1.05);
}
.card__media--empty {
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  color: var(--ink-faint);
  background:
    repeating-linear-gradient(45deg, #f3ebdd, #f3ebdd 12px, #efe5d4 12px, #efe5d4 24px);
}
.card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(45, 31, 21, 0.82);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.card__body {
  padding: 15px 16px 17px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}
.card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.18rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.card__desc {
  font-size: 0.9rem;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  font-size: 0.82rem;
  color: var(--ink-faint);
  font-weight: 700;
}

/* Звёзды рейтинга */
.stars {
  --on: var(--gold);
  display: inline-flex;
  gap: 2px;
  font-size: 0.95rem;
  letter-spacing: 1px;
  color: #ddd0bb;
}
.stars b {
  color: var(--on);
}

/* ------------------------------------------------------------ Тулбар списка (поиск + фильтры) */
.list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.list-head h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
}
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}
.searchbar {
  position: relative;
  display: flex;
  align-items: center;
}
.searchbar svg {
  position: absolute;
  left: 16px;
  width: 20px;
  height: 20px;
  color: var(--ink-faint);
  pointer-events: none;
}
.searchbar input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  border: 1px solid var(--line);
  background: var(--cream);
  border-radius: 14px;
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.searchbar input:focus {
  outline: none;
  border-color: var(--terra);
  box-shadow: 0 0 0 4px var(--terra-wash);
}
.htmx-indicator {
  position: absolute;
  right: 16px;
  opacity: 0;
  transition: opacity 0.2s;
}
.htmx-request .htmx-indicator {
  opacity: 1;
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--line);
  border-top-color: var(--terra);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 700;
  transition: all 0.14s;
}
.chip:hover {
  border-color: var(--terra);
  color: var(--terra);
}
.chip.active {
  background: var(--terra);
  border-color: var(--terra);
  color: #fff;
}
.chip:has(input:checked) {
  background: var(--terra);
  border-color: var(--terra);
  color: #fff;
}
.chip {
  cursor: pointer;
}
.filters__label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  margin-right: 4px;
}
.toolbar__row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.sort-select {
  margin-left: auto;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--cream);
  font-weight: 700;
  font-size: 0.88rem;
}

/* ------------------------------------------------------------ Пустое состояние */
.empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--ink-soft);
}
.empty__icon {
  font-size: 3rem;
  margin-bottom: 12px;
}
.empty h3 {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

/* ------------------------------------------------------------ Карточка рецепта (detail) */
.recipe-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 38px;
  align-items: start;
}
.recipe-hero__media {
  position: sticky;
  top: 92px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 1 / 1;
  background: var(--paper-deep);
}
.recipe-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recipe-hero__media--empty {
  display: grid;
  place-items: center;
  font-size: 4rem;
  color: var(--ink-faint);
  background:
    repeating-linear-gradient(45deg, #f3ebdd, #f3ebdd 16px, #efe5d4 16px, #efe5d4 32px);
}
.recipe-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.76rem;
  color: var(--terra);
  margin-bottom: 14px;
}
.recipe-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-optical-sizing: auto;
}
.recipe-desc {
  margin-top: 14px;
  font-size: 1.12rem;
  color: var(--ink-soft);
}
.recipe-actions {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.meta-row {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--cream);
  border: 1px solid var(--line);
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.meta-pill b {
  color: var(--ink);
}

.recipe-section {
  margin-top: 40px;
}
.recipe-columns {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 38px;
  align-items: start;
}
.panel-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--terra-wash);
}
.ingredients-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.ingredients-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 11px 2px;
  border-bottom: 1px dashed var(--line);
}
.ingredients-list li:last-child {
  border-bottom: none;
}
.ing-name {
  font-weight: 600;
}
.ing-amount {
  color: var(--terra);
  font-weight: 800;
  font-size: 0.92rem;
  white-space: nowrap;
}
.steps-list {
  list-style: none;
  padding: 0;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.steps-list li {
  position: relative;
  padding-left: 50px;
  min-height: 34px;
  padding-top: 3px;
}
.steps-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--terra-wash);
  color: var(--terra-deep);
  font-family: var(--font-display);
  font-weight: 600;
  border-radius: 10px;
  font-size: 1.05rem;
}

.notes-block {
  margin-top: 40px;
  background: linear-gradient(180deg, #fff8ee, #fdf3e6);
  border: 1px solid #f0e2cd;
  border-left: 4px solid var(--gold);
  border-radius: 14px;
  padding: 22px 24px;
}
.notes-block h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--ink);
}
.notes-block p {
  color: var(--ink-soft);
}
.notes-block :is(p, ul, ol) + :is(p, ul, ol) {
  margin-top: 10px;
}
.notes-block ul,
.notes-block ol {
  padding-left: 20px;
}

.nutrition {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.nutri-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}
.nutri-card .n {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
}
.nutri-card .l {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  font-weight: 800;
}
.nutrition-note {
  margin-top: 10px;
  font-size: 0.84rem;
  color: var(--ink-faint);
  font-style: italic;
}
.source-line {
  margin-top: 30px;
  font-size: 0.9rem;
  color: var(--ink-faint);
}
.source-line a {
  color: var(--terra);
  font-weight: 700;
  text-decoration: underline;
}

/* Интерактивный рейтинг на странице рецепта */
.rating-edit {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.rating-edit .star-btn {
  background: none;
  border: none;
  padding: 0 1px;
  font-size: 1.7rem;
  line-height: 1;
  color: #ddd0bb;
  transition: transform 0.1s, color 0.1s;
}
.rating-edit .star-btn:hover {
  transform: scale(1.15);
}
.rating-edit .star-btn.on {
  color: var(--gold);
}
.rating-edit .rating-clear {
  background: none;
  border: none;
  color: var(--ink-faint);
  font-size: 1.2rem;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 8px;
  transition: color 0.12s, background 0.12s;
}
.rating-edit .rating-clear:hover {
  color: var(--terra);
  background: var(--terra-wash);
}
.rating-hint {
  margin-top: 5px;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* ------------------------------------------------------------ Форма */
.form-wrap {
  max-width: 820px;
  margin-inline: auto;
}
.form-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.field {
  margin-bottom: 20px;
}
.field > label {
  display: block;
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 7px;
  color: var(--ink);
}
.field .hint {
  font-weight: 600;
  color: var(--ink-faint);
  font-size: 0.82rem;
}
.input,
.textarea,
.select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--terra);
  box-shadow: 0 0 0 4px var(--terra-wash);
  background: #fff;
}
.textarea {
  resize: vertical;
  min-height: 90px;
}
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.nutri-in {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nutri-in > span {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink-soft);
}
.form-section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 30px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

/* Динамические строки ингредиентов */
.ing-row,
.step-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: flex-start;
}
.ing-row .ing-name-in {
  flex: 1 1 auto;
}
.ing-row .ing-amount-in {
  width: 90px;
  flex: none;
}
.ing-row .ing-unit-in {
  width: 120px;
  flex: none;
}
.step-row textarea {
  flex: 1;
  min-height: 46px;
}
.row-remove {
  flex: none;
  width: 42px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 11px;
  color: var(--ink-faint);
  font-size: 1.2rem;
  transition: all 0.14s;
}
.row-remove:hover {
  border-color: var(--terra);
  color: var(--terra);
  background: var(--terra-wash);
}
.add-row-btn {
  margin-top: 4px;
  background: none;
  border: 1px dashed var(--line);
  color: var(--terra);
  font-weight: 800;
  padding: 9px 14px;
  border-radius: 11px;
  width: 100%;
  transition: all 0.14s;
}
.add-row-btn:hover {
  border-color: var(--terra);
  background: var(--terra-wash);
}

/* Выбор рейтинга */
.rating-input {
  display: inline-flex;
  gap: 4px;
  font-size: 1.7rem;
  color: #ddd0bb;
}
.rating-input span {
  cursor: pointer;
  transition: transform 0.1s, color 0.1s;
}
.rating-input span:hover {
  transform: scale(1.15);
}
.rating-input span.on {
  color: var(--gold);
}

/* Переключатель типа (блюдо/коктейль) */
.type-toggle {
  display: inline-flex;
  background: var(--paper-deep);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}
.type-toggle label {
  padding: 8px 18px;
  border-radius: 9px;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.14s;
}
.type-toggle input {
  display: none;
}
.type-toggle input:checked + label {
  background: var(--cream);
  color: var(--terra);
  box-shadow: var(--shadow-sm);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.form-actions .spacer {
  flex: 1;
}

.alert {
  background: var(--terra-wash);
  border: 1px solid #e3c6bf;
  color: var(--terra-deep);
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-weight: 600;
}
.alert ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

/* Превью загруженной картинки */
.image-field {
  display: flex;
  gap: 16px;
  align-items: center;
}
.image-preview {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--paper-deep);
}

/* ------------------------------------------------------------ Футер */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--ink-faint);
  font-size: 0.88rem;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------ Появление */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.rise {
  animation: rise 0.5s ease both;
}
.grid > * {
  animation: rise 0.45s ease both;
}
.grid > *:nth-child(2) { animation-delay: 0.04s; }
.grid > *:nth-child(3) { animation-delay: 0.08s; }
.grid > *:nth-child(4) { animation-delay: 0.12s; }
.grid > *:nth-child(5) { animation-delay: 0.16s; }
.grid > *:nth-child(6) { animation-delay: 0.2s; }

/* ------------------------------------------------------------ Адаптив */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .hero__art {
    aspect-ratio: 16 / 10;
    order: -1;
  }
  .recipe-hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .recipe-hero__media {
    position: static;
    aspect-ratio: 16 / 10;
  }
  .recipe-columns {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}
@media (max-width: 620px) {
  .nav {
    display: none;
  }
  .nutrition {
    grid-template-columns: repeat(2, 1fr);
  }
  .row-2,
  .row-4 {
    grid-template-columns: 1fr;
  }
  .ing-row {
    flex-wrap: wrap;
  }
  .ing-row .ing-amount-in,
  .ing-row .ing-unit-in {
    width: calc(50% - 25px);
  }
  main {
    padding-block: 26px 50px;
  }
}

/* Мобильная нижняя навигация */
.mobile-nav {
  display: none;
}
@media (max-width: 620px) {
  .mobile-nav {
    display: flex;
    position: sticky;
    bottom: 0;
    z-index: 40;
    background: rgba(250, 246, 240, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 8px;
    gap: 6px;
  }
  .mobile-nav a {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--ink-soft);
  }
  .mobile-nav a.active {
    color: var(--terra);
    background: var(--terra-wash);
  }
}
