/* ==============================================================
   HEADER — card central flutuante, bege com efeito liquid glass
   Logo à esquerda · páginas ao centro · idioma + redes à direita
   ============================================================== */

.site-header {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 18px 14px 22px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 28px;
  color: var(--ink);
  /* Liquid glass: bege translúcido + desfoque e saturação do fundo */
  background:
    linear-gradient(135deg, rgba(253, 241, 225, 0.82) 0%, rgba(253, 241, 225, 0.56) 55%, rgba(247, 234, 214, 0.7) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(115, 123, 62, 0.1),
    inset 0 0 24px rgba(255, 255, 255, 0.18),
    0 18px 50px rgba(17, 20, 17, 0.18),
    0 2px 6px rgba(17, 20, 17, 0.06);
  animation: header-in 900ms var(--ease-out) 150ms both;
}

/* Reflexo de luz no vidro */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    radial-gradient(120% 140% at 12% -40%, rgba(255, 255, 255, 0.75), transparent 45%),
    radial-gradient(80% 120% at 100% 140%, rgba(194, 122, 90, 0.12), transparent 60%);
  pointer-events: none;
}

/* ---------- Logo ---------- */

.site-logo {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--fs-logo);
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: -0.015em;
  text-decoration: none;
  white-space: nowrap;
}

/* Logo em imagem (header e footer; o tamanho do footer fica em footer.css) */
.site-logo-img {
  display: block;
  width: auto;
  height: 58px;
  filter: drop-shadow(0 2px 6px rgba(17, 20, 17, 0.12));
  transition: transform 300ms var(--ease-out);
}

.site-logo:hover .site-logo-img {
  transform: scale(1.04);
}

/* ---------- Navegação ---------- */

.site-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(20px, 2.2vw, 40px);
}

.site-nav a {
  position: relative;
  padding: 6px 0;
  color: rgba(17, 20, 17, 0.74);
  font-size: var(--fs-nav);
  font-weight: var(--fw-medium);
  line-height: var(--lh-nav);
  letter-spacing: var(--ls-nav);
  text-decoration: none;
  white-space: nowrap;
  transition: color 200ms ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  border-radius: 2px;
  background: var(--terracotta);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 360ms var(--ease-out);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* ---------- Ações (redes sociais + idioma no final) ---------- */

.header-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

/* Seletor de idioma */

.lang {
  position: relative;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 0 0 1px rgba(17, 20, 17, 0.08);
  font-size: var(--fs-nav);
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 200ms ease;
}

.language-switcher:hover,
.language-switcher[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.75);
}

.language-switcher svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

/* Bandeiras (botão e opções do menu) */
.lang-flag {
  display: block;
  flex: 0 0 auto;
  width: 20px;
  height: 14px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(17, 20, 17, 0.12);
}

.lang-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.language-switcher .lang-chevron {
  width: 12px;
  height: 12px;
  transition: transform 260ms var(--ease-out);
}

.language-switcher[aria-expanded="true"] .lang-chevron {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 2;
  display: grid;
  gap: 2px;
  min-width: 164px;
  margin: 0;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  list-style: none;
  background: rgba(253, 241, 225, 0.92);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 18px 40px rgba(17, 20, 17, 0.18);
  animation: lang-menu-in 220ms var(--ease-out) both;
}

.lang-menu[hidden] {
  display: none;
}

.lang-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  text-align: left;
  cursor: pointer;
}

.lang-menu button small {
  color: var(--muted);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.06em;
}

.lang-menu button:hover {
  background: rgba(115, 123, 62, 0.12);
}

.lang-menu button[aria-checked="true"] {
  color: var(--paper);
  background: var(--olive);
}

.lang-menu button[aria-checked="true"] small {
  color: rgba(253, 241, 225, 0.8);
}

/* Redes sociais */

.header-social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.social-link {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 0 0 1px rgba(17, 20, 17, 0.08);
  transition: background-color 240ms ease, color 240ms ease, transform 240ms var(--ease-out);
}

.social-link svg {
  width: 18px;
  height: 18px;
}

.social-link:hover {
  color: var(--paper);
  background: var(--terracotta);
  transform: translateY(-1px);
}

/* ---------- Animações ---------- */

@keyframes header-in {
  from {
    opacity: 0;
    translate: 0 -14px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes lang-menu-in {
  from {
    opacity: 0;
    translate: 0 -6px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

/* Sem suporte a backdrop-filter: bege mais sólido para manter a leitura */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header,
  .lang-menu {
    background: rgba(253, 241, 225, 0.97);
  }
}

/* ==============================================================
   RESPONSIVO
   ============================================================== */

@media (max-width: 1100px) {
  .site-header {
    gap: 20px;
  }

  .site-nav {
    gap: 20px;
  }
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 12px 16px;
    padding: 12px 14px 10px 16px;
    border-radius: 24px;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    gap: 22px;
    padding: 8px 4px 2px;
    border-top: 1px solid rgba(17, 20, 17, 0.08);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 640px) {
  .site-header {
    top: 10px;
    width: calc(100% - 20px);
  }

  .site-logo {
    gap: 10px;
  }


  .header-actions,
  .header-social {
    gap: 6px;
  }

  .language-switcher {
    min-height: 36px;
    padding: 0 10px;
  }

  .social-link {
    width: 36px;
    height: 36px;
  }

  .social-link svg {
    width: 16px;
    height: 16px;
  }

  .site-logo-img {
    height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .site-header,
  .lang-menu {
    animation: none;
  }

  .site-nav a::after,
  .site-logo-img,
  .language-switcher .lang-chevron,
  .social-link {
    transition: none;
  }
}
