/* Cook mode: a full-screen dark layer over the recipe. One big step, timers and a bottom bar. */
body.cook-open { overflow: hidden; }

.cook {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column;
  background: radial-gradient(900px 500px at 50% -10%, #2a1d14, var(--night) 70%);
  color: var(--on-night);
}

/* ---------- Top bar ---------- */
.cook-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid rgba(243, 232, 214, .14); }
.cook-heading { flex: 1; min-width: 0; }
.cook-kicker { margin: 0; color: var(--lantern); font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.cook-bar h2 { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); font-style: italic; font-size: 1.15rem; }

.cook-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 18px;
  border-radius: 999px; border: 1px solid rgba(243, 232, 214, .3); background: rgba(243, 232, 214, .08);
  color: var(--on-night); font: inherit; font-size: .95rem; font-weight: 700; cursor: pointer;
}
.cook-btn .icon { width: 20px; height: 20px; }
.cook-btn:hover:not(:disabled) { background: rgba(243, 232, 214, .18); }
.cook-btn:disabled { opacity: .4; cursor: default; }
.cook-btn:focus-visible, .cook-icon-btn:focus-visible, .cook-suggest-btn:focus-visible, .cook a:focus-visible { outline: 3px solid var(--lantern); outline-offset: 2px; }
.cook-btn[aria-expanded="true"] { background: rgba(242, 165, 59, .2); border-color: var(--lantern); }

.cook-progress { height: 6px; background: rgba(243, 232, 214, .12); }
.cook-progress span { display: block; height: 100%; width: 0; background: var(--red); }

/* ---------- Stage ---------- */
.cook-main { position: relative; flex: 1; min-height: 0; display: flex; overflow-y: auto; }
.cook-stage, .cook-done { flex: 1; display: flex; flex-direction: column; justify-content: safe center; max-width: 52rem; margin: 0 auto; padding: 24px 24px 12px; }
.cook-count { margin: 0 0 14px; color: var(--on-night-soft); font-size: .9rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cook-steps { list-style: none; margin: 0; padding: 0; }
.cook-step p { margin: 0; font-family: var(--serif); font-size: clamp(1.4rem, 1rem + 2.4vw, 2.5rem); line-height: 1.4; text-wrap: pretty; }
.cook-step .step-help { margin-top: 20px; max-width: 440px; }
/* Step photo: a fixed 3:2 frame that never pushes the text out of view. On a wide screen the
   photo sits beside the text; on a phone it goes below it, short enough to leave the text visible. */
.cook-step .step-help-image { display: block; width: 100%; height: auto; max-height: 34vh; aspect-ratio: 3 / 2; object-fit: cover; margin: 0 0 12px; border-radius: 12px; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); }
@media (min-width: 900px) {
  .cook-stage:has(.cook-step:not([hidden]) .step-help-image) { max-width: 70rem; }
  .cook-step:has(.step-help-image) { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 36px; align-items: center; }
  .cook-step:has(.step-help-image) .step-help { margin-top: 0; max-width: none; }
  .cook-step .step-help-image { max-height: 56vh; }
}
.cook-step .step-help-note { font-family: inherit; font-size: 1rem !important; color: var(--on-night); }
.cook-step .step-help-video summary, .cook-step .step-help-video > a { color: var(--lantern); }
.cook-suggest { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.cook-suggest-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 20px; border-radius: 999px;
  border: 1px solid var(--lantern); background: rgba(242, 165, 59, .14); color: var(--on-night); font: inherit; font-weight: 700; cursor: pointer;
}
.cook-suggest-btn .icon { width: 20px; height: 20px; color: var(--lantern); }
.cook-suggest-btn:hover { background: rgba(242, 165, 59, .26); }

/* ---------- Ingredients panel: beside the step on wide screens, over it on phones ---------- */
.cook-ing {
  flex: none; width: min(24rem, 100%); overflow-y: auto; padding: 20px; background: #1d1612; border-left: 1px solid rgba(243, 232, 214, .14);
}
.cook-ing h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-family: var(--serif); font-style: italic; font-size: 1.2rem; }
.cook-ing h3 .icon { width: 20px; height: 20px; color: var(--lantern); }
.cook-ing ul { list-style: none; margin: 0; padding: 0; }
.cook-ing li + li { border-top: 1px solid rgba(243, 232, 214, .1); }
.cook-ing label { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 0; cursor: pointer; }
.cook-ing input { flex: none; width: 24px; height: 24px; accent-color: var(--red); }
.cook-ing-name { flex: 1; line-height: 1.3; }
.cook-ing-qty { flex: none; color: var(--lantern); font-weight: 700; font-size: .92rem; }
.cook-ing input:checked ~ .cook-ing-name { text-decoration: line-through; opacity: .55; }

/* ---------- Timers ---------- */
.cook-timers { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0 16px; }
.cook-timers:empty { display: none; }
.cook-timer {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border-radius: 14px;
  background: rgba(243, 232, 214, .1); border: 1px solid rgba(243, 232, 214, .24);
}
.cook-timer-label { font-size: .82rem; color: var(--on-night-soft); }
.cook-timer-time { min-width: 4.2ch; font-family: var(--sans); font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.cook-timer.is-paused .cook-timer-time { opacity: .6; }
.cook-timer.is-done { background: rgba(201, 35, 31, .35); border-color: var(--red); }
.cook-timer.is-done .cook-timer-time { color: #fff; }
.cook-icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--on-night); cursor: pointer;
}
.cook-icon-btn .icon { width: 22px; height: 22px; }
.cook-icon-btn:hover:not(:disabled) { background: rgba(243, 232, 214, .16); }
.cook-icon-btn:disabled { opacity: .35; cursor: default; }
.cook-timer .when-paused { display: none; }
.cook-timer.is-paused .when-running { display: none; }
.cook-timer.is-paused .when-paused { display: inline; }

/* ---------- Bottom bar ---------- */
.cook-nav { display: flex; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(243, 232, 214, .14); }
.cook-nav .cook-btn { flex: 1; min-height: 56px; font-size: 1.05rem; }
.cook-next { background: var(--red); border-color: var(--red); color: #fff; }
.cook-next:hover:not(:disabled) { background: var(--red-dark); }

/* ---------- Final screen ---------- */
.cook-done { align-items: center; text-align: center; }
.cook-done-mark { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--lantern); color: var(--lantern); }
.cook-done-mark svg { width: 36px; height: 36px; }
.cook-done h3 { margin: 18px 0 8px; font-family: var(--serif); font-style: italic; font-size: clamp(1.8rem, 1.2rem + 3vw, 2.8rem); }
.cook-done p { max-width: 36rem; margin: 0 0 22px; color: var(--on-night-soft); line-height: 1.5; }
.cook-done-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.cook-related { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 8px; width: min(28rem, 100%); }
.cook-related a {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 16px; border-radius: 12px; text-align: left;
  background: rgba(243, 232, 214, .08); border: 1px solid rgba(243, 232, 214, .2); color: var(--on-night); text-decoration: none; font-weight: 600;
}
.cook-related a .icon { width: 18px; height: 18px; flex: none; color: var(--lantern); }
.cook-related a:hover { background: rgba(243, 232, 214, .16); }

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  .cook-bar { padding: 10px 12px; gap: 8px; }
  .cook-bar h2 { font-size: 1rem; }
  .cook-btn { padding: 8px 14px; }
  .cook-btn { font-size: .88rem; }
  .cook-btn .icon { width: 18px; height: 18px; }
  .cook-stage, .cook-done { padding: 20px 16px 8px; }
  .cook-step:has(.step-help-image) p { font-size: clamp(1.25rem, 1rem + 1.6vw, 1.6rem); }
  .cook-step .step-help { margin-top: 16px; }
  .cook-ing { position: absolute; inset: 0; z-index: 2; width: auto; border-left: 0; }
  .cook-timers { padding: 0 12px; }
  .cook-timer { flex: 1 1 100%; }
  .cook-timer-label { flex: 1; }
}
