/* ==========================================================================
   ELITEMAGAZIN — "Recept" Gutenberg-blokk (front-end + szerkesztő + sötét mód)
   Önálló fájl: csak azokon az oldalakon töltődik be, ahol a blokk szerepel
   (has_block), illetve a blokk-szerkesztőben. A sötét módos szabályok is itt
   vannak (body.dark-mode), a meglévő dark-mode.css érintése nélkül.
   Elrendezés (a jóváhagyott mockup szerint):
   - ≥961px: hozzávalók bal oszlop (1 hasáb) | elkészítés jobb oszlop.
   - ≤960px: hozzávalók felül, KÉT hasábban; elkészítés alatta teljes szélesen.
   - ≤560px: hozzávalók 1 hasáb; a 4 infókártya 2×2-es rácsba törik.
   ========================================================================== */

.elitemag-recipe {
  --emr-purple: #7e0177;
  --emr-purple-dark: #4a1051;
  --emr-accent: #ff027f;
  --emr-border: #cfc3d6;
  --emr-line: #e5e5e5;
  --emr-text: #1a1a1a;
  --emr-muted: #444;
  --emr-tip-bg: #efeaf6;
  --emr-icon-fill: #7e0177;
  --emr-icon-cutout: #efeaf6;
  margin: 30px 0;
  color: var(--emr-text);
}

/* ---------- Eredet (ország / tájegység) jelvény — teljes szélességű,
   "boarding pass" hatású sáv, közvetlenül az infókártyák FÖLÖTT —
   felhasználói kérés (2026-07-23), a "Nemzetközi ízek" kategóriához. Csak
   akkor jelenik meg, ha az Ország mező ki van töltve. */
.elitemag-recipe .emr-origin {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--emr-border);
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 20px;
}

.elitemag-recipe .emr-origin-flag {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--emr-tip-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emr-purple);
}

.elitemag-recipe .emr-origin-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.elitemag-recipe .emr-origin-flag svg {
  width: 20px;
  height: 20px;
}

.elitemag-recipe .emr-origin-divider {
  flex: 0 0 auto;
  width: 0;
  height: 32px;
  border-left: 1.5px dashed var(--emr-border);
}

.elitemag-recipe .emr-origin-text {
  flex: 1 1 auto;
  min-width: 0;
}

.elitemag-recipe .emr-origin-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--emr-purple);
}

.elitemag-recipe .emr-origin-value {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: var(--emr-text);
  margin-top: 1px;
}

.elitemag-recipe .emr-origin-region {
  color: var(--emr-muted);
  font-weight: 400;
}

.elitemag-recipe .emr-origin-route {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: .5;
  color: var(--emr-purple);
}

.elitemag-recipe .emr-origin-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.elitemag-recipe .emr-origin-dashes {
  width: 20px;
  height: 1px;
  display: inline-block;
  background: repeating-linear-gradient(to right, currentColor 0 3px, transparent 3px 6px);
}

.elitemag-recipe .emr-origin-route svg {
  display: block;
}

/* ---------- Infókártyák (idő / adag / nehézség) ---------- */
.elitemag-recipe .emr-info {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--emr-line);
  margin-bottom: 28px;
}

.elitemag-recipe .emr-info-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  padding: 14px 10px;
  border: 1px solid var(--emr-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(74, 16, 81, .06);
}

.elitemag-recipe .emr-info-icon {
  display: block;
  width: 26px;
  height: 26px;
  color: var(--emr-purple-dark);
  margin-bottom: 2px;
}

.elitemag-recipe .emr-info-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.elitemag-recipe .emr-info-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--emr-muted);
}

.elitemag-recipe .emr-info-value {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
}

/* ---------- Szakasz-címek (lila sáv + csíkozott dísz) ---------- */
.elitemag-recipe .emr-title {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 18px;
  padding: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.elitemag-recipe .emr-title-text {
  display: inline-block;
  border-left: 5px solid var(--emr-purple);
  padding-left: 14px;
}

.elitemag-recipe .emr-title-deco {
  flex: 1 1 auto;
  height: 12px;
  min-width: 40px;
  background: repeating-linear-gradient(
    -60deg,
    transparent 0 5px,
    #b9b9b9 5px 7px
  );
  opacity: .55;
}

/* ---------- Két oszlopos törzs — felhasználói kérés (2026-07-23): mostantól
   MINDEN méretben (asztali/laptop ESETÉN IS) egymás ALÁ rendezve a
   Hozzávalók és az Elkészítés — korábban csak ≤960px-nél volt így, szélesebb
   nézetekben két oszlopban, egymás mellett jelentek meg. A hozzávalók lista
   is végig két hasábos marad (a korábbi ≤960px viselkedés), mert így széles
   nézetben nem lóg meg feleslegesen hosszan az egyoszlopos lista. */
.elitemag-recipe .emr-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--emr-line);
  margin-bottom: 28px;
}

.elitemag-recipe .emr-body > .emr-col:only-child {
  grid-column: 1 / -1;
}

.elitemag-recipe .emr-col-ingredients {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--emr-line);
}

/* ---------- Hozzávalók ---------- */
.elitemag-recipe .emr-ingredients {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 28px;
}

.elitemag-recipe .emr-ingredients li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 17px;
  line-height: 1.4;
  margin: 0;
  padding: 0;
}

.elitemag-recipe .emr-check {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1.5px solid #9a9a9a;
  border-radius: 50%;
  color: #7a7a7a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.elitemag-recipe .emr-check svg {
  width: 13px;
  height: 13px;
  display: block;
}

/* Alcím a hozzávalók között (pl. "Mangós chutney-hoz:") — pipa nélkül,
   félkövéren; a kéthasábos (keskeny) nézetben mindig teljes szélességű
   sort kap, hogy ne törjön hasáb közepére. */
.elitemag-recipe .emr-ingredient-heading {
  grid-column: 1 / -1;
  margin-top: 10px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--emr-purple-dark);
}

.elitemag-recipe .emr-ingredients li.emr-ingredient-heading:first-child {
  margin-top: 0;
}

/* ---------- Elkészítés (számozott lépések) ---------- */
.elitemag-recipe .emr-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}

.elitemag-recipe .emr-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin: 0;
  padding: 0 0 26px;
}

.elitemag-recipe .emr-step:last-child {
  padding-bottom: 0;
}

/* Összekötő vonal a szám-körök között. */
.elitemag-recipe .emr-step::before {
  content: '';
  position: absolute;
  left: 26px;
  top: 52px;
  bottom: 6px;
  width: 1px;
  background: #d9d9d9;
}

.elitemag-recipe .emr-step:last-child::before {
  display: none;
}

.elitemag-recipe .emr-step-num {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border: 1.5px solid #870A80;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Times New Roman', Times, serif;
  font-size: 26px;
  font-weight: 500;
  color: #870A80;
  position: relative;
  z-index: 1;
}

.elitemag-recipe .emr-step-body {
  flex: 1 1 auto;
  min-width: 0;
}

.elitemag-recipe .emr-step-title {
  margin: 4px 0 6px;
  padding: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}

.elitemag-recipe .emr-step-text {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--emr-text);
}

/* ---------- Séf tipp / Borajánló — ÖNÁLLÓ, TELJES SZÉLESSÉGŰ dobozok
   (ugyanúgy, mint a Tápérték), MINDEN méretben — felhasználói kérés
   (2026-07-23/24). Mindkét doboz UGYANAZT a közös alap-elrendezést kapja
   (`.emr-note`): egy nagyobb, körvonalas ikon balra — a doboz magasságához
   igazodva, függőlegesen középen —, mellette jobbra a felirat + szöveg. A
   Séf tipp ikonja séf-sapka, a Borajánlóé boroskehely; mindkettő a doboz
   háttérszínéhez igazodó "kivágott" és a lila "kitöltött" részekből áll
   (lásd elitemag_recipe_chef_icon() / elitemag_recipe_wine_icon()), a
   színeket CSS-változók adják, így világos/sötét módban automatikusan
   igazodnak. */
.elitemag-recipe .emr-note {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 28px;
  padding: 16px 20px 18px;
  border-radius: 14px;
  background: var(--emr-tip-bg);
}

.elitemag-recipe .emr-note-icon {
  flex: 0 0 auto;
  align-self: center;
  width: 40px;
  height: 40px;
}

.elitemag-recipe .emr-tip2 .emr-note-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.elitemag-recipe .emr-tip2 .emr-note-icon svg {
  width: 24px;
  height: 24px;
}

.elitemag-recipe .emr-note-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.elitemag-recipe .emr-icon-fill {
  fill: var(--emr-icon-fill);
}

.elitemag-recipe .emr-icon-cutout {
  fill: var(--emr-icon-cutout);
}

.elitemag-recipe .emr-icon-stroke {
  fill: none;
  stroke: var(--emr-icon-fill);
}

.elitemag-recipe .emr-note-body {
  flex: 1 1 auto;
  min-width: 0;
}

.elitemag-recipe .emr-note-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--emr-purple);
  margin-bottom: 6px;
}

.elitemag-recipe .emr-note-text {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.55;
}

/* ---------- Tápérték ---------- */
.elitemag-recipe .emr-nutrition {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 16px;
}

.elitemag-recipe .emr-nutrition-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 3px;
  padding: 16px 10px;
  border: 1px solid var(--emr-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(74, 16, 81, .06);
}

.elitemag-recipe .emr-nutrition-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--emr-muted);
}

.elitemag-recipe .emr-nutrition-value {
  font-size: 18px;
  font-weight: 700;
}

/* Megjegyzés a tápérték-kártyák alatt (pl. "A tápérték 1 fő részére
   értendő."). */
.elitemag-recipe .emr-nutrition-note {
  margin: 12px 0 0;
  font-size: 14px;
  font-style: italic;
  color: var(--emr-muted);
}

/* ---------- Reszponzív törések ---------- */
@media (max-width: 560px) {
  .elitemag-recipe .emr-info {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .elitemag-recipe .emr-ingredients {
    grid-template-columns: 1fr;
  }

  .elitemag-recipe .emr-title {
    font-size: 22px;
  }

  .elitemag-recipe .emr-step {
    gap: 14px;
  }

  .elitemag-recipe .emr-step-num {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .elitemag-recipe .emr-step::before {
    left: 22px;
    top: 46px;
  }
}

/* ==========================================================================
   SÖTÉT MÓD (body.dark-mode) — a témában használt sötét paletta szerint.
   ========================================================================== */
body.dark-mode .elitemag-recipe {
  --emr-border: #3a3a3a;
  --emr-line: #2c2c2c;
  --emr-text: #e8e8e8;
  --emr-muted: #b5b5b5;
  --emr-tip-bg: #251c2e;
  --emr-icon-fill: #c98fd0;
  --emr-icon-cutout: #251c2e;
}

body.dark-mode .elitemag-recipe .emr-info-card,
body.dark-mode .elitemag-recipe .emr-nutrition-card {
  background: #1c1c1c;
  box-shadow: none;
}

body.dark-mode .elitemag-recipe .emr-info-icon {
  color: #c98fd0;
}

body.dark-mode .elitemag-recipe .emr-title-text {
  border-left-color: var(--emr-accent);
}

body.dark-mode .elitemag-recipe .emr-title-deco {
  opacity: .3;
}

body.dark-mode .elitemag-recipe .emr-check {
  border-color: #6a6a6a;
  color: #9a9a9a;
}

body.dark-mode .elitemag-recipe .emr-ingredient-heading {
  color: #c98fd0;
}

body.dark-mode .elitemag-recipe .emr-step-num {
  border-color: #c98fd0;
  color: #c98fd0;
}

body.dark-mode .elitemag-recipe .emr-step::before {
  background: #3a3a3a;
}

body.dark-mode .elitemag-recipe .emr-note-label {
  color: var(--emr-accent);
}

body.dark-mode .elitemag-recipe .emr-origin {
  background: #1c1c1c;
  border-color: var(--emr-border);
}

body.dark-mode .elitemag-recipe .emr-origin-flag {
  background: #251c2e;
  color: #c98fd0;
}

body.dark-mode .elitemag-recipe .emr-origin-label,
body.dark-mode .elitemag-recipe .emr-origin-route {
  color: #c98fd0;
}

/* ==========================================================================
   SZERKESZTŐI kiegészítések (.emr-editor) — a front-end kinézetet követi,
   plusz a sor-vezérlők (fel/le/törlés), a hozzáadás-gombok és a súgó-sor.
   A szerkesztőben mindig egyoszlopos a törzs (a szerkesztő-felület keskeny).
   ========================================================================== */
.emr-editor .emr-body {
  grid-template-columns: 1fr;
}

.emr-editor .emr-origin {
  align-items: flex-start;
}

.emr-editor .emr-origin-fields {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.emr-editor .emr-origin-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--emr-border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--emr-text);
  background: #fff;
}

.emr-editor .emr-origin-input:focus {
  outline: none;
  border-color: var(--emr-purple);
}

.emr-editor .emr-origin-hint {
  margin-top: -10px;
}

/* A hozzávalók lista a SZERKESZTŐBEN marad EGY oszlopos (a szerkesztősi
   munkafolyamathoz így kényelmesebb: minden sor sor-vezérlőkkel [fel/le/
   törlés] egymás alatt, könnyebben átlátható), FÜGGETLENÜL attól, hogy a
   front-enden (a látogatók számára) mostantól KÉT hasábban jelenik meg —
   felhasználói kérés, 2026-07-23. */
.emr-editor .emr-ingredients {
  grid-template-columns: 1fr;
}

.emr-editor .emr-ingredients li,
.emr-editor .emr-nutrition-card {
  position: relative;
}

.emr-editor .emr-row-controls {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-left: auto;
  flex: 0 0 auto;
  opacity: .35;
  transition: opacity .15s ease;
}

.emr-editor .emr-ingredients li:hover .emr-row-controls,
.emr-editor .emr-ingredients li:focus-within .emr-row-controls,
.emr-editor .emr-step:hover .emr-row-controls,
.emr-editor .emr-step:focus-within .emr-row-controls,
.emr-editor .emr-nutrition-card:hover .emr-row-controls,
.emr-editor .emr-nutrition-card:focus-within .emr-row-controls {
  opacity: 1;
}

.emr-editor .emr-row-controls .components-button {
  height: 26px;
  min-width: 26px;
  padding: 0 3px;
}

.emr-editor .emr-nutrition-card .emr-row-controls {
  margin: 6px auto 0;
}

.emr-editor .emr-add-btn {
  margin-top: 14px;
}

.emr-editor .emr-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.emr-editor .emr-add-row .emr-add-btn {
  margin-top: 14px;
}

.emr-editor .emr-ingredient-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.emr-editor .emr-ingredient-heading-text {
  flex: 1 1 auto;
  min-width: 0;
}

.emr-editor .emr-editor-hint {
  margin: -8px 0 14px;
  font-size: 12.5px;
  font-style: italic;
  color: var(--emr-muted);
}

.emr-editor .emr-ingredient-text,
.emr-editor .emr-step-text,
.emr-editor .emr-note-text {
  flex: 1 1 auto;
  min-width: 0;
}

.emr-editor .emr-nutrition-note {
  margin-top: 14px;
}

/* A RichText üres-állapot (placeholder) ne "ugráltassa" a sorokat. */
.emr-editor [data-rich-text-placeholder]::after {
  opacity: .45;
}
