/* =====================================================================
   JUSTRECIPE — KITCHEN OS v2  (styles)
   ===================================================================== */

/* ---- ad containers: stay hidden while adsense_enabled is false ------- */
.ko-noads .ad-slot,
.ko-noads .adsbygoogle,
.ko-noads [id^="ad-"],
.ko-noads [class*="ad-container"] { display: none !important; }
.ko-noads .ad-slot { min-height: 0 !important; height: auto !important; }

/* ---- top bar -------------------------------------------------------- */
.ko-topbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: rgba(16, 18, 24, .93);
  backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 -8px 28px rgba(0,0,0,.30);
  transform: translateY(0);
  transition: transform .28s cubic-bezier(.2,.8,.2,1), background .2s;
}
/* the Cook Mode button must ALWAYS be reachable -- it used to live in a bar
   that was translated off-screen until Cook Mode was already on. */
body.ko-chef .ko-topbar { background: rgba(10, 26, 14, .95); }

.ko-btn {
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: #fff; font: inherit; font-weight: 700; font-size: 14px;
  padding: 10px 16px; border-radius: 11px; cursor: pointer;
  transition: .15s; white-space: nowrap;
}
.ko-btn:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.30); }
.ko-btn.on { background: #ffb020; color: #14161b; border-color: #ffb020; }

/* ---- floating timers ------------------------------------------------ */
.ko-timers { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.ko-timerbox {
  position: relative; display: flex; flex-direction: column; align-items: center;
  min-width: 96px; padding: 8px 14px; border-radius: 13px;
  background: linear-gradient(180deg, #ffb020, #f08c00); color: #17130a;
  box-shadow: 0 8px 24px rgba(255,176,32,.35);
}
.ko-timerbox.done { background: linear-gradient(180deg, #22c55e, #16a34a); color: #04140a; }
.ko-timer-lab { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.ko-timer-time { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.ko-timer-x {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px;
  border-radius: 50%; border: none; background: #14161b; color: #fff;
  font-size: 11px; line-height: 22px; cursor: pointer; padding: 0;
}

/* ---- scaler --------------------------------------------------------- */
.ko-scaler {
  display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center;
  padding: 14px 16px; margin: 0 0 18px;
  background: var(--card, #fff); border: 1px solid var(--border, #e6e8ee);
  border-radius: 14px; box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.05));
}
.ko-grp { display: flex; align-items: center; gap: 7px; }
.ko-grp-lbl {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text3, #9aa1ad); margin-right: 2px;
}
.ko-scaler .ko-btn { padding: 7px 13px; font-size: 13.5px; border-radius: 9px; }
.ko-scaler .ko-scale.on, .ko-scaler .ko-unit.on {
  background: var(--accent, #e8590c); color: #fff; border-color: var(--accent, #e8590c);
}

/* ---- ingredient rows ------------------------------------------------ */
.ko-check {
  flex: 0 0 auto; width: 21px; height: 21px; margin-top: 1px;
  border: 2px solid var(--accent, #e8590c); border-radius: 6px;
  display: inline-block; position: relative; cursor: pointer; background: transparent;
}
.ko-amt { font-weight: 800; color: var(--text, #12141a); min-width: 42px; display: inline-block; }
.ko-unit { color: var(--text3, #9aa1ad); font-size: .92em; margin-right: 4px; }
.ko-name { flex: 1; }
.ingredients-list li.ko-done .ko-name { text-decoration: line-through; opacity: .45; }
.ingredients-list li.ko-done .ko-amt { opacity: .45; }

/* ---- inline step timers --------------------------------------------- */
.ko-timer {
  display: inline-block; font: inherit; font-weight: 800; font-size: .95em;
  color: var(--accent, #e8590c); background: rgba(232,89,12,.10);
  border: 1px solid rgba(232,89,12,.35); border-bottom-width: 2px;
  border-radius: 8px; padding: 1px 8px; cursor: pointer; margin: 0 2px;
  transition: .14s;
}
.ko-timer:hover { background: rgba(232,89,12,.20); }
.ko-timer.running { background: var(--accent, #e8590c); color: #fff; }

/* ---- cook mode ------------------------------------------------------ */
body.ko-chef { font-size: 19px; }
body.ko-chef .recipe-title { font-size: 2.1rem !important; }
body.ko-chef .instructions-list li { font-size: 1.32rem; line-height: 1.72; margin-bottom: 26px; }
body.ko-chef .ingredients-list li { font-size: 1.16rem; }
body.ko-chef .step-num { min-width: 40px; height: 40px; font-size: 1.05rem; }
body.ko-chef .recipe-sidebar { display: none; }
body.ko-chef .ko-chefbtn { background: #22c55e; color: #04140a; border-color: #22c55e; }
body.ko-chef .recipe-body { grid-template-columns: 1fr; }

/* ---- grocery drawer + FAB ------------------------------------------- */
.ko-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 70;
  border: none; border-radius: 999px; padding: 13px 19px;
  background: var(--accent, #e8590c); color: #fff; font-size: 18px; cursor: pointer;
  box-shadow: 0 10px 30px rgba(232,89,12,.42);
  display: flex; align-items: center; gap: 7px; font-weight: 700;
}
.ko-fab span {
  background: rgba(255,255,255,.25); border-radius: 999px; padding: 1px 8px;
  font-size: 12.5px; font-weight: 800;
}
.ko-drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(420px, 92vw); z-index: 80;
  background: var(--bg, #fff); border-left: 1px solid var(--border, #e6e8ee);
  box-shadow: -14px 0 40px rgba(0,0,0,.18);
  transform: translateX(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
}
.ko-drawer.open { transform: translateX(0); }
.ko-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border, #e6e8ee);
}
.ko-drawer-x { border: none; background: transparent; font-size: 17px; cursor: pointer; color: var(--text3, #9aa1ad); }
.ko-drawer-body { flex: 1; overflow: auto; padding: 18px 20px; }
.ko-drawer-foot { padding: 14px 20px; border-top: 1px solid var(--border, #e6e8ee); display: flex; gap: 9px; }
.ko-gk h4 { margin: 14px 0 6px; font-size: 14px; }
.ko-gl { margin: 0; padding-left: 16px; color: var(--text2, #4b5563); font-size: 14.5px; line-height: 1.85; }
.ko-empty { color: var(--text3, #9aa1ad); font-size: 14.5px; line-height: 1.7; }

/* ---- tools card ----------------------------------------------------- */
.ko-tools {
  margin-top: 22px; padding: 18px; border-radius: 16px;
  background: var(--card, #fff); border: 1px solid var(--border, #e6e8ee);
  box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.05));
}
.ko-tools-h { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .09em; color: var(--text3, #9aa1ad); }
.ko-tools-list { margin: 0; padding: 0; list-style: none; }
.ko-tools-list li { padding: 7px 0; border-bottom: 1px dashed var(--border, #e6e8ee); }
.ko-tools-list li:last-child { border-bottom: none; }
.ko-tool-link { color: var(--text, #12141a); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.ko-tool-link:hover { color: var(--accent, #e8590c); text-decoration: underline; }
.ko-tools-note { margin: 12px 0 0; font-size: 12px; color: var(--text3, #9aa1ad); }

/* ---- toast ---------------------------------------------------------- */
.ko-toast {
  position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 18px);
  z-index: 90; background: #14161b; color: #fff; padding: 11px 18px;
  border-radius: 11px; font-size: 14px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: .22s;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.ko-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- print card ----------------------------------------------------- */
@media print {
  .ko-topbar, .ko-fab, .ko-drawer, .ko-toast, .ko-scaler, .ko-tools,
  nav, footer, .recipe-sidebar, .ad-slot, .adsbygoogle { display: none !important; }
  body { background: #fff !important; font-size: 12pt; }
  .recipe-body { display: block !important; max-width: 100%; }
  .recipe-section { break-inside: avoid; border: 1px solid #ddd !important; box-shadow: none !important; }
  .instructions-list li { break-inside: avoid; }
  a[href]::after { content: ""; }
}

/* ---- homepage filter bar -------------------------------------------- */
.ko-filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 4px 0 26px; padding: 14px 16px;
  background: var(--card, #fff); border: 1px solid var(--border, #e6e8ee);
  border-radius: 16px; box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.05));
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(12px);
}
.ko-filters .ko-lbl { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--text3, #9aa1ad); }
.ko-chip {
  border: 1px solid var(--border, #e6e8ee); background: transparent; color: var(--text, #12141a);
  font: inherit; font-weight: 700; font-size: 13.5px; padding: 8px 15px;
  border-radius: 999px; cursor: pointer; transition: .15s;
}
.ko-chip:hover { border-color: var(--accent, #e8590c); color: var(--accent, #e8590c); }
.ko-chip.on { background: var(--accent, #e8590c); border-color: var(--accent, #e8590c); color: #fff; }
.ko-count { margin-left: auto; font-size: 13px; color: var(--text3, #9aa1ad); font-weight: 700; }
.ko-hidden { display: none !important; }
.ko-search-wrap { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 220px; }
.ko-search-wrap input {
  flex: 1; font: inherit; font-size: 15px; padding: 10px 14px;
  border: 1px solid var(--border, #e6e8ee); border-radius: 11px;
  background: var(--bg, #fff); color: var(--text, #12141a); outline: none;
}
.ko-search-wrap input:focus { border-color: var(--accent, #e8590c); box-shadow: 0 0 0 3px rgba(232,89,12,.12); }

/* ---- hero collection cards ------------------------------------------ */
.ko-collections { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 0 0 30px; }
.ko-coll {
  border-radius: 16px; padding: 20px; color: #fff; text-decoration: none;
  display: flex; flex-direction: column; justify-content: flex-end; min-height: 132px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14); position: relative; overflow: hidden;
  transition: transform .16s;
}
.ko-coll:hover { transform: translateY(-3px); }
.ko-coll b { font-size: 19px; font-weight: 900; letter-spacing: -.4px; }
.ko-coll span { font-size: 13.5px; opacity: .9; margin-top: 3px; }
.ko-coll::after {
  content: attr(data-emoji); position: absolute; right: 14px; top: 8px;
  font-size: 52px; opacity: .32;
}
