/* Menu-first grid (server/menu-first.js + menu-first.js).
   Uses the site tokens from styles.css: --ink, --ink-soft, --paper, --bg-2,
   --rust (pink), --blue, --hairline. Phone first: two cards a row. */

.mf { max-width: 1280px; margin: 0 auto; padding: 4px 16px 28px; }
@media (min-width: 1024px) { .mf { padding: 8px 40px 40px; } }

.mf-head { display: grid; gap: 8px; margin-bottom: 14px; }
.mf-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.mf-chips::-webkit-scrollbar { display: none; }
.mf-chip {
  flex: 0 0 auto; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--hairline); background: var(--paper); color: var(--ink);
  font: 600 14px/1 var(--font-body, 'DM Sans', system-ui, sans-serif); cursor: pointer;
}
.mf-chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.mf-chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.mf-tiers { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.4; }

.mf-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .mf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1024px) { .mf-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.mf-card {
  min-width: 0; display: flex; flex-direction: column; background: var(--paper);
  border: 1px solid var(--hairline); border-radius: 14px; overflow: hidden;
}
.mf-card[data-in-box] { border-color: var(--rust); box-shadow: 0 0 0 1px var(--rust); }
.mf-later { display: none; }
.mf-showall .mf-later, .mf-filtering .mf-later { display: flex; }
.mf-card[hidden] { display: none !important; }

.mf-shot { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--bg-2); }
.mf-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mf-macro-strip {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 4px;
  padding: 5px 8px; background: rgba(12, 13, 18, 0.78); color: #fff;
  font: 500 11px/1.2 var(--font-mono, 'JetBrains Mono', ui-monospace, monospace); letter-spacing: .02em;
}
.mf-macro-strip b { font-weight: 700; }

.mf-body { display: flex; flex-direction: column; gap: 8px; padding: 10px 10px 12px; flex: 1; }
.mf-name {
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em;
}
.mf-name:hover { text-decoration: underline; }
.mf-row { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.mf-price { font-weight: 700; font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }

.mf-add {
  min-height: 44px; padding: 0 14px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--rust); color: #fff; font: 700 14px/1 var(--font-body, 'DM Sans', system-ui, sans-serif); white-space: nowrap;
}
.mf-add:hover { filter: brightness(0.95); }
.mf-add:focus-visible, .mf-step button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.mf-step { display: inline-flex; align-items: center; border-radius: 999px; background: var(--ink); color: var(--paper); }
.mf-step button {
  width: 44px; height: 44px; border: 0; background: transparent; color: inherit; cursor: pointer;
  font: 700 20px/1 var(--font-body, 'DM Sans', system-ui, sans-serif); border-radius: 999px;
}
.mf-qty { min-width: 18px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.mf-more {
  display: block; width: 100%; margin: 14px 0 0; min-height: 48px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink); font: 700 15px/1 var(--font-body, 'DM Sans', system-ui, sans-serif);
}
.mf-links { margin: 14px 0 0; font-size: 14px; color: var(--ink-soft); }
.mf-links a { color: var(--ink); font-weight: 600; }

/* Sticky box bar (phones only, via .sticky-cta). */
.mf-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 16px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 18px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}
.mf-bar[hidden] { display: none; }
@media (min-width: 768px) { .mf-bar { display: none; } }
.mf-bar-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.mf-bar-text strong { font-size: 15px; }
.mf-bar-text span { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mf-bar-go {
  flex: 0 0 auto; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--rust); color: #fff; font: 700 15px/1 var(--font-body, 'DM Sans', system-ui, sans-serif); white-space: nowrap;
}
.mf-bar[data-state="ready"] .mf-bar-go { background: var(--blue); }

/* Compact hero above the grid on menu-first pages: heading + one line. */
.mf-hero { padding-top: 18px !important; padding-bottom: 10px !important; }
.mf-hero h1 { font-size: clamp(30px, 8vw, 56px) !important; line-height: 1.04 !important; margin-bottom: 10px !important; }
.mf-hero .mf-sub { margin: 0; font-size: 16px; color: var(--ink-soft); line-height: 1.45; max-width: 60ch; }
@media (max-width: 767px) { .mf-hero .eyebrow { display: none; } }

/* The full guide, kept on the page below the grid. */
.mf-guide { max-width: 1280px; margin: 8px auto 0; padding: 0 16px; }
.mf-guide > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between;
  min-height: 52px; padding: 0 18px; border: 1.5px solid var(--ink); border-radius: 12px; font-weight: 700; font-size: 16px;
}
.mf-guide > summary::-webkit-details-marker { display: none; }
.mf-guide > summary::after { content: "+"; font-size: 22px; }
.mf-guide[open] > summary::after { content: "\2212"; }
@media (min-width: 1024px) { .mf-guide { padding: 0 40px; } }

/* Guide split arm B: the week strip's meals as a grid. */
.mf-grid-strip { margin: 12px 0 16px; }

/* Inside a page <main> that already has a container and side padding. */
main.mx-auto > .mf, main.mx-auto > .mf-guide { padding-inline: 0; max-width: none; }
