/**
 * Carrossel de Notícias SEDUC-MT
 * Design moderno com gradiente e navegação por dots
 */

/* Container principal */
.noticias-section {
  margin: 24px 0;
  padding: 0;
}

.noticias-container {
  background: linear-gradient(135deg, #1D357F 0%, #00897B 50%, #26A69A 100%);  /* Azul SEDUC → Verde Teal */
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 137, 123, 0.3);
}

/* Header do carrossel */
.noticias-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.noticias-titulo {
  color: white;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.noticias-titulo img {
  height: 32px;
  width: auto;
}

.noticias-fonte {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 12px;
  border-radius: 20px;
}

/* Wrapper do carrossel */
.carrossel-wrapper {
  position: relative;
  overflow: hidden;
}

/* Track que contém os cards */
.carrossel-track {
  display: flex;
  gap: 16px;
  transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

/* Card de notícia */
.noticia-card {
  flex: 0 0 calc(33.333% - 11px);
  min-width: 280px;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.noticia-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Wrapper da imagem */
.noticia-imagem-wrapper {
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: linear-gradient(135deg, #1D357F 0%, #00897B 100%);  /* Azul SEDUC → Verde Teal */
  position: relative;
}

/* Loading shimmer enquanto carrega */
.noticia-imagem-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Imagem do card */
.noticia-imagem {
  width: 100%;
  height: 140px;
  object-fit: cover;
  object-position: top;
  background: transparent;
  transition: opacity 0.3s ease;
}

/* Esconde shimmer quando imagem carrega */
.noticia-imagem-wrapper:has(.noticia-imagem[src]:not([src=""]))::before {
  display: none;
}

.noticia-imagem-placeholder {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, #1D357F 0%, #00897B 100%);  /* Azul SEDUC → Verde Teal */
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 48px;
}

/* Conteúdo do card */
.noticia-content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.noticia-categoria {
  font-size: 11px;
  text-transform: uppercase;
  color: #1D357F;  /* Azul SEDUC */
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Ícone SVG junto à categoria */
.noticia-categoria-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.noticia-categoria-icon svg {
  width: 16px;
  height: 16px;
  stroke: #1D357F;
}

/* Card compacto (sem imagem) */
.noticia-card-compact {
  min-height: 180px;
}

.noticia-card-compact .noticia-content {
  padding: 20px;
}

/* Ícone SVG na data */
.noticia-data {
  display: flex;
  align-items: center;
  gap: 6px;
}

.noticia-data svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  opacity: 0.7;
}

.noticia-titulo-card {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.noticia-resumo {
  font-size: 12px;
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.noticia-data {
  font-size: 11px;
  color: #999;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Navegação do carrossel */
.carrossel-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

/* Botões de seta */
.carrossel-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carrossel-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.1);
}

.carrossel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

/* Dots de navegação */
.carrossel-dots {
  display: flex;
  gap: 8px;
}

.carrossel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.carrossel-dot:hover {
  background: rgba(255, 255, 255, 0.6);
}

.carrossel-dot.active {
  background: #FFD700;
  transform: scale(1.2);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

/* Estado de loading */
.noticias-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: white;
  font-size: 16px;
}

.noticias-loading .spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 12px;
}

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

/* Estado de erro */
.noticias-erro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: white;
  text-align: center;
}

.noticias-erro-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.noticias-erro-msg {
  font-size: 14px;
  opacity: 0.8;
}

/* Link para mais notícias */
.noticias-footer {
  text-align: center;
  margin-top: 16px;
}

.noticias-ver-mais {
  color: white;
  text-decoration: none;
  font-size: 13px;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.noticias-ver-mais:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Responsivo */
@media (max-width: 1024px) {
  .noticia-card {
    flex: 0 0 calc(50% - 8px);
    min-width: 260px;
  }
}

@media (max-width: 768px) {
  .noticias-container {
    padding: 16px;
    border-radius: 12px;
  }

  .noticias-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .noticia-card {
    flex: 0 0 100%;
    min-width: 100%;
  }

  .carrossel-track {
    gap: 12px;
  }

  .noticia-imagem,
  .noticia-imagem-placeholder {
    height: 120px;
  }

  .carrossel-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .noticias-titulo {
    font-size: 16px;
  }

  .noticia-content {
    padding: 12px;
  }

  .noticia-titulo-card {
    font-size: 13px;
  }
}
