/* ============================================================================
   Wikiped.ia.br — Estilos (visual Wikipedia)
   Classificação LIVRE — adequado para todas as idades
   ============================================================================ */

/* ── Reset e base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Linux Libertine', Georgia, 'Times New Roman', serif;
  font-size: 14px;
  line-height: 1.6;
  color: #202122;
  background: #fff;
}

a {
  color: #0645ad;
  text-decoration: none;
}
a:visited { color: #0b0080; }
a:hover { text-decoration: underline; }

/* ── Banner de aviso (fixo no topo) ──────────────────────────────────────── */
.disclaimer-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fef3cd;
  border-bottom: 1px solid #f0c040;
  padding: 6px 16px;
  font-size: 12px;
  color: #7a5800;
  text-align: center;
  line-height: 1.4;
}

/* ── Badge LIVRE ─────────────────────────────────────────────────────────── */
.badge-livre {
  display: inline-block;
  background: #198754;
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  padding: 1px 6px;
  border-radius: 3px;
  font-family: sans-serif;
  vertical-align: middle;
  letter-spacing: 0.5px;
}
.badge-livre-lg {
  display: inline-block;
  background: #198754;
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: sans-serif;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.wiki-header {
  background: #f8f9fa;
  border-bottom: 1px solid #a2a9b1;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.logo-link:hover { text-decoration: none; }

.logo-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #3366cc;
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Linux Libertine', Georgia, serif;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 20px;
  font-weight: bold;
  color: #000;
  line-height: 1.2;
}

.logo-tagline {
  font-size: 12px;
  color: #555;
}

.header-search {
  flex: 1;
  max-width: 500px;
  margin-left: auto;
}

.search-form {
  display: flex;
  gap: 4px;
}

.search-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #a2a9b1;
  border-radius: 2px;
  font-size: 13px;
  font-family: sans-serif;
  background: #fff;
  color: #202122;
}
.search-input:focus {
  outline: none;
  border-color: #3366cc;
  box-shadow: 0 0 0 2px rgba(51,102,204,0.2);
}

.search-btn {
  padding: 6px 12px;
  background: #f8f9fa;
  border: 1px solid #a2a9b1;
  border-radius: 2px;
  font-size: 13px;
  font-family: sans-serif;
  cursor: pointer;
  color: #202122;
  white-space: nowrap;
}
.search-btn:hover { background: #e8e9ea; }

/* ── Abas decorativas ────────────────────────────────────────────────────── */
.header-tabs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 0 76px;
  display: flex;
  gap: 0;
  border-top: 1px solid #a2a9b1;
}

.tab {
  display: inline-block;
  padding: 4px 12px;
  font-size: 13px;
  font-family: sans-serif;
  color: #555;
  border: 1px solid #a2a9b1;
  border-bottom: none;
  margin-right: 2px;
  border-radius: 2px 2px 0 0;
  cursor: default;
  background: #f8f9fa;
  position: relative;
  bottom: -1px;
}
.tab-active {
  background: #fff;
  color: #202122;
  font-weight: bold;
  border-bottom: 1px solid #fff;
}

/* ── Layout principal ────────────────────────────────────────────────────── */
.wiki-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.wiki-sidebar {
  width: 180px;
  flex-shrink: 0;
  font-size: 13px;
  font-family: sans-serif;
}

.sidebar-section {
  margin-bottom: 16px;
  border: 1px solid #a2a9b1;
  border-radius: 2px;
  overflow: hidden;
}

.sidebar-title {
  font-size: 12px;
  font-weight: bold;
  padding: 6px 10px;
  background: #f8f9fa;
  border-bottom: 1px solid #a2a9b1;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-family: sans-serif;
}

.sidebar-nav {
  list-style: none;
  padding: 6px 0;
}
.sidebar-nav li { padding: 2px 10px; }
.sidebar-nav a { font-size: 13px; color: #0645ad; }

/* ── Conteúdo principal ──────────────────────────────────────────────────── */
.wiki-content {
  flex: 1;
  min-width: 0;
}

/* ── Página inicial ──────────────────────────────────────────────────────── */
.home-page { max-width: 860px; }

.home-title {
  font-size: 28px;
  font-weight: normal;
  border-bottom: 1px solid #a2a9b1;
  padding-bottom: 4px;
  margin-bottom: 16px;
}

.home-intro {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.7;
}

/* ── Gerador de artigo ───────────────────────────────────────────────────── */
.generator-box {
  border: 1px solid #a2a9b1;
  border-radius: 4px;
  padding: 16px 20px;
  background: #f8f9fa;
  margin: 20px 0;
}

.generator-box h2 {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 12px;
  color: #202122;
}

.generator-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.topic-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #a2a9b1;
  border-radius: 2px;
  font-size: 14px;
  font-family: serif;
  background: #fff;
  color: #202122;
}
.topic-input:focus {
  outline: none;
  border-color: #3366cc;
  box-shadow: 0 0 0 2px rgba(51,102,204,0.15);
}

.generator-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-primary {
  padding: 8px 18px;
  background: #3366cc;
  color: #fff;
  border: 1px solid #2a57b3;
  border-radius: 3px;
  font-size: 14px;
  font-family: sans-serif;
  cursor: pointer;
  font-weight: bold;
}
.btn-primary:hover { background: #2a57b3; }

.btn-secondary {
  padding: 8px 16px;
  background: #f8f9fa;
  color: #202122;
  border: 1px solid #a2a9b1;
  border-radius: 3px;
  font-size: 14px;
  font-family: sans-serif;
  cursor: pointer;
}
.btn-secondary:hover { background: #e8e9ea; }

/* ── Chips de sugestão ───────────────────────────────────────────────────── */
.suggestions {
  margin-top: 14px;
}

.suggestions-label {
  font-size: 12px;
  color: #555;
  font-family: sans-serif;
  font-weight: bold;
  display: block;
  margin-bottom: 8px;
}

.suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.suggestion-chip {
  background: #fff;
  border: 1px solid #a2a9b1;
  border-radius: 12px;
  padding: 4px 12px;
  font-size: 12px;
  font-family: sans-serif;
  cursor: pointer;
  color: #0645ad;
  transition: background 0.15s;
}
.suggestion-chip:hover {
  background: #e8f0fe;
  border-color: #3366cc;
}

/* ── Loading ─────────────────────────────────────────────────────────────── */
.loading-area {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: #f8f9fa;
  border: 1px solid #a2a9b1;
  border-radius: 4px;
  margin: 20px 0;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #a2a9b1;
  border-top-color: #3366cc;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-message {
  font-size: 14px;
  color: #555;
  font-family: sans-serif;
}

/* ── Erro ────────────────────────────────────────────────────────────────── */
.error-area {
  padding: 16px 20px;
  background: #fff3cd;
  border: 1px solid #f0c040;
  border-radius: 4px;
  margin: 20px 0;
}
.error-message {
  font-size: 14px;
  color: #7a5800;
  font-family: sans-serif;
}

/* ── Grid de artigos populares ───────────────────────────────────────────── */
.popular-section { margin-top: 28px; }

.popular-section h2 {
  font-size: 20px;
  font-weight: normal;
  border-bottom: 1px solid #a2a9b1;
  padding-bottom: 4px;
  margin-bottom: 14px;
}

.popular-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.popular-card {
  border: 1px solid #a2a9b1;
  border-radius: 4px;
  padding: 12px 14px;
  background: #f8f9fa;
  transition: background 0.15s;
}
.popular-card:hover { background: #e8f0fe; }

.popular-card a {
  font-size: 14px;
  font-weight: bold;
  color: #0645ad;
  display: block;
  margin-bottom: 4px;
}

.popular-card .card-subtitle {
  font-size: 12px;
  color: #555;
  font-family: sans-serif;
  font-style: italic;
}

.popular-card .card-views {
  font-size: 11px;
  color: #777;
  font-family: sans-serif;
  margin-top: 4px;
}

/* ── Badge de classificação ──────────────────────────────────────────────── */
.classification-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 8px 14px;
  background: #f0fff4;
  border: 1px solid #a8d5b5;
  border-radius: 4px;
}
.classification-text {
  font-size: 12px;
  color: #155724;
  font-family: sans-serif;
}

/* ── Artigo ──────────────────────────────────────────────────────────────── */
.article-body { max-width: 860px; }

.article-title {
  font-size: 28px;
  font-weight: normal;
  border-bottom: 1px solid #a2a9b1;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.article-subtitle {
  font-size: 14px;
  color: #555;
  font-style: italic;
  margin-bottom: 16px;
}

/* ── Infobox ─────────────────────────────────────────────────────────────── */
.infobox {
  float: right;
  clear: right;
  margin: 0 0 16px 20px;
  border: 1px solid #a2a9b1;
  background: #f8f9fa;
  padding: 0;
  max-width: 22em;
  font-size: 13px;
  font-family: sans-serif;
  line-height: 1.5;
}

.infobox-image { text-align: center; padding: 4px 0 6px; }
.infobox-image img { max-width: 100%; height: auto; }
.infobox-caption { font-size: 11px; color: #54595d; text-align: center;
                   padding: 2px 4px; line-height: 1.4; }

.infobox-title {
  background: #cee0f2;
  text-align: center;
  font-weight: bold;
  padding: 6px 10px;
  font-size: 13px;
  border-bottom: 1px solid #a2a9b1;
  font-family: sans-serif;
}

.infobox table {
  width: 100%;
  border-collapse: collapse;
}
.infobox td {
  padding: 4px 10px;
  vertical-align: top;
  border-bottom: 1px solid #e8e9ea;
  font-size: 13px;
}
.infobox td:first-child {
  font-weight: bold;
  color: #555;
  white-space: nowrap;
  width: 40%;
}
.infobox tr:last-child td { border-bottom: none; }

/* ── TOC ─────────────────────────────────────────────────────────────────── */
.toc {
  display: inline-block;
  border: 1px solid #a2a9b1;
  background: #f8f9fa;
  padding: 10px 14px;
  margin: 0 0 16px 0;
  min-width: 180px;
  max-width: 280px;
  font-family: sans-serif;
}

.toc-title {
  font-weight: bold;
  font-size: 13px;
  display: block;
  margin-bottom: 6px;
}

#toc-list {
  padding-left: 20px;
  margin: 0;
}
#toc-list li {
  font-size: 13px;
  margin: 3px 0;
}
#toc-list a { color: #0645ad; }

/* ── Seções do artigo ────────────────────────────────────────────────────── */
.article-section {
  margin-bottom: 20px;
}

.article-section h2 {
  font-size: 20px;
  font-weight: normal;
  border-bottom: 1px solid #a2a9b1;
  padding-bottom: 2px;
  margin: 16px 0 8px;
}

.article-section p {
  margin-bottom: 10px;
  text-align: justify;
}

/* ── Botões de ação do artigo ────────────────────────────────────────────── */
.article-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid #a2a9b1;
  clear: both;
}

.btn-action {
  display: inline-block;
  padding: 7px 14px;
  background: #f8f9fa;
  border: 1px solid #a2a9b1;
  border-radius: 3px;
  font-size: 13px;
  font-family: sans-serif;
  cursor: pointer;
  color: #202122;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-action:hover { background: #e8e9ea; color: #202122; text-decoration: none; }

/* ── Rodapé ──────────────────────────────────────────────────────────────── */
.wiki-footer {
  margin-top: 40px;
  background: #f8f9fa;
  border-top: 1px solid #a2a9b1;
  padding: 20px 16px;
  font-family: sans-serif;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-disclaimer {
  font-size: 12px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 8px;
}

.footer-classification {
  font-size: 12px;
  color: #555;
  margin-bottom: 8px;
}

.footer-links {
  font-size: 12px;
  margin-top: 8px;
}
.footer-links a { color: #0645ad; }

.footer-tagline {
  font-size: 13px;
  color: #777;
}

/* ── Responsivo ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .wiki-container { flex-direction: column; }
  .wiki-sidebar { width: 100%; }

  .infobox {
    float: none;
    margin: 0 0 16px 0;
    max-width: 100%;
    width: 100%;
  }

  .header-tabs { display: none; }

  .popular-grid { grid-template-columns: 1fr 1fr; }

  .header-inner { flex-direction: column; align-items: flex-start; }
  .header-search { width: 100%; max-width: none; margin-left: 0; }
}

@media (max-width: 480px) {
  .popular-grid { grid-template-columns: 1fr; }
  .logo-title { font-size: 16px; }
}
