/* =============================================================================
   GESTOR FAQ — Estilos Públicos v1.0.1
   Prefixo: gfaq-
============================================================================= */

:root {
  --gfaq-cor: #003778;
  --gfaq-radius: 8px;
  --gfaq-sombra: 0 2px 12px rgba(0, 0, 0, 0.08);
  --gfaq-transicao: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- WRAPPER --- */
.gfaq-wrapper * {
  box-sizing: border-box;
}

.gfaq-wrapper {
  font-family: "Segoe UI", system-ui, sans-serif;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 12px;
  box-sizing: border-box;
}

.gfaq-titulo-portal {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gfaq-cor);
  margin: 0 0 20px;
  text-align: center;
  line-height: 1.3;
}

/* --- BUSCA --- */
.gfaq-form-busca {
  margin-bottom: 20px;
}

.gfaq-busca-container {
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid #dde6f0;
  border-radius: 50px;
  padding: 4px 4px 4px 16px;
  gap: 8px;
  transition:
    border-color var(--gfaq-transicao),
    box-shadow var(--gfaq-transicao);
  box-shadow: var(--gfaq-sombra);
}

.gfaq-busca-container:focus-within {
  border-color: var(--gfaq-cor);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gfaq-cor) 12%, transparent);
}

.gfaq-busca-icone {
  color: #aab8cc;
  font-size: 18px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: color var(--gfaq-transicao);
}

.gfaq-busca-container:focus-within .gfaq-busca-icone {
  color: var(--gfaq-cor);
}

.gfaq-busca-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.97rem;
  color: #333;
  background: transparent;
  padding: 8px 0;
  min-width: 0;
}

.gfaq-busca-btn {
  padding: 9px 22px;
  border: none;
  border-radius: 40px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    opacity var(--gfaq-transicao),
    transform 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.gfaq-busca-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.gfaq-busca-limpar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eef2f7;
  color: #666;
  text-decoration: none;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: background var(--gfaq-transicao);
  margin-right: 2px;
}

.gfaq-busca-limpar:hover {
  background: #dde6f0;
  color: #333;
}

/* --- BOTÕES DE FILTRO POR CATEGORIA --- */
.gfaq-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.gfaq-filtro-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 2px solid currentColor;
  border-radius: 40px;
  text-decoration: none;
  font-size: 0.87rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--gfaq-transicao);
  background: #fff;
  white-space: nowrap;
  line-height: 1;
  font-family: inherit;
}

.gfaq-filtro-btn .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.gfaq-filtro-btn:hover:not(.ativo) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  opacity: 0.9;
  text-decoration: none;
}

.gfaq-filtro-btn.ativo {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.gfaq-filtro-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  font-size: 0.73rem;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}

/* --- CABEÇALHO DO RESULTADO --- */
.gfaq-resultado-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 11px 16px;
  background: #f4f8fd;
  border: 1px solid #dde6f0;
  border-left: 4px solid var(--gfaq-cor);
  border-radius: 0 var(--gfaq-radius) var(--gfaq-radius) 0;
  font-size: 0.88rem;
  color: #555;
  margin-bottom: 12px;
}

.gfaq-resultado-header .dashicons {
  font-size: 17px;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.gfaq-resultado-header strong {
  color: #1a2a3a;
}

.gfaq-resultado-desc {
  color: #888;
  font-size: 0.84rem;
}

.gfaq-limpar-filtro {
  margin-left: auto;
  padding: 3px 10px;
  background: #fff;
  border: 1px solid #ccd8ee;
  border-radius: 4px;
  color: #666;
  text-decoration: none;
  font-size: 0.8rem;
  transition: 0.2s;
  white-space: nowrap;
}

.gfaq-limpar-filtro:hover {
  background: #003778;
  color: #fff;
  border-color: #003778;
  text-decoration: none;
}

/* --- ACORDEÃO --- */
.gfaq-acordeao {
  border: 1px solid #e4ecf4;
  border-radius: var(--gfaq-radius);
  overflow: hidden;
  box-shadow: var(--gfaq-sombra);
}

.gfaq-item {
  border-bottom: 1px solid #edf2f8;
  transition: background var(--gfaq-transicao);
}

.gfaq-item:last-child {
  border-bottom: none;
}

/* Destaque */
.gfaq-item.gfaq-destaque {
  border-left: 4px solid var(--gfaq-item-borda, var(--gfaq-cor));
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--gfaq-item-borda, var(--gfaq-cor)) 4%, transparent),
    #fff
  );
}

/* Aberto */
.gfaq-item.gfaq-aberto {
  background: #f8fbff;
}

.gfaq-item.gfaq-destaque.gfaq-aberto {
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--gfaq-item-borda, var(--gfaq-cor)) 6%, transparent),
    #f8fbff
  );
}

/* Botão da pergunta */
.gfaq-pergunta {
  width: 100%;
  display: flex;
  align-items: flex-start; /* Alinha ícone e seta no topo quando o texto quebra linha */
  gap: 12px;
  padding: 16px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 0.97rem;
  font-weight: 600;
  color: #1a2a3a;
  line-height: 1.45;
  transition: background var(--gfaq-transicao);
}

.gfaq-pergunta:hover {
  background: color-mix(in srgb, var(--gfaq-cor) 5%, transparent);
}

.gfaq-pergunta-icone {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: background var(--gfaq-transicao);
}

.gfaq-item.gfaq-aberto .gfaq-pergunta-icone {
  background: color-mix(in srgb, var(--gfaq-cor) 18%, transparent) !important;
}

.gfaq-pergunta-icone .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
}

.gfaq-pergunta-texto {
  flex: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0; /* Permite que o flex child encolha corretamente */
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Chevron animado */
.gfaq-chevron {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  transition: transform var(--gfaq-transicao);
  display: flex;
  align-items: center;
  opacity: 0.65;
  margin-top: 3px; /* Centraliza visualmente com a primeira linha de texto */
}

.gfaq-chevron svg {
  width: 100%;
  height: 100%;
}

.gfaq-item.gfaq-aberto .gfaq-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Badges */
.gfaq-badge-destaque {
  display: inline-block;
  padding: 2px 9px;
  background: #fff8e1;
  color: #b8860b;
  border: 1px solid #f5d060;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
  margin-left: 5px;
}

.gfaq-badge-cat {
  display: inline-block;
  padding: 2px 9px;
  color: #fff;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0.85;
  vertical-align: middle;
  margin-left: 5px;
}

/* Resposta */
.gfaq-resposta {
  display: none;
  overflow: hidden;
  transition: max-height var(--gfaq-transicao);
}

.gfaq-resposta-inner {
  padding: 4px 20px 22px 68px;
  font-size: 0.93rem;
  line-height: 1.75;
  color: #444;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.gfaq-resposta-inner img,
.gfaq-resposta-inner video,
.gfaq-resposta-inner table {
  max-width: 100% !important;
  height: auto !important;
}

.gfaq-resposta-inner p {
  margin: 0 0 12px;
}
.gfaq-resposta-inner p:last-child {
  margin-bottom: 0;
}
.gfaq-resposta-inner ul,
.gfaq-resposta-inner ol {
  padding-left: 20px;
  margin: 8px 0 12px;
}
.gfaq-resposta-inner li {
  margin-bottom: 4px;
}
.gfaq-resposta-inner a {
  color: var(--gfaq-cor);
  text-decoration: underline;
}
.gfaq-resposta-inner strong {
  color: #222;
}

.gfaq-resposta-inner blockquote {
  border-left: 3px solid var(--gfaq-cor);
  margin: 12px 0;
  padding: 8px 16px;
  background: #f8fafd;
  border-radius: 0 4px 4px 0;
  color: #555;
  font-style: italic;
}

/* Destaque de busca */
.gfaq-resposta-inner mark,
.gfaq-pergunta-texto mark {
  background: #fff176;
  color: #333;
  border-radius: 2px;
  padding: 0 2px;
}

/* --- VAZIO --- */
.gfaq-empty {
  text-align: center;
  color: #999;
  padding: 32px 16px;
  font-size: 0.95rem;
  background: #fafbfd;
  border: 1px dashed #dde6f0;
  border-radius: var(--gfaq-radius);
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 640px) {
  .gfaq-filtros {
    gap: 6px;
  }
  .gfaq-filtro-btn {
    padding: 7px 11px;
    font-size: 0.8rem;
    gap: 5px;
  }
  .gfaq-filtro-btn span:not(.dashicons):not(.gfaq-filtro-count) {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .gfaq-resultado-header {
    font-size: 0.82rem;
    padding: 10px;
  }
  .gfaq-pergunta {
    padding: 13px 14px;
    gap: 8px;
    font-size: 0.92rem;
  }
  .gfaq-resposta-inner {
    padding: 4px 14px 18px 14px; /* Remove o recuo grande de 68px no mobile */
  }
  .gfaq-pergunta-icone {
    width: 30px;
    height: 30px;
  }
  .gfaq-busca-btn {
    padding: 8px 14px;
    font-size: 0.82rem;
  }
}
