:root {
  --bg: #fbf8f5;
  --surface: #ffffff;
  --fg: #1f1a17;
  --muted: #6e655e;
  --line: #e8e1da;
  --accent: #7a1f3d;
  --accent-fg: #ffffff;
  --chip: #f4e7ec;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151211;
    --surface: #1e1a18;
    --fg: #eee8e3;
    --muted: #a59c95;
    --line: #322c29;
    --accent: #e48aa8;
    --accent-fg: #1a0b10;
    --chip: #3a2229;
  }
}

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }

header.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.brand {
  display: inline-block;
  line-height: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 14px;
}

.site-nav a { color: var(--fg); text-decoration: none; }

.site-nav a:hover { color: var(--accent); }

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 16px;
}

h1, h2 { font-family: "Fraunces", Georgia, serif; }

h1 { font-size: 28px; font-weight: 700; line-height: 1.2; margin: 8px 0; }

h2 { font-size: 19px; font-weight: 600; }

.sub { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }

.intro p { color: var(--muted); margin-top: 0; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin: 16px 0 8px;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.filters label.check { flex-direction: row; align-items: center; gap: 6px; }

.filters label.search { flex: 1 1 220px; }

.filters input[type="number"], .filters input[type="search"], .filters select {
  font: inherit;
  width: 130px;
  padding: 6px 8px;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.filters input[type="search"] { width: 100%; }

.list { list-style: none; margin: 0; padding: 0; }

.list li { border-bottom: 1px solid var(--line); }

.row {
  display: grid;
  grid-template-columns: 44px 1fr 96px 112px;
  gap: 16px;
  align-items: center;
  padding: 12px 4px;
  color: inherit;
  text-decoration: none;
}

.row:hover { background: var(--surface); }

.row .thumb {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.row.head { padding: 6px 4px; border-bottom: 1px solid var(--line); }

.row.head button {
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* Every cell has a fixed column. The header and a wine with no ML photo
   yet have no thumbnail, and without these rules the name would slide
   into the 44px photo column (live 2026-10-31). */
.row .thumb { grid-column: 1; }

.row .name { grid-column: 2; }

.row .rating { grid-column: 3; }

.row .price { grid-column: 4; }

.row.head .name { justify-self: start; }

.row.head .rating, .row.head .price { justify-self: end; }

.row.head button[aria-pressed="true"] { color: var(--accent); font-weight: 600; }

.row.head button::after { content: attr(data-seta); margin-left: 4px; }

.row .name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

.row .rating, .row .price { text-align: right; white-space: nowrap; }

.row .rating { font-weight: 600; }

.row .price { font-weight: 700; color: var(--accent); }

.chip {
  display: inline-block;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--chip);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}

.wine .photo {
  display: block;
  width: 220px;
  height: 320px;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 12px 0;
}

.wine .winery { color: var(--muted); margin: 0; }

.wine .meta { color: var(--muted); margin-top: 0; }

.facts { display: grid; gap: 12px; margin: 24px 0; }

.facts div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
}

.facts dt { color: var(--muted); font-size: 13px; }

.facts dd { margin: 0; font-size: 24px; font-weight: 700; }

.facts dd.stale { color: var(--muted); }

/* burst-05 item 6: the price-history block sits in its own .facts div like
   the others, but its dd carries a chip and an inline sparkline rather than
   a single number, so it needs a smaller size and the svg on its own line. */
.history dd { font-size: 16px; font-weight: 400; }

.history .sparkline { display: block; margin-top: 8px; color: var(--accent); }

.chip.baixou { color: var(--accent); }

.list.drops { list-style: none; margin: 0; padding: 0; }

.list.drops li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.list.drops .sub { margin-left: auto; font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.button {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}

.button.primary { background: var(--accent); color: var(--accent-fg); }

.note { color: var(--muted); font-size: 13px; }

footer {
  max-width: 880px;
  margin: 32px auto 0;
  padding: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

footer p.fresh { margin-top: 12px; }

footer p.links a { color: var(--muted); margin-right: 4px; }

.static h2 { font-size: 18px; margin: 24px 0 4px; }

.static p { color: var(--muted); }

.hub-index { list-style: none; margin: 16px 0 0; padding: 0; }

.hub-index li { padding: 8px 0; border-bottom: 1px solid var(--line); }

.hub-index a { font-weight: 600; }

.similar, .wine-hubs {
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.similar ul, .wine-hubs ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.similar li a, .wine-hubs li a {
  display: block;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  font-size: 14px;
}

.similar li a .sub { margin-top: 2px; }

.wine-hubs li a { color: var(--accent); font-weight: 600; }

/* burst-06 item 3: up to 3 "other offers" below the facts, same shape as
   .list.drops's rows (a link, then a right-aligned value). */
.offers {
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.offers ul { list-style: none; margin: 8px 0 0; padding: 0; }

.offers li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.offers .price { margin-left: auto; font-weight: 700; color: var(--accent); }

/* burst-05 item 3: index rows become cards (photo, name, nota, price) below
   640px. Same 4-column grid as desktop, just narrower, so the header's
   explicit grid-column rules above still line each button up with its
   column — no JS change needed, the filter/sort logic never reads layout. */
@media (max-width: 640px) {
  .row { gap: 10px; grid-template-columns: 36px 1fr 64px 92px; }
  .row .thumb { width: 36px; height: 36px; }
  .filters input[type="number"], .filters select { width: 110px; }
  header.top { justify-content: flex-start; }
}

/* Ficha técnica: a compact two-column sheet, not the big price cards above.
   Values are sentences from the profile, so normal weight and size. */
.spec { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; margin: 12px 0 24px; }

.spec div { display: contents; }

.spec dt, .spec dd { padding: 10px 0; border-top: 1px solid var(--line); }

.spec dt { color: var(--muted); font-size: 14px; padding-right: 16px; }

.spec dd { margin: 0; font-size: 15px; line-height: 1.5; }

.sources { color: var(--muted); font-size: 12px; white-space: nowrap; }

.sources a { color: var(--muted); }

@media (max-width: 640px) {
  .spec { grid-template-columns: 1fr; }
  .spec dt { padding-bottom: 0; border-top: 1px solid var(--line); }
  .spec dd { padding-top: 2px; border-top: 0; }
}
