/*
 * As páginas públicas do catálogo (`/postos/...`), geradas por
 * `scripts/build-pages.mjs`. HTML estático: este arquivo é todo o estilo.
 */
:root {
  --paper: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.1);
  --tint: #0071e3;
  --good: #248a3d;
  --good-bg: #e3f6e8;
  --watch: #b25000;
  --watch-bg: #fff1dc;
  --bad: #d70015;
  --bad-bg: #ffe5e7;
  --none-bg: #e8e8ed;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #000000;
    --card: #1c1c1e;
    --ink: #f5f5f7;
    --muted: #a1a1a6;
    --line: rgba(255, 255, 255, 0.14);
    --tint: #2997ff;
    --good: #30d158;
    --good-bg: rgba(48, 209, 88, 0.16);
    --watch: #ff9f0a;
    --watch-bg: rgba(255, 159, 10, 0.16);
    --bad: #ff453a;
    --bad-bg: rgba(255, 69, 58, 0.16);
    --none-bg: #2c2c2e;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
a { color: var(--tint); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0; letter-spacing: -0.025em; text-wrap: balance; }
h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.08; }
h2 { font-size: clamp(22px, 3vw, 28px); line-height: 1.15; }
p { margin: 0; }
small, em { font-style: normal; color: var(--muted); font-size: 14px; }

/* --- barra e rodapé --- */
.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: calc(8px + env(safe-area-inset-top)) 20px 8px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--line);
}
.mark { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 700; letter-spacing: -0.02em; }
.mark img { display: block; border-radius: 7px; }
.bar nav { display: flex; align-items: center; gap: 16px; font-size: 15px; font-weight: 600; }
.bar nav a:first-child { color: var(--ink); }
.cta {
  min-height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
}
.cta:hover { text-decoration: none; opacity: 0.88; }

main {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 20px 20px 56px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
article, section { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
article { gap: 32px; }
.foot {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 24px 20px calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --- trilha --- */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: var(--muted); }

/* --- cabeçalho da página --- */
.head { display: flex; align-items: center; gap: 18px; }
.head-list { flex-direction: column; align-items: flex-start; gap: 12px; }
.lede { color: var(--muted); font-size: clamp(17px, 2.2vw, 21px); line-height: 1.38; max-width: 60ch; }
.summary { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.fine { color: var(--muted); font-size: 14px; }

/* --- a nota --- */
.score {
  flex: none;
  min-width: 46px;
  height: 30px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.score-big { min-width: 84px; height: 84px; border-radius: 22px; font-size: 34px; letter-spacing: -0.03em; }
.score-good { background: var(--good-bg); color: var(--good); }
.score-watch { background: var(--watch-bg); color: var(--watch); }
.score-bad { background: var(--bad-bg); color: var(--bad); }
.score-none { background: var(--none-bg); color: var(--muted); }

/* --- números --- */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
}
.facts div { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--card); }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* --- botões --- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  min-height: 50px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 14px;
  background: var(--tint);
  color: #fff;
  font-weight: 600;
}
.button:hover { text-decoration: none; filter: brightness(1.08); }
.button-quiet { background: var(--card); color: var(--tint); border: 1px solid var(--line); }

/* --- tabela de amostras --- */
.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 12px 16px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
tbody tr { border-top: 1px solid var(--line); }
td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.tag-good { background: var(--good-bg); color: var(--good); }
.tag-bad { background: var(--bad-bg); color: var(--bad); }

/* --- listas --- */
.chips, .prices, .rows, .links { list-style: none; margin: 0; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 7px 13px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 15px; font-weight: 600; }
.prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.prices li { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.prices strong { font-size: 22px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.rows { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.rows li + li { border-top: 1px solid var(--line); }
.rows a { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 10px 16px; color: var(--ink); }
.rows a:hover { text-decoration: none; background: color-mix(in srgb, var(--tint) 8%, transparent); }
.rows a > span:not(.score) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rows strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows em { flex: none; }
/* Cidade grande tem centenas de linhas: o que está fora da tela não é desenhado. */
.rows-long li { content-visibility: auto; contain-intrinsic-size: auto 57px; }

.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.links a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
}
.links a:hover { text-decoration: none; border-color: var(--tint); }
.links em { flex: none; font-weight: 400; }

/* --- convite para o app --- */
.invite {
  scroll-margin-top: 72px;
  display: flex;
  gap: 18px;
  padding: 24px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--line);
}
.invite > img { flex: none; border-radius: 14px; }
.invite > div { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.invite p { color: var(--muted); }
.invite-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.badge { display: inline-flex; padding: 5px 10px; border-radius: 10px; background: #fff; line-height: 0; }

@media (max-width: 560px) {
  .head:not(.head-list) { align-items: flex-start; }
  .score-big { min-width: 68px; height: 68px; border-radius: 18px; font-size: 28px; }
  .rows em { display: none; }
  .invite { flex-direction: column; }
  .bar nav a:first-child { display: none; }
}
