/* ============================================================
   Sumidos PB — Wiki style.css
   Paleta alinhada com lista.php: #012a00 / #024d00 / #039c00
   ============================================================ */

/* ── Variáveis ─────────────────────────────────────────────── */
:root {
  --green-dark:    #012a00;
  --green-mid:     #024d00;
  --green-main:    #039c00;
  --green-light:   #e8f8e8;
  --text-primary:   #1a1a1a;
  --text-secondary: #495057;
  --text-muted:     #6c757d;
  --bg-page:    #f8f9fa;
  --bg-card:    #ffffff;
  --bg-sidebar: #ffffff;
  --danger:  #dc3545;
  --success: #024d00;
  --info:    #0dcaf0;
  --warning: #ffc107;
  --border-color: #dee2e6;
  --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
  --shadow-md: 0 .5rem 1rem rgba(0,0,0,.15);
  --shadow-lg: 0 1rem 3rem rgba(0,0,0,.175);
  --font-main: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius: 12px;
  --header-height: 64px;
  --sidebar-width: 280px;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-main);
  background-color: #f8f9fa;
  color: #1a1a1a;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: #024d00; text-decoration: none; transition: 0.2s; }
a:hover { color: #012a00; text-decoration: underline; }

/* ── Layout Principal ──────────────────────────────────────── */
.wiki-layout {
  display: grid;
  /* Sidebar ocupa a coluna esquerda inteira (da borda superior); o header fica
     só sobre a área principal — assim o painel sobe até o topo, como no lista.php. */
  grid-template-areas: "sidebar header" "sidebar main";
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--header-height) 1fr;
  min-height: 100vh;
}

/* ── Header — gradiente idêntico ao hero do lista.php ──────── */
.wiki-header {
  grid-area: header;
  background: linear-gradient(135deg, #012a00 0%, #024d00 40%, #039c00 100%);
  border-bottom: none;
  box-shadow: 0 4px 16px rgba(2,77,0,0.30);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}
.wiki-header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.wiki-logo {
  display: flex;
  align-items: center;
  gap: 18px;
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
  text-decoration: none;
}
.wiki-logo:hover { text-decoration: none; color: #fff; }
.wiki-logo-icon {
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.wiki-logo-text { color: #fff; font-weight: 800; }
.wiki-logo-text span { color: #b8e6b8; }

.wiki-search-wrap { flex: 1; max-width: 500px; position: relative; }
.wiki-search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  border: 1px solid rgba(255,255,255,0.30);
  border-radius: 50px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 0.875rem;
  transition: 0.2s;
}
.wiki-search-input::placeholder { color: rgba(255,255,255,0.60); }
.wiki-search-input:focus {
  outline: none;
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.55);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.10);
}
.search-icon {
  position: absolute;
  left: 1rem; top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.65);
  pointer-events: none;
}

.wiki-header-actions { display: flex; gap: 0.5rem; }
.wiki-header-btn {
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  display: flex; align-items: center; gap: 6px;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.10);
  color: #fff;
  cursor: pointer;
  transition: 0.2s;
  text-decoration: none;
}
.wiki-header-btn:hover { background: rgba(255,255,255,0.22); color: #fff; text-decoration: none; }
.wiki-header-btn.primary { background: #fff; color: #024d00; border-color: #fff; font-weight: 700; }
.wiki-header-btn.primary:hover { background: #e8f8e8; color: #012a00; }

/* ── Sidebar ────────────────────────────────────────────────── */
.wiki-sidebar {
  grid-area: sidebar;
  background: #000;
  color: #fff;
  border-right: 1px solid rgba(255,255,255,0.08);
  /* Painel FIXO cobrindo toda a altura da tela (top:0 → sem faixa branca quando
     o header sai ao rolar). O padding-top reserva o espaço do header, e o
     z-index fica abaixo do header (1000) para o header aparecer por cima.
     Usa position:fixed (não sticky) porque o body tem overflow-x:hidden. */
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  z-index: 900;
}
.sidebar-section { margin-bottom: 2rem; }
.sidebar-section-title {
  font-size: 0.70rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 0.75rem;
  padding: 0 0.5rem 0.4rem;
  font-weight: 700;
  border-bottom: 1.5px solid rgba(255,255,255,0.12);
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: #d7e6d7;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 2px;
  transition: 0.15s;
  text-decoration: none;
}
.sidebar-link:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.sidebar-link i { width: 20px; text-align: center; color: #4caf50; font-size: 0.85rem; }
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(3,156,0,0.28), rgba(3,156,0,0.10));
  color: #fff;
  font-weight: 700;
  border-left: 3px solid #039c00;
  padding-left: calc(0.75rem - 3px);
}

/* ── Main ───────────────────────────────────────────────────── */
.wiki-main {
  grid-area: main;
  padding: 2rem 2.5rem;
  max-width: none;
  margin: 0;
  width: 100%;
}
.wiki-breadcrumb {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.875rem;
  color: #6c757d;
  margin-bottom: 1.5rem;
}
.wiki-breadcrumb a { color: #024d00; }
.wiki-breadcrumb a:hover { color: #012a00; }

/* ── Article Layout ─────────────────────────────────────────── */
.wiki-article-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; }
.wiki-article-heading { margin-bottom: 2rem; }
.wiki-article-heading h1 { font-size: 2.5rem; font-weight: 800; color: #012a00; line-height: 1.2; }

.wiki-status-banner {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0.5rem 1rem; border-radius: 50px;
  font-weight: 700; font-size: 0.875rem; margin-top: 1rem;
}
.wiki-status-banner.ativo     { background: #fff3cd; color: #856404; border: 1px solid #ffd966; }
.wiki-status-banner.encontrado { background: #d4edda; color: #155724; border: 1px solid #b8e6b8; }

/* ── Sections ───────────────────────────────────────────────── */
.wiki-section {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(2,77,0,0.06);
}
.wiki-section-title {
  font-size: 1.15rem; font-weight: 700;
  color: #012a00;
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 2px solid #d4edda;
  padding-bottom: 0.6rem;
}
.wiki-section-title i { color: #039c00; }
.wiki-section-content { color: #495057; line-height: 1.8; }

/* ── Infobox ────────────────────────────────────────────────── */
.wiki-infobox {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(2,77,0,0.12);
  position: sticky;
  top: calc(var(--header-height) + 1rem);
}
.infobox-header {
  background: linear-gradient(135deg, #012a00 0%, #024d00 50%, #039c00 100%);
  color: #fff;
  padding: 1rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
}
.infobox-image-wrap {
  width: 100%; aspect-ratio: 3/4;
  overflow: hidden; background: #f0f8f0;
}
.infobox-image-wrap img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
.infobox-image-wrap img:hover { transform: scale(1.05); }
.infobox-content { padding: 1rem; }
.infobox-row {
  display: flex; justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f3f5;
  font-size: 0.875rem;
}
.infobox-row:last-child { border-bottom: none; }
.infobox-label { font-weight: 700; color: #6c757d; }
.infobox-value { font-weight: 600; color: #1a1a1a; text-align: right; }
.infobox-actions { padding: 1rem; display: grid; gap: 0.5rem; }
.infobox-btn {
  width: 100%; padding: 0.6rem; border-radius: 8px;
  text-align: center; font-weight: 600; font-size: 0.875rem;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid #d4edda;
  background: #f8fdf8; color: #024d00;
  cursor: pointer; text-decoration: none; transition: 0.2s;
}
.infobox-btn:hover { background: #e8f8e8; border-color: #b8e6b8; color: #012a00; text-decoration: none; }
.infobox-btn.primary {
  background: linear-gradient(135deg, #024d00, #039c00);
  color: #fff; border: none;
  box-shadow: 0 3px 10px rgba(2,77,0,0.25);
}
.infobox-btn.primary:hover {
  background: linear-gradient(135deg, #039c00, #024d00);
  color: #fff; transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(2,77,0,0.35);
}

/* ── Tabelas ─────────────────────────────────────────────────── */
.wiki-char-table { width: 100%; border-collapse: collapse; }
.wiki-char-table td { padding: 0.75rem; border-bottom: 1px solid #e6f4e6; }
.wiki-char-table tr:last-child td { border-bottom: none; }
.wiki-char-table tr:hover td { background: #f8fdf8; }
.char-label { font-weight: 700; color: #6c757d; width: 140px; }

/* ── Mapa ────────────────────────────────────────────────────── */
.wiki-map-container { height: 300px; border-radius: var(--radius); overflow: hidden; border: 1px solid #d4edda; }

/* ── Galeria ─────────────────────────────────────────────────── */
.wiki-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.gallery-item {
  aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  cursor: pointer; border: 1px solid #d4edda; transition: 0.2s;
}
.gallery-item:hover { border-color: #039c00; box-shadow: 0 4px 12px rgba(3,156,0,0.20); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
.gallery-item:hover img { transform: scale(1.08); }

/* ── Autocomplete ────────────────────────────────────────────── */
.search-autocomplete {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid #d4edda; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(2,77,0,0.15);
  z-index: 9999; max-height: 320px; overflow-y: auto; display: none;
}
.search-autocomplete.show { display: block; }
.search-ac-item {
  padding: 0.6rem 1rem; cursor: pointer; font-size: 0.875rem;
  border-bottom: 1px solid #f1f3f5;
  display: flex; align-items: center; gap: 10px; color: #1a1a1a;
}
.search-ac-item:last-child { border-bottom: none; }
.search-ac-item:hover { background: #e8f8e8; color: #012a00; }
.search-ac-img { width: 32px; height: 40px; border-radius: 4px; object-fit: cover; background: #eee; flex-shrink: 0; }

/* ── Utilitários ────────────────────────────────────────────── */
.text-danger  { color: #dc3545 !important; }
.text-success { color: #024d00 !important; }
.text-info    { color: #0dcaf0 !important; }
.fw-bold { font-weight: 700; }
.wiki-article-sidebar { /* alias */ }

/* ── Responsividade ─────────────────────────────────────────── */
@media (max-width: 992px) {
  .wiki-article-layout { grid-template-columns: 1fr; }
  .wiki-infobox { position: static; margin-bottom: 2rem; }
}
@media (max-width: 768px) {
  .wiki-layout {
    grid-template-areas: "header header" "main main";
    grid-template-columns: 1fr;
    /* No mobile o menu vira gaveta; remove o fundo preto da coluna (senão vira
       uma faixa preta à esquerda da página). */
    background: none;
  }
  .wiki-sidebar {
    position: fixed; left: -100%; z-index: 2000;
    transition: 0.3s; width: 280px;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }
  .wiki-sidebar.mobile-open { left: 0; }
  .sidebar-overlay.open {
    display: block; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 1500;
  }
  #sidebarToggle { display: flex !important; }
  .wiki-search-wrap { display: none; }
}

/* ── Print ──────────────────────────────────────────────────── */
@media print {
  .wiki-header, .wiki-sidebar, .wiki-breadcrumb,
  .infobox-actions, .sidebar-overlay { display: none !important; }
  .wiki-layout { display: block; }
  .wiki-main { max-width: 100%; padding: 0; }
  .wiki-article-layout { grid-template-columns: 1fr; }
  .wiki-infobox { box-shadow: none; border: 1px solid #ccc; }
}
