/* =========================================================
   Tesouraria — Estilo do Projeto Comunitário
   Paleta: terracota + olive + creme + marrom quente
   Tipografia: mixed-newsroom (serif para títulos, sans para corpo)
   ========================================================= */

:root {
  --terracota: #a8472a;
  --terracota-escuro: #8a3820;
  --oliva: #6b7a3a;
  --oliva-escuro: #555f2d;
  --creme: #f7f2e8;
  --creme-card: #fbf7ee;
  --creme-escuro: #efe7d4;
  --marrom: #2a2017;
  --marrom-suave: #4a3d2e;
  --marrom-claro: #7a6a55;
  --linha: #e2d8c2;
  --sombra: 0 2px 6px rgba(42, 32, 23, .08), 0 8px 24px rgba(42, 32, 23, .06);
  --sombra-forte: 0 4px 12px rgba(42, 32, 23, .12), 0 16px 40px rgba(42, 32, 23, .1);
  --max: 1180px;
  --serif: "Georgia", "Charter", "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
}

[data-theme="dark"] {
  --creme: #1f1a14;
  --creme-card: #271f17;
  --creme-escuro: #2e251b;
  --marrom: #f3ead8;
  --marrom-suave: #d8cab0;
  --marrom-claro: #b3a187;
  --linha: #3a2f22;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--creme);
  color: var(--marrom);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--terracota); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

img, svg { max-width: 100%; display: block; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- Cabeçalho / Split-nav ---------- */
.topbar {
  background: var(--creme);
  border-bottom: 1px solid var(--linha);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(1.1);
}

.topbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 14px;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  color: var(--marrom);
  letter-spacing: -0.5px;
}
.brand-tag {
  font-size: 11px;
  color: var(--marrom-claro);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: -2px;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  background: transparent;
  border: 1px solid var(--linha);
  color: var(--marrom-suave);
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--creme-escuro); border-color: var(--marrom-claro); }

.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--marrom);
  cursor: pointer;
  width: 38px; height: 38px;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
}
.menu-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--marrom); border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 0 14px;
  flex-wrap: wrap;
}
.nav-row a {
  color: var(--marrom-suave);
  font-size: 14px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 6px;
  letter-spacing: 0.2px;
}
.nav-row a:hover { background: var(--creme-escuro); color: var(--terracota); text-decoration: none; }
.nav-row a.ativa { color: var(--terracota); }
.nav-spacer { flex: 1; }
.nav-date { font-size: 12px; color: var(--marrom-claro); font-style: italic; }

/* ---------- Tipografia editorial ---------- */
h1, h2, h3, h4 { font-family: var(--serif); color: var(--marrom); line-height: 1.2; letter-spacing: -0.3px; }
h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 700; margin: 0 0 12px; }
h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 700; margin: 0 0 14px; }
h3 { font-size: 22px; font-weight: 700; margin: 0 0 10px; }
h4 { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
p { margin: 0 0 16px; }

.eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--terracota);
  margin-bottom: 10px;
}

.byline {
  font-size: 13px;
  color: var(--marrom-claro);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.byline .dot { width: 3px; height: 3px; background: var(--marrom-claro); border-radius: 50%; display: inline-block; }
.byline a { color: var(--marrom-suave); font-weight: 600; }

.kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--oliva);
  margin-bottom: 8px;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform .1s, background .15s, color .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--terracota); color: #fff; }
.btn-primary:hover { background: var(--terracota-escuro); color: #fff; }
.btn-ghost { background: transparent; color: var(--terracota); border-color: var(--terracota); }
.btn-ghost:hover { background: var(--terracota); color: #fff; }

/* ---------- Seções ---------- */
section { padding: 40px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 26px;
  border-bottom: 2px solid var(--marrom);
  padding-bottom: 10px;
}
.section-head h2 { margin: 0; }
.section-head .more { font-size: 14px; font-weight: 600; color: var(--terracota); }
.section-rule { border: none; border-top: 2px solid var(--marrom); margin: 0 0 26px; }

/* ---------- Bloco de campanha ---------- */
.campaign-feature { padding: 18px 0 0; }
.campaign-box {
  background: var(--creme-card);
  border: 1px solid var(--linha);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--sombra);
}
.campaign-box[hidden] { display: none; }
.campaign-creative img,
.campaign-creative [data-cmp-creative] {
  width: 100%;
  height: auto;
  display: block;
  max-height: 420px;
  object-fit: cover;
}
.campaign-info { padding: 20px 24px 24px; }
.campaign-info-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.campaign-info-row [data-cmp-logo] {
  max-height: 40px;
  width: auto;
  flex-shrink: 0;
}
.campaign-info h2 { font-size: 22px; margin: 0; flex: 1; }
.campaign-info p { color: var(--marrom-suave); margin-bottom: 14px; }
[data-cmp-logo].brand-mark { max-height: 36px; width: auto; }
footer [data-cmp-logo] { max-height: 34px; width: auto; margin-bottom: 10px; }

/* ---------- Homepage: destaque ---------- */
.hero { padding-top: 28px; }

/* ---------- Faixa local PME ---------- */
.pme-strip {
  background: var(--oliva);
  color: var(--creme);
  padding: 10px 0;
  font-size: 13px;
}
.pme-strip .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.pme-strip b { color: #fff; }
.pme-strip .note { font-style: italic; opacity: .9; }

/* ---------- Colunas mistas (revista) ---------- */
.magazine {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: start;
}
.magazine-side { display: flex; flex-direction: column; gap: 22px; }
.brief {
  padding: 18px 20px;
  background: var(--creme-card);
  border-radius: 10px;
  border: 1px solid var(--linha);
}
.brief h3 { font-size: 17px; margin-bottom: 6px; }
.brief p { font-size: 14.5px; color: var(--marrom-suave); margin: 0; }
.brief .meta { font-size: 12px; color: var(--marrom-claro); margin-top: 8px; }

/* ---------- Formulário de contato ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.contact-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--linha);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  background: var(--creme-card);
  color: var(--marrom);
  margin-bottom: 16px;
}
.contact-form textarea { min-height: 140px; resize: vertical; }
.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  outline: 2px solid var(--terracota);
  border-color: var(--terracota);
}
.contact-card {
  background: var(--creme-escuro);
  border-radius: 10px;
  padding: 28px;
  border: 1px solid var(--linha);
}
.contact-card h3 { margin-bottom: 12px; }
.contact-card p { font-size: 15px; }

/* ---------- Equipe (about) ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
  margin: 30px 0;
}
.team-card {
  background: var(--creme-card);
  border: 1px solid var(--linha);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  box-shadow: var(--sombra);
}
.team-card img, .team-card svg { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 14px; }
.team-card h3 { font-size: 18px; margin-bottom: 4px; }
.team-card .role { font-size: 13px; color: var(--oliva); font-weight: 600; margin-bottom: 10px; }
.team-card p { font-size: 14.5px; color: var(--marrom-suave); margin: 0; }

.featured {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 36px;
  align-items: center;
}
.featured-media { border-radius: 10px; overflow: hidden; box-shadow: var(--sombra); }
.featured-media svg { width: 100%; height: auto; display: block; }
.featured-body h1 { margin-top: 6px; }
.featured-dek {
  font-size: 19px;
  color: var(--marrom-suave);
  margin-bottom: 18px;
  line-height: 1.5;
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card {
  background: var(--creme-card);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--sombra);
  border: 1px solid var(--linha);
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--sombra-forte); }
.card-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--creme-escuro); }
.card-media svg { width: 100%; height: 100%; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--oliva);
  margin-bottom: 8px;
}
.card-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.25;
  margin: 0 0 8px;
  color: var(--marrom);
}
.card-title a { color: inherit; }
.card-title a:hover { color: var(--terracota); text-decoration: none; }
.card-excerpt { font-size: 15px; color: var(--marrom-suave); margin: 0 0 14px; flex: 1; }
.card-meta { font-size: 12.5px; color: var(--marrom-claro); }

/* ---------- Comunidade / vozes ---------- */
.community {
  background: var(--creme-escuro);
  border-top: 1px solid var(--linha);
  border-bottom: 1px solid var(--linha);
}
.voices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.voice {
  background: var(--creme-card);
  border-radius: 10px;
  padding: 24px;
  box-shadow: var(--sombra);
  border-left: 4px solid var(--terracota);
}
.voice blockquote {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  color: var(--marrom);
  font-style: italic;
}
.voice-person { display: flex; align-items: center; gap: 12px; }
.voice-avatar { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; }
.voice-name { font-weight: 700; font-size: 14px; color: var(--marrom); }
.voice-role { font-size: 12.5px; color: var(--marrom-claro); }

/* ---------- Newsletter ---------- */
.newsletter {
  background: var(--marrom);
  color: var(--creme);
  border-radius: 12px;
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: center;
}
.newsletter h2 { color: var(--creme); margin-bottom: 8px; }
.newsletter p { color: var(--creme-escuro); margin-bottom: 0; font-size: 15px; }
.newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--marrom-claro);
  background: #fff;
  color: var(--marrom);
  font-size: 15px;
  font-family: inherit;
}
.newsletter-form input[type="email"]:focus { outline: 2px solid var(--terracota); border-color: var(--terracota); }

/* ---------- Layout de artigo (sidebar) ---------- */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 50px;
  align-items: start;
  padding-top: 30px;
}
.article-main { min-width: 0; }
.article-head { margin-bottom: 28px; border-bottom: 1px solid var(--linha); padding-bottom: 22px; }
.article-head h1 { font-size: clamp(26px, 3.6vw, 38px); }
.article-dek { font-size: 19px; color: var(--marrom-suave); margin: 8px 0 16px; line-height: 1.5; }
.article-hero { border-radius: 10px; overflow: hidden; margin-bottom: 28px; box-shadow: var(--sombra); }
.article-body { font-size: 18px; line-height: 1.75; color: var(--marrom); }
.article-body p { margin-bottom: 20px; }
.article-body h2 { font-size: 26px; margin: 36px 0 14px; }
.article-body h3 { font-size: 20px; margin: 28px 0 10px; }
.article-body ul, .article-body ol { margin: 0 0 20px; padding-left: 24px; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  border-left: 4px solid var(--terracota);
  margin: 24px 0;
  padding: 8px 0 8px 22px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--marrom-suave);
}
.article-body strong { color: var(--marrom); }

.callout {
  background: var(--creme-escuro);
  border-radius: 10px;
  padding: 22px 26px;
  margin: 28px 0;
  border-left: 4px solid var(--oliva);
}
.callout .kicker { color: var(--oliva-escuro); margin-bottom: 6px; }
.callout p:last-child { margin-bottom: 0; }

.article-tags { margin: 30px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 12px;
  padding: 5px 12px;
  background: var(--creme-escuro);
  border-radius: 999px;
  color: var(--marrom-suave);
  font-weight: 600;
}

.author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border-top: 1px solid var(--linha);
  border-bottom: 1px solid var(--linha);
  padding: 22px 0;
  margin: 28px 0;
}
.author-box img, .author-box svg { width: 64px; height: 64px; border-radius: 50%; }
.author-box h4 { margin-bottom: 4px; }
.author-box p { font-size: 14.5px; color: var(--marrom-suave); margin: 0; }

/* ---------- Sidebar ---------- */
.sidebar { position: sticky; top: 130px; display: flex; flex-direction: column; gap: 28px; }
.side-block { background: var(--creme-card); border: 1px solid var(--linha); border-radius: 10px; padding: 22px; box-shadow: var(--sombra); }
.side-block h3 { font-size: 18px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--terracota); }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { padding: 12px 0; border-bottom: 1px dashed var(--linha); }
.side-list li:last-child { border-bottom: none; }
.side-list a { font-weight: 700; font-size: 15px; color: var(--marrom); display: block; line-height: 1.3; }
.side-list a:hover { color: var(--terracota); }
.side-list .meta { font-size: 12px; color: var(--marrom-claro); margin-top: 4px; font-weight: 400; }

/* ---------- Página simples / estática ---------- */
.page { padding-top: 30px; }
.page-head { margin-bottom: 30px; border-bottom: 2px solid var(--marrom); padding-bottom: 16px; }
.page-head .eyebrow { margin-bottom: 6px; }
.prose { max-width: 720px; font-size: 18px; line-height: 1.75; }
.prose h2 { font-size: 24px; margin: 32px 0 12px; }
.prose ul, .prose ol { padding-left: 22px; margin-bottom: 18px; }
.prose li { margin-bottom: 8px; }

/* ---------- Listagem de artigos ---------- */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.filter-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--linha);
  background: var(--creme);
  color: var(--marrom-suave);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.filter-btn:hover { border-color: var(--terracota); color: var(--terracota); }
.filter-btn.active { background: var(--terracota); color: #fff; border-color: var(--terracota); }

.list-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--linha);
  align-items: start;
}
.list-row:hover .list-title { color: var(--terracota); }
.list-thumb { border-radius: 8px; overflow: hidden; aspect-ratio: 16/10; background: var(--creme-escuro); }
.list-thumb svg { width: 100%; height: 100%; }
.list-title { font-family: var(--serif); font-size: 22px; font-weight: 700; margin: 0 0 8px; color: var(--marrom); line-height: 1.25; }
.list-title a { color: inherit; }
.list-excerpt { color: var(--marrom-suave); font-size: 15.5px; margin-bottom: 8px; }

/* ---------- Footer ---------- */
footer {
  background: var(--marrom);
  color: var(--creme-escuro);
  margin-top: 50px;
  padding: 50px 0 24px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}
.foot-brand .brand-name { color: var(--creme); }
.foot-brand .brand-tag { color: var(--marrom-claro); }
.foot-brand p { font-size: 14px; color: var(--creme-escuro); margin-top: 14px; max-width: 280px; }
footer h4 { color: var(--creme); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; font-family: var(--sans); }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: 9px; }
footer a { color: var(--creme-escuro); font-size: 14.5px; }
footer a:hover { color: #fff; }
.foot-bottom {
  border-top: 1px solid var(--marrom-suave);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--marrom-claro);
}

/* ---------- Cookie notice ---------- */
.cookie {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 460px;
  margin: 0 auto;
  background: var(--marrom);
  color: var(--creme);
  padding: 18px 22px;
  border-radius: 12px;
  box-shadow: var(--sombra-forte);
  z-index: 200;
  display: none;
  font-size: 14px;
  line-height: 1.5;
}
.cookie.show { display: block; animation: slideup .3s ease; }
@keyframes slideup { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.cookie p { margin: 0 0 12px; }
.cookie a { color: #f0c9a8; text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; }
.cookie-actions button {
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.cookie-accept { background: var(--terracota); color: #fff; }
.cookie-accept:hover { background: var(--terracota-escuro); }
.cookie-decline { background: transparent; color: var(--creme); border: 1px solid var(--marrom-claro); }

/* ---------- Acessibilidade ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
:focus-visible { outline: 3px solid var(--terracota); outline-offset: 2px; border-radius: 4px; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .featured { grid-template-columns: 1fr; gap: 24px; }
  .magazine { grid-template-columns: 1fr; gap: 32px; }
  .contact-grid { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; gap: 36px; }
  .sidebar { position: static; }
  .newsletter { grid-template-columns: 1fr; padding: 28px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .list-row { grid-template-columns: 160px 1fr; gap: 18px; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .menu-toggle { display: inline-flex; }
  .nav-row {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--creme);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 24px 20px;
    border-bottom: 1px solid var(--linha);
    box-shadow: var(--sombra);
  }
  .nav-row.open { display: flex; }
  .nav-row a { padding: 12px; }
  .nav-spacer, .nav-date { display: none; }
  .brand-tag { display: none; }
  section { padding: 32px 0; }
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .list-row { grid-template-columns: 1fr; }
  .list-thumb { aspect-ratio: 16/9; }
  .article-body { font-size: 17px; }
  .prose { font-size: 17px; }
}

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