/* =========================================================
   SITE V3 — Header & Footer (global)
   Namespace: .site-header  .site-footer
   Carregado em todas as páginas, após blh-theme-main.
   ========================================================= */

/* ── Tokens de design (duplicados do home-v3 para uso global) ── */
:root {
  --terracota:      #B5644E;
  --terracota-dark: #8B4A38;
  --mostarda:       #E2A16D;
  --verde:          #649287;
  --verde-claro:    #8BBEB9;
  --creme:          #FFE8AB;
  --offwhite:       #FFF6E2;
  --bege:           #FAEBD0;
  --tinta:          #3A2A22;
  --tinta-soft:     #6B4A3D;
  --r-pill:         999px;
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--offwhite);
  border-bottom: 1px solid rgba(181, 100, 78, 0.1);
  backdrop-filter: blur(8px);
}

.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px clamp(16px, 4vw, 40px);
}

/* ── Brand ─────────────────────────────────────────────── */
.site-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
.site-header .brand-logo {
  height: 106px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.18)) contrast(1.08) saturate(1.12);
}

/* ── Primary nav ────────────────────────────────────────── */
.site-header .primary-nav {
  display: flex;
  align-items: center;
  flex: 1;
}
.site-header .primary-nav ul {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.site-header .primary-nav li > a {
  display: block;
  padding: 9px 13px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--tinta-soft);
  border-radius: var(--r-pill);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.site-header .primary-nav li > a:hover {
  color: var(--terracota);
  background: var(--bege);
}
.site-header .primary-nav .current-menu-item > a,
.site-header .primary-nav .current_page_item > a,
.site-header .primary-nav .current-menu-ancestor > a {
  color: var(--terracota-dark);
  background: var(--creme);
}
/* Sub-menus — ocultos por padrão */
.site-header .primary-nav ul ul { display: none; }

/* ── Header actions ─────────────────────────────────────── */
.site-header .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.site-header .icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bege);
  color: var(--terracota-dark);
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background 0.2s;
}
.site-header .icon-btn svg { width: 18px; height: 18px; }
.site-header .icon-btn:hover { background: var(--creme); }

/* ── Search overlay ─────────────────────────────────────── */
.blh-search-overlay {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 8000;
  background: rgba(255,246,226,0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--bege);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: 20px 24px;
  transform: translateY(-110%);
  opacity: 0;
  transition: transform 0.32s var(--ease-spring, cubic-bezier(.34,1.56,.64,1)), opacity 0.22s ease;
  pointer-events: none;
}
.blh-search-overlay.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.blh-search-overlay__inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.blh-search-form {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--offwhite);
  border: 2px solid var(--bege);
  border-radius: var(--r-pill);
  padding: 0 6px 0 20px;
  transition: border-color 0.2s;
}
.blh-search-form:focus-within { border-color: var(--terracota); }
.blh-search-form__input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: 'Nunito', 'Nunito Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--tinta);
  padding: 13px 0;
  outline: none;
  min-width: 0;
}
.blh-search-form__input::placeholder { color: var(--tinta-soft); opacity: 0.55; }
.blh-search-form__submit {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--terracota);
  color: var(--offwhite);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.blh-search-form__submit:hover { background: var(--terracota-dark); transform: scale(1.08); }
.blh-search-form__submit svg { width: 17px; height: 17px; }
.blh-search-overlay__close {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--bege);
  color: var(--tinta-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.blh-search-overlay__close:hover { background: var(--creme); color: var(--terracota-dark); }
.blh-search-overlay__close svg { width: 18px; height: 18px; }

/* Botão CTA do header */
.site-header .header-cta {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: var(--terracota);
  color: #fff;
  font-family: 'Nunito', 'Nunito Sans', sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
  border-radius: var(--r-pill);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s;
}
.site-header .header-cta:hover {
  background: var(--terracota-dark);
  transform: translateY(-1px);
}

/* ── Burger (mobile) ────────────────────────────────────── */
.site-header .nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}
.site-header .nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--terracota-dark);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.site-header .nav-burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.site-header .nav-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.site-header .nav-burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* nav-cta: oculto no desktop (o header-cta já aparece lá) */
.site-header .nav-cta { display: none; }

/* ── Responsivo ─────────────────────────────────────────── */
@media (max-width: 1080px) {
  .site-header .brand-logo   { height: 52px; }
  .site-header .primary-nav  { display: none; }
  .site-header .nav-burger   { display: flex; }
  /* No mobile o header-actions some; o CTA vive dentro do dropdown */
  .site-header .header-actions { display: none; }

  /* Dropdown abaixo do header ao abrir */
  .site-header .primary-nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--offwhite);
    box-shadow: 0 8px 32px rgba(58, 42, 34, 0.14);
    padding: 20px clamp(16px, 4vw, 40px) 32px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    z-index: 10;
  }
  .site-header .primary-nav.is-open ul {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
  }
  .site-header .primary-nav.is-open li { width: 100%; }
  .site-header .primary-nav.is-open li > a {
    font-size: 1.1rem;
    padding: 12px 16px;
    border-radius: 12px;
  }

  /* Botão CTA dentro do dropdown */
  .site-header .primary-nav.is-open .nav-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    padding: 15px 24px;
    background: var(--terracota);
    color: #fff;
    font-family: 'Nunito', 'Nunito Sans', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    border-radius: var(--r-pill);
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
  }
  .site-header .primary-nav.is-open .nav-cta:hover {
    background: var(--terracota-dark);
  }
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--terracota-dark);
  color: var(--bege);
  padding: 0;
}

.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 0.9fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px clamp(16px, 4vw, 40px) 52px;
}

/* ── Coluna Brand ────────────────────────────────────────── */
.site-footer .footer-brand .brand-mark {
  width: 64px;
  height: auto;
  margin-bottom: 18px;
  display: block;
}
.site-footer .footer-tagline {
  margin-bottom: 14px;
}
.site-footer .footer-tagline__name {
  display: block;
  font-family: 'Nunito', 'Nunito Sans', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--creme);
  line-height: 1.35;
}
.site-footer .footer-tagline__sub {
  display: block;
  font-family: 'Nunito', 'Nunito Sans', sans-serif;
  font-weight: 600;
  font-size: 0.87rem;
  color: var(--creme);
  opacity: 0.72;
  line-height: 1.35;
  margin-top: 3px;
}
.site-footer .footer-address {
  font-size: 0.9rem;
  opacity: 0.75;
  line-height: 1.65;
}

/* ── Logos parceiros institucionais ─────────────────────── */
.site-footer .footer-partner-logos {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 246, 226, 0.14);
}
.site-footer .footer-partner-logos a {
  display: flex;
  align-items: center;
  transition: opacity 0.2s;
}
.site-footer .footer-partner-logos a:hover img { opacity: 1; }
.site-footer .footer-partner-logos img {
  height: 40px;
  width: auto;
  object-fit: contain;
  opacity: 0.78;
}

/* ── Colunas genéricas ──────────────────────────────────── */
.site-footer .footer-col h4 {
  font-family: 'Nunito', 'Nunito Sans', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--creme);
  margin-bottom: 16px;
}
.site-footer .footer-col a,
.site-footer .footer-col ul li a {
  display: block;
  padding: 6px 0;
  color: var(--bege);
  opacity: 0.85;
  font-size: 0.95rem;
  text-decoration: none;
  transition: opacity 0.2s, color 0.2s;
}
.site-footer .footer-col a:hover,
.site-footer .footer-col ul li a:hover {
  opacity: 1;
  color: var(--creme);
}
.site-footer .footer-col ul,
.site-footer .footer-col .blh-footer-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer .footer-col li { padding: 0; }
.site-footer .footer-hours {
  margin-top: 8px;
  font-size: 0.88rem;
  opacity: 0.7;
}

/* ── Redes sociais ──────────────────────────────────────── */
.site-footer .social-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.site-footer .social {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 246, 226, 0.12);
  color: var(--creme);
  display: grid;
  place-items: center;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.site-footer .social svg { width: 20px; height: 20px; fill: currentColor; }
.site-footer .social:hover { background: var(--mostarda); color: #fff; }

.site-footer .footer-brand-strip {
  display: flex;
  justify-content: center;
  padding: 40px clamp(16px, 4vw, 40px) 28px;
  border-bottom: 1px solid rgba(255,246,226,0.12);
}

.site-footer .footer-portal-logo {
  display: block;
  width: 360px;
  max-width: 100%;
  height: auto;
  opacity: 0.75;
}

/* ── Barra inferior ─────────────────────────────────────── */
.site-footer .footer-bottom {
  border-top: 1px solid rgba(255, 246, 226, 0.12);
  padding: 28px 0 32px;
}
.site-footer .footer-bottom-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 48px;
  font-size: 0.85rem;
  opacity: 0.68;
}
.site-footer .footer-bottom-inner span {
  flex: 0 0 44%;
}
.site-footer .footer-bottom-inner span:last-child {
  padding-left: 10%;
}
.site-footer .footer-bottom-side {
  max-width: 1200px;
  margin: 18px auto 0;
  padding: 16px clamp(16px, 4vw, 40px) 0;
  border-top: 1px solid rgba(255, 246, 226, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.site-footer .footer-bottom-desc {
  flex: 0 0 46%;
}
.site-footer .footer-bottom-desc p {
  font-size: 0.78rem;
  line-height: 1.65;
  opacity: 0.45;
  margin: 0;
}
.site-footer .footer-credits {
  flex: 0 0 44%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 10%;
}
.site-footer .footer-credits p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.6;
  opacity: 0.42;
}
.site-footer .footer-dev-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s;
}
.site-footer .footer-dev-link:hover { opacity: 1; }

/* ── Responsivo ─────────────────────────────────────────── */
@media (max-width: 960px) {
  .site-footer .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .site-footer .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .site-footer .footer-bottom-inner { flex-direction: column; align-items: flex-start; }
  .site-footer .footer-partner-logos img { height: 34px; }
  .site-footer .footer-bottom-side { flex-direction: column; }
  .site-footer .footer-bottom-desc,
  .site-footer .footer-credits { flex: 0 0 100%; text-align: left; }
}

/* ── Voltar ao topo ───────────────────────────────────────────────────── */
.blh-back-to-top {
  position: fixed;
  bottom: 28px;
  right: 22px;
  z-index: 9000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--terracota);
  color: var(--offwhite);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(181, 100, 78, 0.40);
  opacity: 0;
  transform: translateY(16px) scale(0.85);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.blh-back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.blh-back-to-top:hover,
.blh-back-to-top:focus-visible {
  background: var(--terracota-dark);
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 8px 24px rgba(181, 100, 78, 0.50);
  outline: none;
}
.blh-back-to-top svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .blh-back-to-top { width: 44px; height: 44px; bottom: 16px; right: 14px; }
}
