/* Family Recipes: the grid, the recipe page, the JavaScript-free editor and the print sheet.
   Mobile first (375 px). Every colour comes from a theme token. */

/* ---- List ---- */
.recipe-search { display: flex; gap: var(--space-2); }
.recipe-search input { flex: 1; min-width: 0; min-height: var(--tap); padding: var(--space-2) var(--space-3); }
.recipe-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.recipe-chip {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--space-3);
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text); font-size: var(--step-small); text-decoration: none;
}
.recipe-chip[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.recipe-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }
@media (min-width: 560px) { .recipe-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .recipe-grid { grid-template-columns: repeat(3, 1fr); } }
.recipe-card {
  height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.recipe-card__link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.recipe-card__art {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--accent-soft); color: var(--accent-strong);
}
.recipe-card__art img { width: 100%; height: 100%; object-fit: cover; }
.recipe-card__plate { display: inline-flex; }
.recipe-card__body { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3); }
.recipe-card__category {
  font-size: var(--step-small); font-weight: 700; color: var(--accent-strong);
}
.recipe-card__title { font-weight: 650; font-size: var(--step-name); color: var(--text-strong); overflow-wrap: anywhere; }
.recipe-card__meta { font-size: var(--step-small); }
.recipe-pages { display: flex; justify-content: space-between; gap: var(--space-3); }
.recipe-empty { text-align: center; }

/* ---- Home feed card ---- */
.recipe-feedcard { padding: 0; overflow: hidden; }
.recipe-feedcard__link { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.recipe-feedcard__art {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--accent-soft); color: var(--accent-strong);
}
.recipe-feedcard__art img { width: 100%; height: 100%; object-fit: cover; }
.recipe-feedcard__body { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) var(--space-4); }

/* ---- The recipe page ---- */
.recipe-head { display: flex; flex-direction: column; gap: var(--space-1); }
.recipe-head h1 { margin: 0; overflow-wrap: anywhere; }
.recipe-eyebrow {
  margin: 0; font-size: var(--step-small); font-weight: 700;
  color: var(--accent-strong);
}
.recipe-from { margin: 0; font-style: italic; color: var(--accent-strong); }
.recipe-meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin: 0; color: var(--muted); }
.recipe-moments { margin: 0; }
.recipe-hero { margin: 0; overflow: hidden; border-radius: var(--radius); }
.recipe-hero img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: cover; }
.recipe-story { padding-left: var(--space-3); border-left: 3px solid var(--accent); }
.recipe-story p { margin: 0; overflow-wrap: anywhere; }
.recipe-body { display: grid; gap: var(--space-5); }
@media (min-width: 760px) { .recipe-body { grid-template-columns: 1fr 1.6fr; align-items: start; } }
.recipe-body h2 { margin: 0 0 var(--space-2); }
.recipe-checklist { display: flex; flex-direction: column; }
.recipe-check { display: flex; align-items: flex-start; gap: var(--space-3); min-height: var(--tap); padding: var(--space-2) 0; cursor: pointer; }
.recipe-check input { flex: none; width: 22px; height: 22px; margin-top: 2px; }
.recipe-check input:checked + span { color: var(--muted); text-decoration: line-through; }
.recipe-steplist { margin: 0; padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.recipe-steplist li { padding-left: var(--space-1); overflow-wrap: anywhere; }
.recipe-danger { color: var(--danger); }
.recipe-madeby { margin: var(--space-1) 0 0; font-size: var(--step-small); }
.recipe-upload { display: flex; flex-direction: column; gap: var(--space-2); }

/* ---- The editor (works without JavaScript) ---- */
.recipe-form__meta { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }
@media (min-width: 560px) { .recipe-form__meta { grid-template-columns: 1.4fr 1fr 1fr; } }
.recipe-rows { display: flex; flex-direction: column; gap: var(--space-3); margin: 0; padding: 0; border: 0; min-width: 0; }
.recipe-rows legend { padding: 0; font-weight: 650; }
.recipe-rowlist { display: flex; flex-direction: column; gap: var(--space-3); margin: 0; counter-reset: row; }
.recipe-row { display: flex; flex-direction: column; gap: var(--space-2); }
.recipe-row input, .recipe-row textarea { width: 100%; min-height: var(--tap); padding: var(--space-2) var(--space-3); }
.recipe-row__tools { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.recipe-row__btn { min-width: var(--tap); min-height: var(--tap); }
.recipe-moments-pick summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; }

/* ---- Print: one recipe per page, black on white, no chrome ---- */
@media print {
  :root { color-scheme: only light; }
  body, main, .recipe-print { background: Canvas; color: CanvasText; box-shadow: none; border: 0; }
  .topbar, .appnav, .tabbar, .messages, .recipe-tools, .social, .recipe-made, .recipe-social, .recipe-search,
  .recipe-chips, .recipe-pages, .crumb, [data-print], .recipe-upload, .tile-actions, .badge { display: none; }
  main, .container { max-width: none; margin: 0; padding: 0; }
  .recipe-print { display: block; padding: 0; page-break-inside: avoid; break-inside: avoid-page; }
  .recipe-print h1, .recipe-print h2 { color: CanvasText; }
  .recipe-eyebrow, .recipe-from, .recipe-meta { color: CanvasText; }
  .recipe-hero { max-width: 40%; float: right; margin: 0 0 12pt 12pt; }
  .recipe-hero img { max-height: 3in; }
  .recipe-body { display: block; }
  .recipe-checklist { display: block; margin: 0; padding: 0; list-style: none; }
  .recipe-check { display: block; min-height: 0; padding: 2pt 0; }
  .recipe-check input { display: none; }
  .recipe-check input:checked + span { color: CanvasText; text-decoration: none; }
  .recipe-steplist li { break-inside: avoid; }
  .recipe-story { border-left-color: CanvasText; }
  a { color: CanvasText; text-decoration: none; }
}
/* A recipe without a photo: one compact row (a mark, the title), never an empty picture box */
.recipe-feedcard--text .recipe-feedcard__link { flex-direction: row; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.recipe-feedcard--text .recipe-feedcard__body { padding: 0; }
.recipe-feedcard__mark { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-strong); }
.recipe-card__title { font-family: var(--font-heading); font-weight: var(--heading-weight); letter-spacing: var(--heading-tracking); }
.recipe-card__noart { display: flex; align-items: center; padding: var(--space-4) var(--space-4) 0; color: var(--accent-strong); }
.recipe-card__noart .icon { width: 32px; height: 32px; }
/* Categories: one row that scrolls sideways on a phone instead of three rows before the first recipe */
@media (max-width: 639px) {
  .recipe-chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(-1 * var(--space-4)); padding: 0 var(--space-4) var(--space-1); scrollbar-width: none; }
  .recipe-chips::-webkit-scrollbar { display: none; }
  .recipe-chip { flex: none; }
}
