/* Estilo para el contenedor principal de noticias */
#news-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  /* padding: 2rem; */
  /* max-width: 800px; */
  margin: 0 auto;
}

/* Artículo de noticia */
.news-article {
  background-color: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease;
}

.news-article:hover {
  transform: translateY(-2px);
}

/* Título de noticia */
.news-article h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 2rem;
  text-align: center;

}

.news-author {
  font-size: 1.25rem;
  font-style: italic;
  color: #666;
  margin-bottom: 4px;
}

/* Fecha de publicación */
.news-date {
  display: block;
  font-size: 1.25rem;
  color: #666;
  margin-bottom: 1rem;
}

.news-description {
  font-size: 1.5rem;
  line-height: 1.6;
  color: #444;
  margin-top: 10px;
  margin-bottom: 15px;
  text-align: justify;
}


/* Botón de enlace */
.btn-link {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background-color: #0077cc;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.2s;
  font-size: 1.5rem;
}

.btn-link:hover {
  background-color: #005fa3;
}

/* Contenedor de comentarios */
.comments-container {
  margin-top: 1.5rem;
  border-top: 1px solid #eee;
}

/* Comentario individual */
.comment {
  margin-bottom: 1rem;
  padding: 0.5rem;
  border-radius: 8px;
  background-color: #f8f8f8;
}

.comment strong {
  font-weight: bold;
}

.comment small {
  font-size: 0.75rem;
  color: #888;
  margin-left: 0.5rem;
}

/* Formulario de comentarios */
.comment-form {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment-form input[type="text"],
.comment-form textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
}

.comment-form textarea {
  resize: vertical;
  min-height: 80px;
}

.comment-form button {
  align-self: flex-start;
  padding: 0.6rem 1.2rem;
  background-color: #28a745;
  border: none;
  color: white;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.comment-form button:hover {
  background-color: #218838;
}

/* Contenedor de botones de navegación */
.btn-nav-container {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem auto;
}

/* Botones de navegación */
.btn-nav {
  font-size: 1.25rem;
  padding: 0.6rem 1.2rem;
  background-color: #444;
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-nav:hover:not(:disabled) {
  background-color: #222;
}

.btn-nav:disabled {
  background-color: #aaa;
  cursor: default;
}

.oculto {
  display: none;
}

.toggle-comments-btn {
  margin-top: 1rem;
  /* o la cantidad que prefieras */
}

/* Contenedor de búsqueda */
.div-search {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  /* max-width: 600px; */
  margin: 2rem auto 2.5rem;
  padding: 0 1rem;
}

/* Input de búsqueda */
#search-input {
  flex-grow: 1;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 999px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  font-family: inherit;
  background-color: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

#search-input:focus {
  border-color: #0077cc;
  box-shadow: 0 0 0 3px rgba(0, 119, 204, 0.15);
}

/* Botón de búsqueda */
.btn-search {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border: none;
  background-color: #0077cc;
  color: white;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease, transform 0.1s ease;
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.btn-search:hover {
  background-color: #005fa3;
}

.btn-search:active {
  transform: scale(0.97);
}

/* Galería de imágenes */
.image-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin: 0 auto;
  /* Eliminado el margen superior */
  /* max-width: 1000px; */
  padding: 0 1rem;
}

/* Los enlaces que envuelven las imágenes */
.image-gallery a {
  display: block;
  max-width: 400px;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  /* para que el border-radius afecte también al img */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Efecto hover en el enlace (y por tanto la imagen) */
.image-gallery a:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Imagen dentro del enlace */
.image-gallery img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
}

/* Imagen dentro de una publicación */
.news-image {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 50dvh;
  object-fit: contain;
  display: block;
  margin: 0rem auto 1rem;
  /* ↑ Espacio superior (1rem), centrado horizontal */
}