﻿/* ===== ESTILOS ESPECÍFICOS PARA LA PÁGINA DE DETALLE DE NOTICIA ===== */

/* Contenedor principal del artículo */
.article-detail {
  padding: var(--spacing-xl) 0;
  background-color: var(--gris-6);
}

/* Navegación del artículo */
.article-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.article-navigation .breadcrumb {
  color: var(--gris-2);
  font-size: 14px;
}

.article-navigation .breadcrumb a {
  color: var(--primario);
  text-decoration: none;
  transition: color 0.3s ease;
}

.article-navigation .breadcrumb a:hover {
  color: var(--verde);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  background: white;
  color: var(--primario);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  border: 1px solid var(--gris-4);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-back:hover {
  background: var(--gris-6);
  color: var(--primario);
  border-color: var(--gris-3);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-back svg {
  width: 14px;
  height: 14px;
}

/* Layout con sidebar */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--spacing-xl);
  align-items: start;
}

/* Contenido principal */
.article-main {
  min-width: 0; /* Para evitar overflow */
}

.article-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* Imagen principal - más alta y específica */
.article-hero-image img {
  width: 100%;
  height: 450px !important; /* Forzar altura con !important */
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(23, 38, 60, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: white;
}

.article-hero-image:hover .hero-overlay {
  opacity: 1;
}

.article-hero-image:hover img {
  transform: scale(1.02);
}

.article-hero-image figcaption {
  padding: var(--spacing-sm) var(--spacing-xl);
  background: var(--gris-6);
  color: var(--gris-2);
  font-size: 14px;
  font-style: italic;
  border-bottom: 1px solid var(--gris-5);
}

/* Galería de imágenes - más pequeñas */
.article-gallery {
  padding: var(--spacing-md) var(--spacing-xl);
  border-bottom: 1px solid var(--gris-5);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 5 columnas para aprovechar espacio */
  gap: var(--spacing-xs); /* Gap muy pequeño */
}

.gallery-item {
  position: relative;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.3s ease;
  margin: 0;
}

.gallery-item:hover {
  transform: translateY(-2px);
}

.gallery-item img {
  width: 100%;
  height: 80px; /* Muy pequeñas */
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(23, 38, 60, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: white;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Header del artículo */
.article-header {
  padding: var(--spacing-lg) var(--spacing-xl) var(--spacing-lg);
  border-bottom: 1px solid var(--gris-5);
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.article-date {
  color: var(--primario-claro);
  font-size: 14px;
  font-weight: 500;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
}

.article-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primario);
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
}

.article-lead {
  font-size: 1.1rem;
  color: var(--gris-2);
  line-height: 1.6;
  font-weight: 400;
  margin: 0;
}

/* Cuerpo del artículo - solo texto */
.article-body {
  padding: var(--spacing-xl);
  line-height: 1.8;
}

.article-body p {
  margin-bottom: var(--spacing-md);
  color: var(--gris-1);
  font-size: 16px;
}

.article-body h2 {
  color: var(--primario);
  font-size: 1.6rem;
  font-weight: 600;
  margin: var(--spacing-xl) 0 var(--spacing-md);
  line-height: 1.3;
}

.article-body h3 {
  color: var(--primario);
  font-size: 1.3rem;
  font-weight: 600;
  margin: var(--spacing-lg) 0 var(--spacing-sm);
  line-height: 1.3;
}

/* Enlaces de más información */
.more-info {
  padding: var(--spacing-xl);
  border-top: 1px solid var(--gris-5);
  background: var(--gris-6);
}

.more-info h3 {
  color: var(--primario);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
}

.info-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-sm);
}

.info-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm); /* Aumentar gap de xs a sm */
  padding: var(--spacing-sm) var(--spacing-md);
  background: white;
  color: var(--primario);
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.2; /* Reducir interlineado */
  transition: all 0.3s ease;
  border: 1px solid var(--gris-4);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.info-link:hover {
  background: var(--verde-claro);
  color: var(--primario);
  border-color: var(--verde);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.info-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Compartir en redes sociales */
.article-share {
  padding: var(--spacing-xl);
  border-top: 1px solid var(--gris-5);
  background: var(--gris-6);
}

.article-share h3 {
  color: var(--primario);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
}

.share-buttons {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  color: white;
}

.share-facebook {
  background: #1877f2;
}

.share-facebook:hover {
  background: #166fe5;
  color: white;
}

.share-twitter {
  background: #000000;
}

.share-twitter:hover {
  background: #333333;
  color: white;
}

.share-linkedin {
  background: #0077b5;
}

.share-linkedin:hover {
  background: #006399;
  color: white;
}

.share-whatsapp {
  background: #25d366;
}

.share-whatsapp:hover {
  background: #22c55e;
  color: white;
}

/* Sidebar */
.article-sidebar {
  position: sticky;
  top: 100px;
}

.sidebar-widget {
  background: white;
  border-radius: 8px;
  padding: var(--spacing-lg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sidebar-widget h3 {
  color: var(--primario);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--verde);
  padding-bottom: var(--spacing-xs);
}

/* Listado de noticias minimalista */
.latest-news {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm); /* Gap más pequeño */
}

.news-item {
  display: flex;
  flex-direction: column;
  gap: 2px; /* Gap muy pequeño entre fecha y título */
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--gris-5);
}

.news-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Quitar estilos de imagen */
.news-image {
  display: none;
}

.news-content {
  flex: 1;
  min-width: 0;
}

.news-date {
  color: var(--gris-3);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.news-content h4 {
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 500;
}

.news-content h4 a {
  color: var(--primario);
  text-decoration: none;
  transition: color 0.3s ease;
}

.news-content h4 a:hover {
  color: var(--verde);
}

/* Modal de galería */
.gallery-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
}

.gallery-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  text-align: center;
}

.gallery-modal-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.gallery-modal-caption {
  color: white;
  padding: var(--spacing-sm) 0;
  font-size: 16px;
  line-height: 1.4;
  max-width: 600px;
  margin: 0 auto;
}

.gallery-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 35px;
  font-weight: bold;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.gallery-modal-close:hover {
  opacity: 0.7;
}

.gallery-modal-prev,
.gallery-modal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  font-size: 24px;
  font-weight: bold;
  padding: var(--spacing-sm);
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-modal-prev {
  left: -60px;
}

.gallery-modal-next {
  right: -60px;
}

.gallery-modal-prev:hover,
.gallery-modal-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 992px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .article-sidebar {
    /* CAMBIO: Quitar order: -1 para que aparezca debajo en móvil */
    position: static;
  }

  .gallery-modal-prev {
    left: 10px;
  }

  .gallery-modal-next {
    right: 10px;
  }
}

@media (max-width: 768px) {
  .article-detail {
    padding: var(--spacing-lg) 0; /* Reducir de xl a lg en móvil */
  }

  .article-hero-image img {
    height: 300px !important; /* Forzar en móvil también */
  }

  .article-gallery {
    padding: var(--spacing-md);
  }

  .gallery-grid {
    grid-template-columns: repeat(4, 1fr); /* 4 columnas en tablet */
  }

  .gallery-item img {
    height: 70px;
  }

  .info-links {
    grid-template-columns: 1fr;
  }

  .more-info {
    padding: var(--spacing-lg) var(--spacing-md);
  }

  .article-navigation {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }

  .btn-back {
    align-self: flex-end;
  }

  .article-content {
    border-radius: 0;
  }

  .article-title {
    font-size: 1.8rem;
  }

  .article-lead {
    font-size: 1rem;
  }

  .article-header,
  .article-body,
  .article-share {
    padding: var(--spacing-lg) var(--spacing-md);
  }

  .article-hero-image figcaption {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .share-buttons {
    justify-content: center;
  }

  .gallery-modal-close {
    top: 10px;
    right: 10px;
  }

  .gallery-modal-prev,
  .gallery-modal-next {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr); /* 3 columnas en móvil */
  }

  .gallery-item img {
    height: 60px;
  }

  .article-title {
    font-size: 1.6rem;
  }

  .article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
  }

  .share-buttons {
    flex-direction: column;
  }

  .share-btn {
    justify-content: center;
  }

  .news-item {
    flex-direction: column;
    gap: var(--spacing-xs);
  }

  .news-image {
    width: 100%;
    height: 120px;
  }
}
