/* ============================================================
   B9 — OVERLAYS (Busca + Menu) e PÁGINA DE RESULTADOS
   Carregado depois de b9-v6 + v7 + v8 + b9-archive.
   Base visual compartilhada: overlay escuro, fechar no topo
   direito, tipografia e cores do sistema B9. Função distinta:
   Busca = achar algo · Menu = navegar o universo B9.
   ============================================================ */

/* ── BASE COMUM ───────────────────────────────────────────── */
.b9ov {
  position: fixed; inset: 0; z-index: 4000;
  display: none; opacity: 0;
  transition: opacity .26s ease;
}
.b9ov.is-open { display: block; opacity: 1; }
.b9ov__scrim { position: absolute; inset: 0; }
body.b9-locked { overflow: hidden; }

/* botão fechar (círculo no canto superior direito) */
.b9ov__close {
  position: fixed; top: clamp(18px, 2vw, 30px); right: clamp(18px, 2.4vw, 40px); z-index: 3;
  width: clamp(44px, 4vw, 56px); height: clamp(44px, 4vw, 56px);
  border-radius: 50%; border: 1px solid rgba(255,255,255,.34); background: transparent;
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .18s, border-color .18s, transform .18s;
}
.b9ov__close:hover { background: var(--red); border-color: var(--red); transform: rotate(90deg); }
.b9ov__close svg { width: 40%; height: 40%; }

/* entrada: o overlay já faz fade via opacity. Conteúdo sempre visível
   (sem animação por-filho que arrisque travar em opacity:0). */

/* ════════════════════════════════════════════════════════════
   1 · MODAL DE BUSCA
   ════════════════════════════════════════════════════════════ */
.b9search .b9ov__scrim {
  background: rgba(10,9,7,.94);
  backdrop-filter: blur(7px) saturate(0.9);
}
.b9search__inner {
  position: relative; z-index: 2; height: 100%; overflow-y: auto;
  max-width: 1180px; margin: 0 auto;
  padding: clamp(86px, 11vh, 150px) clamp(22px, 5vw, 64px) clamp(40px, 6vh, 80px);
}

/* campo de busca grande */
.b9search__field { position: relative; display: flex; align-items: center; gap: clamp(14px, 1.6vw, 22px); padding-bottom: 18px; }
.b9search__field::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--red); }
.b9search__icon { flex-shrink: 0; color: var(--red); display: flex; }
.b9search__icon svg { width: clamp(26px, 3vw, 38px); height: clamp(26px, 3vw, 38px); }
.b9search__input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--paper);
  font-family: var(--display); font-weight: 700; letter-spacing: -0.028em;
  font-size: clamp(30px, 5.2vw, 64px); line-height: 1.04;
}
.b9search__input::placeholder { color: rgba(255,255,255,.34); }
[data-type="franklin"] .b9search__input, [data-type="atf"] .b9search__input { font-weight: 800; }
.b9search__clear {
  flex-shrink: 0; display: none; border: 0; background: transparent; cursor: pointer;
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,.5); padding: 8px;
}
.b9search__clear:hover { color: #fff; }
.b9search.has-query .b9search__clear { display: inline-flex; }

/* labels vermelhos (mono) */
.b9ov__label { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--red); margin: 0 0 22px; }

/* estado inicial: sugestões + mais buscadas */
.b9search__panel { display: none; margin-top: clamp(36px, 5vh, 64px); }
.b9search__panel.is-on { display: block; }
.b9search__cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(36px, 6vw, 96px); }

.b9sugg { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: clamp(12px, 1.4vw, 18px); }
.b9sugg a {
  font-family: var(--serif); font-size: clamp(22px, 2.4vw, 32px); line-height: 1.12;
  color: var(--paper); transition: color .16s, transform .16s; display: inline-block;
}
.b9sugg a:hover { color: var(--red); transform: translateX(5px); }

.b9hot { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.b9hot li { border-bottom: 1px solid rgba(255,255,255,.1); }
.b9hot li:first-child { border-top: 1px solid rgba(255,255,255,.1); }
.b9hot a { display: flex; align-items: baseline; gap: clamp(16px, 2vw, 28px); padding: clamp(14px, 1.5vw, 20px) 0; transition: color .16s; }
.b9hot__num { font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--red); flex-shrink: 0; }
.b9hot__term { font-family: var(--serif); font-size: clamp(19px, 2vw, 26px); line-height: 1.1; color: var(--paper); transition: color .16s; }
.b9hot a:hover .b9hot__term { color: var(--red); }

/* estado digitando: resultados instantâneos agrupados */
.b9res__group { margin-bottom: clamp(26px, 3vw, 40px); }
.b9res__cat { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--red); margin: 0 0 4px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.14); }
.b9res__item { display: flex; align-items: baseline; gap: 14px; padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,.08); transition: padding .16s; }
.b9res__item:hover { padding-left: 6px; }
.b9res__item:hover .b9res__title { color: var(--red); }
.b9res__meta { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); flex-shrink: 0; min-width: 92px; }
.b9res__title { font-family: var(--serif); font-size: clamp(17px, 1.6vw, 20px); line-height: 1.3; color: var(--paper); transition: color .16s; text-wrap: pretty; }
.b9res__title em { font-style: normal; color: var(--red); }
.b9res__date { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,.4); margin-left: auto; flex-shrink: 0; padding-left: 14px; }
.b9res__all {
  display: inline-flex; align-items: center; gap: 11px; margin-top: 8px;
  font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #fff; border-bottom: 2px solid var(--red); padding-bottom: 6px; transition: color .16s;
}
.b9res__all:hover { color: var(--red); }
.b9res__all span { transition: transform .16s; }
.b9res__all:hover span { transform: translateX(4px); }

/* estado sem resultado */
.b9empty__title { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; font-size: clamp(26px, 3vw, 40px); line-height: 1.05; color: var(--paper); margin: 0 0 14px; text-wrap: balance; }
[data-type="franklin"] .b9empty__title, [data-type="atf"] .b9empty__title { font-weight: 800; }
.b9empty__title em { font-style: normal; color: var(--red); }
.b9empty__text { font-family: var(--serif); font-size: clamp(17px, 1.5vw, 21px); line-height: 1.5; color: rgba(255,255,255,.66); margin: 0 0 30px; max-width: 52ch; text-wrap: pretty; }
.b9chips { display: flex; flex-wrap: wrap; gap: 11px; }
.b9chip {
  font-family: var(--mono); font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em;
  color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.28);
  padding: 11px 18px; cursor: pointer; transition: color .16s, background .16s, border-color .16s;
}
.b9chip:hover { color: var(--ink); background: #fff; border-color: #fff; }

/* lista de resultados ao vivo (b9-search.js) */
.b9results { display: flex; flex-direction: column; }
.b9results__empty, .b9results__msg {
  font-family: var(--serif); font-size: clamp(18px, 1.8vw, 24px); line-height: 1.4;
  color: rgba(255,255,255,.62); margin: 8px 0 0; text-wrap: pretty;
}
.b9results__empty span { color: var(--paper); }

/* ════════════════════════════════════════════════════════════
   2 · MODAL DE MENU
   ════════════════════════════════════════════════════════════ */
.b9menu .b9ov__scrim { background: #0C0B09; }
.b9menu__inner {
  position: relative; z-index: 2; height: 100%; overflow-y: auto;
  max-width: 1340px; margin: 0 auto;
  padding: clamp(86px, 11vh, 140px) clamp(22px, 5vw, 72px) clamp(48px, 7vh, 88px);
  display: grid; grid-template-columns: 1.1fr 1fr 0.92fr 1.02fr; gap: clamp(26px, 3.2vw, 56px);
  align-content: start;
}
.b9menu__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: clamp(10px, 1.1vw, 15px); }
.b9menu__col a {
  font-family: var(--display); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(24px, 2.4vw, 36px); line-height: 1.12; color: var(--paper);
  transition: color .16s, transform .16s; display: inline-block;
}
.b9menu__col a:hover { color: var(--red); transform: translateX(5px); }
[data-type="franklin"] .b9menu__col a, [data-type="atf"] .b9menu__col a { font-weight: 800; }

/* coluna utilitária (B9 / B9+): tipo menor, agrupada à direita */
.b9menu__util { display: flex; flex-direction: column; gap: clamp(26px, 3vh, 40px); }
.b9menu__util .b9ov__label { margin-bottom: 15px; }
.b9menu__col--sm ul { gap: clamp(8px, 0.8vw, 11px); }
.b9menu__col--sm a { font-size: clamp(18px, 1.5vw, 22px); font-weight: 600; letter-spacing: -0.01em; }
.b9menu__ext { font-size: 0.66em; color: rgba(255,255,255,.45); vertical-align: super; margin-left: 2px; }

/* card lateral B9+ */
.b9menu__cta {
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.03);
  padding: clamp(26px, 2.6vw, 38px); align-self: start;
}
.b9menu__cta-label { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--yellow); margin: 0 0 14px; }
.b9menu__cta h3 {
  font-family: var(--display); font-weight: 700; letter-spacing: -0.024em;
  font-size: clamp(26px, 2.6vw, 36px); line-height: 1.0; color: var(--paper); margin: 0;
}
[data-type="franklin"] .b9menu__cta h3, [data-type="atf"] .b9menu__cta h3 { font-weight: 800; }
.b9menu__cta p { font-family: var(--serif); font-size: 16px; line-height: 1.5; color: rgba(255,255,255,.7); margin: 14px 0 24px; text-wrap: pretty; }
.b9menu__cta-btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--yellow); color: var(--black); padding: 14px 22px;
  transition: background .16s, transform .16s;
}
.b9menu__cta-btn:hover { background: var(--yellow-deep); transform: translateY(-2px); }

/* "Siga o B9" — redes sociais no card do menu */
.b9menu__social { margin-top: clamp(22px, 2.2vw, 30px); padding-top: clamp(18px, 1.8vw, 24px); border-top: 1px solid rgba(255,255,255,.14); }
.b9menu__social-label { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,.5); margin: 0 0 13px; }
.b9menu__social-row { display: flex; align-items: center; gap: 16px; }
.b9menu__social-row a { color: rgba(255,255,255,.78); transition: color .16s, transform .16s; display: inline-flex; }
.b9menu__social-row a svg { width: 21px; height: 21px; display: block; }
.b9menu__social-row a:hover { color: var(--yellow); transform: translateY(-2px); }

/* ════════════════════════════════════════════════════════════
   3 · PÁGINA DE RESULTADOS DE BUSCA
   ════════════════════════════════════════════════════════════ */
.srch-main { position: relative; z-index: 1; }
.srch-head { padding: clamp(28px, 3.6vw, 52px) 0 clamp(20px, 2.4vw, 30px); }
.srch-head__eyebrow { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--red); margin: 0 0 16px; }
.srch-head__title { font-family: var(--display); font-weight: 700; letter-spacing: -0.028em; font-size: clamp(34px, 4.6vw, 64px); line-height: 1.0; color: var(--ink); margin: 0; text-wrap: balance; }
[data-type="franklin"] .srch-head__title, [data-type="atf"] .srch-head__title { font-weight: 800; }
.srch-head__title em { font-style: normal; color: var(--red); }

/* campo menor já preenchido */
.srch-field { margin-top: clamp(22px, 2.6vw, 34px); display: flex; align-items: center; gap: 13px; max-width: 560px; border-bottom: 2px solid var(--ink); padding-bottom: 12px; }
.srch-field__icon { color: var(--red); display: flex; flex-shrink: 0; }
.srch-field input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: clamp(18px, 1.8vw, 24px); letter-spacing: -0.01em; }
.srch-field button { border: 0; background: transparent; cursor: pointer; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); padding: 6px; }
.srch-field button:hover { color: var(--red); }

/* barra de filtros + contagem */
.srch-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin: clamp(26px, 3vw, 38px) 0 0; padding-bottom: 18px; border-bottom: 1px solid var(--rule); }
.srch-count { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-muted); }

/* listagem (lista, não grid) */
.srch-list { list-style: none; margin: 0; padding: 0; }
.srch-item { display: grid; grid-template-columns: clamp(120px, 15vw, 188px) 1fr; gap: clamp(20px, 2.4vw, 38px); align-items: start; padding: clamp(24px, 2.8vw, 36px) 0; border-bottom: 1px solid var(--rule); }
.srch-item--noimg { grid-template-columns: 1fr; }
.srch-item__media { aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--paper-2); position: relative; }
.srch-item__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.srch-item:hover .srch-item__media img { transform: scale(1.04); }
.srch-item__media.is-art { background: #0c0c0c; }
.srch-item__media.is-art::before { content: ""; position: absolute; inset: 0; background-image: var(--bg); background-size: cover; background-position: center; filter: blur(20px) brightness(.5); transform: scale(1.2); }
.srch-item__media.is-art img { object-fit: contain; position: relative; z-index: 1; }
.srch-item__plus { position: absolute; top: 10px; left: 10px; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; background: var(--yellow); color: var(--black); padding: 4px 8px; border-radius: 5px; }

.srch-item__kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; margin-bottom: 9px; }
.srch-item__type { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #fff; background: var(--ink); padding: 4px 9px; }
.srch-item__type--ep { background: var(--red); }
.srch-item__type--autor, .srch-item__type--tag { background: transparent; color: var(--fg-soft); border: 1px solid var(--rule); }
.srch-item__cat { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--red); }
.srch-item__title { font-family: var(--display); font-weight: 700; letter-spacing: -0.018em; font-size: clamp(21px, 2.1vw, 30px); line-height: 1.1; color: var(--ink); margin: 0; text-wrap: pretty; transition: color .16s; }
[data-type="franklin"] .srch-item__title, [data-type="atf"] .srch-item__title { font-weight: 700; }
.srch-item:hover .srch-item__title { color: var(--red); }
.srch-item__title em { font-style: normal; background: rgba(255,230,0,.4); padding: 0 2px; }
.srch-item__dek { font-family: var(--serif); font-size: clamp(15px, 1.4vw, 17px); line-height: 1.5; color: var(--fg-soft); margin: 9px 0 0; text-wrap: pretty; max-width: 64ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.srch-item__date { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); margin-top: 12px; }

/* estado vazio na página */
.srch-zero { padding: clamp(40px, 6vw, 90px) 0 clamp(50px, 7vw, 110px); max-width: 640px; }
.srch-zero__title { font-family: var(--display); font-weight: 700; letter-spacing: -0.022em; font-size: clamp(26px, 3vw, 40px); line-height: 1.04; color: var(--ink); margin: 0 0 14px; }
[data-type="franklin"] .srch-zero__title, [data-type="atf"] .srch-zero__title { font-weight: 800; }
.srch-zero__title em { font-style: normal; color: var(--red); }
.srch-zero__text { font-family: var(--serif); font-size: clamp(17px, 1.5vw, 20px); line-height: 1.5; color: var(--fg-soft); margin: 0 0 30px; text-wrap: pretty; }
.srch-zero__label { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--red); margin: 0 0 16px; }
.srch-zero__chips { display: flex; flex-wrap: wrap; gap: 11px; }
.srch-zero__chips a {
  font-family: var(--mono); font-size: 12.5px; font-weight: 700; letter-spacing: 0.03em;
  color: var(--fg-soft); background: #fff; border: 1px solid var(--rule); padding: 11px 18px;
  transition: color .16s, border-color .16s, background .16s;
}
.srch-zero__chips a:hover { color: var(--red); border-color: var(--red); background: rgba(255,62,54,.05); }

/* ── RESPONSIVO ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .b9menu__inner { grid-template-columns: 1fr 1fr; gap: clamp(30px, 4vw, 56px); }
  .b9menu__util { flex-direction: row; gap: clamp(28px, 5vw, 64px); }
  .b9menu__util .b9menu__col--sm { flex: 1; }
  .b9menu__cta { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .b9search__cols { grid-template-columns: 1fr; gap: clamp(34px, 6vh, 52px); }
}
@media (max-width: 560px) {
  .b9menu__inner { grid-template-columns: 1fr; gap: clamp(26px, 5vh, 40px); }
  .b9menu__util { flex-direction: row; flex-wrap: wrap; gap: 28px 32px; }
  .srch-item { grid-template-columns: 1fr; gap: 14px; }
  .srch-item__media { max-width: 280px; }
  .b9res__item { flex-wrap: wrap; }
  .b9res__date { margin-left: 0; padding-left: 0; flex-basis: 100%; }
}