/* ---------- Shared page rhythm ---------- */
.page { display: grid; gap: var(--space-5); }
.page > * { min-width: 0; }

/* ---------- Home ---------- */
.hero {
  display: grid;
  gap: var(--space-4);
  padding-block: var(--space-3) 0;
}
.hero__lead {
  margin-inline: auto;
  text-align: center;
  white-space: nowrap; /* always one line: the size follows the screen width */
  font-family: var(--font-titre);
  font-size: min(2rem, 4.6vw);
  line-height: 1.45;
  color: var(--text);
}
/* Pacifico has no italic: the second half is set apart by colour only. */
.hero__lead em {
  font-style: normal;
  color: var(--encre);
  /* Highlighter stroke in the Pêche of the category cards (as text it would be unreadable). */
  background: linear-gradient(transparent 38%, var(--cat-flanes) 38%, var(--cat-flanes) 90%, transparent 90%);
  padding-inline: 0.15em;
  border-radius: 0.2em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
/* Phones: bigger, on two centred lines ("Copiadas de su cuaderno," / "tal como las escribió."). */
@media (max-width: 719px) {
  .hero__lead { white-space: normal; font-size: min(2.4rem, 8.4vw); line-height: 1.35; }
  .hero__lead em { display: table; margin: 0.15em auto 0; white-space: nowrap; }
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: var(--space-3);
  list-style: none;
}
@media (min-width: 900px) { .cat-grid { grid-template-columns: repeat(5, 1fr); } }
/* Category cards (look shared with recipe cards: .card in components.css). */
.cat-tile {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr;
  align-items: end;
  gap: var(--space-3) var(--space-2);
  min-height: 128px;
  padding: var(--space-3);
}
.cat-tile .card__icon { grid-column: 1; grid-row: 1; align-self: start; }
.cat-tile__count {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  min-width: 36px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--surface);
  text-align: center;
  font-weight: 800;
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
}
.cat-tile__name {
  grid-column: 1 / -1;
  grid-row: 2;
  font-family: var(--font-titre);
  font-size: 1.375rem;
  line-height: 1.3;
  color: var(--encre);
}

/* ---------- Catalog ---------- */
.catalog-head { display: grid; gap: var(--space-3); }
.catalog-tools { display: grid; gap: var(--space-2); }
.result-count {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Recipe sheet ---------- */
.recipe { display: grid; gap: var(--space-4); }
.recipe__head { display: grid; gap: var(--space-3); }
.recipe__cat {
  font-size: var(--fs-label);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
}
.recipe__cat:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.recipe__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.recipe__actions .btn { min-height: 44px; padding: 0 var(--space-3); font-size: 0.9375rem; }
@media (max-width: 599px) {
  .recipe__actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
  .recipe__actions .btn {
    flex-direction: column;
    gap: 2px;
    min-height: 64px;
    padding: var(--space-2) var(--space-1);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    line-height: 1.2;
    text-align: center;
  }
}

/* The sheet itself sits on squared paper, like the notebook it was copied from. */
.sheet {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-4) var(--space-3);
  border: 2px solid var(--edge);
  border-radius: var(--radius-lg);
  background-color: var(--surface);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -1px -1px;
}
@media (max-width: 599px) {
  .sheet { margin-inline: -8px; padding: var(--space-4) 12px; }
}
@media (min-width: 900px) {
  .sheet {
    grid-template-columns: minmax(280px, 5fr) 7fr;
    align-items: start;
    padding: var(--space-5);
  }
  .sheet__ingredients { position: sticky; top: calc(var(--header-h) + var(--space-3)); }
}
.sheet > * { min-width: 0; }
.sheet__section { display: grid; gap: var(--space-3); align-content: start; }
.sheet__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.progress {
  font-size: var(--fs-small);
  font-weight: 800;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.ing-group { display: grid; gap: var(--space-1); }
.ing-group + .ing-group { margin-top: var(--space-3); }
.ing-group h3 {
  font-size: var(--fs-label);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ing-list { list-style: none; display: grid; }
.check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 10px 0;
  min-height: 44px;
  cursor: pointer;
  font-size: var(--fs-ingredient);
  font-weight: 600;
  line-height: 1.45;
  border-bottom: 1px dashed var(--line);
}
.check input {
  appearance: none;
  flex: none;
  width: 24px; height: 24px;
  margin: 0;
  border: 2px solid var(--edge);
  border-radius: 7px;
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.check input::after {
  content: "";
  width: 11px; height: 6px;
  border: solid var(--ivoire);
  border-width: 0 0 2.5px 2.5px;
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
}
.check input:checked { background: var(--basilic); border-color: var(--basilic); }
.check input:checked::after { opacity: 1; }
.check input:checked + span { color: var(--text-muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }

.steps { list-style: none; display: grid; gap: var(--space-2); counter-reset: step; }
.step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
  width: 100%;
  padding: 12px var(--space-2);
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  text-align: left;
  font-size: var(--fs-body);
  line-height: 1.6;
  max-width: var(--reading-max);
}
.step:hover { background: var(--surface-tint); }
.step__num {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 2px solid var(--edge);
  border-radius: var(--radius-pill);
  background: var(--peche);
  color: var(--encre);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.step[aria-pressed="true"] { background: transparent; }
.step[aria-pressed="true"] .step__text { color: var(--text-muted); }
.step[aria-pressed="true"] .step__num { background: var(--basilic); border-color: var(--basilic); color: var(--ivoire); }

