/* ==========================================================
   blog.css — Blog da Caetano Contabilidade
   Carregado DEPOIS do css/style.css do site: reaproveita as
   variáveis (--navy, --gold...), os botões, .post, .photo, .chip
   etc. Aqui fica só o que é exclusivo do blog.
   ========================================================== */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Topo (listagem e post) ---------- */
.blog-hero {
  background: var(--navy);
  color: var(--white);
  padding: clamp(56px, 7vw, 96px) 0;
}
.blog-hero__title {
  max-width: 820px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -.02em;
}
.blog-hero__text { max-width: 640px; font-size: clamp(16px, 1.4vw, 18px); line-height: 1.65; color: var(--text-light); }

/* busca */
.blog-search {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 560px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  transition: border-color .2s ease, background-color .2s ease;
}
.blog-search:focus-within { border-color: var(--gold); background: rgba(255,255,255,.1); }
.blog-search input {
  flex: 1;
  min-width: 0;
  padding: 0 16px;
  border: 0;
  background: none;
  color: var(--white);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.blog-search input::placeholder { color: rgba(213,221,231,.7); }
/* a seta "›" dos botões gold não faz sentido aqui */
.blog-search button { padding-right: 18px; }
.blog-search button::before, .blog-search button::after { display: none; }

/* ---------- Filtros (chips) ---------- */
.blog-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  /* zera o visual de botão "pílula" grande quando o chip é um <button> */
  --btn-bg: transparent; --btn-fg: var(--navy); --btn-border: rgba(12,38,65,.14);
  --btn-hover-bg: var(--cream); --btn-hover-border: rgba(12,38,65,.24);
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--btn-border);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 14px;
  font-weight: 600;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.chip:hover { background: var(--btn-hover-bg); border-color: var(--btn-hover-border); color: var(--navy); }
button.chip:hover { transform: none; box-shadow: none; }
.chip.is-active { background: var(--navy); border-color: var(--navy); color: var(--white); }

/* ---------- Cards de post ---------- */
.post .photo img { transition: transform .5s ease; }
.post:hover .photo img { transform: scale(1.04); }
.post__meta { font-size: 13px; color: var(--text-muted); }

/* post em destaque: imagem grande + texto ao lado */
.post--featured {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding-bottom: clamp(32px, 4vw, 48px);
  border-bottom: 1px solid rgba(12,38,65,.1);
}
.post--featured__body { display: flex; flex-direction: column; gap: 16px; }
.post--featured h2 { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.2; transition: color .2s; }
.post--featured:hover h2 { color: var(--gold-dark); }
.post--featured p { font-size: 16px; line-height: 1.65; color: var(--text-muted); }

/* sem resultados */
.blog-empty { padding: 48px 0; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.blog-empty h2 { font-size: 22px; }
.blog-empty p { color: var(--text-muted); }

/* ---------- Paginação ---------- */
.pagination { display: flex; justify-content: center; gap: 6px; }
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}
.pagination a { border: 1px solid rgba(12,38,65,.14); transition: background-color .2s ease; }
.pagination a:hover { background: var(--cream); color: var(--navy); }
.pagination .is-active { background: var(--navy); color: var(--white); }

/* ---------- Página do post ---------- */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 70; }
.reading-progress span { display: block; height: 100%; width: 0; background: var(--gold); }

.post-head { display: flex; flex-direction: column; gap: 20px; max-width: 880px; }
.back-link { align-self: flex-start; font-size: 14px; font-weight: 600; color: var(--text-light); }
.back-link::before { content: "‹ "; }
.back-link:hover { color: var(--white); }
.post__cat--light { align-self: flex-start; color: var(--gold); }
.post__cat--light:hover { color: var(--white); }

.post-author { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.post-author strong { display: block; font-family: var(--font-title); font-size: 15px; }
.post-author span { font-size: 14px; color: var(--text-light); }
.photo--avatar { width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; }
.photo--avatar.photo--empty { background: var(--gold); color: var(--navy); font-family: var(--font-title); font-size: 18px; font-weight: 700; }

.post-cover { margin-top: clamp(-48px, -4vw, -32px); }
.post-cover .photo { aspect-ratio: 16 / 7; border-radius: 20px; box-shadow: 0 20px 40px -24px rgba(12,38,65,.35); }
.blog-hero--post:has(+ .post-cover) { padding-bottom: clamp(80px, 9vw, 128px); }

.post-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 720px);
  justify-content: center;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.post-layout:not(:has(.post-toc)) { grid-template-columns: minmax(0, 720px); }

/* sumário fixo ao lado do texto */
.post-toc { position: sticky; top: calc(var(--header-h) + 24px); display: flex; flex-direction: column; gap: 14px; }
.post-toc ul { display: flex; flex-direction: column; border-left: 1px solid rgba(12,38,65,.12); }
.post-toc a {
  display: block;
  margin-left: -1px;
  padding: 6px 0 6px 16px;
  border-left: 2px solid transparent;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-muted);
  transition: color .2s ease, border-color .2s ease;
}
.post-toc .is-sub a { padding-left: 28px; font-size: 13px; }
.post-toc a:hover { color: var(--navy); }
.post-toc a.is-active { color: var(--navy); border-left-color: var(--gold); font-weight: 600; }

@media (max-width: 899px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); }
  .post-toc { position: static; padding: 20px; border-radius: 14px; background: var(--cream); }
}

/* tipografia do texto do post (o HTML vem do editor do painel) */
.post-content { font-size: 17px; line-height: 1.8; color: #24364C; }
.post-content > * + * { margin-top: 1.1em; }
.post-content h2 { margin-top: 2em; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.25; color: var(--navy); scroll-margin-top: calc(var(--header-h) + 24px); }
.post-content h3 { margin-top: 1.6em; font-size: 20px; line-height: 1.3; color: var(--navy); scroll-margin-top: calc(var(--header-h) + 24px); }
.post-content > :first-child { margin-top: 0; }
.post-content a { color: var(--gold-dark); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { color: var(--navy); }
.post-content ul, .post-content ol { padding-left: 1.4em; }
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li + li { margin-top: .4em; }
.post-content li::marker { color: var(--gold-dark); }
.post-content blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--gold);
  font-size: 19px;
  font-style: italic;
  color: var(--navy);
}
.post-content img { border-radius: 14px; }
.post-content strong { color: var(--navy); }

.post-tags, .post-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.post-tags { margin-top: 2.4em !important; padding-top: 24px; border-top: 1px solid rgba(12,38,65,.1); }
.post-share span { margin-right: 4px; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-dark); }

/* ---------- Chamada final do blog ---------- */
.blog-cta { border-top: 1px solid rgba(12,38,65,.08); }
