/* SIMMER — cookbook grid + the recipe card (the thing you actually cook from) */

.cook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* a recipe tile — picture plate over a tin card */
.tile {
  background: var(--paper-2); border: 1px solid var(--shade);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1);
  cursor: pointer; text-align: left; padding: 0;
  display: flex; flex-direction: column;
  transition: box-shadow .14s, transform .08s, border-color .14s;
  position: relative;
}
.tile:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); border-color: var(--shade-2); }

.tile .plate {
  height: 116px; flex: none; position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 46px; line-height: 1;
  background: var(--copper-lt);
  border-bottom: 1px solid var(--shade);
  overflow: hidden;
}
.tile .plate img { width: 100%; height: 100%; object-fit: cover; }

/* readiness ribbon across the plate corner */
.tile .ready {
  position: absolute; top: 8px; left: 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 20px;
  background: rgba(255,255,255,.92); box-shadow: var(--shadow-1);
}
.tile[data-ready="have"]   .ready { color: var(--fresh); }
.tile[data-ready="close"]  .ready { color: var(--copper); }
.tile[data-ready="far"]    .ready { color: var(--ink-3); }
.tile[data-ready="have"]  { border-color: #BBD6C4; }
.tile[data-ready="have"]  .plate { background: var(--fresh-bg); }

.tile .favstar {
  position: absolute; top: 6px; right: 6px;
  background: rgba(255,255,255,.9); border: 0; border-radius: 50%;
  width: 27px; height: 27px; cursor: pointer; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); box-shadow: var(--shadow-1);
}
.tile .favstar.on { color: var(--copper); }
.tile .favstar:hover { color: var(--copper); }

.tile .tbody { padding: 11px 13px 13px; flex: 1; display: flex; flex-direction: column; }
.tile .tname { font-family: var(--serif); font-size: 16px; font-weight: 600; line-height: 1.25; }
.tile .tmeta { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.tile .tmiss {
  margin-top: 8px; font-size: 12px; line-height: 1.35;
  padding-top: 8px; border-top: 1px dashed var(--shade-2);
}
.tile .tmiss b { color: var(--copper); font-weight: 700; }
.tile .tmiss.ok { color: var(--fresh); font-weight: 600; }
.tile .tmiss.use { color: var(--urgent); font-weight: 600; }

/* ---------- the open recipe card ---------- */
.recipe {
  display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 24px;
}
.recipe-hero {
  height: 190px; border-radius: var(--r-lg); overflow: hidden;
  background: var(--copper-lt); border: 1px solid var(--shade);
  display: flex; align-items: center; justify-content: center; font-size: 72px;
  margin-bottom: 18px;
}
.recipe-hero img { width: 100%; height: 100%; object-fit: cover; }
.recipe h1 { font-size: 30px; line-height: 1.15; }
.recipe .blurb { font-size: 15px; color: var(--ink-2); margin-top: 7px; line-height: 1.5; font-family: var(--serif); font-style: italic; }
.recipe .facts { display: flex; gap: 18px; flex-wrap: wrap; margin: 16px 0 22px; padding: 12px 0; border-top: 1px solid var(--shade-2); border-bottom: 1px solid var(--shade-2); }
.recipe .fact .k { font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-3); }
.recipe .fact .v { font-size: 15px; font-weight: 600; margin-top: 2px; }

.recipe h2 {
  font-size: 12px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-3); font-family: var(--sans);
  margin: 26px 0 11px; padding-bottom: 6px; border-bottom: 1px solid var(--shade-2);
}
.recipe h2:first-of-type { margin-top: 0; }

/* steps — numbered, generous */
ol.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
ol.steps li {
  counter-increment: s; position: relative;
  padding: 0 0 15px 42px; font-size: 14.5px; line-height: 1.58;
}
ol.steps li::before {
  content: counter(s);
  position: absolute; left: 0; top: -1px;
  width: 27px; height: 27px; border-radius: 50%;
  background: var(--pine); color: #fff;
  font-family: var(--sans); font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
ol.steps li.done { color: var(--ink-3); }
ol.steps li.done::before { background: var(--shade-2); color: var(--ink-3); }

/* ingredient checklist — the have/missing ledger */
.ing-list { display: flex; flex-direction: column; gap: 1px; }
.ing {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  font-size: 13.5px; border-left: 3px solid transparent;
}
.ing .imark { width: 15px; flex: none; font-size: 12px; text-align: center; }
.ing .iname { flex: 1; }
.ing .iqty { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ing .inote { font-size: 11.5px; color: var(--ink-3); display: block; }
.ing.have    { background: var(--fresh-bg); border-left-color: var(--fresh); }
.ing.have .imark { color: var(--fresh); }
.ing.short   { background: var(--soon-bg); border-left-color: var(--soon); }
.ing.short .imark { color: #8a6a12; }
.ing.missing { background: var(--expired-bg); border-left-color: var(--expired); }
.ing.missing .imark { color: var(--expired); }
.ing.missing .iname { font-weight: 600; }
.ing.staple  { background: transparent; color: var(--ink-3); border-left-color: var(--shade-2); }
.ing .where { display: block; font-size: 11px; color: var(--pine); font-weight: 600; }

/* right column of the recipe card */
.recipe-side { display: flex; flex-direction: column; gap: 16px; }
.recipe-side .card-body { padding: 13px; }
.side-actions { display: flex; flex-direction: column; gap: 8px; }

/* personal notes pad */
.notepad textarea {
  font-family: var(--serif); font-size: 14px; line-height: 1.6;
  background: #FFFDF6;
  background-image: repeating-linear-gradient(180deg, transparent 0 27px, var(--shade) 27px 28px);
  line-height: 28px; padding: 6px 10px; min-height: 120px;
}

/* cook-mode: strip everything but the steps */
body.cooking .topbar,
body.cooking .recipe-side { display: none; }
body.cooking .recipe { grid-template-columns: 1fr; max-width: 760px; margin: 0 auto; }
body.cooking ol.steps li { font-size: 18px; padding-bottom: 22px; }
body.cooking .cook-exit { display: inline-flex !important; }
.cook-exit { display: none !important; position: fixed; top: 14px; right: 14px; z-index: 60; }

@media (max-width: 900px) {
  .recipe { grid-template-columns: 1fr; }
  .recipe-side { order: -1; }
}
