/* Collection pages, the language hubs, the family sheets and the about
 * pages (tool/importer/nomme_import/render.py and about.py).
 *
 * Built on nomme.css: the palette, the type scale, Fraunces for h1/h2,
 * the badge and the focus ring come from there, and only what a long
 * list of recipes needs is here. A page can carry 60 cards and a family
 * sheet 300 links, so everything below has to hold at that length: no
 * shadows at rest, no per-card motion, and images that never load until
 * they are near the viewport. DESIGN.md documents the system.
 */

html { scroll-padding-top: 88px; }   /* #get lands below the sticky bar */

.vh {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── The bar ─────────────────────────────────────────────────────────
 * Solid cream and sticky (nomme.css owns header), one row: wordmark,
 * the language menu, the store button. 64 px on a phone, 72 on a
 * desktop. The languages used to be a row of their own and made the
 * sticky part 159 px tall. */

header.bar { padding-top: env(safe-area-inset-top, 0px); }

.bar-in {
  max-width: calc(900px + 48px);
  margin: 0 auto;
  padding: 0 24px;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.bar .brand { margin-right: auto; font-size: 1rem; }
.bar .brand img { height: 30px; width: auto; display: block; }

.bar .stores { display: flex; flex-wrap: nowrap; gap: 8px; margin: 0; }

.bar .store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  background: var(--forest);
  color: #fff;
  font: 600 1rem/1.2 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s, transform .15s var(--ease-out);
}
.bar .store:hover { background: var(--forest-deep); color: #fff; }
.bar .store:active { transform: scale(.97); }

/* Both stores show only on a desktop; there the App Store one is ink so
 * the two read as two choices, not one doubled button. Alone on an
 * iPhone it is the forest primary. */
.bar .store.store-ios { background: var(--ink); }
html[data-os="ios"] .bar .store.store-ios { background: var(--forest); }

html[data-os="ios"] .store-android,
html[data-os="android"] .store-ios { display: none !important; }

/* The language menu: "EN" and a drawn chevron; the other languages
 * open in a small floating list, each a 44 px row. */
.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  color: var(--ink-muted);
  font: 600 1rem/1 var(--font-body);
  cursor: pointer;
  user-select: none;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after {
  content: "";
  width: .4em; height: .4em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s var(--ease-out);
}
.lang-menu[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.lang-menu summary:hover,
.lang-menu[open] summary { color: var(--ink); background: var(--leaf-surface); }

.lang-menu nav {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 184px;
  padding: 6px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-float);
}
.lang-menu ul { list-style: none; margin: 0; padding: 0; }
.lang-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}
.lang-menu a:hover { background: var(--leaf-surface); color: var(--ink); }

@media (max-width: 640px) {
  .bar-in { min-height: 64px; padding: 0 16px; gap: 6px; }
  .bar .brand img { height: 26px; }
  .bar .store { min-height: 44px; padding: 0 16px; }
  .lang-menu summary { padding: 0 10px; }
}

/* ── The page ──────────────────────────────────────────────────────── */

.collection {
  max-width: calc(900px + 48px);   /* narrower than --measure: this is a list */
  margin: 0 auto;
  padding: var(--space-2) 24px var(--space-8);
}
.collection section { padding: 0; }       /* nomme.css pads every section 84 px */

.collection > p,
.collection section > p { max-width: 65ch; }

/* The trail: small print, but each link is a 44 px target and the
 * separators are drawn chevrons with room around them. */
.crumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: var(--step--1);
  line-height: 1.3;
}
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li + li::before {
  content: "";
  width: 5px; height: 5px;
  margin: 0 10px 0 6px;
  border-top: 1.5px solid var(--ink-muted);
  border-right: 1.5px solid var(--ink-muted);
  transform: rotate(45deg);
}
.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-muted);
  text-decoration-thickness: 1px;
}
.crumbs a:hover { color: var(--ink); }

/* h1 → h2 → h3, on the 1.333 scale: the h1 is a sentence, so it takes
 * the h2 step of the start page (30-50 px); section heads are Fraunces
 * at step 1 (22.7 px); card titles are the 17 px body in bold. */
.collection h1 {
  font-size: var(--step-2);
  line-height: 1.05;
  letter-spacing: -0.025em;
  max-width: 22ch;
  margin: var(--space-2) 0 var(--space-5);
}
.collection h2 { font-size: var(--step-1); letter-spacing: -0.015em; line-height: 1.2; }

.collection .lead {
  font-size: var(--step-1);
  line-height: 1.45;
  max-width: 36em;
  margin: 0;
}

/* The one offer line, then the list. */
.offer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  margin: var(--space-6) 0 0;
}
.offer-row .offer { margin: 0; font-weight: 600; }

/* The store links between the prose: pills, one per store on a desktop,
 * one "Get the app" on a phone, never wrapping inside themselves. Ghost
 * by default (the header button is the filled one on screen); filled
 * only in the mid-list pause. */
.pills { display: inline-flex; flex-wrap: wrap; gap: 8px; vertical-align: middle; }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--forest);
  box-shadow: inset 0 0 0 2px var(--forest); /* taste-skill-ignore: a stroke, not a shadow */
  font: 600 1rem/1.2 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s;
}
.pill.store-ios { color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); } /* taste-skill-ignore */
html[data-os="ios"] .pill.store-ios { color: var(--forest); box-shadow: inset 0 0 0 2px var(--forest); } /* taste-skill-ignore */
.pill:hover { background: var(--leaf-surface); color: var(--forest); }

.to-app.mid .pill { background: var(--forest); color: #fff; box-shadow: none; } /* taste-skill-ignore */
.to-app.mid .pill.store-ios { background: var(--ink); }
html[data-os="ios"] .to-app.mid .pill.store-ios { background: var(--forest); color: #fff; box-shadow: none; }
.to-app.mid .pill:hover { background: var(--forest-deep); color: #fff; }

/* ── The list ──────────────────────────────────────────────────────── */

.list { margin-top: var(--space-8); }
.list > h2 { margin: 0 0 var(--space-3); }
.list > p { margin: 0 0 var(--space-5); }

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
}

/* The whole card is the link to the app. White on cream, no stroke and
 * no shadow: the step in tone is the edge. */
.card { min-width: 0; }             /* or long titles push the grid wider */
.card > a {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  min-height: 86px;
  padding: 10px 16px 10px 10px;
  background: var(--surface);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  transition: background-color .15s;
}
.card > a:hover { background: var(--leaf-surface); color: var(--ink); }
.card > a:focus-visible { border-radius: var(--radius); outline-offset: 2px; }

.card img,
.card .ph {
  width: 88px;
  height: 66px;
  flex: none;
  object-fit: cover;
  border-radius: 12px;
  background: var(--leaf-surface);   /* what shows while it loads */
}

.card-text { min-width: 0; }
.card h3 {
  margin: 0 0 4px;
  font: 700 var(--step-0)/1.3 var(--font-body);
  letter-spacing: -0.01em;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.card .swipe {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--forest);
}
.card .swipe::after {
  content: "";
  width: 5px; height: 5px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform .2s var(--ease-out);
}
.card > a:hover .swipe::after { transform: translateX(3px) rotate(45deg); }

/* The pause in the middle of a long list: a leaf field, not a second ending. */
.to-app.mid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-5);
  margin: 12px 0;
  padding: var(--space-5);
  background: var(--leaf-surface);
  border-radius: var(--radius);
}
.to-app.mid p { margin: 0; max-width: 52ch; }

.more-in-app {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  margin: var(--space-5) 0 0;
  font-weight: 600;
}

/* ── The questions ─────────────────────────────────────────────────
 * Open by default: these answers are the reason the page exists and
 * what an assistant quotes. <details> stays so a reader can fold one. */

.faq { margin-top: var(--space-8); }
.faq details + details { margin-top: var(--space-6); }
.faq summary {
  list-style: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 44px;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary h2 { margin: 0; }
.faq summary::after {
  content: "";
  flex: none;
  width: .45em; height: .45em;
  margin-right: 4px;
  border-right: 2px solid var(--ink-muted);
  border-bottom: 2px solid var(--ink-muted);
  transform: translateY(-4px) rotate(45deg);
  transition: transform .2s var(--ease-out);
}
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq details p { margin: var(--space-3) 0 0; max-width: 65ch; }

/* ── Nearby ──────────────────────────────────────────────────────── */

.nearby { margin-top: var(--space-8); }
.nearby h2 { margin: 0 0 var(--space-3); }
.nearby ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0 var(--space-5);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.nearby a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-block: 8px;
  line-height: 1.35;
}
.nearby > p { margin: var(--space-3) 0 0; font-weight: 600; }
.nearby > p a { display: inline-flex; align-items: center; min-height: 44px; }

/* ── The end: the coral field, as on the start page's close ────────── */

.to-app {
  --focus: var(--ink);
  margin-top: var(--space-8);
  padding: var(--space-7) clamp(24px, 5vw, 56px);
  background: var(--coral);
  color: var(--ink);
  border-radius: var(--radius);
}
.to-app p { margin: 0 0 var(--space-4); max-width: 52ch; }
.to-app a { color: var(--ink); }
.to-app a.badge { color: #fff; }
.to-app .clause {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "SOFT" 100, "WONK" 0;
  font-size: var(--step-1);
  line-height: 1.35;
  letter-spacing: -0.015em;
  max-width: 34ch;
  margin-bottom: var(--space-5);
}
.to-app .stores { margin: var(--space-5) 0 var(--space-4); gap: 12px; }
.to-app .offer { margin-bottom: 0; }
.to-app .offer strong { font-weight: 700; }
.to-app .more { margin: var(--space-3) 0 0; }
.to-app .more a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* The date and the sources: small print at the foot, said once. */
.updated { margin: var(--space-6) 0 0; font-size: var(--step--1); color: var(--ink-muted); }
.updated a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; }
.sources {
  margin: var(--space-2) 0 0;
  font-size: var(--step--1);
  line-height: 1.7;                  /* room between the inline links */
  color: var(--ink-muted);
  max-width: 75ch;
}
.sources a { color: inherit; }

/* ── The hub and the family sheets ─────────────────────────────────── */

/* The hub: the kinds of page on forest, as the start page lists them. */
.hub .families { margin-top: var(--space-7); }
.hub .families ul {
  --focus: var(--on-forest);
  list-style: none;
  margin: 0;
  padding: var(--space-4) 28px;
  background: var(--forest);
  color: var(--on-forest);
  border-radius: var(--radius);
}
.hub .families li {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}
.hub .families a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding-block: 6px;
  color: var(--on-forest);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 640;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: var(--step-1);
  line-height: 1.2;
  letter-spacing: -0.015em;
}
/* The row is the target. */
.hub .families a::before { content: ""; position: absolute; inset: 0; }
.hub .families li::after {
  content: "";
  flex: none;
  width: 8px; height: 8px;
  margin: 0 4px 0 -4px;
  border-top: 2.5px solid currentColor;
  border-right: 2.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform .2s var(--ease-out);
}
.hub .families a { flex: 1; }
.hub .families li:hover a { color: #fff; }
.hub .families li:hover::after { transform: translateX(4px) rotate(45deg); }
.hub .families span { flex: none; min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; }

/* A family sheet: long by design, one hop from every page it lists. */
.hub .pages { margin-top: var(--space-7); }
.hub .pages ul {
  list-style: none;
  margin: 0;
  padding: var(--space-3) 24px;
  background: var(--surface);
  border-radius: var(--radius);
  columns: 2;
  column-gap: 40px;
}
.hub .pages li {
  break-inside: avoid;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.hub .pages a { display: inline-block; padding-block: 11px; line-height: 1.35; }
.hub .pages span {
  flex: none;
  color: var(--ink-muted);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}
.hub .back { margin: var(--space-5) 0 0; font-weight: 600; }
.hub .back a { display: inline-flex; align-items: center; min-height: 44px; }

/* ── The about page ────────────────────────────────────────────────── */

.about h1 { margin-top: var(--space-6); }
.about h2 { margin: var(--space-7) 0 var(--space-3); }

/* On a phone the lead is a long paragraph: body size, so the offer and
 * the list arrive sooner; the h1 above it still leads. */
@media (max-width: 640px) {
  .collection .lead { font-size: var(--step-0); line-height: 1.6; }
}

@media (max-width: 640px) {
  .collection { padding: 0 16px var(--space-8); }
  .cards { grid-template-columns: 1fr; gap: 10px; }
  .hub .pages ul { columns: 1; }
  .to-app { padding: var(--space-6) 20px; }
  .to-app.mid { padding: 20px; }
  .list, .faq, .nearby, .to-app { margin-top: var(--space-7); }
}
