/* ================================================================
   recipes.css — recipe grid cards AND recipe detail page
   ================================================================ */

/* ── GRID ───────────────────────────────────────────────────────── */
.grid-wrap    { padding: var(--sp-sm) var(--sp-lg); max-width: 1100px; margin: .75rem auto; }
.section-title {
  font-family: var(--heading-font);
  font-size: 18.7px; color: var(--rd); font-style: italic;
  margin-bottom: var(--sp-xs);
  display: flex; align-items: center; gap: 10px;
}
.section-title::before,
.section-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--go), transparent);
}
.section-subtitle {
  text-align: center; margin: -2px 0 2px;
  font-family: var(--body-font); font-style: italic;
  font-size: 13.2px; color: var(--muted);
}

.sort-row {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 6px; margin-bottom: var(--sp-md);
  font-size: 13.2px; color: var(--muted); font-family: var(--body-font);
}
.sort-row select {
  font-size: 13.2px; padding: 3px 8px;
  border: 1px solid #d4b5b5; border-radius: 4px;
  background: #fff; color: var(--im);
  cursor: pointer; font-family: var(--body-font);
}
.sort-row select:focus { outline: none; border-color: var(--red); }

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);   /* 5 larger cards across the same width */
  gap: var(--sp-md);
}

/* ── CARD ───────────────────────────────────────────────────────── */
.recipe-card {
  background: #fff; border: 1px solid var(--bo);
  border-radius: var(--r-lg); overflow: hidden;
  cursor: pointer; text-decoration: none; display: block; outline: none;
  transition: transform .18s, box-shadow .18s;
}
.recipe-card:hover,
.recipe-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(139,26,26,.13);
  text-decoration: none;
}
.recipe-card-img {
  position: relative;
  aspect-ratio: 4 / 3;            /* uniform, responsive image area */
  display: flex; align-items: center; justify-content: center;
  background: var(--pa); overflow: hidden;
}

/* bottom gradient scrim — adds depth and keeps overlay pills legible */
.recipe-card-scrim {
  position: absolute; left: 0; right: 0; bottom: 0; height: 55%;
  background: linear-gradient(to top, rgba(28,8,8,.55), rgba(28,8,8,.10) 55%, transparent);
  pointer-events: none;
}

/* "New" badge (top-right) */
.recipe-card-badge {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
  background: var(--go); color: var(--rd);
  box-shadow: 0 1px 4px rgba(0,0,0,.28);
}

/* difficulty pill (bottom-left) with a colour-coded dot */
.recipe-card-diff {
  position: absolute; left: 8px; bottom: 8px; z-index: 2;
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 600; letter-spacing: .03em;
  padding: 3px 9px 3px 7px; border-radius: 20px;
  background: rgba(28,8,8,.55); color: #fff;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.recipe-card-diff::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: #8bc34a;            /* Easy (default) */
}
.recipe-card-diff.diff-medium::before { background: #f0b429; }
.recipe-card-diff.diff-hard::before   { background: #e8674c; }
.recipe-card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease;
}
.recipe-card:hover .recipe-card-img img,
.recipe-card:focus-visible .recipe-card-img img { transform: scale(1.06); }
.recipe-card-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--pa);
}
.recipe-card-placeholder i { font-size: 30.8px; color: var(--muted); }
.recipe-card-body  { padding: var(--sp-sm) var(--sp-md) var(--sp-md); }
.recipe-card-cat   { font-size: 9.9px; letter-spacing: .12em; text-transform: uppercase; color: var(--red); margin-bottom: 2px; }
.recipe-card-title {
  font-family: var(--heading-font); font-size: 14.3px; color: var(--rd);
  line-height: 1.3; margin-bottom: 4px; font-style: italic;
  /* clamp to 2 lines so every card lines up, regardless of title length */
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; min-height: 2.6em;
}
.recipe-card-meta  {
  display: flex; gap: 7px; font-size: 11px; color: var(--muted); flex-wrap: wrap;
  min-height: 1.2em; /* reserve space so cards with no meta stay aligned */
}

/* ── DETAIL HEADER ──────────────────────────────────────────────── */
.det-header  { background: var(--rd); border-bottom: 3px solid var(--go); }
.det-inner   { max-width: 1100px; margin: 0 auto; padding: var(--sp-md) var(--sp-lg); }
.det-top     { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.det-cat     { font-size: 9.9px; letter-spacing: .14em; text-transform: uppercase; color: var(--go); margin-bottom: 3px; }
.det-title   { font-family: var(--heading-font); font-size: 26.4px; color: var(--pa); font-style: italic; margin-bottom: .4rem; line-height: 1.2; }
.det-meta    { display: flex; gap: var(--sp-md); font-size: 13.2px; color: var(--gl); opacity: .9; flex-wrap: wrap; }
.det-entered-inline { color: rgba(201,168,76,.65); font-style: italic; }
.det-actions { display: flex; gap: .5rem; flex-shrink: 0; align-items: center; }
.det-actions .btn-icon {
  width: 42px; height: 42px; padding: 0;
  border-radius: 50%;
  border: 2px solid var(--go);
  font-size: 20.9px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.det-actions .btn-icon:hover { border-color: #fff; transform: scale(1.05); }

/* ── DETAIL LAYOUT ──────────────────────────────────────────────── */
.det-page    { max-width: 1100px; margin: 0 auto; }
.det-layout  { display: grid; grid-template-columns: 290px 1fr; min-height: 400px; border-top: 1px solid var(--bo); }
.det-sidebar { padding: var(--sp-md) var(--sp-lg) var(--sp-md) var(--sp-md); border-right: 1px solid var(--bo); background: #EADFBF; }
.det-main    { padding: var(--sp-md) var(--sp-lg) 2rem; background: var(--cr); }

/* ── SERVING SCALER ─────────────────────────────────────────────── */
.scaler-box   {
  background: #fff; border: 1px solid var(--bs);
  border-top: 3px solid var(--red); border-radius: var(--r-md);
  padding: .2rem .75rem; margin-bottom: var(--sp-md);
}
.scaler-label { font-size: 9.9px; letter-spacing: .1em; text-transform: uppercase; color: var(--red); margin-bottom: .4rem; }
.scaler-row   { display: flex; align-items: center; gap: .35rem; margin-bottom: .25rem; }
.scaler-btn   {
  width: 30px; height: 30px;
  border: 1px solid var(--bs); background: var(--rp); border-radius: var(--r-sm);
  cursor: pointer; font-size: 19.8px; display: flex; align-items: center; justify-content: center;
  color: var(--red); transition: all .15s; font-family: sans-serif;
}
.scaler-btn:hover   { background: var(--red); color: #fff; }
.scaler-input {
  flex: 1; text-align: center;
  border: 1px solid var(--bs); border-radius: var(--r-sm);
  font-family: var(--heading-font); font-size: 18.7px; color: var(--rd);
  background: #fff; padding: 3px; outline: none;
}
.scaler-input:focus { border-color: var(--red); }
.scaler-note  { font-size: 11px; color: var(--muted); font-style: italic; }
.scaler-scale { font-size: 11px; color: var(--gl2); margin-top: 2px; font-weight: 600; }

/* ── INGREDIENT LIST WITH CHECKBOXES ────────────────────────────── */
.section-heading {
  font-family: var(--heading-font); font-size: 16.5px; color: var(--rd);
  margin-bottom: .4rem; padding-bottom: .25rem;
  border-bottom: 1px solid var(--go); font-style: italic;
}
.ingredient-list { list-style: none; margin-bottom: var(--sp-md); }
.ingredient-list li {
  font-size: 13.2px; color: var(--im);
  padding: 6px 4px; margin: 0 -4px;
  border-bottom: 1px dashed var(--bo);
  display: flex; gap: 8px; align-items: center;
  cursor: pointer; transition: background .1s; border-radius: var(--r-sm);
}
.ingredient-list li:hover { background: var(--rp); }
.ingredient-list li.ing-header {
  cursor: default;
  border-bottom: 1px solid var(--go);
  padding: 10px 4px 3px;
  font-family: var(--heading-font);
  font-size: 12.1px; color: var(--rd);
  font-style: italic; font-weight: 700;
}
.ingredient-list li.ing-header:hover { background: none; }
.ingredient-list li.ing-subheader {
  cursor: default;
  border-bottom: 1px dotted var(--bo);
  padding: 6px 4px 2px 16px;
  font-family: var(--heading-font);
  font-size: 11px; color: var(--im);
  font-style: italic; font-weight: 600;
}
.ingredient-list li.ing-subheader:hover { background: none; }
.ing-checkbox { width: 14px; height: 14px; accent-color: var(--red); cursor: pointer; flex-shrink: 0; }
.ing-content  { flex: 1; display: flex; gap: 0; align-items: center; transition: opacity .15s; }
.ing-content.checked { opacity: .45; text-decoration: line-through; }
.ing-qty {
  color: var(--red); font-style: italic; flex-shrink: 0;
  font-weight: 600; font-size: 14.3px;
  width: 64px; text-align: right; padding-right: 8px; margin-right: 8px;
  border-right: 1px solid var(--go);
}
.ing-qty.scaled { color: var(--gl2); font-weight: 600; }

/* ── RECIPE BODY ────────────────────────────────────────────────── */
.recipe-photo    { width: 100%; max-height: 200px; object-fit: cover; border-radius: var(--r-md); margin-bottom: var(--sp-md); border: 2px solid var(--pd); }
.recipe-no-photo { display: flex; align-items: center; justify-content: center; height: 110px; background: var(--pa); border-radius: var(--r-md); margin-bottom: var(--sp-md); border: 1px solid var(--bo); }
.recipe-no-photo i { font-size: 39.6px; color: var(--muted); }

.recipe-notes {
  background: var(--pa); border-left: 3px solid var(--go);
  padding: var(--sp-sm) var(--sp-md); margin-bottom: var(--sp-md);
  font-size: 13.2px; color: var(--im); font-style: italic;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* ── STEPS ──────────────────────────────────────────────────────── */
.method-steps { list-style: none; }
.method-steps li.step-header {
  padding: 12px 0 3px;
  border-bottom: none;
  font-family: var(--heading-font);
  font-size: 13.2px; color: var(--rd);
  font-style: italic; font-weight: 700;
  letter-spacing: .02em;
}
.method-steps li.step-header::before { display: none; }
.method-steps li.step-subheader {
  border-bottom: none;
  font-family: var(--heading-font);
  font-size: 11.5px; color: var(--im);
  font-style: italic; font-weight: 600;
  letter-spacing: .02em;
  position: relative;
}
/* Indent depends on what came before: nestle under a section header, but align
   with the step text when it interrupts a run of numbered steps. */
.method-steps li.step-subheader.after-header { padding: 4px 0 2px 18px; }
.method-steps li.step-subheader.after-step   { padding: 12px 0 2px 34px; }
/* Arrow bullet (overrides the numbered-step circle from .method-steps li::before) */
.method-steps li.step-subheader::before {
  content: "\2192\00a0";
  position: static; width: auto; height: auto;
  background: none; border-radius: 0; display: inline;
  font-size: inherit; color: var(--go);
  font-style: normal; font-weight: 700;
}
.method-steps li {
  font-size: 14.3px; color: var(--im);
  padding: 10px 0 10px 34px; border-bottom: 1px dashed var(--bo);
  position: relative; line-height: 1.65;
}
.method-steps li::before {
  content: attr(data-num);
  position: absolute; left: 0; top: 8px;
  width: 20px; height: 20px;
  background: var(--red); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}

