/* שורשים — עיצוב בסיסי */
:root {
  --sage: #7a8b6f;
  --sage-deep: #3f4a3a;
  --sage-soft: #e3e8dc;
  --cream: #f6f1e7;
  --paper: #fffdf8;
  --terra: #b85c38;
  --terra-soft: #f3dfd3;
  --ink: #2a2a26;
  --muted: #6b6a61;
  --line: #e2dccd;
  --radius: 14px;
  --font-body: "Assistant", "Segoe UI", Arial, sans-serif;
  --font-head: "Frank Ruhl Libre", Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
}
a { color: var(--sage-deep); }
img, svg { max-width: 100%; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* כותרת עליונה */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
/* שורת הכותרת מסודרת תמיד משמאל לימין, כך שכפתור השפה נשאר בפינה הימנית
   בכל שפה. הלוגו והניווט שבתוכה מתהפכים לפי כיוון השפה. */
.header-row {
  direction: ltr;
  display: flex; align-items: center; gap: 14px; height: 64px;
}
.header-main {
  flex: 1; min-width: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
html[dir="rtl"] .header-main { direction: rtl; }

/* בורר שפה — רוחב קבוע, כדי שלא יזוז כשמחליפים שפה */
.lang-switch { position: relative; flex: none; }
.lang-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 78px; height: 38px; padding: 0;
  font: inherit; font-size: 15px; font-weight: 700; letter-spacing: .03em;
  color: var(--sage-deep); background: var(--cream);
  border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer;
}
.lang-btn:hover, .lang-btn[aria-expanded="true"] { border-color: var(--sage); }
.lang-btn svg { width: 18px; height: 18px; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  list-style: none; margin: 0; padding: 6px; min-width: 160px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(63,74,58,.16); z-index: 20;
}
.lang-menu[hidden] { display: none; }
.lang-menu a {
  display: block; padding: 8px 12px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-size: 16px;
}
.lang-menu a:hover, .lang-menu a:focus-visible { background: var(--sage-soft); }
.lang-menu a[aria-current="true"] { font-weight: 700; color: var(--sage-deep); }
.lang-menu a[lang="he"] { direction: rtl; text-align: right; }
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 700; font-size: 26px;
  color: var(--sage-deep); text-decoration: none;
}
.logo svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 22px; font-size: 17px; }
.nav a { text-decoration: none; color: var(--ink); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--terra); }
@media (max-width: 640px) { .nav .hide-sm { display: none; } }

/* עמוד הבית */
.hero { padding: 56px 0 36px; }
.hero h1 {
  font-family: var(--font-head); font-size: clamp(34px, 6vw, 54px);
  line-height: 1.15; margin: 0 0 12px; color: var(--sage-deep);
}
.hero p { font-size: 20px; color: var(--muted); max-width: 560px; margin: 0 0 26px; }

.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 6px 8px 6px 18px; max-width: 560px;
}
.search:focus-within { border-color: var(--sage); }
.search svg { width: 20px; height: 20px; color: var(--muted); flex: none; margin-inline-start: 8px; }
.search input {
  flex: 1; border: 0; background: transparent; font: inherit; padding: 8px 4px;
  outline: none; min-width: 0;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.chip {
  font: inherit; font-size: 16px; padding: 6px 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--sage-deep); border-color: var(--sage-deep); color: #fff; }
.chip[disabled] { opacity: .5; cursor: default; }

.section { padding: 28px 0 40px; }
.section h2 {
  font-family: var(--font-head); font-size: 30px; margin: 0 0 18px; color: var(--sage-deep);
}

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(63,74,58,.12); }
.card-art { height: 150px; display: grid; place-items: center; }
.card-art svg { width: 84px; height: 84px; }
.card-body { padding: 16px 18px 18px; }
.card h3 { font-family: var(--font-head); font-size: 22px; margin: 0 0 6px; }
.card .meta { font-size: 15px; color: var(--muted); }
.empty { color: var(--muted); display: none; }

.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tool {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.tool h3 { margin: 0 0 6px; font-size: 20px; }
.tool p { margin: 0; color: var(--muted); font-size: 16px; }
.soon {
  display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 10px;
  border-radius: 999px; background: var(--terra-soft); color: var(--terra); margin-bottom: 8px;
}

/* עמוד מתכון */
.crumbs { font-size: 15px; color: var(--muted); padding: 22px 0 0; }
.crumbs a { color: var(--muted); }
.recipe-head { padding: 10px 0 18px; }
.recipe-head h1 {
  font-family: var(--font-head); font-size: clamp(32px, 5vw, 46px);
  margin: 6px 0 8px; color: var(--sage-deep); line-height: 1.2;
}
.recipe-head .lead { font-size: 19px; color: var(--muted); margin: 0 0 14px; max-width: 640px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 16px; }
.facts b { color: var(--sage-deep); }

.notice {
  background: var(--terra-soft); color: #7a3a20; border-radius: 10px;
  padding: 10px 14px; font-size: 15px; margin: 14px 0 0; max-width: 640px;
}

.layout { display: grid; grid-template-columns: 1fr; gap: 22px; padding-bottom: 50px; }
@media (min-width: 900px) { .layout { grid-template-columns: 1.4fr 1fr; align-items: start; } }

.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px;
}
.panel h2 { font-family: var(--font-head); font-size: 24px; margin: 0 0 14px; color: var(--sage-deep); }

/* כלי שינוי אצווה */
.scaler { background: var(--sage-soft); border-color: #cfd8c5; }
.scaler-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.scaler label { font-weight: 700; }
.amount-input {
  display: flex; align-items: center; background: #fff; border: 1.5px solid #c4cdb9;
  border-radius: 10px; overflow: hidden;
}
.amount-input input {
  width: 96px; border: 0; font: inherit; font-size: 20px; font-weight: 700;
  padding: 8px 10px; text-align: center; outline: none; direction: ltr;
}
.amount-input span { padding: 0 12px; color: var(--muted); }
.preset, .unit-btn {
  font: inherit; font-size: 15px; padding: 7px 14px; border-radius: 999px;
  border: 1.5px solid #c4cdb9; background: #fff; cursor: pointer; color: var(--ink);
}
.preset:hover, .unit-btn:hover { border-color: var(--sage-deep); }
.unit-btn[aria-pressed="true"] { background: var(--sage-deep); color: #fff; border-color: var(--sage-deep); }
.units { display: flex; gap: 6px; margin-inline-start: auto; }
.scaler-msg { font-size: 15px; margin: 10px 0 0; min-height: 1.2em; }
.scaler-msg.error { color: #a12d14; font-weight: 700; }
.scaler-msg.warn { color: #7a3a20; }

table.ing { width: 100%; border-collapse: collapse; font-size: 17px; }
table.ing th {
  text-align: start; font-size: 14px; color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--line); padding: 6px 4px;
}
table.ing td { padding: 11px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.ing tr:last-child td { border-bottom: 0; }
table.ing .inci { display: block; font-size: 13px; color: var(--muted); direction: ltr; text-align: start; unicode-bidi: plaintext; }
table.ing .pct, table.ing .amt { white-space: nowrap; text-align: end; }
table.ing .amt { font-weight: 700; font-size: 19px; color: var(--sage-deep); direction: ltr; unicode-bidi: plaintext; }
table.ing tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
.check { width: 20px; height: 20px; accent-color: var(--sage-deep); vertical-align: middle; }
tr.done td, li.done .step-text { opacity: .45; text-decoration: line-through; }

ol.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
ol.steps li {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: start;
  padding: 12px 0; border-bottom: 1px solid var(--line); counter-increment: s;
}
ol.steps li:last-child { border-bottom: 0; }
ol.steps li::before {
  content: counter(s); width: 30px; height: 30px; border-radius: 50%;
  background: var(--sage-deep); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 15px;
}

ul.plain { margin: 0; padding-inline-start: 20px; }
ul.plain li { margin: 4px 0; }
.warn-panel { border-color: #e8c4b2; }
.warn-panel h2 { color: var(--terra); }

.save-btn {
  width: 100%; font: inherit; font-weight: 700; font-size: 18px; padding: 13px;
  border: 0; border-radius: 12px; background: var(--terra); color: #fff; cursor: pointer;
}
.save-btn:hover { background: #a34f2f; }
.save-note { font-size: 15px; color: var(--muted); margin: 10px 0 0; display: none; }

.stack { display: grid; gap: 22px; }

/* כותרת תחתונה */
.site-footer {
  border-top: 1px solid var(--line); background: var(--paper);
  padding: 26px 0 34px; font-size: 15px; color: var(--muted);
}
.site-footer p { margin: 0 0 8px; max-width: 760px; }

:focus-visible { outline: 3px solid var(--terra); outline-offset: 2px; }

@media (max-width: 640px) {
  .nav { gap: 14px; font-size: 16px; }
  .logo { font-size: 22px; gap: 6px; }
  .logo svg { width: 24px; height: 24px; }
}
@media (max-width: 420px) { .nav .hide-xs { display: none; } }
.layout > *, .stack > * { min-width: 0; }
