/* =====================================================
   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;
}

/* === CONTENT SPACING NORMALIZE START === */
body:not(.reading-mode) .tg-body.section-items {
  display: block;
  padding-top: 0 !important;
}

body:not(.reading-mode) .tg-body.section-items > .section-item {
  margin: 0 !important;
}

body:not(.reading-mode) .tg-body.section-items > .section-item + .section-item {
  margin-top: 22px !important;
}

body:not(.reading-mode) .tg-body.section-items > .section-item--heading + .section-item {
  margin-top: 12px !important;
}

body:not(.reading-mode) .tg-body.section-items > .section-item--image + .section-item,
body:not(.reading-mode) .tg-body.section-items > .section-item--video + .section-item {
  margin-top: 24px !important;
}

body:not(.reading-mode) .tg-body.section-items .section-heading,
body:not(.reading-mode) .tg-body.section-items .text-item,
body:not(.reading-mode) .tg-body.section-items .text-content,
body:not(.reading-mode) .tg-body.section-items .ingredients-block,
body:not(.reading-mode) .tg-body.section-items .ingredients-view,
body:not(.reading-mode) .tg-body.section-items .steps-block,
body:not(.reading-mode) .tg-body.section-items .steps-list,
body:not(.reading-mode) .tg-body.section-items .image-block,
body:not(.reading-mode) .tg-body.section-items .video-block,
body:not(.reading-mode) .tg-body.section-items .tg-quote {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

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

body:not(.reading-mode) .tg-body.section-items .step-item:last-child,
body:not(.reading-mode) .tg-body.section-items .ingredient-view-item:last-child {
  margin-bottom: 0 !important;
}

body:not(.reading-mode) .tg-body.section-items .text-content > :first-child,
body:not(.reading-mode) .tg-body.section-items .step-text > :first-child,
body:not(.reading-mode) .tg-body.section-items .tg-quote > :first-child {
  margin-top: 0 !important;
}

body:not(.reading-mode) .tg-body.section-items .text-content > :last-child,
body:not(.reading-mode) .tg-body.section-items .step-text > :last-child,
body:not(.reading-mode) .tg-body.section-items .tg-quote > :last-child {
  margin-bottom: 0 !important;
}

body:not(.reading-mode) .tg-body.section-items .ingredients-view {
  padding: 0;
}

body:not(.reading-mode) .tg-body.section-items .section-item--heading .section-heading {
  line-height: 1.35;
}
/* === CONTENT SPACING NORMALIZE END === */
