/* Estilos específicos para el template single-news.php */

/* Optimización del viewport y distribución de elementos */
.news-single {
  max-width: 1200px; /* Aumentado de 1000px para mejor uso del ancho */
  margin: 150px auto 2rem auto; /* Reducido el margen superior en desktop */
  background: #fff;
  border-radius: 1.2rem;
  box-shadow: 0 2px 16px rgba(16,26,40,0.07);
  padding: 30px 1rem 2.5rem 1rem; /* Reducido padding superior */
}

.container {
  max-width: 1100px; /* Aumentado para mejor aprovechamiento del ancho */
  margin: 0 auto;
  padding: 0 1rem;
}

/* Agrupar breadcrumbs y meta en una línea compacta */
.news-header {
  margin-bottom: 2rem; /* Reducido de 2.5rem */
  border-bottom: none;
  padding-bottom: 0;
}

/* Breadcrumbs y meta más compactos */
.breadcrumbs {
  font-size: 0.9rem; /* Reducido ligeramente */
  margin-bottom: 0.5rem; /* Reducido de 1.2rem */
}

.news-meta {
  color: var(--color-gray-main, #6b7280);
  font-size: var(--font-small, 1rem);
  margin-bottom: 1rem; /* Reducido de 0.75rem */
  font-weight: 200;
  display: inline-block; /* Para que no ocupe toda la línea */
}

/* Lead image/video optimizado */
.news-featured-image {
  margin: 1.5rem 0 4rem 0; /* Reducido de 2.5rem */
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(16,26,40,0.07);
  aspect-ratio: 16/9; /* Aspect ratio fijo para consistencia */
}

.news-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Para mantener proporciones */
  display: block;
}

/* Feature video optimizado */
.feature-video {
  margin: 1.5rem 0 1.5rem 0;
  aspect-ratio: 16/9;
  border-radius: 1rem;
  overflow: hidden;
}

.feature-video iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Título optimizado */
.news-title {
  font-size: var(--font-h2, 2.5rem);
  font-weight: var(--font-weight-bold, 700);
  color: var(--color-blue-secondary, #1a237e);
  margin-bottom: .5rem; /* Reducido de 0.5rem */
  line-height: 1.15;
}

/* Botones de compartir más compactos */
.news-share {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem 0; /* Reducido de 1.5rem */
  padding: 0;
  background: none;
  border: none;
}

/* Contenido principal optimizado */
.news-content {
  font-size: var(--font-p, 1.125rem);
  color: var(--color-blue-secondary, #1a237e);
  line-height: 1.7;
  margin-bottom: 2.5rem; /* Reducido de 3rem */
  margin-top: 1.5rem; /* Reducido de 2.5rem */
  /* max-width y centrado ahora lo hereda de .news-main */
}

/* Separador de share más sutil */
.share-separator {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 2rem 0 1rem 0; /* Reducido de 2.5rem */
}

/* Navegación optimizada */
.news-navigation {
  margin: 2.5rem 0 2rem 0; /* Reducido de 3.5rem */
  padding: 1.5rem 0 0 0; /* Reducido de 2rem */
  border-top: 1px solid #e5e7eb;
  border-bottom: none;
}

/* Posts relacionados optimizados */
.related-posts {
  margin-top: 2.5rem; /* Reducido de 3.5rem */
  padding-top: 1.5rem; /* Reducido de 2.5rem */
  border-top: 1px solid #e5e7eb;
}

.related-posts h2 {
  font-size: var(--font-h4, 2rem);
  color: var(--color-blue-secondary, #1a237e);
  margin-bottom: 1.5rem; /* Reducido de 2rem */
  font-weight: var(--font-weight-bold, 700);
  text-align: center;
}

/* Quote destacado con mejor diseño visual */
.news-content blockquote {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-left: 4px solid var(--color-blue-main, #0073C2);
  padding: 2rem;
  margin: 2rem 0;
  border-radius: 0.5rem;
  position: relative;
  font-style: italic;
  font-size: 1.1em;
  line-height: 1.6;
}

.news-content blockquote::before {
  content: '"';
  font-size: 4rem;
  color: var(--color-blue-main, #0073C2);
  position: absolute;
  top: -1rem;
  left: 1rem;
  font-family: serif;
  opacity: 0.3;
}

/* Mejorar listas de features */
.news-content ul {
  margin: 1.5rem 0;
  padding-left: 0;
}

.news-content ul li {
  position: relative;
  padding-left: 1.8rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.news-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: .6rem;
  height: .6rem;
  background: var(--color-blue-main, #0073C2);
  border-radius: 50%;
  display: inline-block;
}

.wp-block-quote p:last-child em {
  font-weight: 200;
}

/* Responsive optimizado */
@media (max-width: 1200px) {
  .news-single { 
    max-width: 95vw; 
    margin: 100px auto 2rem auto;
  }
  .container { 
    max-width: 95vw; 
  }
}

@media (max-width: 900px) {
  .news-single { 
    max-width: 98vw; 
    margin: 80px auto 2rem auto;
    padding: 40px 1rem 2rem 1rem;
  }
  .container { 
    max-width: 98vw; 
  }
  .news-title { 
    font-size: var(--font-h3, 2rem); 
  }
  .news-featured-image { 
    margin: 1rem 0 1rem 0; 
  }
  .news-content { 
    margin-top: 1rem; 
  }
  .news-navigation { 
    margin: 2rem 0 1.5rem 0; 
    padding: 1rem 0 0 0; 
  }
  .related-posts { 
    margin-top: 2rem; 
    padding-top: 1rem; 
  }
  .related-posts h2 { 
    font-size: var(--font-h5, 1.25rem); 
  }
}

@media (max-width: 768px) {
  .news-single {
    padding: 1.2rem 0.7rem;
    margin: 80px auto 2rem auto;
    border-radius: 0.8rem;
  }
  .news-title { 
    font-size: var(--font-h3, 2rem); 
  }
  .news-featured-image { 
    margin: 1rem 0 1rem 0; 
    border-radius: 0.8rem;
  }
  .feature-video {
    border-radius: 0.8rem;
  }
  .news-content { 
    margin-top: 1rem; 
    font-size: 1rem;
  }
  .news-content blockquote {
    padding: 1.5rem;
    margin: 1.5rem 0;
  }
  .news-content blockquote::before {
    font-size: 3rem;
    top: -0.5rem;
    left: 0.5rem;
  }
  .news-navigation { 
    margin: 2rem 0 1.5rem 0; 
    padding: 1rem 0 0 0; 
  }
  .related-posts { 
    margin-top: 2rem; 
    padding-top: 1rem; 
  }
  .related-grid { 
    grid-template-columns: 1fr; 
    gap: 1.5rem; 
  }
  .nav-links { 
    grid-template-columns: 1fr; 
    gap: 1rem; 
  }
  .nav-next { 
    text-align: left; 
  }
}

@media (max-width: 480px) {
  .container { 
    padding: 0 0.5rem; 
  }
  .news-share { 
    gap: 0.3rem; 
  }
  .share-label { 
    margin-right: 0.4rem; 
  }
  .news-featured-image { 
    margin: 0.8rem 0 0.8rem 0; 
  }
  .news-content { 
    margin-top: 0.8rem; 
  }
  .news-content blockquote {
    padding: 1rem;
    margin: 1rem 0;
  }
  .related-content { 
    padding: 1rem; 
  }
}

figure.wp-block-embed.is-type-video.is-provider-youtube, figure.wp-block-embed-youtube {
  border-radius: 35px !important;
  overflow: hidden;
  border: 10px solid var(--color-blue-secondary, #1a237e);
}

/* Estilos para video como feature image */
.feature-video iframe {
  border-radius: 35px !important;
  overflow: hidden;
  border: 10px solid var(--color-blue-secondary, #1a237e);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Breadcrumbs visuales y modernos */
.breadcrumbs {
  font-size: 0.95rem;
  color: var(--color-gray-main, #8F91A6);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5em;
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--color-gray-main, #8F91A6);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumbs a:hover {
  color: var(--color-blue-main, #0073C2) !important;
  text-decoration: underline;
}

.breadcrumbs span {
  color: var(--color-blue-secondary, #051A40);
  font-weight: 400;
}

.breadcrumbs-separator {
  color: var(--color-gray-light, #D4D4DB);
  font-size: 1.1em;
  margin: 0 0.2em;
  user-select: none;
}

/* Breadcrumbs: restaurar contraste visual solo en el breadcrumb actual */
.breadcrumbs a span[itemprop="name"] {
  color: var(--color-gray-main, #8F91A6);
  font-weight: 400;
}

.breadcrumbs .breadcrumbs-separator {
  color: var(--color-gray-light, #D4D4DB);
}

.breadcrumbs > span[itemprop="itemListElement"] span[itemprop="name"] {
  color: var(--color-blue-secondary, #051A40);
  font-weight: 400; /* O 600 si prefieres más contraste */
}

/* Estilos restaurados para elementos esenciales */
.share-label {
  display: inline-block;
  margin-right: 0.75rem;
  font-size: var(--font-small, 1rem);
  color: var(--color-gray-main, #6b7280);
  font-weight: 300;
  vertical-align: middle;
}

.share-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-start;
  align-items: center;
}

.share-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 0;
  background: inherit;
  margin: 0;
}

.share-btn i {
  font-size: 1rem;
  margin: 0;
  line-height: 1;
}

.share-facebook { background: #1877f2; color: white; }
.share-facebook:hover { background: #166fe5; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3); }
.share-twitter { background: #1da1f2; color: white; }
.share-twitter:hover { background: #1a91da; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3); }
.share-linkedin { background: #0077b5; color: white; }
.share-linkedin:hover { background: #006097; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 119, 181, 0.3); }
.share-copy { background: #6b7280; color: white; }
.share-copy:hover, .share-copy.copied { background: #4b5563; color: white; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3); }

.news-author {
  font-weight: var(--font-weight-semibold, 600);
  color: var(--color-blue-main, #3949ab);
}

.nav-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.nav-link {
  padding: 1.5rem;
  background: #f8fafc;
  border-radius: 0.8rem;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.nav-link:hover {
  background: #f1f5f9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.nav-link a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.nav-label {
  display: block;
  font-size: var(--font-small, 1rem);
  color: var(--color-gray-main, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  font-weight: var(--font-weight-medium, 500);
}

.nav-link h4 {
  font-size: var(--font-h5, 1.25rem);
  color: var(--color-blue-secondary, #1a237e);
  margin-bottom: 0.5rem;
  font-weight: var(--font-weight-semibold, 600);
  line-height: 1.4;
}

.nav-date {
  font-size: var(--font-small, 1rem);
  color: var(--color-gray-main, #6b7280);
}

.nav-prev { text-align: left; }
.nav-next { text-align: right; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.related-post {
  background: #f8fafc;
  border-radius: 0.8rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%; /* Asegurar altura uniforme */
}

.related-post:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.related-thumbnail {
  height: 200px;
  overflow: hidden;
  flex-shrink: 0; /* Evitar que la imagen se comprima */
}

.related-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.related-post:hover .related-thumbnail img {
  transform: scale(1.05);
}

.related-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto; /* Ocupar todo el espacio disponible */
  justify-content: space-between; /* Distribuir contenido */
}

.related-content h4 {
  font-size: var(--font-h5, 1.25rem);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.related-content h4 a {
  color: var(--color-blue-secondary, #1a237e);
  text-decoration: none;
  font-weight: var(--font-weight-semibold, 600);
  line-height: 1;
}

.related-content h4 a:hover {
  color: var(--color-blue-main, #3949ab);
}

.related-meta {
  font-size: var(--font-small, 1rem);
  color: var(--color-gray-main, #6b7280);
  margin-bottom: 1rem;
}

.related-author {
  font-weight: var(--font-weight-medium, 500);
  color: var(--color-blue-main, #3949ab);
}

.related-excerpt {
  display: none; /* Ocultar el excerpt */
}

.no-related-posts {
  text-align: center;
  padding: 3rem 1rem;
  background: #f8fafc;
  border-radius: 0.8rem;
  border: 1px solid #e2e8f0;
}

.no-related-content i {
  font-size: 3rem;
  color: var(--color-gray-main, #6b7280);
  margin-bottom: 1rem;
}

.no-related-content h4 {
  font-size: var(--font-h5, 1.25rem);
  color: var(--color-blue-secondary, #1a237e);
  margin-bottom: 0.5rem;
  font-weight: var(--font-weight-semibold, 600);
}

.no-related-content p {
  font-size: var(--font-small, 1rem);
  color: var(--color-gray-main, #6b7280);
  margin-bottom: 1.5rem;
}

.btn-back-to-news {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--color-blue-main, #3949ab);
  color: white;
  text-decoration: none;
  border-radius: 0.5rem;
  font-size: var(--font-small, 1rem);
  font-weight: var(--font-weight-medium, 500);
  transition: all 0.3s ease;
}

.btn-back-to-news:hover {
  background: var(--color-blue-secondary, #1a237e);
  transform: translateY(-2px);
  color: white;
}

.news-featured-image figcaption {
  font-size: var(--font-small, 1rem);
  color: var(--color-gray-main, #6b7280);
  margin-top: 0.5rem;
  text-align: center;
}

.news-main {
  /* max-width: 65ch; */
  max-width: 80ch;
  margin-left: auto;
  margin-right: auto;
}
.breadcrumbs,
.news-meta,
.news-featured-image,
.feature-video,
.news-title {
  max-width: 80ch;
  /* margin-left: auto;
  margin-right: auto; */
}

.breadcrumbs,
.news-meta {
  font-size: 0.95rem;
  color: var(--color-gray-main, #8F91A6);
  margin-bottom: 0.5rem;
}

.news-featured-image,
.feature-video {
  max-width: 900px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  display: block;
}
@media (max-width: 950px) {
  .news-featured-image,
  .feature-video {
    max-width: 98vw;
  }
}

.news-content ul li::before {
  width: 1.2rem;
  height: 1.2rem;
  background: var(--color-blue-main, #0073C2);
  border: 2px solid #fff;
}

@media (max-width: 600px) {
  .news-main {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .news-content blockquote {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

.share-separator {
  border-top: 1px solid #e5e7eb;
  margin: 1.5rem 0 1rem 0;
}

/* === NEWS ARCHIVE STYLES === */
.news-archive-header {
  margin: 2.5rem 0 1.5rem 0;
  text-align: center;
}
.news-search-form {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 400px;
  margin: 0 auto;
  background: #f8fafc;
  border-radius: 2rem;
  box-shadow: 0 2px 8px rgba(16,26,40,0.07);
  padding: 0.25rem 1rem;
}
.news-search-input {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  padding: 0.7rem 0.5rem;
  outline: none;
  flex: 1;
}
.news-search-btn {
  background: none;
  border: none;
  color: var(--color-blue-main, #0073C2);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.5rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.news-search-btn:hover {
  color: var(--color-blue-secondary, #1a237e);
}

.news-archive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

input#news-search-field {
  font-family: var(--font-body);
}

@media (min-width: 600px) {
  .news-archive-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 1000px) {
  .news-archive-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
.news-archive-item {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 2px 16px rgba(16,26,40,0.07);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: box-shadow 0.2s, transform 0.2s;
}
.news-archive-item:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,0.10);
  transform: translateY(-4px);
}
.news-archive-thumb img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.news-archive-meta {
  font-size: 0.95rem;
  color: var(--color-gray-main, #8F91A6);
  margin: 1rem 0 0.5rem 0;
  padding: 0 1.2rem;
}
.news-archive-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-blue-secondary, #1a237e);
  margin: 0 0 0.5rem 0;
  padding: 0 1.2rem;
  line-height: 1.3;
}
.news-archive-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.news-archive-title a:hover {
  color: var(--color-blue-main, #0073C2);
}
.news-archive-excerpt {
  font-size: 1rem;
  color: var(--color-gray-main, #6b7280);
  padding: 0 1.2rem 1.2rem 1.2rem;
  flex: 1 1 auto;
}
.no-news-found {
  text-align: center;
  color: var(--color-gray-main, #6b7280);
  font-size: 1.1rem;
  padding: 2rem 0;
}
.news-archive-pagination {
  display: flex;
  justify-content: center;
  margin: 2.5rem 0 1.5rem 0;
}
.news-archive-pagination .page-numbers {
  display: inline-block;
  margin: 0 0.3rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: #f8fafc;
  color: var(--color-blue-secondary, #1a237e);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.news-archive-pagination .page-numbers.current,
.news-archive-pagination .page-numbers:hover {
  background: var(--color-blue-main, #0073C2);
  color: #fff;
}
/* Fin estilos archive-news */

/* Estilos adicionales para la paginación */
.related-grid {
  transition: opacity 0.3s ease;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Mejoras en el grid responsive */
@media (max-width: 1200px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .related-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Botón Read More */
.read-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  background: var(--color-blue-main, #0073C2);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  border: none;
  position: relative;
  overflow: hidden;
  margin-top: auto; /* Empujar al final */
  align-self: flex-start; /* Alinear a la izquierda */
}

.read-more-btn:hover {
  background: var(--color-blue-secondary, #051A40);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 115, 194, 0.3);
}

.read-more-btn:focus {
  outline: 2px solid var(--color-blue-main, #0073C2);
  outline-offset: 2px;
}

/* Ícono del botón */
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.read-more-btn:hover .btn-icon {
  background: rgba(255, 255, 255, 0.3);
  transform: translateX(2px);
}

.btn-icon svg {
  width: 12px;
  height: 12px;
  color: white;
}