:root {
    --primary-color: #E60000;
    --bg-dark: #252525;
    --bg-header-footer: #1a1a1a;
    --text-light: #D2C195;
    --accent: #7B6E4A;
}

body {
    /* Mantenemos el degradado pero optimizamos la carga */
    background-image: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('imagenes/fondos/fondo.png');
    background-attachment: fixed;
    background-position: center; /* Asegura que la máquina de escribir esté centrada */
    background-size: cover;      /* Cubre toda la pantalla sin deformar */
    background-repeat: no-repeat;
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Raleway', sans-serif;
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
    /* Mejora el rendimiento de scroll en móviles */
    -webkit-overflow-scrolling: touch; 
}

h1, h2 {
    font-family: 'Cinzel', serif;
    letter-spacing: 2px;
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5%;
    background: var(--bg-header-footer);
    position: fixed;
    width: 100%; /* Cambiado de 90% a 100% */
    left: 0;
    top: 0;
    box-sizing: border-box; /* Vital para que el padding no desborde */
    height: 60px;
    z-index: 1000;
}

.logo-img { height: 50px; width: auto; object-fit: contain; }
.nav-links { display: flex; list-style: none; }
.nav-links li a { color: white; text-decoration: none; margin-left: 20px; transition: 0.3s; }
.nav-links li a:hover { color: var(--primary-color); }

/* NOTA: Estilo para el botón hamburguesa (oculto en escritorio) */
.menu-toggle {
    display: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Busca esta parte en tu código y cámbiala así: */
.hero-slider {
    width: 70%; /* O 100% si quieres que cubra todo el ancho */
    margin: 0 auto; /* ← ESTA ES LA LÍNEA QUE CENTRA EL SLIDER */
    height: 85vh;
    min-height: 500px;
    background-size: cover;
    background-position: center 35%;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    transition: background-image 0.8s ease-in-out;
    position: relative;
    overflow: hidden;
}

.slide-content {
    flex-grow: 1;
    z-index: 2;
    text-align: center;
    /* Quitamos el fondo degradado de aquí, ya lo hace el JS en el hero */
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.slide-content h2 { 
    font-size: clamp(2rem, 5vw, 4rem); /* Tamaño dinámico: no se hace gigante en PC */
    color: var(--primary-color);
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8);
    text-transform: uppercase;
}
.prev-btn, .next-btn {
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    font-size: 2rem;
    width: 60px; /* Ancho fijo para que no se estiren */
    height: 100px; /* Alto fijo */
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev-btn:hover, .next-btn:hover {
    background: var(--primary-color);
}

/* SECCION AUTOR */
.section-dark { padding: 100px 0 80px 1%; background: rgba(30, 30, 30, 0.85); }

.author-flex-layout {
    display: flex;
    align-items: stretch;
    gap: 20px;
    justify-content: space-between;
}

.author-text-container {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 80px;
}

.author-image-container {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.author-photo {
    width: 100%;
    max-width: 250px;
    height: auto;
    display: block;
    opacity: 0.90; 
    filter: grayscale(20%);
    transition: 0.5s ease;
}

.author-photo:hover {
    opacity: 1;
    filter: grayscale(0%);
}

.quote {
    font-family: 'Special Elite', cursive;
    font-size: 1.3rem;
    color: var(--accent);
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
}

/* OBRAS */
.section-gray { padding: 80px 10%; background: rgba(42, 42, 42, 0.85); }

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    justify-items: center;
}

.book-card {
    background: #1a1a1a;
    padding: 20px;
    border-bottom: 4px solid var(--primary-color);
    max-width: 200px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.book-card img.book-cover {
    width: 100%;
    height: 280px;      
    object-fit: cover;  
    border-radius: 3px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

.book-details {
    margin: 0;
    padding-left: 18px;   /* Controla qué tan pegado queda a la izquierda */
}

.book-details li {
    margin-bottom: 4px;   /* Reduce separación vertical */
    line-height: 1.3;     /* Más compacto */
}

/* SECCION HISTORIA */
.container-history {
    padding: 80px 10%;
    max-width: 1200px;
    margin: 0 auto;
}

.history-title {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 40px;
}

.history-content {
    display: flex;
    flex-direction: column; /* Coloca imágenes arriba y texto abajo, o viceversa */
    gap: 40px;
}

.history-images {
    display: flex;
    justify-content: center; 
    align-items: center;
    width: 100%;
    padding: 0;           /* Quitamos paddings extra que puedan achicar la imagen */
}

.history-img {
    width: 100%;          
    max-width: 400px;     
    height: auto;         /* Esto evita que se vea flaca o estirada */
    object-fit: contain;  /* Cambia cover por contain aquí para asegurar que se vea completa */
    border-radius: 5px;
    border-left: 3px solid var(--primary-color);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    display: block;
    margin: 0 auto;       
}

.history-text {
    font-size: 1.1rem;
    color: var(--text-light);
    text-align: justify;
}

.history-text p {
    margin-bottom: 20px;
}

/* Ajuste Responsivo para Historia */
@media (max-width: 768px) {
    /* ... otros estilos que ya tienes ... */

    .history-content {
        flex-direction: column; /* Imagen arriba, texto abajo */
        gap: 20px;
    }

    .history-img {
        width: 90%;       /* Un poco de margen a los lados en el cel */
        height: auto;     /* Refuerza que no se estire */
    }
    
    .history-text {
        text-align: left; /* En celular el 'justify' a veces deja huecos feos */
    }
}

/* EVENTOS */
.event-subsection { margin-bottom: 60px; }
.event-subsection h3 { font-family: 'Cinzel', serif; color: var(--accent); margin-bottom: 30px; border-bottom: 1px solid #444; padding-bottom: 10px; }

.events-grid-large { display: flex; justify-content: center; gap: 20px; }
.events-grid-large img { width: 100%; max-width: 800px; height: auto; border-radius: 5px; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }

.events-grid-small { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.events-grid-small img { width: 100%; height: auto; filter: sepia(30%); transition: 0.3s; }

.interview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.interview-card { background: #1a1a1a; display: flex; align-items: center; padding: 15px; border-radius: 5px; }
.interview-card img { width: 100px; height: auto; margin-right: 15px; border: 1px solid var(--accent); }

/* FOOTER */
footer { background-color: var(--bg-header-footer); padding: 20px 0; text-align: center; }
.social-links { display: flex; justify-content: center; gap: 30px; margin-bottom: 15px; }
.social-links a { color: white; font-size: 1.5rem; transition: 0.3s; }
.social-links a:hover { color: var(--primary-color); }

/* --- AJUSTES RESPONSIVOS Y MENÚ HAMBURGUESA --- */

/* 1. ESTADO POR DEFECTO (Escritorio / PC) */
.menu-toggle { 
    display: none; /* Escondido en PC */
}

/* 2. AJUSTES PARA MÓVILES (Pantallas menores a 768px) */
@media (max-width: 768px) {
    .menu-toggle { 
        display: block; /* Aparece solo en celular */
        order: 2; 
    }
    
    .logo { 
        order: 1; 
    }

    .nav-links {
        position: absolute;
        top: 60px;
        left: -100%; /* Menú escondido a la izquierda */
        flex-direction: column;
        background: var(--bg-header-footer);
        width: 100%;
        text-align: center;
        transition: 0.5s;
        padding: 20px 0;
        box-shadow: 0 10px 10px rgba(0,0,0,0.5);
        z-index: 1000;
    }

    .nav-links.active { 
        left: 0; /* Se desliza al centro al abrirlo */
    }

    .nav-links li { 
        margin: 15px 0; 
    }

    .nav-links li a { 
        margin-left: 0; 
        font-size: 1.2rem; 
    }

    /* Ajustes de contenido para celular */
.hero-slider { 
        width: 100% !important;  /* En el celular DEBE ocupar todo el ancho para que no se corte */
        margin: 60px 0 0 0 !important; /* Pegado a los bordes */
        height: 60vh; 
        background-size: cover; 
        border-radius: 0;        /* Sin bordes redondeados en móvil */
    }
    
    .slide-content {
        padding: 10px;           /* Evita que el texto empuje las flechas */
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
.slide-content h2 { 
        font-size: 1.6rem;       /* Tamaño más controlado para que no salte el botón */
        width: 90%;              /* Deja espacio para las flechas laterales */
        margin: 0 auto 15px;
    }
    
.prev-btn, .next-btn {
        width: 35px;             /* Flechas un poco más delgadas para no tapar el texto */
        height: 60px;
        font-size: 1.2rem;
        position: relative;      /* Asegura que se mantengan en su sitio */
        z-index: 10;
    }
    
    .author-flex-layout { 
        flex-direction: column; 
        text-align: center; 
        padding-left: 0; 
        padding-right: 0; 
    }
    
    .section-dark { 
        padding: 80px 5%; 
    }
    
    .author-image-container { 
        justify-content: center; 
        margin-top: 20px; 
    }
    
    .events-grid-large { 
        padding: 0 10px; 
    }
    
    .interview-card { 
        flex-direction: column; 
        text-align: center; 
    }
    
    .interview-card img { 
        margin-right: 0; 
        margin-bottom: 10px; 
    }
} /* <--- AQUÍ CIERRA LA MEDIA QUERY CORRECTAMENTE */

/* Esto hará que TODOS los enlaces de la página sean rojos por defecto */
a {
    color: var(--primary-color); /* Usa el rojo que ya definiste en tus variables */
    text-decoration: none;       /* Quita el subrayado si lo deseas */
    transition: 0.3s;
}

/* Color cuando pasas el mouse por encima (opcional) */
a:hover {
    color: white; 
}

/* Específicamente para los enlaces dentro de las tarjetas de libros */
.book-card a {
    color: var(--primary-color);
    font-weight: bold;
}
.events-grid-large {
    display: flex;
    flex-direction: column; /* Esto obliga a que el texto vaya DEBAJO de la imagen */
    align-items: center;    /* Centra ambos elementos */
    gap: 20px;
    width: 100%;
}

.events-grid-large img {
    width: 100%;
    max-width: 900px;      /* Puedes aumentar este valor si quieres que sea más grande */
    height: auto;
    border-radius: 5px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

/* Estilo para el texto de agradecimiento para que no se vea como un H1 gigante */
.certificate-thanks {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;      /* Ajusta el tamaño a tu gusto */
    text-align: center;
    max-width: 800px;
    color: var(--text-light);
    line-height: 1.4;
    margin-top: 20px;
}
.btn {
    background-color: var(--primary-color);
    color: white !important;
    padding: 12px 28px;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
    transition: 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    background-color: #b80000;
    transform: scale(1.05);
}