/* Dock suspenso: glifo e rótulo trocam de lugar em 200 ms. */
.site-header.floating-dock {
  position: fixed;
  top: 16px;
  left: 50%;
  right: auto;
  translate: -50% 0;
  width: max-content;
  max-width: calc(100% - 16px);
  border: 1px solid #fff;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.site-header.floating-dock .header-inner {
  width: auto;
  min-height: 0;
  padding: 10px;
  gap: 14px;
}
.floating-dock .dock-brand { padding: 0 6px; flex: 0 0 auto; }
.floating-dock .dock-brand img { height: 34px; width: auto; }
.site-header.floating-dock nav { margin: 0; gap: 8px; }
.site-header.floating-dock .dock-link {
  --dock-expanded: 96px;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #fff;
  font-family: var(--heading);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}
.site-header.floating-dock .dock-link::after { display: none; }
/* A pílula preta (96 px = o slot e mais um vizinho) cresce por cima do vizinho; o slot de 44 px nunca muda de largura,
   então nenhum botão se move. O último link cresce para a esquerda para ficar dentro do dock. */
.floating-dock .dock-link::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 44px;
  border-radius: 14px;
  background: #000;
  z-index: -1;
  pointer-events: none;
  transition: width .2s ease;
}
.floating-dock .dock-link:last-child::before { inset: 0 0 0 auto; }
/* Página atual: barra branca sob o glifo (forma, não só cor); some quando o rótulo expande. */
.site-header.floating-dock .dock-link[aria-current="page"]::after {
  display: block;
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 16px;
  height: 3px;
  margin-left: -8px;
  border-radius: 2px;
  background: #fff;
}
@media (min-width: 640px) {
  .site-header.floating-dock .dock-link[aria-current="page"]:is(:hover, :focus-visible)::after { opacity: 0; }
}
.floating-dock .dock-glyph {
  position: absolute;
  width: 20px;
  height: 20px;
  opacity: 1;
  transition: opacity .2s ease, transform .2s ease;
}
.floating-dock .dock-label {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--dock-expanded);
  display: grid;
  place-items: center;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.floating-dock .dock-link:last-child .dock-label { inset: 0 0 0 auto; }
.site-header.floating-dock nav:not(:has(.dock-link:hover)) .dock-link:focus-visible { outline: none; z-index: 1; }
.site-header.floating-dock nav:not(:has(.dock-link:hover)) .dock-link:focus-visible::before {
  width: var(--dock-expanded);
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #000;
}
.site-header.floating-dock nav:not(:has(.dock-link:hover)) .dock-link:focus-visible .dock-glyph { opacity: 0; transform: translateY(-6px); }
.site-header.floating-dock nav:not(:has(.dock-link:hover)) .dock-link:focus-visible .dock-label { opacity: 1; transform: translateY(0); }
@media (hover: hover) {
  .site-header.floating-dock .dock-link:hover { z-index: 1; }
  .site-header.floating-dock .dock-link:hover::before { width: var(--dock-expanded); box-shadow: 0 0 0 3px #fff; }
  .site-header.floating-dock .dock-link:hover .dock-glyph { opacity: 0; transform: translateY(-6px); }
  .site-header.floating-dock .dock-link:hover .dock-label { opacity: 1; transform: translateY(0); }
}

/* Celular: dock na base (alcance do polegar), glifo e rótulo sempre visíveis, sem expansão. */
@media (max-width: 639px) {
  .site-header.floating-dock {
    top: auto;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    left: 8px;
    right: 8px;
    translate: none;
    width: auto;
    max-width: none;
  }
  .site-header.floating-dock .header-inner { width: 100%; padding: 4px; gap: 2px; }
  .floating-dock .dock-brand { display: grid; place-items: center; min-width: 44px; height: 56px; padding: 0 4px; }
  .floating-dock .dock-brand img { height: 24px; }
  .site-header.floating-dock nav { flex: 1; min-width: 0; gap: 4px; }
  .site-header.floating-dock .dock-link {
    flex: 1 1 0;
    width: auto;
    min-width: 44px;
    height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
    letter-spacing: -.01em;
  }
  .floating-dock .dock-link::before,
  .floating-dock .dock-link:last-child::before { inset: 0; width: auto; box-shadow: none; transition: none; }
  .floating-dock .dock-glyph,
  .floating-dock .dock-label,
  .floating-dock .dock-link:last-child .dock-label { position: static; inset: auto; opacity: 1; transform: none; transition: none; }
  .floating-dock .dock-label { width: auto; display: block; }
  .floating-dock .dock-glyph { flex: 0 0 auto; }
  .site-header.floating-dock .dock-link[aria-current="page"]::after { bottom: 3px; }
  .site-header.floating-dock nav:not(:has(.dock-link:hover)) .dock-link:focus-visible::before { width: auto; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #000; }
  .site-header.floating-dock nav:not(:has(.dock-link:hover)) .dock-link:focus-visible .dock-glyph,
  .site-header.floating-dock nav:not(:has(.dock-link:hover)) .dock-link:focus-visible .dock-label { opacity: 1; transform: none; }
}
@media print {
  .site-header.floating-dock { display: none; }
}

/* Páginas de leitura reservam espaço para o dock fixo: no topo no desktop, na base no celular. */
.has-dock:not(.home-page) main { padding-top: 96px; }
@media (max-width: 639px) {
  .has-dock:not(.home-page) main { padding-top: 0; }
  .has-dock { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  html { scroll-padding-top: 0; }
}
@media print {
  .has-dock:not(.home-page) main { padding-top: 0; }
  .has-dock { padding-bottom: 0; }
}

/* Alvo de toque do logo no rodapé: mínimo de 44 px. */
.footer-brand { display: flex; align-items: center; min-height: 44px; }
