/* Recipes: list, recipe page, Nutrition Facts, print. Colours come from each theme. */
.recipes, .shop { padding-bottom: 3rem; }
.recipe-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }
html:not(.js) .js-only { display: none; }

.recipe-search { display: flex; gap: .5rem; max-width: 34rem; margin-bottom: 1rem; }
.recipe-search input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); min-height: 46px; }
.recipe-search .button { cursor: pointer; font: inherit; font-weight: 600; }
.recipe-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.5rem; }
.recipe-filters a { padding: .35rem .85rem; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: inherit; font-size: .95rem; }
.recipe-filters a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.recipe-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.recipe-card { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.recipe-card__media { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); text-decoration: none; }
.recipe-card__media img { width: 100%; height: 100%; object-fit: cover; }
.recipe-card__initial { display: grid; place-items: center; height: 100%; font-size: 4.5rem; color: var(--muted); }
.recipe-card__body { padding: .9rem 1rem 1rem; overflow-wrap: anywhere; }
.recipe-card__title { margin: 0 0 .3rem; font-size: 1.3rem; line-height: 1.25; }
.recipe-card__title a { color: inherit; text-decoration: none; }
.recipe-card__title a:hover { text-decoration: underline; }
.recipe-card__summary { color: var(--muted); font-size: .95rem; line-height: 1.5; margin: 0 0 .4rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.recipe { padding-bottom: 3rem; overflow-wrap: break-word; }
.recipe-preview { margin: 1rem 0 0; padding: .7rem 1rem; border: 1px dashed var(--accent); border-radius: var(--radius-sm); }
.recipe-head { display: grid; gap: 1.5rem; padding-block: clamp(1.5rem, 4vw, 2.75rem) 2rem; border-bottom: 1px solid var(--border); }
.recipe-head__text, .recipe-ingredients, .recipe-method { min-width: 0; }
.recipe-title { font-size: clamp(2rem, 6vw, 3rem); line-height: 1.12; margin: 0 0 .75rem; }
.recipe-summary { color: var(--muted); font-size: 1.15rem; max-width: 60ch; }
.recipe-stats { display: flex; flex-wrap: wrap; gap: .75rem 1.75rem; margin: 1.25rem 0; }
.recipe-stats dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.recipe-stats dd { margin: 0; font-weight: 600; }
.recipe-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; }
.recipe-actions .button, .shop .button { min-height: 46px; cursor: pointer; font: inherit; font-size: .95rem; font-weight: 600; justify-content: center; }
/* Instacart's published button colours and shape. */
.recipe-shop { background: #003D29; border-color: #003D29; color: #FAF1E5; border-radius: 999px; padding-inline: 18px; }
.recipe-share { position: relative; }
.recipe-share summary { list-style: none; }
.recipe-share summary::-webkit-details-marker { display: none; }
.recipe-share ul { position: absolute; z-index: 5; left: 0; top: calc(100% + .35rem); margin: 0; padding: .35rem; list-style: none; min-width: 14rem; max-width: 80vw; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.recipe-share.is-end ul { left: auto; right: 0; }
.recipe-share li a, .recipe-share li button { display: block; width: 100%; padding: .55rem .75rem; text-align: left; font: inherit; font-size: .95rem; color: var(--text); background: none; border: 0; text-decoration: none; cursor: pointer; }
.recipe-share li a:hover, .recipe-share li button:hover { background: var(--surface-2); }
.recipe-photo { margin: 0; }
.recipe-photo img { display: block; width: 100%; height: auto; max-height: 30rem; object-fit: cover; border-radius: var(--radius); }
.recipe-photo figcaption { color: var(--muted); font-size: .85rem; margin-top: .4rem; }

.recipe-body { display: grid; gap: 2rem 3rem; padding-top: 2rem; }
.recipe-body h2 { font-size: 1.5rem; margin: 0 0 .75rem; }
.recipe-body h3 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
.recipe-ingredients ul { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.recipe-ingredients label { display: flex; gap: .7rem; align-items: baseline; padding: .3rem 0; cursor: pointer; }
.recipe-ingredients label span { min-width: 0; }
.recipe-ingredients input { flex: none; width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
.recipe-ingredients input:checked + span { color: var(--muted); text-decoration: line-through; }
.recipe-ingredients .recipe-equipment { list-style: disc; padding-left: 1.2rem; }
.recipe-method ol { padding-left: 1.6rem; margin: 0 0 1.5rem; max-width: 64ch; }
.recipe-method ol li { padding-left: .35rem; margin-bottom: .85rem; }
.recipe-method ol li::marker { color: var(--accent); font-weight: 700; }
.recipe-notes__text { white-space: pre-line; max-width: 64ch; }
.recipe-source { color: var(--muted); font-size: .95rem; }
.recipe-print-url { display: none; }
.recipe-discussion { max-width: var(--measure); }

@media (min-width: 800px) {
  .recipe-head--photo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .recipe-body { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
}

/* Black on white in both themes, like the label on food packages. */
.facts { margin-top: 2rem; max-width: 21rem; padding: .5rem .6rem; border: 2px solid #000; background: #fff; color: #000; font: 14px/1.3 Helvetica, Arial, sans-serif; }
.recipe-body .facts__title { font: 900 1.85rem/1.1 Helvetica, Arial, sans-serif; letter-spacing: 0; margin: 0 0 .15rem; color: #000; }
.facts__per { margin: 0; padding-bottom: .3rem; border-bottom: 5px solid #000; }
.facts table { width: 100%; border-collapse: collapse; margin: 0; }
.facts th, .facts td { padding: .2rem 0; text-align: left; font-weight: 400; border-bottom: 1px solid #000; background: none; color: #000; }
.facts thead th { border-bottom-width: 3px; vertical-align: bottom; }
.facts thead .facts__calories { font-size: 1.25rem; font-weight: 900; }
.facts thead .facts__dv { text-align: right; font-size: .8rem; font-weight: 700; }
.facts td { text-align: right; white-space: nowrap; }
.facts .facts__sub th { padding-left: 1rem; }
.facts .facts__join th, .facts .facts__join td { border-bottom: 0; }
.facts .facts__thick th, .facts .facts__thick td { border-bottom-width: 5px; }
.facts b { font-weight: 800; }
.facts__note { margin: 0; padding: .3rem 0; font-size: .78rem; }
.facts__source { margin: 0; padding-top: .3rem; border-top: 1px solid #999; font-size: .72rem; color: #444; }

.shop { max-width: 46rem; }
.shop-list { list-style: none; padding: 0; }
.shop-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.shop-list span { min-width: 0; overflow-wrap: anywhere; }
.shop-note { color: var(--muted); font-size: .85rem; }

@media print {
  @page { margin: 12mm; }
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #333; --border: #999; --accent: #000; }
  .site-header, .site-footer, .skip-link, .recipe-actions, .recipe-discussion, .recipe-preview, .recipe-head .eyebrow { display: none !important; }
  body { display: block !important; background: #fff; color: #000; font-size: 10.5pt; line-height: 1.35; min-height: 0; }
  .wrap { max-width: none; padding: 0; }
  .recipe, .recipe-head { padding: 0 0 .4rem; }
  .recipe-title { font-size: 21pt; margin: 0 0 .2rem; }
  .recipe-summary { font-size: 10.5pt; margin: 0; }
  .recipe-stats { margin: .4rem 0 0; gap: .2rem 1.2rem; }
  .recipe-head--photo { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 1rem; }
  .recipe-photo img { max-height: 42mm; }
  .recipe-photo figcaption { display: none; }
  .recipe-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 0 1.2rem; padding-top: .6rem; align-items: start; }
  .recipe-body h2 { font-size: 13pt; margin-bottom: .3rem; }
  .recipe-body h3 { font-size: 11pt; margin: .5rem 0 .2rem; }
  .recipe-ingredients label { padding: .05rem 0; gap: .4rem; }
  .recipe-ingredients input { -webkit-appearance: none; appearance: none; width: 8pt; height: 8pt; margin: 0; border: 1px solid #555; border-radius: 1px; background: #fff; }
  .recipe-ingredients input:checked + span { color: inherit; text-decoration: none; }
  .recipe-method ol li { margin-bottom: .3rem; break-inside: avoid; }
  .facts { margin-top: .6rem; max-width: 72mm; font-size: 8pt; break-inside: avoid; }
  .recipe-body .facts__title { font-size: 15pt; }
  .facts th, .facts td { padding: .02rem 0; }
  .facts thead .facts__calories { font-size: 11pt; }
  .recipe-print-url { display: block; font-size: 8pt; color: #555; }
}
