/* =====================================================
   GBF - Chips de navegação
   Base compartilhada: Home, rodapé, single, listagens e
   páginas editoriais de bairro.
   ===================================================== */

.gbf-chips {
  --gbf-chip-background: #fff;
  --gbf-chip-color: #54595f;
  --gbf-chip-active: var(--e-global-color-gbf-verde, #007a55);
  margin: 1.25rem 0;
}

.gbf-chips-head {
  display: flex;
  margin-bottom: 0.75rem;
}

.gbf-chips-title {
  margin: 0;
  color: #2a2a2a;
  font-size: 24px;
  line-height: 1.2;
}

.gbf-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gbf-chips .gbf-chips-item {
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.2rem 0;
}

/*
 * O link permanece inline para que, quando o texto quebrar, cada fragmento
 * receba seu próprio fundo arredondado. A leve sobreposição vertical une os
 * fragmentos numa única cápsula escalonada, sem esticar o chip até 100%.
 */
.gbf-chips .gbf-chip {
  position: relative;
  top: 0;
  display: inline;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  background: var(--gbf-chip-background);
  color: var(--gbf-chip-color);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  text-align: center;
  text-decoration: none;
  text-shadow: none;
  white-space: normal;
  overflow-wrap: anywhere;
  text-wrap: balance;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition:
    top 0.18s ease,
    color 0.18s ease,
    background-color 0.18s ease;
}

.gbf-chips .gbf-chip:hover,
.gbf-chips .gbf-chip:focus-visible {
  background: var(--gbf-chip-active);
  color: #fff;
  text-decoration: none;
  top: -1px;
}

.gbf-chips .gbf-chip:focus-visible {
  outline: 2px solid var(--gbf-chip-active);
  outline-offset: 2px;
}

/* Home: mantém o espaçamento amplo aprovado. */
.gbf-chips--home {
  margin: 0;
}

.gbf-chips--home .gbf-chips-row {
  align-items: center;
  justify-content: center;
  gap: 16px 76px;
  max-width: 1300px;
  margin-inline: auto;
}

/* Blocos sem título próprio do Elementor: compactos e alinhados ao conteúdo. */
.gbf-chips--padrao,
.gbf-chips--bairro {
  width: 100%;
  max-width: 100%;
  margin: 0;
  align-self: stretch;
}

@media (min-width: 768px) {
  .gbf-chips--padrao .gbf-chips-row,
  .gbf-chips--bairro .gbf-chips-row {
    align-items: center;
    justify-content: flex-start;
    gap: 14px 16px;
  }
}

/* Single e listagens: centraliza o conjunto até 1024 px. */
@media (max-width: 1024px) {
  .gbf-chips--single .gbf-chips-head,
  .gbf-chips--archive .gbf-chips-head {
    justify-content: center;
  }

  .gbf-chips--single .gbf-chips-title,
  .gbf-chips--archive .gbf-chips-title {
    text-align: center;
  }

  .gbf-chips--single .gbf-chips-row,
  .gbf-chips--archive .gbf-chips-row {
    justify-content: center;
  }
}

@media (max-width: 767px) {
  .gbf-chips-title {
    font-size: 20px;
  }

  /* Um item por linha, preservando a largura do chip conforme o conteúdo. */
  .gbf-chips .gbf-chips-item {
    flex: 0 0 100%;
    text-align: center;
  }

  /* A seção da Home é de largura total e precisa de proteção nas bordas. */
  .gbf-chips--home .gbf-chips-row {
    gap: 12px;
    padding-inline: 16px;
  }

  .gbf-chips--padrao .gbf-chips-head,
  .gbf-chips--bairro .gbf-chips-head {
    justify-content: center;
  }

  .gbf-chips--padrao .gbf-chips-title,
  .gbf-chips--bairro .gbf-chips-title {
    text-align: center;
  }

  .gbf-chips--padrao .gbf-chips-row,
  .gbf-chips--bairro .gbf-chips-row {
    gap: 10px;
  }
}

/* Espaço entre as duas seções consecutivas das listagens. */
.gbf-chips--archive.gbf-chips--related
  + .gbf-chips--archive.gbf-chips--popular {
  margin-top: 5rem;
}

@media (prefers-reduced-motion: reduce) {
  .gbf-chips .gbf-chip {
    transition: none;
  }
}
