@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@400;500;600&display=swap');

/* ============================================================
   TEMA SERTÃO — Portal Cultural da Bahia
   Paleta: terra seca, barro, couro, sol a pino
   ============================================================ */

:root {
  --barro:        #c17f3a;   /* Tom principal — barro úmido */
  --barro-claro:  #e8c088;   /* Barro claro, areia quente */
  --barro-escuro: #8b4e13;   /* Barro escuro, couro curtido */
  --seco:         #f5ede0;   /* Fundo seco, caatinga */
  --pele:         #faf4ea;   /* Fundo mais claro */
  --carvao:       #1e140a;   /* Quase preto, fumaça de fogão */
  --cinza-seca:   #8c7b6a;   /* Poeira, cinza de palha */
  --borda:        #d6c3a8;   /* Borda cor de palha */
  --branco-sol:   #fffdf8;   /* Branco lavado pelo sol */

  /* Mapa */
  --mapa-fill:    #d4a96a;   /* Municípios: barro */
  --mapa-stroke:  #000000;   /* Divisões: branco queimado */
  --mapa-hover:   #9b958a;   /* Hover: amarelo sol */
  --mapa-ativo:   #001275;   /* Selecionado: couro escuro */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--seco);
  color: var(--carvao);
  overflow: hidden;
}

/* ═══════════════════════════════════════════════
   CABEÇALHO
═══════════════════════════════════════════════ */
#cabecalho {
  height: 62px;
  background: var(--carvao);
  color: var(--branco-sol);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 18px;
  position: relative;
  z-index: 20;
  border-bottom: 3px solid var(--barro);
}

.logo-faculdade {
  height: 36px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-faculdade img {
  max-height: 100%;
  max-width: 100px;
  object-fit: contain;
}

/* Separador vertical */
.logo-faculdade::after {
  content: '';
  display: block;
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.12);
  margin-left: 18px;
}

#cabecalho h1 {
  font-family: 'Crimson Pro', serif;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--barro-claro);
  white-space: nowrap;
}

/* Barra de pesquisa no cabeçalho */
#barra-pesquisa {
  margin-left: auto;
  position: relative;
  width: 300px;
  flex-shrink: 0;
}

#icone-lupa {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  pointer-events: none;
  opacity: 0.5;
  z-index: 2;
}

#input-pesquisa {
  width: 100%;
  padding: 9px 14px 9px 36px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  font-size: 0.84rem;
  font-family: 'Inter', sans-serif;
  color: var(--branco-sol);
  outline: none;
  transition: background 0.2s, border-color 0.2s;
}

#input-pesquisa::placeholder { color: rgba(255,255,255,0.35); }

#input-pesquisa:focus {
  background: rgba(255,255,255,0.14);
  border-color: var(--barro);
}

#lista-sugestoes {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  list-style: none;
  background: var(--branco-sol);
  border: 1px solid var(--borda);
  border-radius: 8px;
  max-height: 240px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 8px 28px rgba(30,20,10,0.18);
  z-index: 100;
}

#lista-sugestoes li {
  padding: 11px 16px;
  font-size: 0.84rem;
  color: var(--carvao);
  cursor: pointer;
  border-bottom: 1px solid var(--borda);
  transition: background 0.12s;
}

#lista-sugestoes li:last-child { border-bottom: none; }

#lista-sugestoes li:hover {
  background: #fdf3e3;
}

#lista-sugestoes li strong {
  font-weight: 600;
}

#lista-sugestoes li span {
  font-size: 0.72rem;
  color: var(--cinza-seca);
  margin-left: 6px;
}

/* ═══════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════ */
#conteudo-principal {
  display: flex;
  height: calc(100vh - 62px);
}

/* ═══════════════════════════════════════════════
   PAINEL ESQUERDO
═══════════════════════════════════════════════ */
#painel-informacoes {
  width: 300px;
  flex-shrink: 0;
  background: var(--branco-sol);
  display: flex;
  flex-direction: column;
  z-index: 10;
  overflow-y: auto;
  border-right: 1px solid var(--borda);
}

.painel-topo {
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--borda);
  background: var(--pele);
}

#painel-informacoes h2 {
  font-family: 'Crimson Pro', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--carvao);
  letter-spacing: 0.01em;
}

.subtitulo {
  font-size: 0.78rem;
  color: var(--cinza-seca);
  margin-top: 5px;
  line-height: 1.55;
}

/* Estado vazio */
#estado-vazio {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 24px;
  text-align: center;
}

#estado-vazio svg { opacity: 0.25; }

#estado-vazio p {
  font-size: 0.82rem;
  color: var(--cinza-seca);
  line-height: 1.6;
  max-width: 190px;
}

/* Card do município */
#detalhes-municipio {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#detalhes-header {
  padding: 20px 22px 18px;
  background: var(--barro-escuro);
  position: relative;
  overflow: hidden;
}

/* Textura sutil de sombra no canto */
#detalhes-header::before {
  content: '';
  position: absolute;
  bottom: -30px; right: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(0,0,0,0.12);
}

#regiao-municipio {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--barro-claro);
  margin-bottom: 7px;
  opacity: 0.85;
}

#nome-municipio {
  font-family: 'Crimson Pro', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

#detalhes-body {
  padding: 20px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#cultura-municipio {
  font-size: 0.84rem;
  line-height: 1.72;
  color: var(--cinza-seca);
}

.btn-primario {
  margin-top: auto;
  background: var(--barro);
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  width: 100%;
  text-align: center;
  letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.1s;
}

.btn-primario:hover  { background: var(--barro-escuro); }
.btn-primario:active { transform: scale(0.98); }

.oculto { display: none !important; }

/* ═══════════════════════════════════════════════
   ÁREA DO MAPA
═══════════════════════════════════════════════ */
#container-mapa {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  /* Fundo seco de caatinga — degradê sutil */
  background:
    radial-gradient(ellipse at 60% 40%, #e8d0a8 0%, transparent 65%),
    linear-gradient(170deg, #b3a996 0%, #b3a793 50%, #a1937b 100%);
  overflow: hidden;
  cursor: grab;
  user-select: none;
}

#container-mapa:active { cursor: grabbing; }

#wrapper-mapa {
  width: 82%;
  height: 92%;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-origin: center center;
}

/* Sombra quente de barro no mapa */
#wrapper-mapa svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 28px rgba(100, 50, 10, 0.35));
}

#carregando {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  color: var(--barro-escuro);
  opacity: 0.7;
  font-style: italic;
}

/* ── Municípios no SVG ─────────────────────────────────────── */
/* !important necessário pois o IBGE injeta fill inline nos paths */

#wrapper-mapa path {
  fill:         var(--mapa-fill)   !important;
  stroke:       var(--mapa-stroke) !important;
  stroke-width: 20               !important;
  cursor:       pointer            !important;
  transition:   fill 0.15s ease   !important;
}

#wrapper-mapa path:hover {
  fill: var(--mapa-hover) !important;
}

#wrapper-mapa path.municipio-ativo {
  fill:         var(--mapa-ativo) !important;
  stroke:       #ffe8b0           !important;
  stroke-width: 1.2               !important;
}