:root {
  --bg: #fbf6ee;
  --surface: #ffffff;
  --ink: #1b120c;
  --muted: #6b5b4e;
  --line: #eadfce;
  --gold: #e8a317;
  --gold-ink: #7a4f00;
  --terra: #b5452b;
  --green: #1f7a4d;
  --green-soft: #e3f3ea;
  --hero: #1b120c;
  --hero-ink: #fbf1df;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(27 18 12 / .06), 0 6px 20px rgb(27 18 12 / .06);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #140d08;
    --surface: #1f1610;
    --ink: #f6ece0;
    --muted: #bba996;
    --line: #3a2c21;
    --gold-ink: #f3c156;
    --green: #5fd398;
    --green-soft: #12301f;
    --hero: #0c0805;
    --shadow: 0 1px 2px rgb(0 0 0 / .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 Inter, system-ui, sans-serif;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Hero com padrão geométrico inspirado em tecidos africanos */
.hero {
  background:
    radial-gradient(circle at 12px 12px, rgb(232 163 23 / .18) 2px, transparent 3px) 0 0 / 24px 24px,
    linear-gradient(135deg, var(--hero) 0%, #2b1a10 60%, #4a2414 100%);
  color: var(--hero-ink);
  padding: 48px 0 32px;
  border-bottom: 6px solid var(--gold);
  box-shadow: inset 0 -6px 0 var(--terra), inset 0 -12px 0 var(--green);
}
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: var(--gold); font-weight: 600; }
h1 { font-family: Fraunces, Georgia, serif; font-weight: 800; font-size: clamp(40px, 8vw, 72px); line-height: 1; margin: 8px 0 12px; }
h1 span { color: var(--gold); }
.lede { max-width: 640px; margin: 0 0 24px; color: #e6d6c1; }
.search input {
  width: 100%;
  max-width: 640px;
  padding: 14px 18px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: #fffaf2;
  color: #1b120c;
  font-size: 17px;
}
.search input:focus { outline: none; border-color: var(--gold); }
.stats { margin: 12px 0 0; color: #e6d6c1; font-size: 14px; }

/* Categorias */
.cats { display: flex; gap: 8px; overflow-x: auto; padding-top: 20px; padding-bottom: 8px; scrollbar-width: thin; }
.cat {
  flex: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.cat small { color: var(--muted); margin-left: 4px; }
.cat[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cat[aria-pressed="true"] small { color: inherit; opacity: .7; }

/* Layout */
.layout { display: grid; grid-template-columns: 250px 1fr; gap: 28px; padding-top: 16px; padding-bottom: 48px; }
.filters { position: sticky; top: 16px; align-self: start; display: grid; gap: 14px; }
.filters-head { display: flex; justify-content: space-between; align-items: baseline; }
.filters h2 { margin: 0; font-size: 18px; }
.filters label, .toolbar label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
select {
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
}
.toggle { display: flex !important; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--green-soft); color: var(--green) !important; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--green); }
.link { background: none; border: 0; padding: 0; color: var(--terra); font-weight: 600; cursor: pointer; font-size: 14px; }

.results { min-width: 0; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 20px; }
.toolbar label { min-width: 200px; }
.btn-filters { display: none; }

/* Destaque de grátis */
.highlight {
  background: var(--green-soft);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 28px;
}
.highlight-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.highlight h2 { margin: 0; color: var(--green); font-family: Fraunces, Georgia, serif; font-size: 24px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 280px); gap: 14px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.rail .card { scroll-snap-align: start; }
.rail .desc { display: none; }

/* Grupos e cards */
.group + .group { margin-top: 32px; }
.group > h2 { font-family: Fraunces, Georgia, serif; font-size: 24px; margin: 0 0 14px; text-transform: capitalize; }
.group > h2 small { font-family: Inter, sans-serif; font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card.is-free { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), var(--shadow); }
.card-img { display: block; aspect-ratio: 2 / 1; background: var(--line); }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img.no-img {
  background:
    repeating-linear-gradient(45deg, var(--gold) 0 10px, var(--terra) 10px 20px, var(--ink) 20px 30px, var(--green) 30px 40px);
  opacity: .45;
}
.card-img.no-img img { display: none; }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13px; }
.price { font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #fdf0d2; color: var(--gold-ink); white-space: nowrap; }
@media (prefers-color-scheme: dark) { .price { background: #3a2a0c; } }
.price[data-range="gratis"] { background: var(--green); color: #fff; }
.price[data-range="consultar"] { background: var(--line); color: var(--muted); font-weight: 600; }
.date { color: var(--muted); text-align: right; }
.card h3 { margin: 2px 0 0; font-size: 17px; line-height: 1.3; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.where { margin: 0; font-size: 14px; color: var(--muted); }
.desc { margin: 0; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.chips { list-style: none; margin: auto 0 0; padding: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 0; background: var(--bg); border-radius: 6px; padding: 3px 8px; font-size: 12px; cursor: pointer; }
.chips button:hover { background: var(--line); }
.chips .src { font-size: 12px; color: var(--muted); padding: 3px 0; margin-left: auto; }

.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius); }
.more { display: block; margin: 28px auto 0; padding: 12px 28px; border-radius: 999px; border: 2px solid var(--ink); background: none; font-weight: 600; cursor: pointer; }
.more:hover { background: var(--ink); color: var(--bg); }

.foot { border-top: 1px solid var(--line); padding-top: 20px; padding-bottom: 40px; font-size: 13px; color: var(--muted); }
.foot .visits { font-size: 11px; opacity: .7; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .filters { display: none; position: static; padding: 16px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
  .filters.open { display: grid; }
  .layout { display: flex; flex-direction: column; }
  .results { order: 2; }
  .btn-filters { display: inline-block; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--ink); background: var(--surface); font-weight: 600; cursor: pointer; }
  .toolbar label { min-width: 0; flex: 1 1 140px; }
}
