/* ==========================================================================
 * css/home-busca.css: busca em destaque e "Navegue por ano" da home.
 * Carregado depois do css/pnb.css. Usa as variáveis do site quando existem.
 * ========================================================================== */
 :root {
  --hb-bg: var(--bg, #08060F);
  --hb-bg2: var(--bg2, #0F0C1A);
  --hb-fg: var(--fg, #F5F3FF);
  --hb-muted: var(--muted, #8A86A6);
  --hb-linha: var(--linha, rgba(255, 255, 255, .08));
  --hb-roxo: var(--roxo, #7C3AED);
  --hb-rosa: var(--rosa, #EC4899);
  --hb-grad: linear-gradient(90deg, var(--hb-roxo), var(--hb-rosa));
  --hb-display: 'Unbounded', system-ui, sans-serif;
  --hb-texto: 'Space Grotesk', system-ui, sans-serif;
}

.hb-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- hero */
.hb-hero { overflow: visible; }                 /* deixa as sugestões passarem da borda do hero */
.hb-parede-clip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
/* a parede de fotos vira textura: escura e sem cor forte, para não brigar com o título */
.hb-hero .hero__parede { opacity: .5; filter: saturate(.55); }
.hb-parede-clip::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(110% 85% at 50% 38%, rgba(8, 6, 15, .80) 0%, rgba(8, 6, 15, .92) 60%, var(--hb-bg) 100%),
    linear-gradient(180deg, rgba(8, 6, 15, .6), rgba(8, 6, 15, 0) 30%);
}
.hb-hero .hero__conteudo {
  position: relative; z-index: 2;
  padding-bottom: 8px;
  text-align: center;
}
.hb-hero .hb-titulo {
  margin: 0 auto .7rem;
  font-family: var(--hb-display);
  font-weight: 800;
  font-size: clamp(1.85rem, 1.1rem + 2.8vw, 3.3rem);
  line-height: 1.06;
  letter-spacing: -.025em;
  max-width: 20ch;
  text-wrap: balance;
  color: var(--hb-fg);
}
.hb-hero .hb-sub {
  margin: 0 auto 1.8rem;
  max-width: 52ch;
  color: var(--hb-muted);
  font-size: clamp(1rem, .95rem + .3vw, 1.15rem);
  line-height: 1.5;
}

.hb-busca { position: relative; max-width: 760px; margin: 0 auto; text-align: left; }

.hb-campo {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 18px;
  background: rgba(15, 12, 26, .94);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color .2s, box-shadow .2s;
}
.hb-campo:focus-within {
  border-color: var(--hb-roxo);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, .28), 0 24px 60px rgba(0, 0, 0, .5);
}
.hb-campo__lupa { width: 22px; height: 22px; flex: none; fill: var(--hb-muted); }
.hb-campo input {
  flex: 1; min-width: 0; min-height: 52px;
  padding: 0; border: 0; outline: none; background: transparent;
  color: var(--hb-fg); font: 500 1.125rem/1.2 var(--hb-texto);
}
.hb-campo input::placeholder { color: var(--hb-muted); opacity: 1; }
.hb-campo input::-webkit-search-cancel-button { filter: invert(1) opacity(.6); }
.hb-procurar {
  flex: none; height: 52px; padding: 0 26px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--hb-grad); color: #fff;
  font: 700 1rem var(--hb-texto);
}
.hb-procurar:hover { filter: brightness(1.1); }
.hb-procurar:focus-visible, .hb-campo input:focus-visible { outline: none; }
.hb-procurar:focus-visible { box-shadow: 0 0 0 3px #fff; }
@media (max-width: 480px) {
  .hb-campo { padding-left: 14px; }
  .hb-campo input { font-size: 1rem; }
  .hb-procurar { padding: 0 18px; }
}

/* sugestões */
.hb-sugestoes {
  position: absolute; left: 0; right: 0; top: calc(52px + 12px + 8px); z-index: 40;
  margin: 0; padding: 6px; list-style: none;
  max-height: min(60vh, 460px); overflow-y: auto;
  background: var(--hb-bg2);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
}
.hb-sug a {
  display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 12px;
  padding: 8px; border-radius: 14px;
  color: var(--hb-fg); text-decoration: none;
}
.hb-sug img { width: 72px; height: 48px; object-fit: cover; border-radius: 8px; background: rgba(255, 255, 255, .06); }
.hb-sug__nome { display: block; font-weight: 600; line-height: 1.3; }
.hb-sug__nome mark { background: none; color: inherit; text-decoration: underline; text-decoration-color: var(--hb-rosa); text-underline-offset: 3px; }
.hb-sug__meta { display: block; margin-top: 2px; color: var(--hb-muted); font-size: .85rem; }
.hb-sug--todos a { display: block; padding: 12px 10px; color: var(--hb-muted); font-size: .95rem; }
.hb-sug--todos strong { color: var(--hb-fg); }
.hb-sug--vazio { padding: 14px 12px; color: var(--hb-muted); }
.hb-sug[aria-selected="true"] a, .hb-sug a:hover { background: rgba(124, 58, 237, .2); }

/* filtros */
.hb-filtros {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
  margin-top: 16px;
}
.hb-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.hb-cats label { position: relative; cursor: pointer; }
.hb-cats input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hb-cats span {
  display: inline-block; padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px;
  background: rgba(15, 12, 26, .75); color: var(--hb-muted);
  font-size: .9rem; white-space: nowrap; transition: color .15s, background .15s;
}
.hb-cats label:hover span { color: var(--hb-fg); }
.hb-cats input:checked + span { background: var(--hb-grad); border-color: transparent; color: #fff; font-weight: 600; }
.hb-cats input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }

.hb-datas { display: flex; gap: 8px; }
.hb-select select {
  -webkit-appearance: none; appearance: none;
  padding: 9px 38px 9px 16px; min-height: 40px;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px;
  background: rgba(15, 12, 26, .75) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238A86A6'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 12px center / 18px;
  color: var(--hb-fg); font: 500 .95rem var(--hb-texto); cursor: pointer;
}
.hb-select select:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.hb-select option { background: var(--hb-bg2); color: var(--hb-fg); }
.hb-hero .hb-dica { margin: 14px 0 0; color: var(--hb-muted); font-size: .875rem; text-align: center; }
.hb-hero .hero__numeros { margin-top: clamp(32px, 5vw, 56px); }
@media (max-width: 640px) {
  .hb-cats { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 4px; scrollbar-width: none; }
  .hb-cats::-webkit-scrollbar { display: none; }
  .hb-datas { width: 100%; }
  .hb-select { flex: 1; }
  .hb-select select { width: 100%; font-size: 1rem; }
}

/* ------------------------------------------------------ navegue por ano */
.hb-anos .hb-anos__sub { margin: .5rem 0 0; color: var(--hb-muted); max-width: 60ch; }

.hb-linha {
  --altura: 120px;
  display: flex; align-items: flex-end; gap: 4px;
  margin-top: 1.4rem;
  padding: 26px 2px 0;
  border-bottom: 1px solid var(--hb-linha);
  overflow-x: auto; scrollbar-width: thin;
  scroll-snap-type: x proximity;
}
.hb-ano {
  position: relative; flex: 1 0 40px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 0 0 10px;
  color: var(--hb-muted); text-decoration: none;
  scroll-snap-align: center;
}
.hb-ano__barra {
  display: block; width: 100%; max-width: 34px;
  height: max(3px, calc(var(--p) * var(--altura)));
  border-radius: 6px 6px 2px 2px;
  background: rgba(255, 255, 255, .13);
  transition: background .2s, transform .2s;
  transform-origin: bottom;
}
.hb-ano__num { font: 600 .8rem var(--hb-texto); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.hb-ano__qtd {
  position: absolute; left: 50%; bottom: calc(max(3px, var(--p) * var(--altura)) + 10px + 8px + 1.2em);
  transform: translateX(-50%);
  font: 600 .72rem var(--hb-texto); color: var(--hb-fg); white-space: nowrap;
  opacity: 0; transition: opacity .15s;
}
span.hb-ano { opacity: .4; }
@media (hover: hover) { a.hb-ano:hover .hb-ano__barra { background: rgba(255, 255, 255, .28); } }
a.hb-ano:hover .hb-ano__qtd, a.hb-ano:focus-visible .hb-ano__qtd, .hb-ano[aria-current="true"] .hb-ano__qtd { opacity: 1; }
.hb-ano[aria-current="true"] { color: var(--hb-fg); }
a.hb-ano[aria-current="true"] .hb-ano__barra { background: linear-gradient(0deg, var(--hb-roxo), var(--hb-rosa)); }
.hb-ano[aria-current="true"]::after {
  content: ""; position: absolute; left: 50%; bottom: -1px; width: 22px; height: 3px;
  transform: translateX(-50%); border-radius: 3px; background: var(--hb-rosa);
}
.hb-ano:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 6px; }
@media (min-width: 900px) { .hb-linha { --altura: 150px; } }

/* painel do ano */
.hb-painel { padding-top: 1.6rem; transition: opacity .2s; }
.hb-painel.carregando { opacity: .45; pointer-events: none; }
.hb-painel__topo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; margin-bottom: 1rem; }
.hb-painel__ano {
  margin: 0;
  font-family: var(--hb-display); font-weight: 800;
  font-size: clamp(3rem, 2rem + 5vw, 6rem); line-height: .95; letter-spacing: -.04em;
  background: var(--hb-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.hb-painel__total { margin: 0; color: var(--hb-muted); font-size: 1.05rem; }

.hb-meses {
  display: flex; gap: 6px;
  overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none;
}
.hb-meses::-webkit-scrollbar { display: none; }
.hb-mes {
  flex: none; display: inline-flex; align-items: baseline; gap: 6px;
  padding: 9px 14px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .12); background: var(--hb-bg2);
  color: var(--hb-fg); font: 600 .9rem var(--hb-texto); text-decoration: none; white-space: nowrap;
}
.hb-mes small { color: var(--hb-muted); font-weight: 500; font-size: .78rem; }
a.hb-mes:hover { border-color: rgba(255, 255, 255, .3); }
.hb-mes[aria-current="true"] { background: var(--hb-grad); border-color: transparent; color: #fff; }
.hb-mes[aria-current="true"] small { color: rgba(255, 255, 255, .85); }
.hb-mes[aria-disabled="true"] { opacity: .32; cursor: default; }
.hb-mes:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (min-width: 1000px) {
  .hb-meses { display: grid; grid-template-columns: auto repeat(12, 1fr); overflow: visible; }
  .hb-mes { justify-content: center; }
}

.hb-legenda {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px;
  margin: 1.2rem 0 .9rem;
}
.hb-legenda p { margin: 0; color: var(--hb-muted); font-size: 1rem; }
.hb-grade { margin-top: 0; }
@media (max-width: 640px) {
  .hb-painel .hb-grade {
    display: grid; grid-auto-flow: column; grid-auto-columns: 78%; grid-template-columns: none;
    gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 20px;
    margin: 0 -20px; padding: 0 20px 8px; scrollbar-width: none;
  }
  .hb-painel .hb-grade::-webkit-scrollbar { display: none; }
  .hb-painel .hb-grade > * { scroll-snap-align: start; min-width: 0; }
  .hb-painel .hb-grade > .vazio { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .hb-painel, .hb-ano__barra, .hb-campo { transition: none; }
}