/* Sofraty — homepage (FE-11)
 *
 * The design's three-column portal grid, built on logical properties so RTL
 * mirrors without a single direction-specific override.
 *
 * Nothing on this page loads an image. Card thumbs are flat colour fills from
 * the recipe's own `placeholderColor`, every box has a fixed height reserved in
 * CSS, and the only font is the one already preloaded — so the LCP element is
 * the <h1> text, which arrives with the HTML, and CLS has nothing to shift.
 */

.home main {
  max-width: 1280px;
  margin-inline: auto;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-content: start;
}

.home main > .recipe-index,
.home main > .ad-slot,
.home main > .swap-strip { grid-column: 1 / -1; }

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

.portal-hero {
  grid-column: span 2;
  background: var(--molokhia);
  border-radius: 14px;
  padding: 32px 34px;
  display: flex;
  align-items: center;
  gap: 30px;
}

.portal-hero-copy { display: flex; flex-direction: column; gap: 14px; flex-grow: 1; min-width: 0; }

/* On --molokhia only the light end of the palette clears 4.5:1 — brass and
 * shatta both fail there, so the eyebrow is --brass-soft, not --brass. */
.portal-hero .eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--brass-soft);
  letter-spacing: 1.5px;
}
.portal-hero h1 {
  margin: 0;
  font-size: 38px;
  font-weight: 900;
  line-height: 1.25;
  color: var(--ground);
  text-wrap: balance;
}
.portal-hero .dek {
  margin: 0;
  font-size: 16px;
  line-height: var(--leading-ar);
  color: var(--molokhia-soft);
  max-width: 48ch;
}
.portal-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.portal-hero .btn-ghost { border-color: rgba(253, 250, 246, .35); color: var(--ground); }

.portal-hero-figure { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: none; }

.cost-ring {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  border: 2px dashed var(--brass-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--brass-soft);
}
.cost-ring .num { font-size: 42px; font-weight: 500; line-height: 1; }
.cost-ring-label { font-size: 13px; }
.portal-hero-caption { margin: 0; font-size: 13px; color: var(--molokhia-soft); text-align: center; }

/* ---- spotlights + dish cards ---------------------------------------- */

.spotlights { display: flex; flex-direction: column; gap: 20px; }

.dish-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}
.dish-card:hover { border-color: var(--ink-3); }
.dish-card:focus-visible { outline: 2px solid var(--molokhia); outline-offset: 3px; }

.dish-card-spotlight { flex-grow: 1; border-radius: 14px; }
.dish-card-spotlight .dish-thumb { height: 118px; }
.dish-card-grid .dish-thumb { height: 132px; }
.dish-thumb { flex: none; }

.dish-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 7px; }
/* The mockup's eyebrow is gold, but --brass measures 4.0:1 on --surface and the
 * brand rule is explicit that it is not a text colour on any ground we ship. */
.dish-eyebrow { font-size: 11px; font-weight: 700; color: var(--molokhia); letter-spacing: 1px; }
.dish-title { font-size: 17px; font-weight: 700; line-height: 1.4; }
.dish-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-2); }
/* A price is information the reader acts on, not a control — it stays --ink
 * and earns emphasis from the mono face, never from the action colour. */
.dish-cost { color: var(--ink); font-weight: 500; }

/* ---- recipe index --------------------------------------------------- */

.recipe-index { display: flex; flex-direction: column; gap: 16px; margin-top: 10px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head h2 { margin: 0; font-size: 24px; font-weight: 900; }
/* --ink-3 sits at ~3.5:1 on --ground; small counts stay on --ink-2 (7.5:1). */
.section-count { font-size: 14px; color: var(--ink-2); }

.dish-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }

/* ---- ad slot -------------------------------------------------------- */

/* One unit on this page, below the grid, never above the fold. The height is
 * reserved at both breakpoints so the slot filling in cannot shift anything. */
.home .ad-slot[data-size="leaderboard"] { min-height: 100px; margin-top: 10px; }

/* ---- cheaper-alternative strip -------------------------------------- */

.swap-strip {
  background: var(--shatta-soft);
  border-inline-start: 4px solid var(--shatta);
  border-radius: 12px;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.swap-strip-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.swap-strip .swap-label { margin: 0; font-size: 12px; font-weight: 700; color: var(--shatta); letter-spacing: 1.2px; }
.swap-strip .swap-text { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.65; }
.swap-strip .btn { white-space: nowrap; }

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

@media (max-width: 900px) {
  /* minmax(0, …) not a bare 1fr — a bare fr track floors at min-content and a
   * single long word would then push the whole page into a sideways scroll. */
  .home main { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 16px; }
  .portal-hero { grid-column: auto; flex-direction: column; align-items: stretch; padding: 22px 20px; gap: 18px; }
  .portal-hero h1 { font-size: 26px; }
  .portal-hero .dek { font-size: 14px; }
  .portal-hero-figure { align-self: center; }
  .cost-ring { width: 132px; height: 132px; }
  .cost-ring .num { font-size: 34px; }

  /* Card rows, not a grid — the design's mobile list puts the thumb beside
   * the title so more than two dishes fit on one screen. Every card takes the
   * row shape, spotlights included: a stack of tall cards pushes the catalogue
   * below the fold, and pages per session is the metric this page moves. */
  .dish-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .spotlights { gap: 12px; }
  .dish-card { flex-direction: row; }
  .dish-card .dish-thumb { width: 108px; height: auto; align-self: stretch; flex: none; }
  .dish-card .dish-body { flex-grow: 1; padding: 13px 15px; min-width: 0; }
  .dish-card .dish-meta { justify-content: flex-start; gap: 12px; }

  .swap-strip { flex-direction: column; align-items: stretch; padding: 17px 18px; }
  .swap-strip .swap-text { font-size: 16px; }

  .home .ad-slot[data-size="leaderboard"] { min-height: 250px; }
}

@media (max-width: 1080px) and (min-width: 901px) {
  .dish-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
