/* ===============================
   TOKENS EDITORIAIS (IDENTIDADE)
================================ */
:root{
  --rail: 720px;
  --rail-pad: 16px;
  --header-h: 56px;

  --brand: #0f172a;
  --brand-contrast: #ffffff;
  --border: rgba(255,255,255,0.15);
  --text: #0b1220;
  --muted: #cbd5e1;
}

/* ===============================
   ACESSIBILIDADE
================================ */
.skip-link{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden}
.skip-link:focus{left:16px;top:16px;width:auto;height:auto;padding:10px 12px;background:#111;color:#fff;z-index:9999}
[hidden]{display:none!important}

/* ===============================
   HEADER BASE (RAIL GLOBAL)
================================ */
.site-header.site-header--editorial{
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--brand);
  border-bottom: 1px solid var(--border);
}

/* Rail do header (mesma régua do conteúdo) */
.site-header.site-header--editorial .header-inner{
  max-width: var(--rail);
  margin: 0 auto;
  padding: 18px var(--rail-pad) 0;
  height: auto;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  box-sizing: border-box;
  position: relative; /* garante referência local se alguém usar absolute */
}

/* ===============================
   GRUPOS
================================ */
.header-left,
.header-right{
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===============================
   LOGO
================================ */
.site-logo{
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.35rem;
  color: var(--brand-contrast);
  text-decoration: none;
  white-space: nowrap;
}

/* ===============================
   BOTÕES
================================ */
.header-action,
.nav-toggle,
.drawer-close{
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: var(--brand-contrast);
}
.header-action:hover,
.nav-toggle:hover,
.drawer-close:hover{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.2);
}

/* ===============================
   NAV DESKTOP
================================ */
.site-nav{display:none}
.nav-menu{list-style:none;display:flex;gap:14px;margin:0;padding:0}
.nav-menu a{
  height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border-radius: 10px;
  font-size: .95rem;
  text-decoration: none;
  color: #e5e7eb;
}
.nav-menu a:hover{background:rgba(255,255,255,.08);color:#fff}
.nav-menu .current-menu-item>a{background:rgba(255,255,255,.16);color:#fff}

/* ===============================
   HAMBURGER
================================ */
.nav-toggle__icon{position:relative;width:18px;height:2px;background:#fff}
.nav-toggle__icon::before,
.nav-toggle__icon::after{content:"";position:absolute;left:0;width:18px;height:2px;background:#fff}
.nav-toggle__icon::before{top:-6px}
.nav-toggle__icon::after{top:6px}

/* ===============================
   SEARCH OVERLAY
================================ */
.search-overlay{
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.98);
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-box{width:100%;max-width:520px;padding:24px}
.search-box input{
  width: 100%;
  padding: 14px;
  font-size: 1.1rem;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  background: #020617;
  color: #fff;
}
.search-box button{margin-top:12px}

/* ===============================
   DRAWER
================================ */
.drawer-overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:1200}
.mobile-drawer{
  position: fixed; top: 0; left: 0;
  width: min(88vw,360px); height: 100vh;
  background: #020617; z-index: 1300;
  transform: translateX(-102%);
  transition: transform .22s ease;
  border-right: 1px solid rgba(255,255,255,.1);
  display: flex; flex-direction: column;
}
.mobile-drawer.is-open{transform:translateX(0)}
.mobile-drawer__header{
  height: var(--header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: #fff;
}
.mobile-menu{list-style:none;padding:14px}
.mobile-menu a{
  display: flex;
  padding: 12px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 650;
  color: #e5e7eb;
}
.mobile-menu a:hover{background:rgba(255,255,255,.08)}

/* ===============================
   BREAKPOINT
================================ */
@media (min-width:1024px){
  .site-nav{display:block}
  .nav-toggle{display:none}
}

/* ===============================
   FIX DEFINITIVO: impede busca “escapar” pro canto
   (override de qualquer absolute/fixed/right/top de outro CSS)
================================ */
.site-header.site-header--editorial .header-right{
  margin-left: auto !important;
  position: static !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
}

.site-header.site-header--editorial .header-right .header-search,
.site-header.site-header--editorial .header-action.header-search{
  position: static !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
}

.site-header.site-header--editorial .header-inner{
  max-width: var(--rail);
  margin: 0 auto;

  min-height: var(--header-h);
  padding: 0 var(--rail-pad);

  display: flex;
  align-items: center;
  justify-content: space-between;

  box-sizing: border-box;
}

@media (min-width:1024px){
  .site-header.site-header--editorial .site-nav{
    margin-left: auto;
  }

  .site-header.site-header--editorial .header-right{
    margin-left: 12px;
  }
}
