/* Estilo para el título principal */
h1 {
    color: #b414a8; /* Color morado para el texto del título */
    margin-bottom: 40px; /* Espacio inferior de 40px debajo del h1 */
}

/* Contenedor general de noticias */
.contenedor-noticias {
    display: flex; /* Usa modelo de caja flexible para alinear elementos */
    justify-content: center; /* Centra los elementos hijos horizontalmente */
    flex-wrap: wrap; /* Permite que los elementos se ajusten a varias líneas */
    gap: 60px; /* Espacio entre las noticias */
}

/* Estilo individual para cada noticia */
/* Contenedor individual de cada noticia */
.noticia {
    position: relative;
    width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Imagen dentro de la noticia */
.noticia img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 18px;
    transition: transform 0.5s ease-in-out, filter 0.4s ease-in-out, box-shadow 0.4s ease;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Efecto al pasar el cursor */
.noticia:hover img {
    transform: scale(1.07);
    filter: brightness(1.1) contrast(1.05);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.35);
}

/* Botón debajo de la imagen */
.noticia button {
    font-family: Georgia, serif; /* Fuente del cuerpo */
    margin-top: 18px; /* Separación respecto a la imagen */
    background: linear-gradient(145deg, #b414a8, #87077d);
    color: white;
    border: none;
    padding: 12px 26px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    font-size: 1em;
    transition: all 0.3s ease;
}

/* Efecto hover del botón */
.noticia button:hover {
    font-family: Georgia, serif; /* Fuente del cuerpo */
    background: linear-gradient(145deg, #87077d, #b414a8);
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

  /* === Overlay oscuro === */
  .overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
    z-index: 1999;
  }
  .overlay.active {
    display: block;
  }

  /* === Panel lateral (offcanvas) === */
  .offcanvas {
    position: fixed;
    top: 0;
    right: -400px;
    width: 370px;
    height: 100%;
    background: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    transition: all 0.4s ease;
    z-index: 2000;
    padding: 30px 25px 40px 25px;
    overflow-y: auto;
    opacity: 0;
    transform: translateX(100px) scale(0.98);
    scrollbar-width: thin;
    scrollbar-color: #b414a8 #f0f0f0;
    font-family: Georgia, serif;;
  }
  .offcanvas.open {
    right: 0;
    opacity: 1;
    transform: translateX(0) scale(1);
  }

  /* Scrollbar para Webkit */
  .offcanvas::-webkit-scrollbar {
    width: 8px;
  }
  .offcanvas::-webkit-scrollbar-thumb {
    background-color: #b414a8;
    border-radius: 10px;
  }
  .offcanvas::-webkit-scrollbar-track {
    background-color: #f0f0f0;
  }

  /* Imagen */
  .offcanvas img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 18px;
    box-shadow: 0 4px 10px rgba(180,20,168,0.3);
    opacity: 0;
    transform: translateY(20px);
    animation-fill-mode: forwards;
  }

  /* Título */
  .offcanvas h2 {
    color: #860791; 
    margin-bottom: 18px;
    font-size: 1.6rem;
    font-weight: 700;
    opacity: 0;
    transform: translateY(20px);
    animation-fill-mode: forwards;
  }

  /* Texto */
  .offcanvas p {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.6;
    margin-bottom: 15px;
    text-align: justify;
    opacity: 0;
    transform: translateY(20px);
    animation-fill-mode: forwards;
    white-space: pre-line;
  }

  /* Negritas para frases destacadas dentro del texto */
  .offcanvas p strong {
    color: #b414a8;
  }

  /* Botón cerrar */
  .cerrar-btn {
    display: block;
    margin-top: 25px;
    background-color: #b414a8;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    width: 100%;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    animation-fill-mode: forwards;
    transition: background-color 0.3s ease;
  }
  .cerrar-btn:hover {
    background-color: #87077d;
  }

  /* Animaciones fadeInUp */
  @keyframes fadeInUp {
    0% {
      opacity: 0;
      transform: translateY(20px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Animación en cascada para los elementos */
  .offcanvas.open img {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.1s;
  }
  .offcanvas.open h2 {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.25s;
  }
  .offcanvas.open p {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.4s;
  }
  .offcanvas.open .cerrar-btn {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.55s;
  }

  /* Botón para abrir noticias */
  .btn-noticia {
    margin: 10px;
    padding: 10px 25px;
    background-color: #860791;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: background-color 0.3s ease;
  }
  .btn-noticia:hover {
    background-color: #b414a8;
  }