/* Estilos generales */
html, body {
    overflow-x: hidden; /* Oculta el scroll horizontal */
    width: 100%; /* Asegura que el ancho sea del 100% */
    max-width: 100%; /* Evita que el contenido exceda el ancho de la ventana */
    box-sizing: border-box;
}
body {
    margin: 0;
    padding: 0;
    background-color: #0a192f;
    color: #ffffff;
    font-family: "Poppins", sans-serif;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

/* Modo Claro */
.light-mode {
    background-color: rgb(234, 237, 242);
    color: #0a192f;
}

.light-mode h1,
.light-mode h2,
.light-mode h3,
.light-mode p {
    color: #0a192f;
}

/* Centrar h1 y h2 */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px;
    position: relative;
}

h1, h2 {
    margin: 0;
    font-weight: normal;
    font-family: "Merriweather", serif;
}

h1 {
    font-size: 5.738rem;
    color: #ccd6f6;
}

h2 {
    font-size: 2.235rem;
    color: #ccd6f6;
    font-style: italic;
    letter-spacing: -0.05em;
}

h3 {
    font-size: 1.875rem;
    font-weight: normal;
    color: #8892b0;
    font-family: "Poppins", sans-serif;
}

p {
    font-size: 1.5rem;
    color: #8892b0;
    line-height: 1.6;
}

/* Botón de modo oscuro/claro */
.toggle-mode {
    position: relative;
    left: 10px;
    top: -10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 2.5rem;
    color: #ccd6f6;
}

/* Contenedor de secciones */

.container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 900px;
    width: 100%;
    padding: 20px;
}

/* Secciones de series y libros */
#series, #libros {
    flex: 1;
    min-width: 300px;
    max-width: 600px; /* Aumentamos el ancho máximo */
    display: flex;
    flex-direction: column;
    align-items: center; /* Centra el contenido horizontalmente */
    text-align: center; /* Centra el texto del h3 */
}

#libros h3 {
    width: 100%; /* Ocupa el 100% del ancho */
    text-align: center; /* Centra el texto */
    margin-bottom: 20px; /* Espacio entre el h3 y la galería */
}

.ultimoVisto img {
    max-height: 400px;
    border-radius: 10px;
}

/* Galería de libros */
.gallery {
    display: flex;
    gap: 6px; /* Espacio de 6px entre imágenes */
    overflow-x: auto;
    padding: 10px;
    list-style: none;
    white-space: nowrap;
    scrollbar-width: thin;
    scrollbar-color: #888 #f4f4f4;
    justify-content: center; /* Centra las imágenes horizontalmente */
}

.gallery li {
    flex: 0 0 auto;
}

.gallery img {
    width: 150px; /* Ancho fijo de las imágenes */
    height: auto; /* Mantiene la proporción */
    border-radius: 10px;
    display: block;
}

/* Estilos para el enlace de Bluesky */
.bluesky-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #ccd6f6;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.bluesky-link .bluesky-icon {
    width: 50px; /* Ajusta el tamaño del icono según sea necesario */
    transition: opacity 0.3s ease;
}
.bluesky-link:hover {
    color: #64ffda;
    transform: scale(1.3); /* Crecimiento del 20% al hacer hover */
}

/* Estilos específicos para el modo claro */
.light-mode .bluesky-link {
    color: #0a192f;
}

.light-mode .bluesky-link:hover {
    color: #64ffda;
}

/* Responsive Design */
@media (max-width: 768px) {
      h1 {
        font-size: 3rem;
        white-space: normal;
        flex-direction: column;
        text-align: center;
    }

    .toggle-mode {
        font-size: 2rem;
        margin-left: 0;
        margin-top: 10px;
    }

    header {
        flex-direction: column; /* Coloca el h1 y el botón en una columna */
        align-items: center; /* Centra el contenido */
    }
    .container {
        flex-direction: column;
        align-items: center; /* Centra el contenido horizontalmente */
        padding: 10px; /* Reduce el padding para evitar desbordamientos */
        width: 100%; /* Asegura que el contenedor ocupe el 100% del ancho */
        box-sizing: border-box; /* Incluye el padding en el ancho total */
    }

    #series, #libros {
        width: 100%; /* Ocupa el 100% del ancho en responsive */
        max-width: 100%; /* Elimina cualquier límite de ancho máximo */
        padding: 0 10px; /* Añade un pequeño padding lateral */
        box-sizing: border-box; /* Incluye el padding en el ancho total */
        text-align: center; /* Centra el texto dentro de las secciones */
    }

    .gallery {
        flex-direction: column; /* Apila las imágenes verticalmente */
        white-space: normal; /* Permite que el texto se ajuste */
        overflow-x: hidden; /* Oculta el scroll horizontal */
        align-items: center; /* Centra las imágenes verticalmente */
        padding: 0; /* Elimina el padding adicional */
    }

    .gallery li {
        width: 100%; /* Ocupa el 100% del ancho en responsive */
    }

    .gallery img {
        width: 100%; /* Ocupa el 100% del ancho en responsive */
        height: auto; /* Mantiene la proporción */
    }
}