/* =====================================================
   GLOBAL
===================================================== */

body {
  background: var(--bg);
}

.muted {
  color: var(--text-muted);
  font-size: 14px;
}




/* =====================================================
   CONTAINER
===================================================== */

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 32px) 32px;
}

body[data-entity="lessons"] .container {
  padding-top: 18px;
}


/* =====================================================
   HERO
===================================================== */

.recipe-hero {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}

.recipe-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.55),
    rgba(0,0,0,.1)
  );
}

.recipe-hero h1 {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;

  margin: 0;
  color: #fff;

  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  z-index: 2;
}

.recipe-hero-placeholder {
  width: 100%;
  height: 100%;
  background: #eee;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 48px;
}


/* =====================================================
   DRAFT
===================================================== */

.draft-banner {
  background: #fff3cd;
  color: #856404;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
}


/* =====================================================
   TEXT CONTENT
===================================================== */

.text-content {
  line-height: 1.7;
  color: var(--text);
}

.text-content p {
  margin: 0 0 12px;
}

.text-content ol,
.text-content ul {
  margin: 0 0 16px;
  padding-left: 24px;
}

.text-content li {
  margin-bottom: 6px;
}

.text-content ol li::marker {
  font-weight: 600;
  color: #6c5ce7;
}


/* =====================================================
   RECIPE BLOCK
===================================================== */

.recipe-block {
  background: var(--surface);
  border-radius: 14px;
  margin-bottom: 12px;
  padding: 16px;

  box-shadow:
    0 6px 20px rgba(0,0,0,.04),
    0 1px 2px rgba(0,0,0,.04);
}



/* =====================================================
   STEPS (OLD DESIGN)
===================================================== */

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 14px 16px;
  border-radius: 14px;

  background: var(--surface);
  border: 1px solid var(--border);
}

/* номер */
.step-number {
  width: 32px;
  height: 32px;
  min-width: 32px;

  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);

  font-weight: 600;
  font-size: 14px;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* текст шага */
.step-text {
  flex: 1;
  min-width: 0;

  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}


/* =====================================================
   IMAGE BLOCK
===================================================== */

.photo-block {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;

  border-radius: 12px;
  overflow: hidden;
  background: #f2f2f2;
}

.photo-block img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 12px;
}

.photo-placeholder {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;

  color: #777;
  font-size: 14px;
  background: var(--surface-2);
}


.section-item-heading {
display: flex;
align-items: center;
justify-content: space-between;


width: 100%;
padding: 12px 16px;
margin: 0 0 12px;


background: var(--surface-2);
color: var(--text);
border-radius: 12px;


font-size: 15px;
font-weight: 600;
line-height: 1.3;
}

.section-item-heading.editable:focus {
outline: none;
background: #f1f5f9;
}

.section-item-heading::after {
font-size: 14px;
opacity: 0.4;
}

.recipe-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;

  width: 100%;
  padding: 14px 18px;
  margin: 0 0 16px;

  background: var(--surface-2);
  color: var(--text);
  border-radius: 12px; /* ← как у подзаголовков */

  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.recipe-section-title.editable:focus {
  outline: none;
  background: #e8edf3;
}

.section-item-heading {
display: flex;
align-items: center;
justify-content: space-between;


width: 100%;
padding: 12px 16px;


/* 🔑 ЕДИНЫЙ РИТМ */
margin: 16px 0;


background: #f8fafc;
border-radius: 12px;


font-size: 15px;
font-weight: 600;
color: #0f172a;
}



.recipe-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.section-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-left: 12px;
  font-size: 14px;
  opacity: 0.5;

  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* 🔽 СВЕРНУТАЯ СЕКЦИЯ */
.recipe-section.is-collapsed .section-toggle {
  transform: rotate(-90deg);
  opacity: 0.4;
}

.recipe-section.is-collapsed .section-items {
  display: none;
}

.recipe-section.is-collapsed .section-actions {
  display: none;
}

.recipe-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  
}

.section-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-left: 12px;
  font-size: 14px;
  opacity: 0.5;
  cursor: pointer;

  transition: transform 0.2s ease, opacity 0.2s ease;
}

.recipe-section.is-collapsed .section-toggle {
  transform: rotate(-90deg);
  opacity: 0.4;
}




.recipe-hero::after {
  pointer-events: none;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-number {
  width: 32px;
  height: 32px;
  min-width: 32px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  background: #f2f4f7;
  color: #333;
  font-weight: 600;
  font-size: 14px;
}

.image-edit-hint {
  pointer-events: none;
}

.recipe-hero.editable-image {
  cursor: pointer;
}

.recipe-title.editable {
  cursor: text;
}

/* =========================
   HERO TITLE — EDIT MODE
========================= */

body.admin .recipe-hero .recipe-title[contenteditable="true"] {
  cursor: text;
}

/* когда редактируем */
body.admin .recipe-hero .recipe-title[contenteditable="true"]:focus {
  outline: none;

  /* 🔑 подложка под текст */
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 10px;
  border-radius: 8px;

  /* читаемость */
  color: #fff;

  /* чтобы фон не скакал */
  box-decoration-break: clone;
}

/* placeholder для пустого заголовка */
body.admin .recipe-hero .recipe-title[contenteditable="true"]:empty::before {
  content: 'Введите название рецепта';
  opacity: 0.5;
}

body.admin .recipe-hero .recipe-title.saved {
  box-shadow: 0 0 0 2px rgba(34,197,94,.6);
}

/* Простой текстовый блок */
.section-item--text .section-item-content {
  margin: 16px 0;
  padding: 0;

  background: transparent;
  border: none;
  border-radius: 0;

  font-size: 15px;
  line-height: 1.7;
  color: #1f2937;
}

/* ===== WIDE LAYOUT FOR RECIPES ===== */

body[data-entity="recipes"] .container {
  max-width: 960px;
}

body[data-entity="recipes"] .lesson-wrap {
  max-width: 100%;
}




/* =========================
   RECIPE HERO — SAME AS LESSON
========================= */

body[data-entity="recipes"] .recipe-hero {
  width: 100%;
  max-width: 960px;
  margin: 0 auto 24px;

  aspect-ratio: 1 / 1;   /* 🔥 квадрат как у уроков */
  max-height: 960px;     /* защита от огромных экранов */

  border-radius: 18px;
  overflow: hidden;
}

/* ===== Адаптивная ширина картинки (как в уроках) ===== */
body[data-entity="recipes"] .image-preview {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  display: block;
}

body[data-entity="recipes"] .tg-body.section-items {
  padding-left: 0;
  padding-right: 0;
}

[data-theme="dark"] .step-number {

  background: var(--surface-2);

  color: var(--text);

}

/* =========================
   INGREDIENTS BLOCK
========================= */

.ingredients-block {
  border-radius: 16px;
  padding: 10px 22px;
  margin: 20px 0;

  background: #FFFFFF; /* ← мягкий серый */
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}



/* =========================
   LIST RESET
========================= */

.ingredients-view {
  list-style: none;
  margin: 0;
  padding: 0;
}



/* аккуратный разделитель */
.ingredient-view-item:not(:last-child) {
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

[data-theme="dark"] .ingredient-view-item:not(:last-child) {
  border-bottom: 1px solid rgba(255,255,255,0.05);
}


/* =========================
   NAME
========================= */

/* =========================
   INGREDIENTS — STABLE GRID
========================= */


.ingredient-name,
.ingredient-amount {
  white-space: normal;       /* разрешаем перенос */
  word-break: break-word;    /* длинные слова переносятся */
}
.ingredient-view-item {
  display: grid;
  grid-template-columns: 1fr minmax(0, 1fr); /* теперь обе колонки гибкие */
  column-gap: 14px;
  align-items: start;
  padding: 14px 0;
}

.ingredient-name {
  white-space: normal;
  word-break: break-word;
}

.ingredient-amount {
  white-space: normal;       /* разрешаем перенос */
  word-break: break-word;    /* перенос длинных слов */
  font-weight: 600;
  text-align: right;
  justify-self: end;         /* держим текст справа */
}
[data-theme="dark"] .ingredients-block {
  background: #2a2b2e;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

/* ========================================
   FULLSCREEN OVERLAY (READING MODE)
======================================== */

.block-fullscreen {
  position: fixed;
  inset: 0;
  background: var(--bg);

  z-index: 99999;

  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;

  overflow-y: auto;
  overscroll-behavior: contain;
}

.block-fullscreen.active {
  opacity: 1;
  pointer-events: auto;
}

/* Внутренний контейнер */
.block-fullscreen-inner {
  min-height: 100vh;
  padding: 80px 24px 120px;
  box-sizing: border-box;
}

/* Контент */
.block-fullscreen-content {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;

  font-size: 24px;
  line-height: 1.9;
}

/* ========================================
   АНИМАЦИЯ ПОЯВЛЕНИЯ
======================================== */

.block-fullscreen-content > * {
  transform: scale(.96);
  opacity: 0;
  transition: transform .28s ease, opacity .28s ease;
}

.block-fullscreen.active .block-fullscreen-content > * {
  transform: scale(1);
  opacity: 1;
}

/* ========================================
   STEPS — ЧИСТЫЙ РЕЖИМ
======================================== */

/* Убираем номера полностью */
.block-fullscreen-content .step-number {
  display: none !important;
}

/* Убираем карточный дизайн */
.block-fullscreen-content .step-item {
  display: block;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 0 36px 0;
}

/* Текст шага */
.block-fullscreen-content .step-text {
  font-size: 26px;
  line-height: 1.9;
}

/* Контейнер шагов */
.block-fullscreen-content .steps-list {
  display: flex;
  flex-direction: column;
}

/* ========================================
   INGREDIENTS — ПРОСТО ТЕКСТ
======================================== */

.block-fullscreen-content .ingredients-block {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.block-fullscreen-content .ingredient-view-item {
  display: block !important;
  text-align: center !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 0 20px 0 !important;
  font-size: 26px !important;
}

.block-fullscreen-content .ingredient-name,
.block-fullscreen-content .ingredient-amount {
  display: inline !important;
  font-size: 26px !important;
}

.block-fullscreen-content .ingredient-dots {
  display: none !important;
}

/* ========================================
   QUOTE — ЧИСТЫЙ РЕЖИМ
======================================== */

.block-fullscreen-content .tg-quote {
  border: none !important;
  background: none !important;
  box-shadow: none !important;

  font-size: 26px;
  line-height: 1.9;
  margin: 0 0 36px 0;
}

/* ========================================
   TEXT BLOCKS
======================================== */

.block-fullscreen-content .section-item--text {
  font-size: 26px;
  line-height: 1.9;
  margin-bottom: 36px;
}

/* ========================================
   CLOSE BUTTON
======================================== */

.block-close {
  position: sticky;
  top: 0;

  margin-left: auto;
  display: block;

  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;

  margin-bottom: 20px;
}

.block-fullscreen-content .text-content br {
  display: block;
  content: "";
  margin-bottom: 0.6em;
}

/* =========================
   READING MODE — TEXT BLOCK
========================= */

.block-fullscreen-content .text-content {
  font-size: 28px;          /* 🔥 крупнее */
  line-height: 1.9;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

/* абзацы */
.block-fullscreen-content .text-content p {
  margin: 0 0 28px 0;
}

/* жирный текст */
.block-fullscreen-content .text-content b,
.block-fullscreen-content .text-content strong {
  font-weight: 700;
}

/* курсив */
.block-fullscreen-content .text-content i,
.block-fullscreen-content .text-content em {
  font-style: italic;
}

/* =========================
   GLOBAL READING MODE
========================= */

/* 🌙 Тёмная тема */
[data-theme="dark"] body.reading-mode {
  background: #111;
}

/* ☀ Светлая тема */
[data-theme="light"] body.reading-mode {
  background: #f8f8fb;
}
body.reading-mode .container {
  max-width: 760px;
  margin: 0 auto;
}


body.reading-mode .item-delete,
body.reading-mode .section-delete,
body.reading-mode .video-wrapper {
  display: none !important;
}



/* Текст */
body.reading-mode .text-content,
body.reading-mode .step-text,
body.reading-mode .tg-quote {
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.9;
  text-align: center;
  margin-bottom: 40px;
}

/* Ингредиенты как текст */
body.reading-mode .ingredient-view-item {
  display: block;
  text-align: center;
  border: none;
  font-size: 24px;
  margin-bottom: 16px;
}

/* Убираем линии */
body.reading-mode .ingredient-dots {
  display: none;
}

/* Убираем карточность */
body.reading-mode .step-item {
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 36px;
}

/* Центрируем изображения */
body.reading-mode .photo-block,
body.reading-mode .image-preview {
  margin: 40px auto;
  max-width: 520px;
}

.reading-exit {
  display: none;
}

body.reading-mode .reading-exit {
  display: block;
  position: fixed;
  top: 50px;
  right: 99px;
  background: rgba(255,255,255,.1);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  z-index: 9999;
}

/* =========================
   READING MODE — INGREDIENTS
========================= */

body.reading-mode .ingredients-block {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 48px 0;
}

body.reading-mode .ingredient-view-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 20px;

  padding: 12px 0;
  margin: 0;

  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.6;

  border-bottom: 1px solid rgba(255,255,255,0.08);
}

body.reading-mode .ingredient-view-item:last-child {
  border-bottom: none;
}

body.reading-mode .ingredient-name {
  text-align: left;
  font-weight: 400;
}

body.reading-mode .ingredient-amount {
  font-weight: 600;
  white-space: nowrap;
}

body.reading-mode .ingredients-block {
  margin: 60px 0;
}

body.reading-mode .ingredient-view-item {
  border-bottom: none;
  padding: 10px 0;
}

/* =========================
   READING MODE — INGREDIENTS SIZE TWEAK
========================= */

body.reading-mode .ingredient-name {
  font-size: clamp(22px, 2.3vw, 26px);
  font-weight: 500;
}

body.reading-mode .ingredient-amount {
  font-size: clamp(22px, 2.3vw, 26px);
  font-weight: 600;
}

/* =========================
   READING MODE — SECTION HEADING
========================= */

body.reading-mode .section-item-heading {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
  line-height: 1.4;

  background: transparent;
  border: none;
  padding: 0;
  margin: 48px 0 24px;
}

/* =========================
   READING MODE — LESSON TITLE FIX
========================= */

body.reading-mode .lesson-section-title {
  display: block !important;

  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.3;

  margin: 64px 0 32px;

  background: transparent;
  border: none;
  text-transform: none;
}

/* =========================
   READING MODE — STEPS ALIGN FIX
========================= */

body.reading-mode .step-item {
  display: flex;
  align-items: center;   /* ← ключевая строка */
  gap: 18px;

  background: none;
  border: none;
  padding: 0;
  margin-bottom: 42px;
}

body.reading-mode .step-number {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 40px;
  height: 40px;
  min-width: 40px;

  font-size: 18px;
}

body.reading-mode .step-text {
  flex: 1;
  margin: 0;
  text-align: left;  /* лучше убрать центрирование */
}

/* =========================
   READING MODE — HEADER SPACING FIX
========================= */

body.reading-mode .tg-header {
  padding: 0 !important;
  margin: 0 0 24px;
  background: transparent;
}

body.reading-mode .lesson-section-title {
  margin: 32px 0 16px;
}

/* =========================
   READING MODE — SECTION BODY SPACING FIX
========================= */

body.reading-mode .tg-body.section-items {
  padding-top: 0 !important;
  padding-bottom: 8px;
}

/* =========================
   READING MODE — INGREDIENTS SPACING
========================= */

body.reading-mode .ingredient-view-item {
  padding: 6px 0;
}

body.reading-mode .lesson-section-title {
  margin: 24px 0 16px;
}

/* =========================
   READING MODE — REMOVE GAP AFTER SECTION TITLE
========================= */

/* убираем нижний отступ у заголовка */
body.reading-mode .lesson-section-title {
  margin-bottom: 12px !important;
}

/* убираем верхний отступ у первого блока в секции */
body.reading-mode .tg-body.section-items > *:first-child {
  margin-top: 0 !important;
}

/* убираем лишний верхний padding у body секции */
body.reading-mode .tg-body.section-items {
  padding-top: 0 !important;
}

body.reading-mode .tg-body.section-items {
  gap: 0 !important;
}

/* =========================
   READING MODE — REMOVE TG-BODY PADDING
========================= */

body.reading-mode .tg-body {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

body.reading-mode .tg-body.section-items .video-wrapper {
  display: none !important;
}

body.reading-mode .tg-body.section-items > *:not(.video-wrapper):first-of-type {
  margin-top: 0 !important;
}

/* =========================
   READING MODE — TEXT CONTENT SPACING FIX
========================= */

body.reading-mode .text-content {
  margin-bottom: 0 !important;
}

body.reading-mode .section-item--text {
  margin: 16px 0 !important;
}

/* =========================
   READING MODE — SECTION HEADING FIX
========================= */

body.reading-mode h3.section-heading {
  margin-top: 0 !important;
  margin-bottom: 16px;

  font-size: clamp(22px, 2.4vw, 26px);
  font-weight: 600;
  line-height: 1.4;

  background: transparent;
  padding: 0;
}

body.reading-mode .ingredients-block {
  margin: 0 0 16px !important;
}

/* =========================
   READING MODE — REMOVE TOP MARGIN FROM SECTION TITLE
========================= */

body.reading-mode .lesson-section-title {
  margin-top: 10px !important;
}

body.reading-mode .tg-header {
  margin-bottom: 0 !important;
}

/* =========================
   INGREDIENT DIVIDERS — LIGHT THEME
========================= */

[data-theme="light"] .ingredient-view-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .ingredient-view-item:last-child {
  border-bottom: none;
}

/* =========================
   READING MODE — TEXT RHYTHM FIX
========================= */

body.reading-mode .text-content,
body.reading-mode .step-text,
body.reading-mode .tg-quote {
  line-height: 1.65 !important;
  margin-bottom: 12px !important;
}

.tg-quote p:last-child {
  margin-bottom: 0;
}

.tg-quote p:empty {
  display: none;
}========================
   READING MODE — STEPS SPACING FIX
========================= */

body.reading-mode .steps-list {
  margin-bottom: 0 !important;
}


body.reading-mode .step-item {
  margin-bottom: 10px !important;
}

/* =========================
   READING MODE — STEP ALIGN FIX
========================= */

body.reading-mode .step-item {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

body.reading-mode .step-number {
  margin-top: 4px;
}

/* =========================
   READING MODE — INGREDIENT RHYTHM FIX
========================= */

body.reading-mode .ingredient-view-item {
  margin: 0 !important;
  padding: 12px 0;
}

.tg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reading-mode-btn {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;

  cursor: pointer;
  transition: all .2s ease;

  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.reading-mode-btn:hover {
  background: var(--surface-2);
}

body.reading-mode .reading-mode-btn {
  background: var(--surface-2);
}

body.reading-mode .reading-mode-btn {
  display: none;
}

.tg-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center; /* центрируем содержимое */
}

.reading-mode-btn {
  position: absolute;
  right: 16px;
}

/* первая карточка — якорь */
.tg-post {
  position: relative;
}
/* кнопка в углу */
.reading-corner-btn {
  position: absolute;
  right: 16px;
  bottom: 16px;

  font-size: 12px;
  font-weight: 500;

  padding: 6px 12px;
  border-radius: 8px;

  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);

  cursor: pointer;
  transition: all .2s ease;
}

.reading-corner-btn:hover {
  transform: translateY(-1px);
}

/* в режиме чтения можно оставить видимой или скрыть */
body.reading-mode .reading-corner-btn {
  opacity: 0.6; /* если хочешь приглушить */
}

/* первая карточка — якорь */
.tg-post:first-child {
  position: relative;
  padding-bottom: 32px;
}


/* контейнер кнопок */
.corner-actions {
  position: absolute;
  right: 16px;
  bottom: 16px;

  display: flex;
  gap: 8px;
}

/* универсальная кнопка */
.corner-btn {
  font-size: 12px;
  font-weight: 500;

  padding: 6px 10px;
  border-radius: 8px;

  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);

  cursor: pointer;
  transition: all .2s ease;
}

.corner-btn:hover {
  transform: translateY(-1px);
}


.recipes-list {
  display: flex;
  flex-direction: column;
  gap: 12px; /* расстояние между кнопками */
  margin-top: 16px;
}

.recipe-button {
  display: block;
  padding: 14px 20px;
  border-radius: 12px;
  background: #f8fafc; /* светлый фон */
  color: #0f172a;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  transition: all 0.2s ease;

  border: 1px solid #e2e8f0; /* легкая рамка */
}

.recipe-button:hover {
  background: #e2e8f0; /* чуть темнее при hover */
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.recipe-button:active {
  background: #cbd5e1;
  transform: translateY(1px);
}

.recipes-list {
  display: grid;
  grid-template-columns: 1fr; /* одна колонка на мобильных */
  gap: 12px;
  margin-top: 16px;
}

.recipe-row {
  display: block;
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid #e2e8f0;
}

.recipe-row:hover {
  background: var(--surface-2);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.recipe-row:active {
  background: #cbd5e1;
  transform: translateY(1px);
}

/* Темная тема */
[data-theme="dark"] .recipe-row {
  background: #1e1e1e;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.08);
}

[data-theme="dark"] .recipe-row:hover {
  background: #2a2a2a;
}


.recipes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

/* Кнопка рецепта */
.recipe-button {
  display: flex;
  flex-direction: column;     /* все элементы по вертикали */
  align-items: center;        /* горизонтальный центр */
  justify-content: center;    /* вертикальный центр */
  gap: 6px;                   /* расстояние между эмоджи и текстом */
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  position: relative;         /* для heart-overlay */
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  text-align: center;         /* текст по центру */
  word-break: break-word;     /* перенос текста */
}

/* Эмоджи */
.recipe-emoji {
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Текст рецепта */
.recipe-title {
  display: block;
}

/* Heart overlay (избранное) */
.recipe-button .heart-overlay {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hover */
.recipe-button:hover {
  background: var(--surface-2);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Темная тема */
[data-theme="dark"] .recipe-button {
  background: #1e1e1e;
  color: #fff;
  border: 1px solid #333;
}

[data-theme="dark"] .recipe-button:hover {
  background: #2a2a2a;
}

.recipes-list .recipe-button {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 16px;               /* расстояние между картинкой и текстом */
  padding: 0 !important;   /* убираем padding у карточки */
  border-radius: 14px !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  font-weight: 600;
  text-decoration: none;
  position: relative;
  border: 1px solid var(--border) !important;
  height: 80px;
  overflow: hidden;         /* чтобы картинка не выходила за границы */
}

.recipes-list .recipe-button .recipe-icon {
  width: 80px;                /* квадратная картинка */
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;             /* не сжимается */
  border-radius: 0 0 0 0;     /* убрали скругления слева */
  margin-left: 0;             /* убираем любой левый margin */
}

.recipes-list .recipe-button .recipe-title {
  flex: 1;               /* текст занимает оставшееся место */
  text-align: left;
}

/* Для светлой темы */
body[data-theme="light"] .recipes-list .recipe-button {
  background: #f5f5f7;       /* мягкий серый фон */
  border: 1px solid #e2e2e8; /* легкая рамка */
  color: #111;                /* текст темный */
}

/* Для темной темы */
body[data-theme="dark"] .recipes-list .recipe-button {
  background: #1b1c1e;       /* темный фон */
  border: 1px solid #2a2b2e; /* темная рамка */
  color: #fff;                /* текст светлый */
}

.recipes-list .recipe-button {
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.recipes-list .recipe-button {
  display: flex;
  align-items: center;        /* вертикальное центрирование всех элементов внутри */
  gap: 12px;
  padding: 8px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
}

/* Картинка слева, квадратная */
.recipes-list .recipe-button img {
  width: 64px;                /* одинаковая ширина и высота */
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;             /* не сжимать */
}

/* Текст занимает оставшееся место */
.recipes-list .recipe-title {
  flex: 1;                     /* растягивается на свободное пространство */
  display: flex;
  align-items: center;          /* центрирование по вертикали */
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}

.recipes-list {
  display: flex;
  flex-direction: column;
  gap: 12px; /* Расстояние между карточками */
}

.recipe-button {
  display: flex;
  align-items: center;       /* Вертикальный центр */
  justify-content: center;   /* Горизонтальный центр */
  position: relative;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  min-height: 60px; /* Можно подстроить высоту */
}

.recipe-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  text-align: center; /* Горизонтальный центр */
}


нер для фильтров рецептов */
.recipe-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Теги фильтров рецептов */
.recipe-filter-tag {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.recipe-filter-tag.active {
  background-color: #6c5ce7;
  color: #fff;
  border-color: #6c5ce7;
}

.recipe-tile{
  position:relative;

  aspect-ratio: 1.8; /* пропорции как на скрине */
  border-radius:12px;

  background-size:cover;
  background-position:center;

  overflow:hidden;
  display:flex;
  align-items:flex-end;

  padding:16px;

  text-decoration:none;
  color:white;
}

.recipe-tile{
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
}

/* затемнение всей карточки */

.recipe-tile::before{
  content:"";
  position:absolute;
  inset:0;

  background:linear-gradient(
    to bottom,
    rgba(0,0,0,0.05),
    rgba(0,0,0,0.55)
  );

  border-radius:inherit;
  z-index:1;
}

.recipe-tile::before{
  content:"";
  position:absolute;
  inset:0;

  background:linear-gradient(
    to bottom,
    rgba(0,0,0,0.05),
    rgba(0,0,0,0.55)
  );

  border-radius:inherit;
  z-index:1;
}


/* заголовок */
.recipe-tile-title{
  position:relative;
  z-index:2;

  font-size:14px;
  font-weight:600;
  line-height:1.2;
}


#recipeSearch{
  margin-bottom:0;
}

.recipes-group:first-child{
  margin-top:0;
}

body[data-entity="recipes"] .dashboard-section{
  margin-bottom:0;
}

.recipes-group-title{
  margin-top:0 !important;
}

.recipe-tile{
  position:relative;
  display:flex;
  align-items:flex-end;
  padding:12px;

  aspect-ratio:16/9;

  border-radius:18px;
  background-size:cover;
  background-position:center;
  overflow:hidden;

  color:white;
  text-decoration:none;

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    filter .18s ease;
}

.recipe-tile:hover{
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
}

.recipe-tile:active{
  transform:scale(.96);
}

@media (hover:none){
  .recipe-tile:hover{
    transform:none;
    box-shadow:none;
  }
}

.recipe-tile{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:12px;
  text-align:center;
  aspect-ratio:16/9;

  border-radius:18px;
  overflow:hidden;

  background-size:cover;
  background-position:center;

  color:white;
  text-decoration:none;
}

.recipe-tile.card-media{
  background-image: inherit;
}

/* CARD */

.recipe-card{

  position:relative;
  display:flex;
  align-items:flex-end;

  aspect-ratio:16/9;
  padding:12px;

  border-radius:18px;
  overflow:hidden;

  background-size:cover;
  background-position:center;

  color:white;
  text-decoration:none;

  transition:
  transform .18s ease,
  box-shadow .18s ease;

}

/* overlay */

.recipe-overlay{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,0.28);
}

/* title */

.recipe-title{
  position:absolute;
  inset:0;

  display:flex;
  align-items:center;
  justify-content:center;

  text-align:center;

  color:#ffffff !important;
  font-weight:600;
  font-size:15px;

  padding:12px;

  text-shadow:0 2px 8px rgba(0,0,0,0.8);

  z-index:2;
}



/* hover */

.recipe-card:hover{
  transform:translateY(-4px);
}

.recipe-card:active{
  transform:scale(.96);
}


.recipe-search-input{
  width:100%;
  box-sizing:border-box;
}

.search-input{
  width:100%;
  box-sizing:border-box;
}

/* ссылки внутри ингредиентов */

.ingredient-name a {
  color: #168acd;
  text-decoration: underline;
}

.ingredient-name a:hover {
  color: #0f6f9c;
}

.ingredient-name a:visited {
  color: #168acd;
}

.video-wrapper {
pointer-events: auto;
}

.recipe-card {
pointer-events: auto;
}

