/* Sofraty — recipe page template (FE-01)
 * The hero image is the LCP element: it is sized via width/height on the <img>
 * (never CSS-only) so the browser reserves the box before the byte arrives —
 * that reservation, not the image itself, is what keeps CLS at zero here.
 */

main { max-width: 1280px; margin-inline: auto; }

/* ---- hero ---------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 480px;
}

.hero-media { position: relative; background: var(--surface-2); overflow: hidden; }
.hero-media picture, .hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-copy {
  padding: 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: center;
}

.eyebrow { margin: 0; font-size: 12px; font-weight: 700; color: var(--brass); letter-spacing: 2px; }
.hero-copy h1 { margin: 0; font-size: 44px; font-weight: 900; line-height: 1.2; letter-spacing: -0.5px; text-wrap: balance; }
.dek { margin: 0; font-size: 17px; line-height: var(--leading-ar); color: var(--ink-2); max-width: 46ch; }

.stat-row {
  display: flex;
  gap: 24px;
  padding: 18px 0;
  border-block: 1px solid var(--rule);
  margin: 4px 0 0;
}
.stat { display: flex; flex-direction: column; gap: 3px; }
.stat + .stat { border-inline-start: 1px solid var(--rule); padding-inline-start: 24px; }
.stat dt { margin: 0; font-size: 22px; color: var(--ink); }
.stat:first-child dt { color: var(--shatta); }
.stat dd { margin: 0; font-size: 12px; color: var(--ink-3); }

.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* ---- body layout ---------------------------------------------------- */

.recipe-body {
  padding: 48px 24px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 36px;
  align-items: start;
}

.recipe-main { display: flex; flex-direction: column; gap: 36px; min-width: 0; }
.recipe-sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
}

/* ---- ingredients ------------------------------------------------------ */

.ingredients .card-header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--rule);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ingredients h2 { margin: 0; font-size: 20px; font-weight: 900; }

.servings-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 7px;
  padding: 5px 12px;
}
.servings-stepper button {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--ink-3);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.servings-stepper button:hover { color: var(--shatta); }
.servings-stepper span { font-size: 15px; min-width: 1.4em; text-align: center; }

.ingredient-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ingredient-list li { padding: 10px 22px; }
.ingredient-list label { display: flex; align-items: center; gap: 12px; font-size: 15px; cursor: pointer; }
.ingredient-list input {
  width: 17px; height: 17px; flex: none; accent-color: var(--molokhia);
}
.ingredient-list label:has(input:checked) span { color: var(--ink-3); text-decoration: line-through; }

.card-footer {
  border-top: 1px solid var(--rule);
  padding: 14px 22px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- steps -------------------------------------------------------- */

.steps-section h2 { font-size: 26px; font-weight: 900; margin: 0 0 20px; }
.step-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.step { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 18px; align-items: start; }
.step-number {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--molokhia); color: var(--ground);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; flex: none;
}
.step p { margin: 0; font-size: 16px; line-height: var(--leading-ar); padding-top: 6px; }

.tip-card {
  background: var(--molokhia-soft);
  border-radius: 12px;
  padding: 20px 24px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tip-label { margin: 0; font-size: 12px; font-weight: 700; color: var(--molokhia); letter-spacing: 1px; }
.tip-card p:last-child { margin: 0; font-size: 15px; line-height: 1.8; color: var(--ink); }

/* ---- sidebar cards -------------------------------------------------- */

.swap-card {
  background: var(--shatta-soft);
  border-inline-start: 4px solid var(--shatta);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.swap-label { margin: 0; font-size: 12px; font-weight: 700; color: var(--shatta); letter-spacing: 1.2px; }
.swap-card p:not(.swap-label) { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.65; }
.swap-card .num { color: var(--shatta); }

.price-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.price-card h3 { margin: 0; font-size: 16px; font-weight: 700; }
.price-rows { display: flex; flex-direction: column; gap: 8px; }
.price-row { display: flex; justify-content: space-between; font-size: 14px; }
.price-row span:first-child { color: var(--ink-2); }
.price-total {
  border-top: 1px solid var(--rule);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 700;
}
.price-total .num { font-size: 18px; color: var(--molokhia); }
.price-updated { margin: 0; font-size: 11px; color: var(--ink-3); line-height: 1.6; }

/* ---- related ------------------------------------------------------- */

.related-section { padding: 44px 24px 40px; display: flex; flex-direction: column; gap: 18px; }
.related-section h2 { margin: 0; font-size: 24px; font-weight: 900; }
.related-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.related-card { display: block; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; color: inherit; }
.related-thumb { height: 120px; }
.related-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.related-title { font-size: 16px; font-weight: 700; }
.related-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); }
.related-meta .num { color: var(--shatta); }

/* ---- responsive: mid-range Android in portrait is the target device --- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-media { aspect-ratio: 4 / 3; }
  .hero-copy { padding: 28px 20px; }
  .hero-copy h1 { font-size: 32px; }
  .stat-row { gap: 16px; flex-wrap: wrap; }
  .stat + .stat { padding-inline-start: 16px; }

  .recipe-body { grid-template-columns: 1fr; padding: 32px 16px 0; gap: 28px; }
  .recipe-sidebar { position: static; }

  .ingredient-list { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .related-section { padding: 32px 16px 32px; }
}
