/*
Theme Name: Confisc Blog
Theme URI: https://confisccontabilidade.com.br/blog/
Author: Confisc Contabilidade
Description: Tema editorial exclusivo do blog da Confisc, alinhado ao site institucional.
Version: 1.2.4
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: confisc-blog
*/

:root {
  --paper: #f7f5f0;
  --white: #ffffff;
  --ink: #1b1b1b;
  --ink-soft: #5c5953;
  --charcoal: #111111;
  --gold: #c99a3d;
  --gold-light: #d9b768;
  --gold-dark: #9a6b1f;
  --line: rgba(27, 27, 27, 0.12);
  --shadow: 0 24px 70px rgba(40, 31, 14, 0.09);
  --radius-sm: 14px;
  --radius-md: 24px;
  --radius-lg: 36px;
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body.admin-bar .site-header { top: 32px; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
::selection { background: var(--gold-light); color: var(--charcoal); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.screen-reader-text,
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 9999;
  border-radius: 999px;
  background: var(--charcoal);
  color: #fff;
  padding: .8rem 1rem;
}
.site-container { width: min(calc(100% - 40px), var(--container)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(27, 27, 27, .08);
  background: rgba(247, 245, 240, .95);
  backdrop-filter: blur(16px);
}
.header-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.brand { width: 186px; height: 58px; overflow: hidden; display: grid; place-items: center; flex: 0 0 auto; }
.brand img { width: 210px; max-width: none; }
.desktop-nav { margin-left: auto; display: flex; align-items: center; gap: 1.6rem; }
.desktop-nav a {
  padding: .75rem 0;
  color: #2d2b28;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
  transition: color 180ms ease;
}
.desktop-nav a:hover,
.desktop-nav .current { color: var(--gold-dark); }
.header-cta,
.button-gold {
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: var(--gold);
  color: var(--charcoal);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .85rem 1.2rem;
  transition: transform 180ms ease, background 180ms ease;
}
.header-cta:hover,
.button-gold:hover { transform: translateY(-2px); background: var(--gold-light); }
.mobile-menu { display: none; margin-left: auto; }
.mobile-menu summary {
  cursor: pointer;
  list-style: none;
  min-width: 46px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0;
}
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu summary::before { content: ""; width: 20px; height: 14px; border-block: 2px solid var(--ink); }
.mobile-menu summary::after { content: ""; position: absolute; width: 20px; height: 2px; background: var(--ink); }
.mobile-menu-panel {
  position: fixed;
  inset: 82px 0 0;
  max-height: calc(100dvh - 82px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.25rem 20px 2rem;
  border-top: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 20px 40px rgba(30, 24, 14, .12);
}
.mobile-menu-panel a { display: block; padding: 1rem 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.mobile-menu-panel .header-cta { margin-top: 1rem; text-align: center; border-bottom: 0; }

.blog-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(5rem, 10vw, 9rem) 0;
  background: radial-gradient(circle at 84% 20%, rgba(201,154,61,.2), transparent 25%), var(--paper);
}
.blog-hero::after { content: ""; position: absolute; inset: auto 0 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(27,27,27,.15), transparent); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(240px, .65fr); align-items: end; gap: clamp(2rem, 7vw, 6rem); }
.eyebrow,
.kicker { margin: 0 0 1rem; color: var(--gold-dark); font-size: .74rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.blog-hero h1,
.archive-hero h1 {
  max-width: 900px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 6.5vw, 6.4rem);
  font-weight: 500;
  line-height: .96;
  letter-spacing: -.055em;
}
.hero-copy { max-width: 710px; margin: 1.7rem 0 0; color: var(--ink-soft); font-size: clamp(1rem,1.7vw,1.18rem); line-height: 1.75; }
.hero-mark {
  min-height: 250px;
  padding: 2rem;
  border-radius: 50% 50% 12% 50%;
  background: var(--charcoal);
  color: var(--gold-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transform: rotate(3deg);
}
.hero-mark-symbol { font-family: Georgia, serif; font-size: 4.5rem; line-height: 1; }
.hero-mark span:last-child { color: rgba(255,255,255,.72); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

.posts-section { padding: clamp(4.5rem, 9vw, 8rem) 0; background: var(--white); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: clamp(2.5rem,5vw,4.5rem); }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(2.2rem,4.5vw,4rem); font-weight: 500; line-height: 1.04; letter-spacing: -.04em; }
.category-list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; }
.category-list a { padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); font-size: .72rem; font-weight: 700; transition: border-color 180ms ease, color 180ms ease, background 180ms ease; }
.category-list a:hover { border-color: var(--gold); background: rgba(201,154,61,.1); color: var(--gold-dark); }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.post-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.post-card:hover { transform: translateY(-5px); border-color: rgba(201,154,61,.55); box-shadow: 0 22px 50px rgba(37,29,15,.08); }
.post-card-media { aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, #1a1916, #332b1c); }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.post-card:hover .post-card-media img { transform: scale(1.035); }
.post-card-placeholder { height: 100%; display: grid; place-items: center; color: var(--gold-light); font-family: Georgia, serif; font-size: 3rem; }
.post-card-body { flex: 1; padding: clamp(1.4rem, 3vw, 2rem); display: flex; flex-direction: column; }
.post-meta { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: .9rem; color: var(--gold-dark); font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.post-meta span + span::before { content: "·"; margin-right: .55rem; color: rgba(27,27,27,.3); }
.post-card h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(1.45rem,2.2vw,1.9rem); font-weight: 500; line-height: 1.14; letter-spacing: -.025em; }
.post-card h2 a:hover { color: var(--gold-dark); }
.post-excerpt { margin: 1rem 0 1.6rem; color: var(--ink-soft); font-size: .9rem; line-height: 1.7; }
.read-more { margin-top: auto; display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.read-more::after { content: "→"; color: var(--gold-dark); transition: transform 180ms ease; }
.read-more:hover::after { transform: translateX(4px); }
.empty-state { grid-column: 1 / -1; padding: clamp(2.5rem,6vw,5rem); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); text-align: center; }
.empty-state h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(2rem,4vw,3.5rem); font-weight: 500; }
.empty-state p { max-width: 620px; margin: 1rem auto 1.7rem; color: var(--ink-soft); line-height: 1.7; }
.pagination { margin-top: 3rem; display: flex; justify-content: center; gap: .5rem; }
.pagination .page-numbers { min-width: 42px; height: 42px; padding: 0 .8rem; border: 1px solid var(--line); border-radius: 999px; display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.pagination .current, .pagination a:hover { border-color: var(--gold); background: var(--gold); color: var(--charcoal); }

.archive-hero { padding: clamp(4rem,8vw,7rem) 0; border-bottom: 1px solid var(--line); }
.archive-hero h1 { font-size: clamp(2.8rem,6vw,5.2rem); }
.search-form { display: flex; max-width: 650px; margin-top: 2rem; }
.search-form label { flex: 1; }
.search-field { width: 100%; min-height: 52px; padding: 0 1rem; border: 1px solid var(--line); border-radius: 999px 0 0 999px; background: #fff; }
.search-submit { min-height: 52px; padding: 0 1.2rem; border: 1px solid var(--gold); border-radius: 0 999px 999px 0; background: var(--gold); color: var(--charcoal); font-weight: 800; cursor: pointer; }

.article-hero { padding: clamp(4.5rem,9vw,8rem) 0 clamp(3rem,6vw,5rem); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2.2rem; color: var(--ink-soft); font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.breadcrumbs a:hover { color: var(--gold-dark); }
.article-hero h1 {
  max-width: min(100%, 1000px);
  min-width: 0;
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(2.6rem, 5.4vw, 5.35rem);
  font-weight: 500;
  line-height: .99;
  letter-spacing: -.045em;
  overflow-wrap: break-word;
  text-wrap: pretty;
}
.article-intro { max-width: 760px; margin: 1.6rem 0 0; color: var(--ink-soft); font-size: clamp(1.05rem,1.8vw,1.25rem); line-height: 1.7; }
.featured-image { width: min(calc(100% - 40px), 1280px); max-height: 680px; margin: 0 auto; border-radius: var(--radius-lg); object-fit: cover; }
.article-wrap { padding: clamp(3.5rem,8vw,7rem) 0; background: #fff; }
.article-content { width: min(calc(100% - 40px), 780px); margin-inline: auto; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.05rem,1.4vw,1.18rem); line-height: 1.85; }
.article-content > *:first-child { margin-top: 0; }
.article-content h2, .article-content h3 { margin: 2.3em 0 .7em; color: var(--ink); line-height: 1.15; letter-spacing: -.025em; }
.article-content h2 { font-size: clamp(1.8rem,3vw,2.6rem); }
.article-content h3 { font-size: clamp(1.4rem,2.5vw,2rem); }
.article-content a { color: var(--gold-dark); text-decoration: underline; text-underline-offset: .16em; }
.article-content blockquote { margin: 2rem 0; padding: .5rem 0 .5rem 1.5rem; border-left: 4px solid var(--gold); color: var(--ink-soft); font-style: italic; }
.article-content img { border-radius: var(--radius-md); }
.article-content .wp-block-button__link { color: var(--charcoal); text-decoration: none; border-radius: 999px; background: var(--gold); font-family: Arial, sans-serif; font-size: .78rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.article-footer { width: min(calc(100% - 40px), 780px); margin: 0 auto 5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .78rem; }

.cta-section { padding: clamp(4.5rem,8vw,7rem) 0; background: var(--paper); }
.cta-card { padding: clamp(2rem,5vw,4.5rem); border-radius: var(--radius-lg); background: var(--charcoal); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.cta-card h2 { max-width: 760px; margin: 0; font-family: Georgia, serif; font-size: clamp(2.1rem,4.5vw,4rem); font-weight: 500; line-height: 1.03; letter-spacing: -.045em; }

.site-footer { background: #0d0d0c; color: rgba(244,244,244,.76); }
.footer-top { padding: 5rem 0 3.5rem; display: grid; grid-template-columns: 1.6fr repeat(3,1fr); gap: 3rem; }
.footer-brand .brand { width: 230px; height: 72px; }
.footer-brand .brand img { width: 260px; filter: brightness(1.7); }
.footer-brand > p { max-width: 390px; margin: 1.2rem 0 1.5rem; color: rgba(244,244,244,.64); line-height: 1.7; }
.contact-list, .footer-links { display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; font-size: .86rem; }
.footer-links h2 { margin: 0 0 .6rem; color: #fff; font-size: .76rem; letter-spacing: .13em; text-transform: uppercase; }
.footer-links a, .contact-list a, .contact-list span { color: rgba(244,244,244,.68); line-height: 1.4; }
.footer-links a:hover, .contact-list a:hover { color: var(--gold-light); }
.footer-bottom { padding: 1.4rem 0 2rem; border-top: 1px solid rgba(255,255,255,.12); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; color: rgba(244,244,244,.5); font-size: .7rem; }
.footer-bottom p { margin: 0; }

@media (max-width: 980px) {
  body.admin-bar .site-header { top: 46px; }
  .desktop-nav, .header-inner > .header-cta { display: none; }
  .mobile-menu { display: block; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-mark { display: none; }
  .post-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .article-hero h1 { font-size: clamp(2.5rem, 7vw, 4.6rem); }
}

@media (max-width: 640px) {
  .site-container, .article-content, .article-footer { width: min(calc(100% - 28px), var(--container)); }
  .header-inner { min-height: 72px; }
  .brand { width: 158px; height: 50px; }
  .brand img { width: 180px; }
  .mobile-menu-panel {
    inset-block-start: 72px;
    max-height: calc(100dvh - 72px);
  }
  .blog-hero { padding-block: 4.5rem; }
  .article-hero { padding-block: 3.5rem 2.5rem; }
  .article-hero h1 {
    font-size: clamp(2.25rem, 10.5vw, 3.25rem);
    line-height: 1.02;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
  }
  .featured-image { width: min(calc(100% - 28px), 1280px); border-radius: var(--radius-md); }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .category-list { justify-content: flex-start; }
  .post-grid { grid-template-columns: 1fr; }
  .cta-card { align-items: flex-start; flex-direction: column; border-radius: var(--radius-md); }
  .cta-card .button-gold { width: 100%; text-align: center; }
  .footer-top { grid-template-columns: 1fr; padding-block: 4rem 2.5rem; }
  .footer-brand { grid-column: auto; }
  .footer-bottom { flex-direction: column; gap: .55rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.confisc-cookie-banner {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 10000;
  width: min(calc(100% - 2rem), 920px);
  margin-inline: auto;
  padding: 1.15rem;
  border: 1px solid rgba(217,183,104,.55);
  border-radius: 18px;
  background: #111;
  box-shadow: 0 20px 60px rgba(0,0,0,.32);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.confisc-cookie-banner strong { display: block; margin-bottom: .35rem; color: var(--gold-light); font-size: 1rem; }
.confisc-cookie-banner p { max-width: 650px; margin: 0; color: rgba(255,255,255,.78); font-size: .875rem; line-height: 1.55; }
.confisc-cookie-banner a { color: #fff; text-decoration: underline; text-underline-offset: .18em; }
.confisc-cookie-actions { display: flex; flex: 0 0 auto; gap: .65rem; }
.confisc-cookie-actions button, .confisc-cookie-settings { min-height: 44px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: .72rem 1rem; background: transparent; color: #fff; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 800; }
.confisc-cookie-actions .primary { border-color: var(--gold); background: var(--gold); color: var(--charcoal); }
.confisc-cookie-settings { position: fixed; bottom: .75rem; left: .75rem; z-index: 9998; min-height: 36px; padding: .5rem .8rem; border-color: rgba(27,27,27,.2); background: rgba(247,245,240,.96); box-shadow: 0 8px 24px rgba(0,0,0,.12); color: var(--ink); font-size: .7rem; }
@media (max-width: 720px) {
  .confisc-cookie-banner { align-items: stretch; flex-direction: column; gap: 1rem; }
  .confisc-cookie-actions button { flex: 1; }
}
@media (max-width: 430px) {
  .confisc-cookie-actions { flex-direction: column-reverse; }
}


/* Ajuste de navegação móvel: mantém todo o menu acessível em telas baixas. */
.mobile-menu-panel {
  inset: 82px 0 0;
  max-height: calc(100dvh - 82px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (max-width: 640px) {
  .mobile-menu-panel {
    inset-block-start: 72px;
    max-height: calc(100dvh - 72px);
  }
}
/* Complemento: painel ocupa toda a altura disponível da tela. */
.mobile-menu-panel { height: calc(100dvh - 82px); }
@media (max-width: 640px) { .mobile-menu-panel { height: calc(100dvh - 72px); } }

/* Garante a altura útil do painel em qualquer orientação. */
.mobile-menu-panel { height: calc(100vh - 82px) !important; }
@media (max-width: 640px) { .mobile-menu-panel { height: calc(100vh - 72px) !important; } }