/* ============================================================================
   TEMA NEWS - Estilo G1/Portal de Notícias
   Design limpo, vermelho vibrante, alta legibilidade
   ============================================================================ */

:root {
  /* Cores principais - Estilo G1 */
  --g1-red: #cc0000;
  --g1-red-dark: #a30000;
  --g1-red-light: #ff3333;
  --g1-blue: #0056b3;
  --g1-blue-hover: #003d80;
  
  /* Cores de texto e fundo */
  --g1-black: #1a1a1a;
  --g1-text: #333333;
  --g1-text-secondary: #666666;
  --g1-text-muted: #888888;
  --g1-bg: #ffffff;
  --g1-bg-gray: #f5f5f5;
  --g1-bg-dark: #eeeeee;
  --g1-border: #dddddd;
  --g1-border-light: #eeeeee;
  
  /* Bootstrap overrides */
  --bs-primary: var(--g1-red);
  --bs-primary-rgb: 204, 0, 0;
  --bs-link-color: var(--g1-blue);
  --bs-link-hover-color: var(--g1-blue-hover);
  --bs-body-bg: var(--g1-bg);
  --bs-body-color: var(--g1-text);
  
  /* Utilitários */
  --g1-shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --g1-shadow: 0 2px 8px rgba(0,0,0,0.1);
  --g1-shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
  --g1-radius: 4px;
  --g1-radius-lg: 8px;
  --g1-transition: all 0.2s ease;
}

/* ============================================================================
   TEMA ESCURO - Alto Contraste
   ============================================================================ */
[data-bs-theme="dark"] {
  --g1-red: #ff4444;
  --g1-red-dark: #cc0000;
  --g1-red-light: #ff6666;
  --g1-blue: #66b3ff;
  --g1-blue-hover: #99ccff;
  
  --g1-black: #ffffff;
  --g1-text: #e8e8e8;
  --g1-text-secondary: #b8b8b8;
  --g1-text-muted: #999999;
  --g1-bg: #121212;
  --g1-bg-gray: #1e1e1e;
  --g1-bg-dark: #2a2a2a;
  --g1-border: #3a3a3a;
  --g1-border-light: #2a2a2a;
  
  --bs-body-bg: var(--g1-bg);
  --bs-body-color: var(--g1-text);
  
  --g1-shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --g1-shadow: 0 2px 8px rgba(0,0,0,0.4);
  --g1-shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
}

/* ============================================================================
   BASE
   ============================================================================ */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--g1-text);
  background: var(--g1-bg);
}

a {
  color: var(--g1-blue);
  text-decoration: none;
  transition: var(--g1-transition);
}

a:hover {
  color: var(--g1-blue-hover);
  text-decoration: underline;
}

/* ============================================================================
   HEADER - Barra Vermelha Principal
   ============================================================================ */
.navbar-news {
  background: var(--g1-red) !important;
  padding: 0;
  min-height: 50px;
  box-shadow: none;
  border: none;
}

[data-bs-theme="dark"] .navbar-news {
  background: #cc0000 !important;
}

.navbar-news .container {
  display: flex;
  align-items: center;
  height: 50px;
}

.navbar-news .navbar-brand {
  font-weight: 900;
  font-size: 28px;
  color: #ffffff !important;
  letter-spacing: -1px;
  padding: 0;
  margin-right: 2rem;
}

.navbar-news .navbar-brand:hover {
  color: #ffffff !important;
  text-decoration: none;
}

.navbar-news .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  font-size: 14px;
  padding: 8px 16px;
  transition: var(--g1-transition);
}

.navbar-news .nav-link:hover {
  color: #ffffff !important;
  background: rgba(0, 0, 0, 0.15);
}

.navbar-news .nav-link.active {
  color: #ffffff !important;
  background: rgba(0, 0, 0, 0.2);
}

/* ============================================================================
   NAVEGAÇÃO SECUNDÁRIA - Categorias
   ============================================================================ */
.nav-news {
  background: var(--g1-bg);
  border-bottom: 1px solid var(--g1-border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

[data-bs-theme="dark"] .nav-news {
  background: var(--g1-bg-gray);
  border-color: var(--g1-border);
}

.nav-news .nav-link {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--g1-text);
  padding: 12px 16px;
  border-bottom: 3px solid transparent;
  transition: var(--g1-transition);
}

.nav-news .nav-link:hover {
  color: var(--g1-red);
  background: var(--g1-bg-gray);
  border-bottom-color: var(--g1-red);
  text-decoration: none;
}

.nav-news .nav-link.active {
  color: var(--g1-red);
  border-bottom-color: var(--g1-red);
}

/* ============================================================================
   TICKER / ÚLTIMAS NOTÍCIAS
   ============================================================================ */
.news-ticker {
  background: var(--g1-bg-gray);
  border-bottom: 1px solid var(--g1-border);
  padding: 8px 0;
  display: flex;
  align-items: center;
}

[data-bs-theme="dark"] .news-ticker {
  background: var(--g1-bg-dark);
  border-color: var(--g1-border);
}

.news-ticker .badge {
  background: var(--g1-red);
  color: #ffffff;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: 2px;
  text-transform: uppercase;
  animation: none;
}

.news-ticker .ticker-text {
  font-size: 14px;
  color: var(--g1-text);
  margin-left: 12px;
}

.news-ticker .ticker-text a {
  color: var(--g1-text);
  font-weight: 500;
}

.news-ticker .ticker-text a:hover {
  color: var(--g1-red);
}

/* ============================================================================
   CARDS DE NOTÍCIAS - Estilo G1
   ============================================================================ */
.featured-card,
.article-card {
  background: var(--g1-bg);
  border: 1px solid var(--g1-border-light);
  border-radius: var(--g1-radius);
  overflow: hidden;
  transition: var(--g1-transition);
  box-shadow: var(--g1-shadow-sm);
}

[data-bs-theme="dark"] .featured-card,
[data-bs-theme="dark"] .article-card {
  background: var(--g1-bg-gray);
  border-color: var(--g1-border);
}

.featured-card:hover,
.article-card:hover {
  box-shadow: var(--g1-shadow-lg);
  transform: translateY(-2px);
}

/* Featured Card - Notícia Principal */
.featured-card {
  border: none;
  border-radius: var(--g1-radius-lg);
}

.featured-card .card-img-wrapper {
  position: relative;
  overflow: hidden;
}

.featured-card img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  transition: var(--g1-transition);
}

.featured-card:hover img {
  transform: scale(1.02);
}

.featured-card .card-body {
  padding: 20px 24px;
}

.featured-card .card-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
}

.featured-card .card-title a {
  color: var(--g1-black);
  text-decoration: none;
}

.featured-card .card-title a:hover {
  color: var(--g1-red);
  text-decoration: none;
}

.featured-card .card-text {
  font-size: 16px;
  color: var(--g1-text-secondary);
  line-height: 1.6;
}

/* Article Card - Cards Menores */
.article-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.article-card .card-img-wrapper {
  position: relative;
  overflow: hidden;
}

.article-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: var(--g1-transition);
}

.article-card:hover img {
  transform: scale(1.03);
}

.article-card .card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card .card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .card-title a {
  color: var(--g1-black);
  text-decoration: none;
}

.article-card .card-title a:hover {
  color: var(--g1-red);
  text-decoration: none;
}

.article-card .card-text {
  font-size: 14px;
  color: var(--g1-text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.article-card .card-footer {
  background: transparent;
  border-top: 1px solid var(--g1-border-light);
  padding: 12px 16px;
  margin-top: auto;
}

[data-bs-theme="dark"] .article-card .card-footer {
  border-color: var(--g1-border);
}

/* ============================================================================
   BADGE DE CATEGORIA
   ============================================================================ */
.badge-category {
  display: inline-block;
  background: var(--g1-red);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 2px;
  margin-bottom: 8px;
}

.badge-category.economia { background: #0a9e01; }
.badge-category.esportes { background: #ff6600; }
.badge-category.tecnologia { background: #7b1fa2; }
.badge-category.politica { background: #1565c0; }
.badge-category.entretenimento { background: #e91e63; }

/* ============================================================================
   METADADOS DO ARTIGO
   ============================================================================ */
.article-meta {
  font-size: 12px;
  color: var(--g1-text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-meta i {
  color: var(--g1-text-muted);
}

.article-meta .author {
  font-weight: 600;
  color: var(--g1-text-secondary);
}

/* ============================================================================
   SIDEBAR / WIDGETS
   ============================================================================ */
.sidebar-widget {
  background: var(--g1-bg);
  border: 1px solid var(--g1-border-light);
  border-radius: var(--g1-radius);
  padding: 16px;
  margin-bottom: 20px;
}

[data-bs-theme="dark"] .sidebar-widget {
  background: var(--g1-bg-gray);
  border-color: var(--g1-border);
}

.sidebar-widget h5 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--g1-red);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--g1-red);
  margin-bottom: 16px;
}

.sidebar-widget .list-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--g1-border-light);
}

[data-bs-theme="dark"] .sidebar-widget .list-item {
  border-color: var(--g1-border);
}

.sidebar-widget .list-item:last-child {
  border-bottom: none;
}

.sidebar-widget .list-item a {
  font-size: 14px;
  font-weight: 500;
  color: var(--g1-text);
  line-height: 1.4;
}

.sidebar-widget .list-item a:hover {
  color: var(--g1-red);
  text-decoration: none;
}

/* ============================================================================
   ÁREA DE ANÚNCIOS
   ============================================================================ */
.ad-space {
  background: var(--g1-bg-gray);
  border: 1px dashed var(--g1-border);
  border-radius: var(--g1-radius);
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--g1-text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

[data-bs-theme="dark"] .ad-space {
  background: var(--g1-bg-dark);
  border-color: var(--g1-border);
}

/* ============================================================================
   CONTEÚDO DO POST
   ============================================================================ */
.post-header {
  border-bottom: 1px solid var(--g1-border);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.post-header .badge-category {
  margin-bottom: 12px;
}

.post-header h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--g1-black);
  margin-bottom: 16px;
}

.post-header .lead {
  font-size: 18px;
  color: var(--g1-text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.post-content {
  font-size: 18px;
  line-height: 1.8;
  color: var(--g1-text);
}

.post-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--g1-black);
  margin-top: 32px;
  margin-bottom: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--g1-border-light);
}

[data-bs-theme="dark"] .post-content h2 {
  border-color: var(--g1-border);
}

.post-content h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--g1-black);
  margin-top: 24px;
  margin-bottom: 12px;
}

.post-content p {
  margin-bottom: 20px;
}

.post-content a {
  color: var(--g1-blue);
  text-decoration: underline;
}

.post-content a:hover {
  color: var(--g1-blue-hover);
}

.post-content blockquote {
  border-left: 4px solid var(--g1-red);
  background: var(--g1-bg-gray);
  padding: 16px 20px;
  margin: 24px 0;
  font-style: italic;
  color: var(--g1-text-secondary);
  border-radius: 0 var(--g1-radius) var(--g1-radius) 0;
}

[data-bs-theme="dark"] .post-content blockquote {
  background: var(--g1-bg-dark);
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--g1-radius);
  margin: 24px 0;
}

.post-content ul,
.post-content ol {
  margin: 20px 0;
  padding-left: 24px;
}

.post-content li {
  margin-bottom: 8px;
}

.post-content figcaption {
  font-size: 14px;
  color: var(--g1-text-muted);
  text-align: center;
  margin-top: 8px;
}

/* ============================================================================
   FOOTER
   ============================================================================ */
.footer-news {
  background: #1a1a1a;
  color: #b0b0b0;
  padding: 40px 0 20px;
  margin-top: 48px;
}

[data-bs-theme="dark"] .footer-news {
  background: #0a0a0a;
  border-top: 1px solid var(--g1-border);
}

.footer-news h5 {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.footer-news ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-news ul li {
  margin-bottom: 8px;
}

.footer-news a {
  color: #b0b0b0;
  font-size: 14px;
  transition: var(--g1-transition);
}

.footer-news a:hover {
  color: #ffffff;
  text-decoration: none;
}

.footer-news .footer-bottom {
  border-top: 1px solid #333333;
  padding-top: 20px;
  margin-top: 32px;
  text-align: center;
  font-size: 13px;
}

.footer-news .footer-logo {
  font-weight: 900;
  font-size: 24px;
  color: #ffffff;
  margin-bottom: 8px;
}

/* ============================================================================
   BOTÕES
   ============================================================================ */
.btn-primary {
  background: var(--g1-red);
  border: none;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: var(--g1-radius);
  transition: var(--g1-transition);
}

.btn-primary:hover {
  background: var(--g1-red-dark);
}

.btn-outline-secondary {
  border: 1px solid var(--g1-border);
  color: var(--g1-text);
  font-weight: 500;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: var(--g1-radius);
}

.btn-outline-secondary:hover {
  background: var(--g1-bg-gray);
  border-color: var(--g1-border);
  color: var(--g1-text);
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
  background: var(--g1-bg-dark);
}

/* ============================================================================
   BADGES GERAIS
   ============================================================================ */
.badge {
  font-weight: 600;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 2px;
}

.badge.bg-primary {
  background: var(--g1-red) !important;
}

/* ============================================================================
   FORMULÁRIOS
   ============================================================================ */
.form-control {
  border: 1px solid var(--g1-border);
  border-radius: var(--g1-radius);
  padding: 10px 14px;
  font-size: 14px;
  transition: var(--g1-transition);
}

.form-control:focus {
  border-color: var(--g1-red);
  box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.1);
}

[data-bs-theme="dark"] .form-control {
  background: var(--g1-bg-gray);
  border-color: var(--g1-border);
  color: var(--g1-text);
}

[data-bs-theme="dark"] .form-control:focus {
  background: var(--g1-bg-dark);
  border-color: var(--g1-red);
}

/* ============================================================================
   PAGINAÇÃO
   ============================================================================ */
.pagination {
  gap: 4px;
}

.page-link {
  border: 1px solid var(--g1-border);
  color: var(--g1-text);
  font-weight: 500;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: var(--g1-radius);
  transition: var(--g1-transition);
}

.page-link:hover {
  background: var(--g1-bg-gray);
  border-color: var(--g1-border);
  color: var(--g1-red);
}

.page-item.active .page-link {
  background: var(--g1-red);
  border-color: var(--g1-red);
  color: #ffffff;
}

[data-bs-theme="dark"] .page-link {
  background: var(--g1-bg-gray);
  border-color: var(--g1-border);
  color: var(--g1-text);
}

[data-bs-theme="dark"] .page-link:hover {
  background: var(--g1-bg-dark);
}

/* ============================================================================
   CARDS DE LISTA (Estilo Lateral)
   ============================================================================ */
.list-card {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--g1-border-light);
}

[data-bs-theme="dark"] .list-card {
  border-color: var(--g1-border);
}

.list-card:last-child {
  border-bottom: none;
}

.list-card img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--g1-radius);
  flex-shrink: 0;
}

.list-card .card-content {
  flex: 1;
}

.list-card .card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
}

.list-card .card-title a {
  color: var(--g1-black);
}

.list-card .card-title a:hover {
  color: var(--g1-red);
  text-decoration: none;
}

.list-card .card-meta {
  font-size: 12px;
  color: var(--g1-text-muted);
}

/* ============================================================================
   SEÇÕES
   ============================================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--g1-red);
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--g1-red);
  margin: 0;
}

.section-header a {
  font-size: 13px;
  font-weight: 600;
  color: var(--g1-text-muted);
}

.section-header a:hover {
  color: var(--g1-red);
}

/* ============================================================================
   RESPONSIVO
   ============================================================================ */
@media (max-width: 992px) {
  .featured-card img {
    height: 300px;
  }
  
  .featured-card .card-title {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  .navbar-news .navbar-brand {
    font-size: 22px;
  }
  
  .featured-card img {
    height: 220px;
  }
  
  .featured-card .card-title {
    font-size: 18px;
  }
  
  .featured-card .card-body {
    padding: 16px;
  }
  
  .article-card img {
    height: 150px;
  }
  
  .article-card .card-title {
    font-size: 15px;
  }
  
  .post-header h1 {
    font-size: 24px;
  }
  
  .post-content {
    font-size: 16px;
  }
  
  .list-card img {
    width: 100px;
    height: 70px;
  }
}
