/* ============================================================
   eats.css — Bloom Eats (bloomdaily.io/eats/)
   Copied into eats-build/eats/ by build_eats.py. Edit THIS file
   (eats-templates/eats.css), never the built copy.

   Layout: phone-first food feed (2-col masonry like Xiaohongshu)
   widening to 3–4 cols; post page = photo carousel + note + shop card.
   Brand: Purple #4E1F73 / Gold #DAB07B / Cream #FAF7F2 (bloom.css).
   ============================================================ */

:root {
  --purple: #4E1F73;
  --purple-deep: #2D1145;
  --gold: #DAB07B;
  --gold-deep: #A8783F;
  --bg: #FAF7F2;
  --card: #FFFFFF;
  --soft: #F4EFE9;
  --tint: #F5F0FA;
  --warm: #FBF4E9;
  --text: #2D1145;
  --body: #4A3B57;
  --muted: #7E6B94;
  --line: #E8DFF0;
  --shadow: 0 6px 22px rgba(78, 31, 115, 0.08);
  --f-head: "Cormorant Garamond", Georgia, serif;
  --f-body: "DM Sans", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --f-zh: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --r: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --purple: #C9A6EC; --purple-deep: #EBDDF8; --gold: #E2BD8D; --gold-deep: #E2BD8D;
    --bg: #17101F; --card: #221830; --soft: #2A1F38; --tint: #2C2040; --warm: #3A2C1A;
    --text: #F2EAF8; --body: #D3C6DF; --muted: #A493B8; --line: #3A2D4B;
    --shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--body);
  font-family: var(--f-body); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: var(--purple); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.wrap {
  max-width: 1120px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
[lang="zh-Hans"] { font-family: var(--f-zh); }

/* ---------- Header ---------- */
header.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand .bd { font-family: var(--f-head); font-weight: 700; font-size: 22px; color: var(--purple); line-height: 1; }
.brand .eats { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-deep); }
.top .free {
  font-size: 13px; font-weight: 600; color: var(--purple); text-decoration: none;
  border: 1px solid var(--line); background: var(--card);
  padding: 7px 14px; border-radius: 999px; white-space: nowrap;
}

/* ---------- Feed intro ---------- */
.intro { padding-block: 22px 6px; }
.intro h1 {
  font-family: var(--f-head); font-weight: 600; color: var(--text);
  font-size: clamp(30px, 6vw, 44px); line-height: 1.08; margin: 0; text-wrap: balance;
}
.intro h1 em { color: var(--gold-deep); font-style: italic; }
.intro p { margin: 8px 0 0; color: var(--muted); max-width: 60ch; }
.intro p[lang="zh-Hans"] { font-size: 14px; }

/* ---------- Filter chips ---------- */
.filters { display: grid; gap: 8px; padding-block: 16px 14px; }
.chiprow { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chiprow::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 500; color: var(--body);
}
.chip[aria-pressed="true"] { background: var(--purple); border-color: var(--purple); color: var(--bg); }
.chiplabel { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.no-js .filters { display: none; }

/* ---------- Masonry feed ---------- */
.feed { columns: 2; column-gap: 10px; padding-bottom: 32px; }
@media (min-width: 720px) { .feed { columns: 3; column-gap: 14px; } }
@media (min-width: 1000px) { .feed { columns: 4; } }
.note {
  break-inside: avoid; margin: 0 0 10px; display: block; text-decoration: none;
  background: var(--card); border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s ease;
  width: 100%;
}
/* .note sets display:block, which would beat the browser's [hidden] rule and break the filters */
.note[hidden] { display: none; }
@media (min-width: 720px) { .note { margin-bottom: 14px; } }
.note:hover { transform: translateY(-2px); }
.note .cover { position: relative; background: var(--soft); }
.note .cover img { width: 100%; height: 100%; object-fit: cover; }
.note .count, .note .badge-vid {
  position: absolute; top: 8px; background: rgba(20, 10, 30, .55); color: #fff;
}
.note .count { left: 8px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.note .badge-vid { right: 8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.note .badge-vid svg { width: 11px; height: 11px; fill: #fff; margin-left: 2px; }
/* minmax(0,1fr): a long area name must ellipsis, not push the card wider than its column */
.note .meta { padding: 9px 10px 11px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; }
.note .t { font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.35; }
.note .tz { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.note .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.note .area { display: flex; align-items: center; gap: 4px; min-width: 0; }
.note .area span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note .price { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--gold-deep); white-space: nowrap; }
.pin { width: 11px; height: 11px; flex: none; fill: currentColor; }
.empty { padding: 40px 0; text-align: center; color: var(--muted); }

/* ---------- Always-free box ---------- */
.free-box {
  margin: 0 0 44px; background: var(--tint); border-radius: var(--r);
  padding: 22px; display: grid; gap: 10px; scroll-margin-top: 80px;
}
.free-box h2 { margin: 0; font-family: var(--f-head); font-size: 26px; color: var(--text); font-weight: 600; }
.free-box p { margin: 0; max-width: 62ch; }
.free-box p[lang="zh-Hans"] { font-size: 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px;
  background: var(--purple); color: var(--bg); padding: 10px 18px; font-weight: 600; font-size: 14px;
  text-decoration: none; justify-self: start;
}
.btn.ghost { background: var(--card); color: var(--purple); border: 1px solid var(--line); }
.btn svg { width: 15px; height: 15px; fill: currentColor; }

/* ---------- Post page ---------- */
.crumb { padding-top: 12px; font-size: 13.5px; }
.crumb a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; }
.crumb svg { width: 16px; height: 16px; fill: currentColor; }
.post { padding-block: 14px 36px; display: grid; gap: 18px; }
@media (min-width: 900px) {
  .post { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; gap: 28px; }
  .post .gallery { position: sticky; top: 74px; }
}
.gallery { display: grid; gap: 8px; min-width: 0; }
.slides {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--r);
  scrollbar-width: none; max-width: 100%; background: var(--soft);
}
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; position: relative; }
.slide img, .slide video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.slide img { background: var(--soft); }
.stage { position: relative; min-width: 0; }
.arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0;
  background: rgba(255, 255, 255, .88); color: #2D1145; box-shadow: 0 2px 10px rgba(20, 10, 30, .25);
  display: grid; place-items: center;
}
.arrow svg { width: 22px; height: 22px; fill: currentColor; }
.arrow.prev { left: 10px; }
.arrow.next { right: 10px; }
.arrow[hidden] { display: none; }
.counter {
  position: absolute; top: 10px; right: 10px; z-index: 2; font-size: 12px; font-weight: 600;
  background: rgba(20, 10, 30, .55); color: #fff; padding: 2px 9px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.no-js .arrow, .no-js .counter { display: none; }
.dots { display: flex; justify-content: center; gap: 2px; }
/* 24px tap target around a 6px dot */
.dot { border: 0; background: none; padding: 9px 4px; display: grid; place-items: center; }
.dot::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--line); transition: width .2s; }
.dot.on::before { background: var(--purple); width: 16px; }
.no-js .dots { display: none; }
.credit { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }

.notebody { display: grid; gap: 16px; min-width: 0; }
.featured {
  display: inline-flex; align-items: center; gap: 7px; justify-self: start;
  border: 1px solid var(--gold); color: var(--gold-deep); background: var(--warm);
  font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px;
}
.featured svg { width: 13px; height: 13px; fill: currentColor; }
.notebody h1 { margin: 0; font-family: var(--f-head); font-weight: 600; font-size: clamp(30px, 5vw, 40px); line-height: 1.1; color: var(--text); text-wrap: balance; }
.notebody .h1zh { margin: -8px 0 0; font-size: 16px; color: var(--muted); }
.byline { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--purple); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.byline b { color: var(--text); font-weight: 600; }

.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--card); justify-self: start; }
.lang button { border: 0; background: none; padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--purple); color: var(--bg); }
.no-js .lang { display: none; }
.caption { display: grid; gap: 10px; font-size: 15.5px; color: var(--body); max-width: 62ch; }
.caption p { margin: 0; }
.caption[lang="zh-Hans"] { font-size: 15px; line-height: 1.75; }
.js .caption[hidden] { display: none; }
.tags { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 13.5px; color: var(--purple); font-weight: 500; }

.section-label { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.dishes { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.dishes li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dishes .dn { color: var(--text); font-weight: 500; min-width: 0; }
.dishes .dn small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.dishes .dp { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--gold-deep); white-space: nowrap; }

.shop { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; }
.shop h2 { margin: 0; font-family: var(--f-head); font-size: 22px; color: var(--text); font-weight: 600; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.checked { font-size: 12.5px; color: var(--muted); margin: 0; }
.more h2 { font-family: var(--f-head); font-size: 24px; color: var(--text); margin: 6px 0 12px; font-weight: 600; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 20;
  background: var(--purple-deep); color: var(--bg); padding: 10px 16px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; max-width: calc(100vw - 32px); overflow-wrap: anywhere;
}
.toast[hidden] { display: none; }

footer.foot { border-top: 1px solid var(--line); padding-block: 18px 28px; font-size: 12.5px; color: var(--muted); }
footer.foot a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
