/* ==========================================================================
   Estilos específicos para la página Noticias (noticias.css)
   ========================================================================== */

/* --- 1. Header --- */
.noticias-header-section {
  width: 100%;
  min-height: 200px;
  background-color: #E8E1DA;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 80px;
  padding-bottom: 40px;
}

.noticias-header-content h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #666666;
  text-transform: uppercase;
  margin: 0;
  letter-spacing: 2px;
}

/* --- 2. Grid de Noticias --- */
.noticias-grid-section {
  width: 100%;
  padding: 60px 40px;
}

.noticias-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}

/* --- 3. Card de Noticia --- */
a.noticia-card {
  display: block;
  text-decoration: none;
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.3s ease;
}

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

.noticia-imagen {
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.noticia-imagen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.noticia-info {
  padding: 15px;
}

.noticia-fecha {
  font-size: 0.8rem;
  color: #86A329;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.noticia-titulo {
  font-size: 1.05rem;
  font-weight: 700;
  color: #666666;
  margin: 8px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.noticia-extracto {
  font-size: 0.9rem;
  color: #888888;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- 4. Página de Detalle de Noticia --- */
.noticia-page-header {
  width: 100%;
  height: 100vh;
  position: relative;
}

.noticia-page-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.noticia-page-header.portrait {
  height: auto;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f0e8;
}

.noticia-page-header.portrait img {
  width: auto;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  margin: 0 auto;
}

.noticia-page-header::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.1) 100%);
}

.noticia-page-header h1 {
  position: absolute;
  top: 100px;
  left: 0;
  right: 0;
  z-index: 2;
  color: #ffffff;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  padding: 0 40px;
  margin: 0;
  line-height: 1.3;
}

.noticia-page-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.noticia-page-body .noticia-fecha {
  display: block;
  margin-bottom: 15px;
}

/* h1 ahora está en el header */

.noticia-subtitulo {
  font-style: italic;
  text-align: center;
  font-size: 1.15rem;
  color: #666666;
  line-height: 1.8;
  margin: 25px 0;
}

.noticia-titulo-seccion {
  font-size: 1.2rem;
  font-weight: 700;
  color: #28a745;
  margin: 30px 0 10px;
  line-height: 1.5;
}

.noticia-page-body p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #666666;
  margin-bottom: 25px;
}

.noticia-contenido-imagen {
  margin: 30px 0;
  border-radius: 6px;
  overflow: hidden;
}

.noticia-contenido-imagen img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  transition: filter 0.3s ease;
}

.noticia-contenido-imagen img:hover {
  filter: brightness(0.85);
}

/* --- 5. Lightbox --- */
.noticia-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.noticia-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

/* --- Layout dos columnas (artículo + sidebar) --- */
.noticia-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  gap: 40px;
}

.noticia-layout .noticia-page-body {
  flex: 1;
  min-width: 0;
  max-width: none;
  margin: 0;
}

/* --- Sidebar --- */
.noticia-sidebar {
  width: 300px;
  flex-shrink: 0;
  padding-top: 40px;
}

.sidebar-titulo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #666666;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #86A329;
}

.sidebar-lista {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sidebar-item {
  display: flex;
  gap: 12px;
  text-decoration: none;
  padding: 8px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.sidebar-item:hover {
  background-color: #f5f0e8;
  text-decoration: none;
}

.sidebar-item-img {
  width: 70px;
  height: 70px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sidebar-item-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.sidebar-item-titulo {
  font-size: 0.85rem;
  font-weight: 600;
  color: #666666;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-item-fecha {
  font-size: 0.75rem;
  color: #86A329;
  font-weight: 600;
}

.noticia-volver {
  display: inline-block;
  margin-top: 30px;
  color: #86A329;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
}

.noticia-volver:hover {
  color: #6e8a1f;
  text-decoration: none;
}

.noticia-volver i {
  margin-right: 8px;
}

/* --- 6. Navegación Anterior / Siguiente --- */
.noticia-nav {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #e0e0e0;
  margin-top: 20px;
}

.noticia-nav-link {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 30px 40px;
  text-decoration: none;
  color: #666666;
  flex: 1;
  transition: background-color 0.3s ease;
}

.noticia-nav-link:hover {
  background-color: #f5f5f5;
  text-decoration: none;
  color: #666666;
}

.noticia-nav-next {
  text-align: right;
  justify-content: flex-end;
  border-left: 1px solid #e0e0e0;
}

.noticia-nav-link i {
  font-size: 1.2rem;
  color: #86A329;
  flex-shrink: 0;
}

.noticia-nav-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.noticia-nav-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #86A329;
  font-weight: 600;
}

.noticia-nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
  .noticias-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .noticias-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .noticias-header-section {
    min-height: 150px;
  }

  .noticias-header-content h2 {
    font-size: 2rem;
  }

  .noticias-grid-section {
    padding: 40px 20px;
  }

  .noticias-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .noticia-page-header h1 {
    font-size: 1.3rem;
    padding: 0 20px;
    top: 80px;
  }

  .noticia-page-body h1 {
    font-size: 1.5rem;
  }

  .noticia-layout {
    flex-direction: column;
    gap: 30px;
  }

  .noticia-sidebar {
    width: 100%;
  }
}
