/* ================================================
   Blog da Loreto Contabilidade
   Mesmos tokens do site (Loreto Design System + tema claro branco puro do site).
   Hierarquia por tipografia e hairline; laranja só em ação primária e destaque.
   ================================================ */

.loreto-blog {
  --bg: #FFFFFF; --bg-2: #F6F5F3; --border: #E4E1DD; --border-2: #EEEBE8;
  --text: #000000; --text-2: #4A4642; --muted: #6E6862; --orange: #D44F0E; --orange-vivo: #F2611C;
  --preto: #000000; --foot-text: #B4B4BC; --branco: #FFFFFF;
  --font-display: 'Clash Display', system-ui, sans-serif;
  --font-body: 'Satoshi', 'Segoe UI', system-ui, sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px;
  --r-xs: 3px; --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;
  --wrap: 1180px; --texto: 720px;
  --focus: 0 0 0 3px var(--bg), 0 0 0 6px var(--orange);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --bracket: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M0 0h17l5 5v17h-9V9H0z' fill='%23F2611C'/%3E%3C/svg%3E");

  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 18px; line-height: 1.7; -webkit-font-smoothing: antialiased;
}
.loreto-blog *, .loreto-blog *::before, .loreto-blog *::after { box-sizing: border-box; }
.loreto-blog img { max-width: 100%; height: auto; display: block; }
.loreto-blog a { color: inherit; }
.loreto-blog :focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-xs); }
html:has(.loreto-blog) { scroll-behavior: smooth; scroll-padding-top: 88px; }

.lb-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s6); }
.lb-texto { max-width: calc(var(--texto) + var(--s6) * 2); margin-left: auto; margin-right: auto; padding-left: var(--s6); padding-right: var(--s6); }

.lb-skip {
  position: absolute; left: var(--s4); top: -100px; z-index: 100;
  background: var(--text); color: var(--bg); padding: var(--s3) var(--s4); border-radius: var(--r-sm);
}
.lb-skip:focus { top: var(--s4); }

/* ---------- Botões ---------- */
.lb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 10px 18px; border-radius: var(--r-sm); border: 0;
  font-family: var(--font-body); font-weight: 700; font-size: 15px; line-height: 1.2; text-decoration: none;
  position: relative; overflow: hidden; isolation: isolate; cursor: pointer;
  transition: transform .2s var(--ease-out), color .2s;
}
.lb-btn-lg { min-height: 54px; padding: 14px 26px; font-size: 16px; }
.lb-btn:active { transform: scale(.98); }
/* Mesmo laranja do botão principal da página inicial (#D44F0E, contraste maior sobre o branco). */
.lb-btn-primary { background: var(--orange); color: #0A0A0B; }
.lb-btn-primary::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--preto); transform: translateY(101%); transition: transform .35s var(--ease-out);
}
.lb-btn-primary:hover::before { transform: none; }
.lb-btn-primary:hover { color: var(--branco); }
.lb-wa-ic { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; }

/* ---------- Topo ---------- */
.lb-top {
  position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--border-2);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.admin-bar .lb-top { top: 32px; }
.lb-top-in { height: 72px; display: flex; align-items: center; gap: var(--s8); }
.lb-brand img { width: 112px; }
.lb-menu { display: flex; gap: var(--s6); }
.lb-menu a { font-size: 15px; font-weight: 500; color: var(--text-2); text-decoration: none; padding: var(--s2) 0; position: relative; }
.lb-menu a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--orange);
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease-out);
}
.lb-menu a:hover, .lb-menu a[aria-current] { color: var(--text); }
.lb-menu a:hover::after, .lb-menu a[aria-current]::after { transform: none; }
.lb-top-btn { margin-left: auto; }

/* ---------- Cabeça do artigo e da lista ---------- */
.lb-cabeca { padding-top: var(--s12); }
.lb-trilha { display: flex; flex-wrap: wrap; gap: var(--s2); font-size: 15px; color: var(--muted); margin-bottom: var(--s6); }
.lb-trilha a { text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.lb-trilha a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.lb-titulo {
  font-family: var(--font-display); font-weight: 600; margin: 0;
  font-size: clamp(34px, 5vw, 56px); line-height: 1.06; letter-spacing: -0.025em; word-spacing: .08em; text-wrap: balance;
}
.lb-fina { font-size: clamp(19px, 2vw, 22px); line-height: 1.5; color: var(--text-2); margin: var(--s5) 0 0; text-wrap: pretty; }
.lb-meta { font-size: 15px; color: var(--muted); margin: var(--s5) 0 0; }

/* ---------- Corpo do artigo ---------- */
.lb-corpo { padding-top: var(--s10); }
.lb-corpo > :first-child { margin-top: 0; }
.lb-corpo p, .lb-corpo ul, .lb-corpo ol, .lb-corpo table, .lb-corpo blockquote, .lb-corpo details { margin: var(--s5) 0 0; }
.lb-corpo h2 {
  font-family: var(--font-display); font-weight: 600; margin: var(--s16) 0 0;
  font-size: clamp(26px, 3vw, 32px); line-height: 1.15; letter-spacing: -0.015em; word-spacing: .08em; text-wrap: balance;
}
.lb-corpo h3 { font-size: 21px; line-height: 1.3; font-weight: 700; margin: var(--s10) 0 0; }
.lb-corpo h2 + p, .lb-corpo h3 + p { margin-top: var(--s3); }
.lb-corpo a { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; transition: color .2s; }
.lb-corpo a:hover { color: var(--orange); }
.lb-corpo strong { font-weight: 700; }
.lb-corpo ul { list-style: none; padding: 0; }
.lb-corpo ul li { display: flex; gap: var(--s3); align-items: baseline; }
.lb-corpo ul li::before { content: ''; width: 10px; height: 10px; flex-shrink: 0; background: var(--bracket) no-repeat center / contain; transform: translateY(-1px); }
.lb-corpo ol { padding-left: var(--s6); }
.lb-corpo li + li { margin-top: var(--s2); }
.lb-corpo blockquote { border-left: 3px solid var(--orange); padding-left: var(--s5); color: var(--text-2); }
.lb-corpo table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; display: block; overflow-x: auto; }
.lb-corpo th, .lb-corpo td { text-align: left; vertical-align: top; padding: var(--s3) var(--s4) var(--s3) 0; border-bottom: 1px solid var(--border); }
.lb-corpo th { font-weight: 700; border-bottom-color: var(--text); white-space: nowrap; }
.lb-corpo td { font-variant-numeric: tabular-nums; }

/* Perguntas frequentes e fontes (vêm no conteúdo do artigo) */
.loreto-faq { margin-top: var(--s16); border-bottom: 1px solid var(--border); }
.loreto-faq h2 { margin-bottom: var(--s4); }
.loreto-faq details { border-top: 1px solid var(--border); margin: 0; }
.loreto-faq summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--s4);
  padding: var(--s5) 0; min-height: 44px; font-weight: 700; font-size: 19px; line-height: 1.4; transition: color .2s;
}
.loreto-faq summary::-webkit-details-marker { display: none; }
.loreto-faq summary:hover { color: var(--orange); }
.loreto-faq summary::after {
  content: ''; width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--border);
  background: linear-gradient(var(--text), var(--text)) center / 12px 2px no-repeat,
              linear-gradient(var(--text), var(--text)) center / 2px 12px no-repeat;
  transition: transform .35s var(--ease-out);
}
.loreto-faq details[open] summary::after { transform: rotate(135deg); }
.loreto-faq details p { margin: 0; padding-bottom: var(--s5); color: var(--text-2); }
.loreto-fontes { margin-top: var(--s12); font-size: 15px; line-height: 1.6; color: var(--text-2); }
.loreto-fontes h2 { font-family: var(--font-body); font-size: 15px; font-weight: 700; letter-spacing: 0; margin: 0; color: var(--text); }
.loreto-fontes ul { margin-top: var(--s2); }
.loreto-fontes li + li { margin-top: var(--s1); }
.loreto-fontes p { margin-top: var(--s3); color: var(--muted); }

/* ---------- Chamada e autor ---------- */
.lb-cta {
  margin-top: var(--s16); padding: var(--s10) 0; border-top: 2px solid var(--text); border-bottom: 1px solid var(--border);
}
.lb-cta > * { max-width: 36em; }
.lb-cta-t { font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 3.4vw, 38px); line-height: 1.08; letter-spacing: -0.02em; word-spacing: .08em; margin: 0; text-wrap: balance; }
.lb-cta p { color: var(--text-2); margin: var(--s4) 0 var(--s6); }
.lb-autor { margin-top: var(--s8); font-size: 16px; line-height: 1.6; color: var(--text-2); }
.lb-autor p { margin: 0; }
.lb-autor strong { color: var(--text); }
.lb-autor > * + * { margin-top: var(--s4); }
.lb-autor-pessoa { display: flex; gap: var(--s4); align-items: flex-start; }
.lb-autor-pessoa img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.lb-guia { margin-top: var(--s16); }

/* ---------- Páginas por público (publico.php) ---------- */
.lp-hero { padding-bottom: var(--s16); }
.lp-h1 {
  font-family: var(--font-display); font-weight: 600; margin: 0; max-width: 14em;
  font-size: clamp(40px, 6.4vw, 80px); line-height: 1.02; letter-spacing: -0.03em; word-spacing: .08em; text-wrap: balance;
}
.loreto-quina { white-space: nowrap; position: relative; padding-right: .42em; }
.loreto-quina::after { content: ''; position: absolute; right: 0; top: .1em; width: .36em; height: .36em; background: var(--bracket) no-repeat center / contain; }
.lp-sub { max-width: 40em; margin: var(--s6) 0 0; font-size: clamp(19px, 2vw, 22px); line-height: 1.5; color: var(--text-2); text-wrap: pretty; }
.lp-acoes { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s8); }
.lp-btn-sec { background: transparent; color: var(--text); border: 1.5px solid var(--text); }
.lp-btn-sec:hover { background: var(--text); color: var(--bg); }
.lp-confianca { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s4) var(--s10); margin: var(--s12) 0 0; padding: var(--s6) 0 0; border-top: 1px solid var(--border); font-size: 15px; color: var(--muted); }
.lp-confianca strong { display: block; color: var(--text); font-size: 17px; }
.lp-hero .lx-aval { margin-top: var(--s4); }
.lp-sec { padding-top: var(--s16); padding-bottom: var(--s16); }
.lp-sec-alt { background: var(--bg-2); }
.lp-sec-alt .lx-sim { margin-top: 0; }
.lp-sec-alt .lx-tela { background: var(--bg); }
.lp-h2 {
  font-family: var(--font-display); font-weight: 600; margin: 0 0 var(--s10);
  font-size: clamp(32px, 4.4vw, 54px); line-height: 1.04; letter-spacing: -0.025em; word-spacing: .08em; text-wrap: balance;
}
.lp-pontos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 var(--s12); }
.lp-ponto { padding: var(--s6) 0 var(--s8); border-top: 1px solid var(--border); }
.lp-ponto h3 { margin: 0; font-size: 21px; line-height: 1.3; font-weight: 700; }
.lp-ponto p { margin: var(--s3) 0 0; color: var(--text-2); font-size: 17px; line-height: 1.6; }
.lp-lista { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 var(--s12); border-top: 1px solid var(--border); }
.lp-lista li { display: flex; gap: var(--s3); align-items: baseline; padding: var(--s4) 0; border-bottom: 1px solid var(--border); font-weight: 500; }
.lp-lista li::before { content: ''; width: 10px; height: 10px; flex-shrink: 0; background: var(--bracket) no-repeat center / contain; transform: translateY(-1px); }
.lp .loreto-faq { margin-top: 0; }
.lp-artigos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 var(--s8); }
.lp-final { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--s12); align-items: start; padding-bottom: 0; }
.lp-final .lb-cta { margin-top: 0; }
.lp-final .lx-chamar { max-width: none; }

/* ---------- Listas de artigos ---------- */
.lb-rel { margin-top: var(--s16); padding-bottom: var(--s16); }
.lb-rel-t { font-family: var(--font-display); font-weight: 600; font-size: 26px; letter-spacing: -0.015em; margin: 0 0 var(--s4); }
.lb-lista { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.lb-lista li { border-bottom: 1px solid var(--border); position: relative; }
.lb-lista li::before {
  content: ''; position: absolute; left: 0; top: -1px; height: 2px; width: 100%; background: var(--orange);
  transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease-out);
}
.lb-lista li:hover::before, .lb-lista li:focus-within::before { transform: none; }
.lb-item { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s6) 0; text-decoration: none; }
.lb-item-t { font-family: var(--font-display); font-weight: 600; font-size: clamp(21px, 2.2vw, 26px); line-height: 1.2; letter-spacing: -0.01em; word-spacing: .06em; text-wrap: balance; }
.lb-item:hover .lb-item-t { color: var(--orange); }
.lb-item-r { color: var(--text-2); font-size: 17px; line-height: 1.55; }
.lb-item-meta { color: var(--muted); font-size: 14.5px; }

.lb-pagina-lista { padding-bottom: var(--s16); }
.lb-pagina-lista .lb-cabeca { padding-bottom: var(--s10); }
.lb-temas { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s8); }
.lb-temas a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4); text-decoration: none;
  border: 1.5px solid var(--border); border-radius: 999px; font-size: 15px; font-weight: 500;
  transition: border-color .2s, background-color .2s, color .2s;
}
.lb-temas a:hover { border-color: var(--text); }
.lb-temas a[aria-current] { background: var(--text); border-color: var(--text); color: var(--bg); }
.lb-paginas { margin-top: var(--s10); }
.lb-paginas .nav-links { display: flex; flex-wrap: wrap; gap: var(--s2); }
.lb-paginas .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 var(--s3);
  border: 1.5px solid var(--border); border-radius: var(--r-sm); text-decoration: none; font-weight: 600;
}
.lb-paginas .page-numbers.current { background: var(--text); border-color: var(--text); color: var(--bg); }
.lb-paginas .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.lb-vazio { color: var(--text-2); margin-top: var(--s8); }
.lb-vazio a { text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 3px; }

/* ---------- Rodapé (preto, como o do site) ---------- */
.lb-foot { background: var(--preto); color: var(--foot-text); padding: var(--s12) 0; margin-top: var(--s16); }
.lb-foot-in { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s8); flex-wrap: wrap; }
.lb-foot-logo { width: 120px; }
.lb-foot-text { display: flex; flex-direction: column; gap: var(--s2); font-size: 14.5px; line-height: 1.6; text-align: right; }
.lb-foot-text p { margin: 0; }
.lb-foot-text a { text-decoration: underline; text-underline-offset: 2px; }
.lb-foot-text a:hover { color: var(--branco); }
.lb-foot :focus-visible { box-shadow: 0 0 0 3px var(--preto), 0 0 0 6px var(--orange-vivo); }

/* Botão flutuante do WhatsApp: só no celular, depois do topo do artigo */
.lb-wa-float {
  display: none; position: fixed; right: var(--s4); bottom: var(--s4); z-index: 60;
  align-items: center; gap: var(--s2); min-height: 54px; padding: 0 var(--s5); text-decoration: none;
  background: var(--orange); color: #0A0A0B; font-weight: 700; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  transform: translateY(140%); transition: transform .45s var(--ease-out);
}
.lb-wa-float.is-on { transform: none; }

/* ---------- Responsivo ---------- */
@media (max-width: 1080px) {
  .lb-menu { display: none; }
  .lp-pontos, .lp-lista, .lp-artigos, .lp-final { grid-template-columns: 1fr; }
}
@media (max-width: 782px) {
  .admin-bar .lb-top { top: 0; }
}
@media (max-width: 680px) {
  .loreto-blog { font-size: 17px; }
  .lb-wrap, .lb-texto { padding-left: var(--s4); padding-right: var(--s4); }
  .lb-top-in { height: 64px; gap: var(--s3); }
  .lb-brand img { width: 96px; }
  .lb-top-btn span { display: none; }
  .lb-top-btn { padding: 10px 12px; }
  .lb-cabeca { padding-top: var(--s8); }
  .lb-corpo h2 { margin-top: var(--s12); }
  .lb-cta .lb-btn { width: 100%; }
  .lb-foot-text { text-align: left; }
  .lb-foot { padding-bottom: 104px; }
  .lb-wa-float { display: inline-flex; }
  .lp-sec { padding-top: var(--s12); padding-bottom: var(--s12); }
  .lp-acoes .lb-btn { width: 100%; }
  .lp-confianca { flex-direction: column; gap: var(--s3); margin-top: var(--s8); }
}

@media (prefers-reduced-motion: reduce) {
  html:has(.loreto-blog) { scroll-behavior: auto; }
  .loreto-blog *, .loreto-blog *::before, .loreto-blog *::after { animation: none !important; transition: none !important; }
}
