/* ───── צבעים וטיפוגרפיה ───── */
:root {
  --paper: #F6EFE2;
  --paper-2: #EFE5D3;
  --card: #FFFBF3;
  --ink: #2A241F;
  --ink-soft: #5E544B;
  --line: #DDD0BA;
  --saffron: #F2B829;
  --saffron-soft: #FBE7AE;
  --clay: #A9482A;
  --olive: #5F6B3A;
  --shadow: 0 1px 2px rgba(60, 40, 20, .08), 0 8px 24px rgba(60, 40, 20, .08);
  --radius: 14px;
  --serif: "Frank Ruhl Libre", "Times New Roman", serif;
  --sans: "Assistant", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --hand: "Amatic SC", var(--serif);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1E1A16;
    --paper-2: #26211C;
    --card: #2A241F;
    --ink: #F1E9DC;
    --ink-soft: #BFB3A3;
    --line: #3D352D;
    --saffron: #F2B829;
    --saffron-soft: #4A3A12;
    --clay: #E07A55;
    --olive: #A9B57C;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1E1A16; --paper-2: #26211C; --card: #2A241F; --ink: #F1E9DC; --ink-soft: #BFB3A3;
  --line: #3D352D; --saffron-soft: #4A3A12; --clay: #E07A55; --olive: #A9B57C; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
main:focus { outline: none; }

/* ───── כותרת עליונה ───── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--saffron); color: #2A241F;
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 900; font-size: 22px; line-height: 1;
}
.brand-text { font-family: var(--serif); font-weight: 700; font-size: 20px; }
.nav { display: flex; gap: 4px; }
.nav a {
  text-decoration: none; padding: 6px 12px; border-radius: 999px; font-weight: 600; color: var(--ink-soft);
}
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a.active { color: var(--ink); background: var(--saffron-soft); }

/* ───── עמוד הבית ───── */
.hero { padding: 56px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow { font-weight: 700; color: var(--clay); letter-spacing: .02em; margin-bottom: 8px; }
.hero h1 { font-size: clamp(48px, 8vw, 92px); font-weight: 900; letter-spacing: -.01em; }
.hero h1 .accent { position: relative; white-space: nowrap; }
.hero h1 .accent::after {
  content: ""; position: absolute; inset-inline: -4px; bottom: .08em; height: .28em;
  background: var(--saffron); z-index: -1; border-radius: 4px; opacity: .85;
}
.hero-lead { font-size: 21px; color: var(--ink-soft); max-width: 34ch; margin: 20px 0 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 700; text-decoration: none;
  border: 2px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; font: inherit; font-weight: 700;
}
.btn.ghost { background: transparent; color: var(--ink); }
.btn:hover { transform: translateY(-1px); }

.polaroid {
  background: #fff; padding: 14px 14px 56px; box-shadow: var(--shadow);
  transform: rotate(-2.5deg); position: relative; max-width: 420px; margin-inline: auto;
}
.polaroid img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.polaroid figcaption {
  position: absolute; bottom: 10px; inset-inline: 0; text-align: center;
  font-family: var(--hand); font-size: 30px; color: #2A241F;
}
.polaroid::before {
  content: ""; position: absolute; top: -14px; left: 50%; width: 110px; height: 30px;
  transform: translateX(-50%) rotate(3deg);
  background: rgba(242, 184, 41, .55);
}

.saying {
  margin: 24px 0 8px; padding: 36px 24px; text-align: center;
  border-block: 1px dashed var(--line);
}
.saying q { font-family: var(--hand); font-size: clamp(40px, 6vw, 64px); line-height: 1.1; quotes: "„" "”"; }
.saying .who { display: block; margin-top: 8px; color: var(--ink-soft); font-size: 16px; }
.saying button {
  margin-top: 12px; background: none; border: 0; color: var(--clay); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 4px;
}

.section { padding: 48px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(32px, 4.5vw, 44px); }
.section-head p { color: var(--ink-soft); margin: 6px 0 0; }
.link-more { font-weight: 700; color: var(--clay); text-decoration: none; }
.link-more:hover { text-decoration: underline; }

.dedication {
  display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: center;
  background: var(--card); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow);
}
.dedication img { width: 100%; filter: drop-shadow(0 6px 14px rgba(0,0,0,.18)); }
.dedication h2 { font-size: 34px; margin-bottom: 14px; }
.dedication p { font-size: 19px; }
.dedication .signature { font-family: var(--hand); font-size: 34px; color: var(--clay); margin: 0; }

/* ───── כרטיסי מתכונים ───── */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 28px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  padding: 7px 16px; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.search {
  flex: 1 1 220px; min-width: 0; max-width: 320px; margin-inline-start: auto;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  padding: 9px 16px; border-radius: 999px; font: inherit;
}
.search:focus, .chip:focus-visible, .btn:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }

.chapter-block { margin-bottom: 44px; }
.chapter-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.chapter-title small { color: var(--clay); font-weight: 700; font-size: 15px; }
.chapter-title h3 { font-size: 28px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  text-decoration: none; display: flex; flex-direction: column; transition: transform .15s ease;
}
.card:hover { transform: translateY(-3px); }
.card-img { aspect-ratio: 4/3; background: var(--paper-2); position: relative; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px 16px 18px; }
.card-body h4 { font-family: var(--serif); font-size: 22px; margin: 0 0 4px; line-height: 1.25; }
.card-body p { margin: 0; color: var(--ink-soft); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.by { display: inline-block; font-size: 13px; font-weight: 700; color: var(--olive); margin-bottom: 4px; }

/* מתכון בלי תמונה – אות גדולה כמו בספר */
.letter-art {
  width: 100%; height: 100%; display: grid; place-items: center;
  background:
    radial-gradient(circle at 30% 20%, var(--saffron-soft), transparent 60%),
    var(--paper-2);
}
.letter-art span { font-family: var(--serif); font-weight: 900; font-size: 110px; color: var(--saffron); line-height: 1; text-shadow: 3px 3px 0 color-mix(in srgb, var(--ink) 12%, transparent); }

.missing-wrap { margin-top: 12px; border: 2px dashed var(--line); border-radius: var(--radius); padding: 24px; }
.missing-wrap h3 { font-size: 26px; margin-bottom: 4px; }
.missing-wrap > p { color: var(--ink-soft); }
.missing-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 12px 0 0; }
.missing-list li { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-weight: 600; font-size: 16px; }
.missing-list li small { color: var(--ink-soft); font-weight: 400; }
.empty { text-align: center; color: var(--ink-soft); padding: 40px 0; }

/* ───── עמוד מתכון ───── */
.back { display: inline-flex; gap: 6px; margin: 28px 0 12px; font-weight: 700; color: var(--ink-soft); text-decoration: none; }
.back:hover { color: var(--ink); }
.recipe-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; margin-bottom: 40px; }
.recipe-head h1 { font-size: clamp(40px, 6vw, 64px); font-weight: 900; margin: 6px 0 12px; }
.recipe-chapter { color: var(--clay); font-weight: 700; text-decoration: none; }
.recipe-quote { font-family: var(--hand); font-size: clamp(30px, 4vw, 40px); line-height: 1.15; margin: 8px 0 14px; }
.recipe-quote::before { content: "„"; color: var(--saffron); }
.recipe-quote::after { content: "”"; color: var(--saffron); }
.recipe-tagline { color: var(--ink-soft); font-size: 19px; }
.recipe-photo { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4/3; background: var(--paper-2); }
.recipe-photo img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.recipe-photo.no-photo { display: grid; place-items: center; text-align: center; padding: 24px; }
.recipe-photo.no-photo .letter-art { border-radius: var(--radius); }
.thumbs { display: flex; gap: 8px; margin-top: 10px; }
.thumbs img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; cursor: zoom-in; box-shadow: var(--shadow); }

.recipe-body { display: grid; grid-template-columns: 340px 1fr; gap: 48px; align-items: start; }
.panel { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.ingredients { position: sticky; top: 84px; }
.panel h2 { font-size: 26px; margin-bottom: 14px; }
.servings { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--saffron-soft); border-radius: 12px; padding: 8px 12px; margin-bottom: 16px; }
.servings label { font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button {
  width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper);
  font-size: 20px; line-height: 1; cursor: pointer; font-family: var(--sans);
}
.stepper output { min-width: 2ch; text-align: center; font-weight: 700; font-size: 20px; }
.ing-list { list-style: none; padding: 0; margin: 0; }
.ing-list li { border-bottom: 1px dashed var(--line); }
.ing-list li:last-child { border-bottom: 0; }
.ing-list label { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; cursor: pointer; }
.ing-list input { accent-color: var(--olive); width: 18px; height: 18px; flex: none; transform: translateY(3px); }
.ing-name { flex: 1; }
.ing-qty { font-weight: 700; white-space: nowrap; }
.ing-qty small { font-weight: 400; color: var(--ink-soft); }
.ing-list input:checked ~ span { text-decoration: line-through; opacity: .5; }

.steps h2 { font-size: 32px; margin-bottom: 18px; }
.step-group { margin-bottom: 28px; }
.step-group h3 { display: flex; align-items: center; gap: 10px; font-size: 24px; margin-bottom: 10px; }
.step-group h3::before {
  content: ""; width: 10px; height: 26px; border-radius: 3px; background: var(--saffron);
}
.step-list { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.step-list li { counter-increment: s; position: relative; padding: 10px 52px 10px 0; border-bottom: 1px solid var(--line); }
.step-list li::before {
  content: counter(s); position: absolute; right: 0; top: 10px;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--ink); font-weight: 700; font-size: 16px;
}
.step-list li.done { opacity: .45; }
.step-list li { cursor: pointer; }
.tip { margin-top: 24px; background: var(--saffron-soft); border-radius: var(--radius); padding: 18px 22px; }
.tip strong { font-family: var(--serif); font-size: 21px; display: block; margin-bottom: 4px; }
.note { margin-top: 20px; border: 2px dashed var(--clay); border-radius: var(--radius); padding: 14px 18px; color: var(--ink); }
.story-link { margin-top: 28px; display: flex; gap: 16px; align-items: center; background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); text-decoration: none; }
.story-link img { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; flex: none; background: var(--paper-2); }
.story-link span { color: var(--ink-soft); font-size: 15px; display: block; }
.story-link b { font-family: var(--serif); font-size: 21px; }
.recipe-actions { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }

.missing-recipe { text-align: center; padding: 60px 0 80px; }
.missing-recipe h1 { font-size: 52px; margin: 10px 0; }

/* ───── סיפורים ───── */
.story-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.story-card { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); text-decoration: none; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.story-card::before { content: "„"; position: absolute; top: -30px; left: 12px; font-family: var(--serif); font-size: 160px; color: var(--saffron); opacity: .35; line-height: 1; }
.story-card h3 { font-size: 26px; }
.story-card p { color: var(--ink-soft); margin: 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.story-card .read { font-weight: 700; color: var(--clay); margin-top: auto; }

.story-page { max-width: 720px; margin: 0 auto 60px; }
.story-page h1 { font-size: clamp(40px, 6vw, 60px); font-weight: 900; margin: 6px 0 28px; }
.story-page .story-img { margin: 0 0 32px; }
.story-page .story-img img { border-radius: var(--radius); box-shadow: var(--shadow); max-height: 520px; margin-inline: auto; }
.story-page .story-img.cutout img { box-shadow: none; filter: drop-shadow(0 10px 20px rgba(0,0,0,.18)); max-height: 380px; }
.story-text p { font-family: var(--serif); font-size: 21px; line-height: 1.85; }
.story-text p:first-child::first-letter {
  float: right; font-size: 3.4em; line-height: .9; margin-left: 10px; margin-top: 6px; color: var(--saffron); font-weight: 900;
}
.story-sign { font-family: var(--hand); font-size: 38px; color: var(--clay); }
.story-recipes { margin-top: 36px; }
.story-recipes h2 { font-size: 26px; margin-bottom: 14px; }

/* ───── אלבום ───── */
.album { columns: 3 260px; column-gap: 20px; }
.album figure { break-inside: avoid; margin: 0 0 20px; background: #fff; padding: 10px 10px 0; box-shadow: var(--shadow); cursor: zoom-in; }
.album figure:nth-child(odd) { transform: rotate(-1deg); }
.album figure:nth-child(even) { transform: rotate(1deg); }
.album figure.cutout { background: linear-gradient(160deg, #F4E3B8, #E9D3A2); }
.album img { width: 100%; }
.album figcaption { font-family: var(--hand); font-size: 28px; text-align: center; color: #2A241F; padding: 4px 0 8px; }
.album-add { border: 2px dashed var(--line); border-radius: var(--radius); padding: 20px; text-align: center; color: var(--ink-soft); margin-top: 16px; }

/* ───── לייטבוקס ───── */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(20, 15, 10, .9); display: grid; place-items: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; text-align: center; }
.lightbox img { max-height: 82vh; max-width: 100%; margin-inline: auto; border-radius: 6px; }
.lightbox figcaption { color: #fff; font-family: var(--hand); font-size: 32px; margin-top: 8px; }
.lightbox-close { position: absolute; top: 14px; left: 18px; background: none; border: 0; color: #fff; font-size: 44px; cursor: pointer; line-height: 1; }

/* ───── כותרת תחתונה ───── */
.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 36px 0 44px; text-align: center; }
.footer-dedication { font-family: var(--serif); font-size: 20px; margin-bottom: 6px; }
.footer-wish { color: var(--ink-soft); margin: 0; font-family: var(--serif); }

/* ───── מובייל ───── */
@media (max-width: 860px) {
  .hero { padding-top: 32px; }
  .hero-grid, .recipe-head, .recipe-body { grid-template-columns: 1fr; gap: 28px; }
  .hero-grid .polaroid { order: -1; max-width: 300px; }
  .dedication { grid-template-columns: 1fr; text-align: center; padding: 24px; gap: 16px; }
  .dedication img { max-width: 180px; margin-inline: auto; }
  .ingredients { position: static; }
  .search { max-width: none; margin-inline-start: 0; flex-basis: 100%; }
}
@media (max-width: 520px) {
  body { font-size: 17px; }
  .brand-text { font-size: 16px; white-space: nowrap; }
  .topbar-inner { gap: 8px; }
  .nav { gap: 0; }
  .brand-mark { width: 30px; height: 30px; font-size: 18px; }
  .nav a { padding: 5px 8px; font-size: 14px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card-body { padding: 10px 12px 14px; }
  .card-body h4 { font-size: 18px; }
  .card-body p { display: none; }
  .letter-art span { font-size: 72px; }
  .story-text p { font-size: 19px; }
}

/* ───── הדפסה ───── */
@media print {
  .topbar, .footer, .back, .recipe-actions, .servings .stepper button, .story-link, .thumbs, .note { display: none !important; }
  body { background: #fff; color: #000; font-size: 13pt; }
  .recipe-head { grid-template-columns: 1fr 1fr; }
  .recipe-body { grid-template-columns: 1fr 1.6fr; }
  .panel { box-shadow: none; border: 1px solid #ccc; }
  .ingredients { position: static; }
}
