/* ============================================================
   site.css — estilos compartilhados (shell + base)
   Calegari Direito Digital

   Tokens críticos (@font-face e :root) permanecem inline em cada
   página para evitar FOUC. Header/footer/WhatsApp/nav-toggle vivem
   aqui para serem alterados em um único lugar.
   O fundo do header usa --header-bg / --header-bg-scrolled, definidos
   no :root inline de cada página (institucional x políticas diferem).
   ============================================================ */

/* ===== HEADER ===== */
/* Escopo em #header (não no elemento <header>) para o <header class="article-hero">
   dos artigos não herdar position/z-index e cobrir o menu mobile aberto. */
#header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: var(--header-bg, rgba(242, 235, 221, 0.85));
  border-bottom: 1px solid var(--line);
  transition: all 0.3s;
}
#header.scrolled {
  background: var(--header-bg-scrolled, rgba(242, 235, 221, 0.95));
  box-shadow: 0 1px 0 var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 24px;
}
.logo { display: flex; align-items: center; line-height: 1; }
.logo img { display: block; height: 42px; width: auto; }
@media (max-width: 820px) { .logo img { height: 36px; } }
@media (max-width: 480px) { .logo img { height: 30px; } }
@media (max-width: 360px) { .logo img { height: 26px; } }

/* Mobile: header fica cheio (logo + hambúrguer + CTA) — aperta espaçamento e compacta o CTA */
@media (max-width: 480px) {
  .nav { gap: 12px; }
  .nav .btn-wa { padding: 10px 14px; font-size: 13px; gap: 7px; }
}
@media (max-width: 360px) {
  .nav .btn-wa { padding: 9px 11px; font-size: 0; gap: 0; }
  .nav .btn-wa svg { width: 18px; height: 18px; }
}

.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
  font-size: 14px;
  color: var(--ink);
  opacity: 0.75;
  transition: opacity 0.2s;
  font-weight: 500;
}
.nav-links a:hover { opacity: 1; }
@media (max-width: 820px) { .nav-links { display: none; } }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--f-body);
  letter-spacing: -0.005em;
  border-radius: 2px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-wa { background: var(--forest); color: var(--paper); }
.btn-wa:hover { background: var(--forest-dk); transform: translateY(-1px); }
.btn-wa svg { width: 16px; height: 16px; }
.btn-lg { padding: 18px 32px; font-size: 15px; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--forest); color: var(--forest); }

/* ===== NAV TOGGLE (mobile hamburger) ===== */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  padding: 11px 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
}
.nav-toggle-bar { display: block; width: 100%; height: 2px; background: var(--ink); transition: transform .25s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--cream);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 28px rgba(26, 36, 52, 0.12);
    padding: 6px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 14px 32px; font-size: 16px; opacity: 0.9; }
  .nav-links a:hover { background: var(--cream-2); opacity: 1; }
}

/* ===== FOOTER ===== */
footer {
  background: var(--forest-dk);
  color: var(--cream);
  padding: 80px 0 32px;
  position: relative;
  z-index: 2;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1.2fr;
  gap: 48px;
  margin-bottom: 64px;
}
@media (max-width: 980px) { .footer-grid { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand .logo-footer img { height: 54px; }
.footer-brand p { margin-top: 20px; font-size: 14px; line-height: 1.6; opacity: 0.7; max-width: 320px; }

.footer-col h4 {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ochre);
  font-weight: 500;
  margin-bottom: 20px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 14px; opacity: 0.75; transition: opacity 0.2s; }
.footer-col a:hover { opacity: 1; color: var(--ochre); }

.footer-contact-item { margin-bottom: 16px; font-size: 14px; }
.footer-contact-item strong {
  display: block;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 4px;
  font-weight: 500;
}
.footer-bottom {
  border-top: 1px solid rgba(242, 235, 221, 0.15);
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
}
.footer-bottom-links { display: flex; gap: 24px; }
.placeholder {
  background: rgba(184, 134, 60, 0.18);
  padding: 1px 6px;
  border-radius: 2px;
  font-family: var(--f-mono);
  font-size: 0.92em;
  color: var(--ochre);
  border: 1px dashed rgba(242, 235, 221, 0.35);
}

/* ===== WHATSAPP FLUTUANTE ===== */
.wa-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  background: var(--whatsapp);
  color: white;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35), 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  animation: waPulse 2.5s ease-in-out infinite;
}
.wa-float:hover { transform: scale(1.08); background: var(--whatsapp-dk); }
.wa-float svg { width: 30px; height: 30px; }

@keyframes waPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35), 0 0 0 0 rgba(37, 211, 102, 0.4); }
  50% { box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35), 0 0 0 16px rgba(37, 211, 102, 0); }
}

.wa-tooltip {
  position: absolute;
  right: 74px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--ink);
  color: var(--cream);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
}
.wa-tooltip::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: var(--ink);
}
.wa-float:hover .wa-tooltip { opacity: 1; right: 80px; }

@media (max-width: 640px) {
  .wa-float { width: 56px; height: 56px; bottom: 20px; right: 20px; }
  .wa-float svg { width: 26px; height: 26px; }
  .wa-tooltip { display: none; }
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== UTILS ===== */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -48px;
  z-index: 300;
  background: var(--forest); color: var(--cream);
  padding: 10px 18px; border-radius: 2px;
  font-size: 14px; font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus { top: 8px; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}
