:root {
  color-scheme: light;
  --bg: #fbfcf8;
  --surface: #ffffff;
  --ink: #16211f;
  --muted: #5f6f6a;
  --line: #dfe7df;
  --accent: #0f766e;
  --secondary: #e11d48;
  --focus: #f59e0b;
  --max: 1120px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
}

body {
  margin: 0;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--accent), transparent 45%);
  text-decoration-thickness: 0.11em;
  text-underline-offset: 0.18em;
}

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

img {
  display: block;
  height: auto;
  max-width: 100%;
}

.skip-link {
  background: var(--focus);
  color: #111;
  left: 1rem;
  padding: 0.6rem 0.8rem;
  position: absolute;
  top: -10rem;
  z-index: 20;
}

.skip-link:focus {
  top: 1rem;
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg), transparent 8%);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner,
.hero,
.content-grid,
.footer-inner {
  margin: 0 auto;
  max-width: var(--max);
  padding-left: clamp(1rem, 3vw, 2rem);
  padding-right: clamp(1rem, 3vw, 2rem);
}

.topbar-inner {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-height: 72px;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-size: 1rem;
  font-weight: 800;
  gap: 0.55rem;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  border-radius: 8px;
  display: inline-block;
  height: 1.1rem;
  width: 1.1rem;
}

.nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.nav a,
.accessibility button {
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  padding: 0.45rem 0.6rem;
  text-decoration: none;
}

.nav a[aria-current="page"],
.nav a:hover,
.accessibility button:hover {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.accessibility {
  align-items: center;
  display: flex;
  gap: 0.25rem;
}

.accessibility button {
  background: transparent;
  cursor: pointer;
  min-width: 2.2rem;
}

.hero {
  padding-bottom: clamp(2.4rem, 5vw, 4rem);
  padding-top: clamp(2.8rem, 7vw, 6rem);
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 0.9rem;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  line-height: 1.08;
}

h1 {
  font-size: clamp(2.2rem, 7vw, 5.4rem);
  margin: 0;
  max-width: 12ch;
}

.hero p {
  color: var(--muted);
  font-size: clamp(1.02rem, 2vw, 1.24rem);
  line-height: 1.65;
  margin: 1.1rem 0 0;
  max-width: 720px;
}

.content-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr) 280px;
  padding-bottom: 4rem;
}

.post-list {
  display: grid;
  gap: 1rem;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 1rem;
  grid-template-columns: 180px minmax(0, 1fr);
  overflow: hidden;
}

.post-card-media {
  background: color-mix(in srgb, var(--accent), transparent 88%);
  min-height: 150px;
}

.post-card-media img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.post-card-body {
  padding: 1rem 1rem 1rem 0;
}

.meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.78rem;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.post-card h2 {
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
  margin: 0 0 0.55rem;
}

.post-card p,
.sidebar p,
.article-body {
  color: var(--muted);
  line-height: 1.7;
}

.post-card p {
  margin: 0;
}

.sidebar {
  align-self: start;
  border-left: 1px solid var(--line);
  padding-left: 1rem;
  position: sticky;
  top: 96px;
}

.sidebar h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.ad-slot {
  align-items: center;
  background: repeating-linear-gradient(135deg, #f5f7f2, #f5f7f2 12px, #eef4ee 12px, #eef4ee 24px);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-size: 0.76rem;
  justify-content: center;
  min-height: 120px;
  padding: 1rem;
  text-align: center;
}

.article {
  margin: 0 auto;
  max-width: 820px;
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 3vw, 2rem);
}

.article h1 {
  max-width: 14ch;
}

.article-body {
  color: var(--ink);
  font-size: 1.04rem;
  margin-top: 2rem;
}

.article-body h2,
.article-body h3 {
  color: var(--ink);
  margin-top: 2.1rem;
}

.article-body p,
.article-body li {
  color: color-mix(in srgb, var(--ink), var(--muted) 25%);
}

.article-body pre {
  background: #111827;
  border-radius: 8px;
  color: #f8fafc;
  overflow-x: auto;
  padding: 1rem;
}

.article-cover {
  border-radius: 8px;
  margin-top: 1.5rem;
  overflow: hidden;
}

.disclosure {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #7c2d12;
  font-size: 0.88rem;
  margin: 1.5rem 0;
  padding: 0.8rem 1rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: space-between;
  padding-bottom: 2rem;
  padding-top: 2rem;
}

html[data-contrast="high"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #000000;
  --muted: #1f2937;
  --line: #111111;
}

html[data-font="large"] {
  font-size: 20px;
}

@media (max-width: 820px) {
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
    padding-bottom: 0.8rem;
    padding-top: 0.8rem;
  }

  .nav {
    justify-content: flex-start;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 1rem;
    position: static;
  }

  .post-card {
    grid-template-columns: 1fr;
  }

  .post-card-body {
    padding: 1rem;
  }
}

/* --- Acessibilidade v0.2: escala de fonte, alto contraste e inversao de cores --- */
html[data-fontlevel="0"] { font-size: 14px; }
html[data-fontlevel="1"] { font-size: 16px; }
html[data-fontlevel="2"] { font-size: 18px; }
html[data-fontlevel="3"] { font-size: 20px; }
html[data-fontlevel="4"] { font-size: 23px; }
html[data-fontlevel="5"] { font-size: 26px; }
html[data-fontlevel="6"] { font-size: 30px; }

html[data-contrast="high"] a {
  text-decoration-color: currentColor;
}

html[data-contrast="high"] .ad-slot,
html[data-contrast="high"] .post-card {
  border-color: #111111;
}

html[data-invert="1"] {
  background: #000;
}

html[data-invert="1"] body {
  background: var(--bg);
  filter: invert(1) hue-rotate(180deg);
}

html[data-invert="1"] img,
html[data-invert="1"] video,
html[data-invert="1"] iframe {
  filter: invert(1) hue-rotate(180deg);
}

.lang-switch {
  align-items: center;
  display: flex;
  gap: 0.15rem;
}

.lang-switch a {
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.5rem;
  text-decoration: none;
}

.lang-switch a[aria-current="true"],
.lang-switch a:hover {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.accessibility button:focus-visible,
.lang-switch a:focus-visible,
.nav a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* --- Banner de consentimento LGPD --- */
.consent {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  bottom: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  left: 50%;
  max-width: 640px;
  padding: 1rem 1.2rem;
  position: fixed;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  z-index: 50;
}

.consent p {
  font-size: 0.92rem;
  margin: 0 0 0.8rem;
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.consent button {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.55rem 1rem;
}

.consent button.secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.consent button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ===== v0.4 — Refinamento visual, AdSense e retencao ===== */

/* Hero mais editorial */
.hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.3rem);
  line-height: 1.06;
  margin: 0 0 1rem;
  max-width: 21ch;
}

.hero p {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 58ch;
}

.hero .eyebrow::before {
  background: linear-gradient(90deg, var(--accent), var(--secondary));
  border-radius: 2px;
  content: "";
  display: inline-block;
  height: 3px;
  margin-right: 0.5rem;
  vertical-align: middle;
  width: 2rem;
}

/* Cards com profundidade sutil e hover */
.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(22, 33, 31, 0.04);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.post-card:hover {
  box-shadow: 0 14px 30px rgba(22, 33, 31, 0.1);
  transform: translateY(-2px);
}

.post-card h2 {
  font-size: 1.22rem;
  line-height: 1.25;
}

.post-card h2 a {
  text-decoration: none;
}

.post-card h2 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.post-card-media img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.35s ease;
  width: 100%;
}

.post-card:hover .post-card-media img {
  transform: scale(1.03);
}

.meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.78rem;
  font-weight: 700;
  gap: 0.4rem 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.meta span:first-child {
  color: var(--accent);
}

/* Tipografia do artigo */
.article article {
  margin: 0 auto;
  max-width: 70ch;
}

.article h1 {
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  line-height: 1.12;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.78;
}

.article-body h2 {
  border-left: 4px solid var(--accent);
  font-size: 1.45rem;
  margin: 2.2rem 0 0.9rem;
  padding-left: 0.7rem;
}

.article-body h3 {
  font-size: 1.15rem;
  margin: 1.8rem 0 0.7rem;
}

.article-body p {
  margin: 0 0 1.15rem;
}

.article-body img {
  border-radius: 12px;
}

.article-body blockquote {
  border-left: 4px solid var(--secondary);
  color: var(--muted);
  font-style: italic;
  margin: 1.4rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
}

.article-cover img {
  border-radius: 16px;
  width: 100%;
}

/* Nota de traducao (retencao bilingue) */
.translation-note {
  background: color-mix(in srgb, var(--accent), transparent 92%);
  border: 1px solid color-mix(in srgb, var(--accent), transparent 70%);
  border-radius: 10px;
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.45rem 0.8rem;
}

.translation-note a {
  color: var(--accent);
  text-decoration: none;
}

/* Blocos AdSense: rotulados e sem "pulo" de layout */
.ad-unit {
  margin: 1.6rem 0;
  text-align: center;
}

.ad-unit .ad-label {
  color: var(--muted);
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.ad-unit ins.adsbygoogle {
  background: color-mix(in srgb, var(--line), transparent 60%);
  border-radius: 10px;
  min-height: 100px;
}

.ad-unit-empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 0.6rem 0;
}

.sidebar .ad-unit ins.adsbygoogle {
  min-height: 250px;
}

/* Leia tambem (referencias cruzadas) */
.related {
  border-top: 1px solid var(--line);
  margin: 2.5rem auto 0;
  max-width: 70ch;
  padding-top: 1.6rem;
}

.related h2 {
  font-size: 1.25rem;
  margin: 0 0 1rem;
}

.related-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.related-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.related-card:hover {
  box-shadow: 0 10px 24px rgba(22, 33, 31, 0.1);
  transform: translateY(-2px);
}

.related-media img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}

.related-body {
  padding: 0.8rem 0.9rem 1rem;
}

.related-cat {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.related-body h3 {
  font-size: 0.98rem;
  line-height: 1.3;
  margin: 0.35rem 0 0;
}

.related-body h3 a {
  text-decoration: none;
}

.related-body h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Rodape mais organizado */
.footer-inner a {
  text-decoration: none;
}

.footer-inner a:hover {
  color: var(--accent);
  text-decoration: underline;
}

@media (max-width: 820px) {
  .related-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== v0.5 — Cards de afiliados ===== */
.af-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(22, 33, 31, 0.05);
  display: flex;
  gap: 1rem;
  margin: 1.8rem 0;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.af-card:hover {
  box-shadow: 0 12px 28px rgba(22, 33, 31, 0.12);
  transform: translateY(-2px);
}

.af-amazon { border-top: 4px solid #ff9900; }
.af-mercadolivre { border-top: 4px solid #ffe600; }
.af-outro { border-top: 4px solid var(--accent); }

.af-media {
  align-items: center;
  background: #fff;
  display: flex;
  flex: 0 0 170px;
  justify-content: center;
}

.af-media img {
  max-height: 170px;
  object-fit: contain;
  width: 100%;
}

.af-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem 0.9rem;
}

.af-store {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.af-store-amazon { color: #b36b00; }
.af-store-mercadolivre { color: #8a7b00; }

.af-title {
  font-size: 1.08rem;
  line-height: 1.3;
  margin: 0;
}

.af-title a {
  color: var(--ink);
  text-decoration: none;
}

.af-title a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.af-desc {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0;
}

.af-foot {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin-top: 0.35rem;
}

.af-price {
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 800;
}

.af-cta {
  background: var(--accent);
  border-radius: 10px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.5rem 0.95rem;
  text-decoration: none;
  transition: filter 0.15s ease;
}

.af-cta:hover {
  filter: brightness(1.08);
}

.af-disclosure {
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 0.3rem;
}

@media (max-width: 640px) {
  .af-card {
    flex-direction: column;
  }
  .af-media {
    flex-basis: auto;
    max-height: 200px;
  }
}
