/* Modo noturno do lmprevidenciario.adv.br: botão no cabeçalho + cores da noite.
   Padrão é o claro; html[data-tema="noite"] vem do botão (tema-prev.js). Fotos e capas não mudam.
   Inicial e páginas do WordPress usam os mesmos nomes de cor (lm-child/style.css): basta trocar o valor deles. */

/* ---------- botão ---------- */
html body .lm-tema-bt { flex: 0 0 auto; width: 42px; height: 42px; padding: 0; display: grid; place-items: center; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%; background: #0D3B2C; color: #fff;
  transition: border-color 200ms ease, color 200ms ease, transform 140ms ease; }
html body .lm-tema-bt:not(.lm-tema-bt--cab) { position: fixed; top: 14px; right: 16px; z-index: 10000; box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .6); }
.lm-tema-bt svg { width: 20px; height: 20px; fill: currentColor; stroke: currentColor; stroke-width: 0; stroke-linecap: round; }
.lm-tema-bt svg path[d^="M12 2.5"] { fill: none; stroke-width: 1.8; }   /* raios do sol */
html body .lm-tema-bt:hover, html body .lm-tema-bt:focus { background: #0D3B2C; }
html body .lm-tema-bt:active { transform: scale(.94); }
html body .lm-tema-bt:focus-visible { outline: 2px solid #F2A64A; outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { html body .lm-tema-bt:hover { border-color: #F2A64A; color: #F2A64A; } }

/* ---------- noite: cores do site ---------- */
html[data-tema="noite"] {
  color-scheme: dark;
  --paper: #0a2018; --ivory: #0a2018; --white: #11382a; --mint: #164333; --ink: #e8efe9; --ink-2: #b9c9c0;
  --line: #24503f; --line-soft: #1d4535; --accent-text: #f7bc6c;
  --base: #0a2018; --base-2: #0a2018; --base-3: #11382a; --contrast: #e8efe9; --contrast-2: #b9c9c0; --contrast-3: #6f8a7e;
}
html[data-tema="noite"] body { background-color: #0a2018; color: #e8efe9; }

/* Inicial e páginas do WordPress (as que têm .site-head): o verde #0D3B2C é fundo das faixas escuras e também letra
   de título e link sobre fundo claro. À noite o fundo claro escurece; a letra verde fica clara fora das faixas escuras. */
html[data-tema="noite"] body:has(.site-head) main :is(h1, h2, h3, h4, h5, h6, strong, b):not(:is(.dark, .lm-cta-contexto) *) { color: #f4f7f3; }
html[data-tema="noite"] body:has(.site-head) main :is(a:not(.btn):not(.lm-thumb), .area-q, .lm-callout__titulo, .lm-toc__titulo):not(:is(.dark, .lm-cta-contexto) *) { color: #8fd9b2; }
html[data-tema="noite"] body:has(.site-head) main .btn--ghost:not(:is(.dark, .lm-cta-contexto) *) { color: #f4f7f3; border-color: #8fd9b2; }
html[data-tema="noite"] body:has(.site-head) .review-summary { background: var(--white); }
html[data-tema="noite"] .lm-chips a:not([aria-current]) { color: #f4f7f3 !important; border-color: var(--line); }   /* o tema usa !important */
html[data-tema="noite"] .review-summary :is(strong, p, b, span:not([class*="g-"])) { color: #f4f7f3; }

/* Inicial: o cabeçalho tem 8 itens; com o botão, o telefone sai do cabeçalho (segue na faixa de cima e no Contato) */
@media (max-width: 1599px) { #site-head:has(.lm-tema-bt--cab) .head-phone { display: none; } }
/* Inicial entre 1100 e 1365 px: 8 itens no menu + botão não cabem (sem o botão o menu já passava da tela até 1366 px). Aperta um pouco. */
@media (min-width: 1100px) and (max-width: 1365px) {
  #site-head .head-in { gap: 12px; }
  #site-head .nav { gap: 10px; }
  #site-head .nav a { font-size: .9rem; }
}
@media (min-width: 1100px) and (max-width: 1365px) {
  #site-head .head-cta { font-size: 0; gap: 0; padding: 0 12px; }   /* só o ícone; o botão flutuante do WhatsApp segue com o texto */
  #site-head .head-cta svg { width: 20px; height: 20px; }
}

/* Celular: o nome do escritório + botão do tema + menu não cabiam (o nome passava por baixo do botão). Menu só ícone. */
@media (max-width: 479px) {
  .site-head:has(.lm-tema-bt--cab) .head-in { gap: 10px; }
  .site-head:has(.lm-tema-bt--cab) .menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* some da tela, mas o leitor de tela ainda lê "Menu" */
  .site-head:has(.lm-tema-bt--cab) .brand { min-width: 0; }
}
@media (max-width: 359px) { .site-head:has(.lm-tema-bt--cab) .brand-name b { font-size: .8rem; } .site-head:has(.lm-tema-bt--cab) .brand-name span { font-size: .58rem; } }
