/* ==========================================================================
   layout.css — cabeçalho fixo, busca, rodapé e botão flutuante do WhatsApp
   ========================================================================== */

/* ---------- Cabeçalho ---------- */
/* Cabeçalho fixo no topo. A altura vem de --header-h e o <body> tem o mesmo espaço em padding-top. */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  background: var(--rose); border-bottom: 1px solid var(--rose-3);
}
.site-header__bar {
  height: 100%; display: flex; align-items: center; gap: clamp(16px, 3vw, 40px);
}
.brand { display: block; flex: none; line-height: 0; }
.brand img { height: calc(var(--header-h) - 26px); width: auto; }

.nav { margin-left: auto; }
.nav__list { display: flex; align-items: center; gap: clamp(18px, 2.6vw, 38px); }
.nav__link {
  position: relative; display: inline-block; padding: 8px 0; font-weight: 500; font-size: 1rem; text-decoration: none;
}
/* Sublinhado animado: cresce ao passar o mouse e fica fixo na página atual. */
.nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--black);
  transform: scaleX(0); transform-origin: left; transition: transform 0.25s var(--ease);
}
.nav__link:hover::after, .nav__link[aria-current="page"]::after { transform: scaleX(1); }

.site-header__actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: transparent; transition: background-color 0.2s var(--ease);
}
.icon-btn:hover { background: var(--rose-2); }
.icon-btn svg { width: 24px; height: 24px; }
.nav-toggle { display: none; }

/* Celular/tablet: o menu vira um painel que desce sob o cabeçalho, aberto pelo botão hambúrguer. */
@media (max-width: 960px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; margin: 0; padding: 12px var(--gutter) 28px;
    background: var(--rose); border-bottom: 1px solid var(--rose-3);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s 0.2s;
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__link { display: block; padding: 16px 0; font-size: 1.25rem; font-family: var(--font-display); font-weight: 600; border-bottom: 1px solid var(--rose-3); }
  .nav__link::after { display: none; }
  .site-header__actions { margin-left: auto; }
}

/* ---------- Busca ---------- */
/* Painel da busca: aparece logo abaixo do cabeçalho; o atributo [hidden] o esconde. */
.search-panel {
  position: absolute; top: 100%; left: 0; right: 0; background: var(--white);
  border-bottom: 1px solid var(--rose-3); box-shadow: 0 18px 30px rgba(0, 0, 0, 0.08);
}
.search-panel[hidden] { display: none; }
.search-panel__inner { padding-block: 20px 24px; }
.search-field { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid var(--black); padding-bottom: 8px; }
.search-field svg { width: 24px; height: 24px; flex: none; }
.search-field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; padding: 4px 0;
}
.search-field input::placeholder { color: var(--ink-3); font-weight: 500; }
.search-results { margin-top: 12px; max-height: min(56vh, 460px); overflow-y: auto; }
.search-results__hint { padding: 14px 0; color: var(--ink-3); margin: 0; }
.search-result {
  display: block; padding: 14px 12px; margin-inline: -12px; text-decoration: none; border-radius: var(--radius-s);
}
.search-result:hover, .search-result:focus-visible { background: var(--rose); }
.search-result__title { display: block; font-weight: 600; font-size: 1.05rem; }
.search-result__where { display: inline-block; margin-left: 8px; font-size: 0.82rem; font-weight: 500; color: var(--ink-3); }
.search-result__snippet { display: block; color: var(--ink-2); font-size: 0.95rem; line-height: 1.5; margin-top: 2px; }
.search-result mark { background: var(--rose-2); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ---------- Rodapé ---------- */
.site-footer { background: var(--black); color: var(--white); padding-top: clamp(56px, 7vw, 88px); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer__grid {
  display: grid; gap: 40px clamp(28px, 5vw, 72px);
  grid-template-columns: 1.5fr 1fr 1.3fr;
}
.footer__brand img { height: 64px; width: auto; filter: brightness(0) invert(1); margin-bottom: 18px; }
.footer__brand p { max-width: 34ch; color: rgba(255, 255, 255, 0.78); font-size: 0.98rem; }
.footer__title { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 14px; color: var(--white); }
.footer__links li + li { margin-top: 8px; }
.footer__contact li { display: flex; gap: 12px; align-items: flex-start; }
.footer__contact li + li { margin-top: 12px; }
.footer__contact svg { width: 20px; height: 20px; margin-top: 4px; flex: none; opacity: 0.85; }
.footer__social { display: flex; gap: 10px; margin-top: 22px; }
.footer__social a {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--white);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.footer__social a:hover { background: var(--white); color: var(--black); text-decoration: none; }
.footer__social svg { width: 22px; height: 22px; }
.footer__bottom {
  margin-top: clamp(40px, 6vw, 72px); padding-block: 22px 96px; border-top: 1px solid var(--line-dark);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  font-size: 0.9rem; color: rgba(255, 255, 255, 0.68);
}
.footer__bottom a { color: inherit; }

@media (max-width: 860px) {
  .footer__grid { grid-template-columns: 1fr; }
}

/* ---------- WhatsApp flutuante (todas as páginas) ---------- */
/* Botão flutuante do WhatsApp; respeita a área segura de celulares com "notch" (env(safe-area-inset-*)). */
.wa-float {
  position: fixed; z-index: 90; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom));
  display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%;
  background: var(--whatsapp); color: var(--white); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s var(--ease);
}
.wa-float:hover { transform: scale(1.06); }
.wa-float svg { width: 32px; height: 32px; }
.wa-float:focus-visible { outline-color: var(--black); outline-offset: 4px; }
