@font-face { font-family: 'Rubik'; src: url(../fonts/rubik-hebrew.woff2) format('woff2'); font-weight: 300 900; unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Rubik'; src: url(../fonts/rubik-latin.woff2) format('woff2'); font-weight: 300 900; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+215B-215E, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fredoka'; src: url(../fonts/fredoka-hebrew.woff2) format('woff2'); font-weight: 300 700; unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Fredoka'; src: url(../fonts/fredoka-latin.woff2) format('woff2'); font-weight: 300 700; unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --bg: #fff8f1; --card: #ffffff; --ink: #2b2118; --muted: #8a7a6b; --line: #f0e3d6;
  --tomato: #ff5a36; --tomato-d: #e2421f; --saffron: #ffb627; --mint: #2ec4a0; --plum: #7b4fd6; --sky: #3aa0ff;
  --shadow: 0 10px 30px -12px rgba(120, 60, 20, .25); --shadow-s: 0 3px 10px -4px rgba(120, 60, 20, .2);
  --r: 20px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: 'Rubik', system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.55;
  background-image: radial-gradient(circle at 10% -10%, #ffe1cc 0, transparent 40%), radial-gradient(circle at 110% 10%, #ffe9b8 0, transparent 35%); background-attachment: fixed; }
h1, h2, h3, .brand-text { font-family: 'Fredoka', 'Rubik', sans-serif; font-weight: 600; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 16px; padding: 12px 24px;
  background: rgba(255, 248, 241, .85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-size: 22px; white-space: nowrap; }
.logo { font-size: 28px; display: inline-block; transition: transform .4s; }
.brand:hover .logo { transform: rotate(-20deg) scale(1.1); }
.search-wrap { flex: 1; max-width: 640px; position: relative; margin-inline: auto; }
.search-wrap input { width: 100%; padding: 12px 44px; border-radius: 999px; border: 2px solid transparent; background: #fff; font: inherit;
  font-size: 16px; box-shadow: var(--shadow-s); outline: none; transition: border-color .2s, box-shadow .2s; }
.search-wrap input:focus { border-color: var(--tomato); box-shadow: 0 0 0 5px rgba(255, 90, 54, .12); }
.search-ico { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--muted); }
.top-actions { display: flex; gap: 10px; align-items: center; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; border: none; background: #c43312; color: #fff;
  font-weight: 500; box-shadow: var(--shadow-s); transition: transform .15s, background .2s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); background: var(--tomato-d); }
.btn.ghost { background: #fff; color: var(--ink); }
.btn.ghost:hover { background: #fff2ea; }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn.mint { background: var(--mint); } .btn.plum { background: var(--plum); }
.seg { display: inline-flex; background: #fff; border-radius: 999px; padding: 4px; box-shadow: var(--shadow-s); }
.seg button { border: none; background: transparent; padding: 6px 14px; border-radius: 999px; font-weight: 500; color: var(--muted); transition: all .2s; }
.seg button.on { background: var(--ink); color: #fff; }

main { max-width: 1320px; margin: 0 auto; padding: 24px; min-height: 80vh; }

/* hero / home */
.home-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 10px 0 18px; flex-wrap: wrap; }
.home-hero h1 { font-size: clamp(32px, 5vw, 54px); margin: 0; line-height: 1.05; }
.home-hero h1 .hl { background: linear-gradient(120deg, var(--tomato), var(--saffron)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.home-hero p { margin: 6px 0 0; color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  font-size: 15px; transition: all .2s; white-space: nowrap; }
.chip:hover { border-color: var(--tomato); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .n { font-size: 12px; opacity: .6; }
.chips.tags .chip { font-size: 13px; padding: 5px 12px; }
.chips.tags .chip.on { background: var(--plum); border-color: var(--plum); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); margin: 4px 0 14px; flex-wrap: wrap; }
.toolbar select { font: inherit; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.card { background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-s); transition: transform .25s, box-shadow .25s;
  position: relative; display: flex; flex-direction: column; animation: pop .4s both; }
.card:hover { transform: translateY(-5px) rotate(-.3deg); box-shadow: var(--shadow); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.card .ph { aspect-ratio: 4/3; overflow: hidden; background: #f6e9dc; position: relative; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.card:hover .ph img { transform: scale(1.07); }
.card .body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { margin: 0; font-size: 18px; line-height: 1.25; }
.card .meta { display: flex; gap: 10px; font-size: 13px; color: var(--muted); margin-top: auto; flex-wrap: wrap; }
.badge { position: absolute; top: 10px; inset-inline-start: 10px; background: rgba(255, 255, 255, .92); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 500; }
.fav { position: absolute; top: 8px; inset-inline-end: 8px; width: 36px; height: 36px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .92);
  font-size: 18px; display: grid; place-items: center; transition: transform .2s; }
.fav:hover { transform: scale(1.15); }
.placeholder { width: 100%; height: 100%; display: grid; place-items: center; font-size: 64px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 18px; }

/* recipe page */
.back { display: inline-flex; gap: 6px; color: var(--muted); margin-bottom: 12px; }
.back:hover { color: var(--tomato); }
.rhero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; margin-bottom: 26px; }
.cover { position: relative; border-radius: 28px; overflow: hidden; aspect-ratio: 4/3; box-shadow: var(--shadow); background: #f6e9dc; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .cover-actions { position: absolute; bottom: 12px; inset-inline-end: 12px; display: flex; gap: 8px; opacity: 0; transition: opacity .2s; }
.cover:hover .cover-actions, .cover:focus-within .cover-actions { opacity: 1; }
.cover.drag::after { content: attr(data-drop); position: absolute; inset: 0; background: rgba(255, 90, 54, .78); color: #fff; display: grid; place-items: center;
  font-size: 22px; font-weight: 600; border: 4px dashed #fff; border-radius: 28px; }
.credit-img { position: absolute; bottom: 8px; inset-inline-start: 12px; font-size: 11px; color: #fff; text-shadow: 0 1px 3px #000; opacity: .8; }
.rtitle h1 { font-size: clamp(30px, 4vw, 46px); margin: 6px 0 8px; line-height: 1.1; }
.rtitle .desc { color: var(--muted); font-size: 18px; margin: 0 0 14px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pill { background: #fff; border-radius: 14px; padding: 8px 14px; box-shadow: var(--shadow-s); font-size: 14px; display: flex; gap: 6px; align-items: center; }
.pill b { font-weight: 600; }
.cat-link { color: var(--tomato); font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.ractions { display: flex; flex-wrap: wrap; gap: 8px; }

.controls { position: sticky; top: 70px; z-index: 20; display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; background: #fff; border-radius: 22px;
  padding: 12px 18px; box-shadow: var(--shadow); margin-bottom: 26px; }
.ctl { display: flex; align-items: center; gap: 8px; }
.ctl label { font-size: 13px; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; background: var(--bg); border-radius: 999px; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: none; background: transparent; font-size: 20px; }
.stepper button:hover { background: #ffe5d9; }
.stepper input { width: 48px; text-align: center; border: none; background: transparent; font: inherit; font-weight: 600; font-size: 17px; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.mult button { min-width: 42px; }

.rbody { display: grid; grid-template-columns: minmax(280px, 1fr) 1.6fr; gap: 30px; align-items: start; }
.panel { background: #fff; border-radius: var(--r); padding: 22px 24px; box-shadow: var(--shadow-s); }
.panel h2 { margin: 0 0 12px; font-size: 24px; display: flex; align-items: center; gap: 10px; }
.panel h2 .emoji { font-size: 26px; }
.ing-group h4, .step-group h4 { margin: 16px 0 6px; color: var(--tomato); font-family: 'Fredoka', sans-serif; font-weight: 500; font-size: 17px; }
.ings { list-style: none; padding: 0; margin: 0; }
.ings li { display: block; padding: 8px 4px; border-bottom: 1px dashed var(--line); transition: opacity .2s; }
.ings li label, .steps li label { display: flex; gap: 10px; align-items: baseline; cursor: pointer; }
.ings li input, .steps li input { width: 18px; height: 18px; flex: none; accent-color: #0e8f72; margin-top: 4px; }
.ings li:last-child { border-bottom: none; }
.ings li .box { flex: none; width: 18px; height: 18px; border-radius: 6px; border: 2px solid #e5cdb9; transform: translateY(3px); transition: all .2s; }
.ings li.done { opacity: .4; } .ings li.done .name { text-decoration: line-through; }
.ings li.done .box { background: var(--mint); border-color: var(--mint); }
.ings .q { font-weight: 600; color: var(--ink); white-space: nowrap; }
.ings .note, .muted { color: var(--muted); font-size: 14px; }
.ings .opt { font-size: 12px; background: #f3ecff; color: var(--plum); border-radius: 6px; padding: 0 6px; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 12px 52px 12px 6px; border-radius: 14px; cursor: pointer; transition: background .2s, opacity .2s; font-size: 17px; }
[dir=ltr] .steps li { padding: 12px 6px 12px 52px; }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: 6px; top: 10px; width: 34px; height: 34px; border-radius: 50%; background: #e09a00;
  color: #2b2118; display: grid; place-items: center; font-weight: 700; font-family: 'Fredoka'; }
[dir=rtl] .steps li { padding: 12px 52px 12px 6px; }
.steps li:hover { background: #fff6ef; }
.steps li.done { opacity: .45; } .steps li.done::before { content: '✓'; background: var(--mint); }
.tok { background: #fff1d6; border-radius: 6px; padding: 0 4px; font-weight: 600; white-space: nowrap; }
.tips { margin-top: 20px; background: linear-gradient(135deg, #fff4d6, #ffe9df); border-radius: var(--r); padding: 18px 22px; }
.tips h3 { margin: 0 0 6px; }
.tips ul { margin: 0; padding-inline-start: 20px; }
details.orig { margin-top: 20px; }
details.orig summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details.orig pre { white-space: pre-wrap; font-family: inherit; background: #fff; border-radius: 14px; padding: 14px; font-size: 14px; direction: rtl; text-align: right; max-height: 500px; overflow: auto; }
.related { margin-top: 40px; }

/* import / editor */
.dropzone { display: block; border: 3px dashed #f0c9b3; border-radius: 28px; padding: 50px 20px; text-align: center; background: #fff; transition: all .2s; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--tomato); background: #fff4ee; transform: scale(1.01); }
.dropzone .big { font-size: 60px; }
.editor { display: grid; gap: 18px; }
.editor .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.editor label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.editor input, .editor select, .editor textarea { width: 100%; font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.editor textarea { min-height: 80px; resize: vertical; }
.editor .en { direction: ltr; text-align: left; } .editor .he { direction: rtl; text-align: right; }
.ing-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.ing-table td { padding: 0 3px; vertical-align: top; }
.ing-table input, .ing-table select { padding: 6px 8px; font-size: 14px; }
.ing-table .x { background: none; border: none; color: var(--muted); font-size: 18px; }
.status { padding: 14px 18px; border-radius: 14px; background: #eefaf6; color: #146b55; }
.status.warn { background: #fff4e0; color: #8a5a00; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid #ffd2c4; border-top-color: var(--tomato); border-radius: 50%; animation: spin 1s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 120px); background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px;
  transition: transform .3s; z-index: 100; box-shadow: var(--shadow); }
#toast.show { transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .rhero, .rbody { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; padding: 10px 14px; } .search-wrap { order: 3; flex-basis: 100%; }
  main { padding: 16px; } .controls { top: 118px; }
  .editor .row { grid-template-columns: 1fr; }
}
@media (hover: none) {
  .cover .cover-actions { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 700px) {
  .ing-table, .ing-table tbody, .ing-table tr, .ing-table td { display: block; width: 100% !important; }
  .ing-table tr[data-row] { background: #fff8f1; border-radius: 12px; padding: 8px; margin-bottom: 8px; }
  .ing-table td { padding: 4px 0; }
}
@media print {
  .topbar, .controls, .ractions, .cover-actions, .back, .related, details.orig, #toast { display: none !important; }
  body { background: #fff; } .panel { box-shadow: none; } .rhero { grid-template-columns: 1fr 1.4fr; }
  .card, .panel { break-inside: avoid; }
}

/* Public mobile browsing */
@media (max-width: 900px) {
  .topbar { justify-content: space-between; gap: 8px; }
  .search-wrap { max-width: none; }
  .controls { position: static; gap: 10px; }
  .rhero { gap: 16px; }
  .seg button, .stepper button, .btn.small { min-height: 44px; }
  .stepper button { width: 44px; }
  .panel { padding: 18px 16px; }
  .ings li, .steps li { overflow-wrap: anywhere; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .card .body { padding: 10px; } .card h3 { font-size: 16px; }
  .badge { max-width: calc(100% - 48px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fav { width: 40px; height: 40px; }
}
