﻿/* --- Seção de Notícias --- */
.news-section {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-top: 25px;
}

.news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
  gap: 15px;
}

.news-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #2c3e50;
  border-left: 4px solid #d32f2f;
  padding-left: 10px;
}

/* Abas de Categoria */
.news-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.news-tabs button {
  padding: 6px 14px;
  background: #f0f0f0;
  border: none;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
}

.news-tabs button:hover {
  background: #e0e0e0;
}

.news-tabs button.active {
  background: #d32f2f;
  color: white;
}

/* Grid de Cards */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.news-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.news-thumb {
  position: relative;
  width: 100%;
  height: 160px;
  background: #f9f9f9;
}

.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-cat-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 4px 8px;
  font-size: 0.7rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.news-content {
  padding: 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: #333;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-source {
  font-size: 0.85rem;
  color: #777;
  margin: 0 0 5px 0;
}

.news-date {
  font-size: 0.75rem;
  color: #999;
  margin-bottom: 12px;
}

.read-more-btn {
  margin-top: auto;
  align-self: flex-start;
  background: none;
  border: 1px solid #d32f2f;
  color: #d32f2f;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.read-more-btn:hover {
  background: #d32f2f;
  color: white;
}

/* Loading e Mensagens */
.loading-spinner, .empty-msg, .error-msg {
  text-align: center;
  padding: 40px;
  color: #666;
  grid-column: 1 / -1;
}

.error-msg { color: #d32f2f; }

/* --- Modal / Overlay de Detalhes --- */
.news-overlay {
  display: none; /* Escondido por padrão */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.news-detail-content {
  background: white;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  border-radius: 12px;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  animation: fadeIn 0.3s;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  color: #999;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
}

.close-btn:hover { color: #d32f2f; }

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  background: #000;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.detail-title {
  padding: 20px 20px 10px;
  margin: 0;
  font-size: 1.4rem;
  color: #333;
}

.detail-meta {
  padding: 0 20px;
  display: flex;
  gap: 15px;
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.detail-desc {
  padding: 15px 20px 30px;
  line-height: 1.6;
  color: #555;
  font-size: 0.95rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsividade */
@media (max-width: 768px) {
  .news-header { flex-direction: column; align-items: flex-start; }
  .news-tabs { width: 100%; overflow-x: auto; padding-bottom: 5px; }
  .news-grid { grid-template-columns: 1fr; }
  .news-detail-content { width: 95%; }
}