/* Smakverket (demo). Warm, editorial, works on a phone in the kitchen. */
:root {
  --bg: #fbf8f3; --card: #fff; --ink: #2a2522; --mute: #7a716a; --line: #ece5dc;
  --acc: #c2502a; --acc-ink: #fff; --soft: #f4ece2; --ok: #3d7a4f;
  --radius: 14px; --serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
body.noscroll { overflow: hidden; }
a { color: var(--acc); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
.mute { color: var(--mute); } .small { font-size: 14px; }
.kicker { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 600; color: var(--acc); margin-bottom: 6px; }
main { max-width: 1180px; margin: 0 auto; padding: 0 20px 40px; }
section { margin: 36px 0; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px; background: #fffdf9e8; backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { font: 700 24px var(--serif); color: var(--ink); text-decoration: none; }
.logo span { color: var(--acc); }
.top nav { display: flex; gap: 18px; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--acc); color: #fff; font-size: 12px; text-align: center; }

.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 99px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.big { padding: 13px 22px; font-size: 17px; }
.btn.wide { width: 100%; justify-content: center; margin-top: 14px; }
.btn.danger { color: #b3261e; }
.btn:disabled { opacity: .4; }
.btn.timer { margin-top: 6px; padding: 6px 12px; font-size: 14px; background: var(--soft); border-color: transparent; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; }
.hero-media video, .hero-media img { width: 100%; border-radius: var(--radius); display: block; background: #000; aspect-ratio: 16/9; object-fit: cover; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar h1, .toolbar h2 { margin: 0; }
input[type=search], form input { font: inherit; padding: 10px 14px; border-radius: 99px; border: 1.5px solid var(--line); min-width: 260px; background: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { font: inherit; font-size: 14px; padding: 5px 12px; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip a { color: inherit; text-decoration: none; margin-left: 6px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.card { display: block; background: var(--card); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: 0 1px 2px #0000000d, 0 6px 24px #5a3b2010; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px #0000000d, 0 12px 32px #5a3b2018; }
.card[hidden] { display: none; }
.card .img { aspect-ratio: 16/10; background: #ddd center/cover; position: relative; }
.card .play { position: absolute; left: 12px; bottom: 12px; background: #000a; color: #fff; padding: 3px 10px; border-radius: 99px; font-size: 13px; }
.card .body { padding: 14px 16px 18px; }
.card .body p { margin: 4px 0 10px; color: var(--mute); font-size: 15px; }
.card .meta { display: flex; gap: 12px; font-size: 13px; color: var(--mute); flex-wrap: wrap; }
.books .book-card { display: grid; grid-template-columns: 110px 1fr; }
.cover { background: #ccc center/cover; min-height: 160px; }
.cover.big { width: 220px; aspect-ratio: 2/3; border-radius: 8px; box-shadow: 0 10px 30px #0003; }
.book-card.saved { outline: 2px solid var(--ok); }
.stars { color: #e0a100; letter-spacing: 2px; } .stars span { color: #ddd; }

/* Recipe */
.recipe-head { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; margin: 28px 0; align-items: start; }
.lead { font-size: 19px; color: #4a423c; }
.facts { display: flex; gap: 24px; margin: 18px 0; }
.facts div { display: flex; flex-direction: column; }
.facts b { font-size: 20px; } .facts span { font-size: 13px; color: var(--mute); }
.recipe-body { display: grid; grid-template-columns: 340px 1fr; gap: 36px; align-items: start; }
.ingredients { position: sticky; top: 76px; background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 2px #0000000d; }
.portions { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.portions h2 { margin: 0; }
.stepper { display: flex; align-items: center; gap: 8px; font-size: 14px; background: var(--soft); border-radius: 99px; padding: 3px; }
.stepper button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: #fff; font-size: 18px; cursor: pointer; }
.stepper span { font-weight: 700; min-width: 18px; text-align: center; }
.ingredients h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); font-family: inherit; margin: 16px 0 4px; }
.ingredients ul { list-style: none; margin: 0; padding: 0; }
.ingredients li { border-bottom: 1px solid var(--line); }
.ingredients li label { display: flex; gap: 10px; padding: 8px 0; cursor: pointer; align-items: baseline; }
.ingredients li.have span { color: var(--mute); text-decoration: line-through; }
.ingredients i { color: var(--mute); font-size: 14px; }
input[type=checkbox] { accent-color: var(--acc); width: 18px; height: 18px; flex: none; }

.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 18px; }
.progress div { height: 100%; background: var(--ok); width: 0; transition: width .3s; }
#stepList { list-style: none; margin: 0; padding: 0; }
.step { display: grid; grid-template-columns: 34px 1fr 260px; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: start; }
.step.done .step-body { opacity: .5; }
.step .n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--acc); color: #fff; font: 600 14px system-ui; margin-right: 6px; }
.step.done .n { background: var(--ok); }
.step p { margin: 0 0 6px; }
.step-ings { list-style: none; margin: 2px 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.step-ings li { background: var(--soft); border-radius: 99px; padding: 2px 10px; font-size: 14px; }
.step-ings i { color: var(--mute); }
.step.done .step-ings { display: none; }
.cook-ings { background: #ffffff12; border-radius: 14px; padding: 12px 18px; margin: 4px 0 18px; }
.cook-ings span { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: #d8cfc6; }
.cook-ings ul { list-style: none; margin: 6px 0 0; padding: 0; columns: 2; column-gap: 24px; }
.cook-ings li { font-size: clamp(18px, 2vw, 24px); padding: 3px 0; break-inside: avoid; }
.cook-ings b { color: #ffb48f; }
.cook-ings i { color: #bdb2a8; font-size: .8em; }
.step-video video { width: 100%; border-radius: 10px; background: #000; display: block; }
.check input { width: 24px; height: 24px; margin-top: 2px; }

/* Cook mode */
.cook { position: fixed; inset: 0; z-index: 100; background: #1d1916; color: #fff; display: flex; flex-direction: column; }
.cook[hidden] { display: none; }
.cook-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; color: #d8cfc6; }
.cook-top button { background: none; border: 0; color: #fff; font-size: 32px; cursor: pointer; }
.cook-progress { height: 4px; background: #ffffff22; } .cook-progress div { height: 100%; background: var(--acc); transition: width .3s; }
.cook-main { flex: 1; display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; align-items: center; padding: 24px 40px; overflow: auto; }
.cook-main video { width: 100%; border-radius: 16px; background: #000; }
.cook-text h2 { font-size: clamp(28px, 4vw, 48px); color: #fff; }
.cook-text p { font-size: clamp(20px, 2.4vw, 30px); line-height: 1.45; }
.cook .btn.timer { background: #ffffff1a; color: #fff; }
.cook-nav { display: flex; justify-content: space-between; padding: 18px 24px 28px; }
.cook-nav .btn:not(.primary) { background: transparent; color: #fff; border-color: #ffffff44; }

/* Timers and toast */
#timers { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
/* In cook mode: up top, clear of the navigation buttons. */
body.noscroll #timers { top: 64px; bottom: auto; }
.timer-pill { display: flex; align-items: center; gap: 12px; background: var(--ink); color: #fff; padding: 10px 10px 10px 16px; border-radius: 99px; box-shadow: 0 8px 24px #0004; }
.timer-pill b { font-variant-numeric: tabular-nums; font-size: 18px; }
.timer-pill button { background: #ffffff22; border: 0; color: #fff; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; }
.timer-pill.done { background: var(--acc); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.04); } }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px;
  z-index: 300; transition: transform .25s, opacity .25s; opacity: 0; pointer-events: none; box-shadow: 0 8px 24px #0004; max-width: 90vw; }
#toast.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
#toast a { color: #ffb48f; margin-left: 6px; }

/* Shopping list */
.shop { max-width: 760px; }
.shop form { margin-bottom: 18px; }
.shop-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); font-family: inherit; margin: 22px 0 6px; }
.shop-section ul { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 2px #0000000d; }
.shop-section li { display: flex; align-items: center; border-bottom: 1px solid var(--line); padding: 0 14px; }
.shop-section li:last-child { border-bottom: 0; }
.shop-section li label { flex: 1; display: flex; gap: 12px; align-items: center; padding: 12px 0; cursor: pointer; }
.shop-section li .what { flex: 1; }
.shop-section li .from { font-size: 12px; color: var(--mute); text-align: right; }
.shop-section li.done .what { text-decoration: line-through; color: var(--mute); }
.shop-section li a { text-decoration: none; color: var(--mute); font-size: 20px; margin-left: 10px; }
.empty { padding: 40px; text-align: center; background: var(--card); border-radius: var(--radius); }

/* Book */
.book-head { display: grid; grid-template-columns: 220px 1fr; gap: 36px; margin: 32px 0; align-items: center; }
.verdict { font: italic 22px var(--serif); }
.book-body { display: grid; grid-template-columns: 1fr 280px; gap: 36px; }
.book-body video { width: 100%; border-radius: var(--radius); margin-bottom: 16px; background: #000; }
.book-body p { font-size: 18px; }
.factbox { background: var(--card); padding: 18px; border-radius: var(--radius); align-self: start; }
.factbox dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.factbox dt { color: var(--mute); }
.factbox dd { margin: 0; }
.toggle { display: flex; gap: 8px; align-items: center; }

footer { border-top: 1px solid var(--line); padding: 24px 20px 80px; text-align: center; font-size: 14px; }
footer p { margin: 4px 0; }

@media (max-width: 860px) {
  .hero, .recipe-head, .recipe-body, .book-body, .cook-main { grid-template-columns: 1fr; }
  .ingredients { position: static; }
  .step { grid-template-columns: 30px 1fr; }
  .step-video { grid-column: 2; }
  .book-head { grid-template-columns: 120px 1fr; gap: 18px; }
  .cover.big { width: 120px; }
  .cook-main { padding: 16px; gap: 16px; }
  .top nav { gap: 12px; font-size: 15px; }
  input[type=search] { min-width: 0; width: 100%; }
}
@media print {
  .top, footer, #timers, #toast, .shop .toolbar .row, .shop form, #shopRecipes a { display: none !important; }
  .shop-section ul { box-shadow: none; }
}

/* Clips in 9:16 (phone held upright, or chosen) */
video.vid-portrait { aspect-ratio: 9/16 !important; width: auto !important; max-width: 100%; max-height: 78vh; margin: 0 auto; display: block; object-fit: cover; }
.step-video video.vid-portrait { max-height: 420px; }
.cook-main video.vid-portrait { max-height: 62vh; }
/* The other format, playing along unseen in the same place */
.fmt-pair { position: relative; }
.fmt-pair > video.fmt-twin { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important;
  max-height: none !important; aspect-ratio: auto !important; margin: 0; opacity: 0; pointer-events: none; }
@media (max-width: 600px) { .fmt { display: none; } }
.fmt { background: none; border: 1px solid var(--line); border-radius: 20px; padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer; color: inherit; }
