/* --- Variables de Color Material Design 3 --- */
:root {
    --md-sys-color-primary: #6750A4;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-surface: #fef7ff;
    --md-sys-color-surface-variant: #e7e0ec;
    --md-sys-color-outline: #79747e;
    --md-sys-bg: #f3f3f8;
}
/* Fuente general */
body {
    margin: 0;
    font-family: 'Roboto', 'Segoe UI', sans-serif; /* Tipografía más limpia para repositorios */
    background: var(--md-sys-bg);
    color: #1c1b1f;
}

/*************************** NAVBAR *****************************/

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, #3b1ee3, #6a4df5);
    padding: 15px 25px;
    color: #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.18);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-title {
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.nav-menu a {
    margin-left: 20px;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: opacity .2s;
}

.nav-menu a:hover {
    opacity: .7;
}

.hamburger {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
}

@media (max-width: 768px) {

    .hamburger {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 70px;
        right: 0;
        background: linear-gradient(90deg, #3b1ee3, #6a4df5);
        flex-direction: column;
        width: 100%;
        text-align: center;
        display: none;
        padding: 20px 0;
    }

    .nav-menu a {
        margin: 15px 0;
        display: block;
        font-size: 1.1rem;
    }

    .nav-menu.active {
        display: flex;
    }
}

/*************************** NAVBAR *****************************/

/* HERO */
.hero {
    padding: 60px 20px 100px;
    text-align: center;
    background: linear-gradient(180deg, #3b1ee3, #6750A4);
    color: #fff;
    clip-path: ellipse(150% 100% at 50% 0%); /* Curva suave al fondo */
}

.heroc {
    background-image: url('img/fondocandombe.png'); /* ruta a tu imagen */
	background-size: cover;        /* 🔥 clave: ocupa todo */
    background-position: center;   /* centra la imagen */
    background-repeat: no-repeat;  /* 🔥 evita repetición */
}

.herom {
    background-image: url('img/fondomemoria.png'); /* ruta a tu imagen */
	background-size: cover;        /* 🔥 clave: ocupa todo */
    background-position: center;  /* centra la imagen */
    background-repeat: no-repeat;  /* 🔥 evita repetición */
}

.heroe {
    background-image: url('img/fondomaterial.png'); /* ruta a tu imagen */
	background-size: cover;        /* 🔥 clave: ocupa todo */
    background-position: center 30%;  /* centra la imagen */
    background-repeat: no-repeat;  /* 🔥 evita repetición */
}

.herob {
    background-image: url('img/fondobiblioteca.png'); /* ruta a tu imagen */
	background-size: cover;        /* 🔥 clave: ocupa todo */
    background-position: center 30%;  /* centra la imagen */
    background-repeat: no-repeat;  /* 🔥 evita repetición */
}

.heroi {
    background-image: url('img/index.png'); /* ruta a tu imagen */
	background-size: cover;        /* 🔥 clave: ocupa todo */
    background-position: center 10%;  /* centra la imagen */
    background-repeat: no-repeat;  /* 🔥 evita repetición */
}

/* HERO - Ajustes de Texto */
.hero h1 {
    font-size: 3.8rem; /* Un poco más grande y elegante */
    font-weight: 300;
    letter-spacing: -0.5px;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.25rem; /* Tamaño optimizado para lectura rápida */
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.5;
    opacity: 0.95; /* Mayor opacidad para mejor contraste */
    font-weight: 400;
}

/* HIGHLIGHT */
.highlight {
    padding: 40px 20px;
    max-width: 900px;
    margin: auto;
    text-align: center;
}

.highlight h2 {
    font-size: 2rem;
    color: #4a33f7;
}

/* --- CARDS TIPO REPOSITORIO --- */
.cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 40px 20px;
}

.card {
    background: #ffffff;
    width: 260px;
    padding: 32px 24px;
    border-radius: 24px; /* Bordes más redondeados */
    text-align: center;
    border: 1px solid var(--md-sys-color-surface-variant);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none; /* Empezamos planos (M3 style) */
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    background-color: var(--md-sys-color-surface);
}

.card-icon {
    font-size: 48px !important;
    color: var(--md-sys-color-primary);
    margin-bottom: 15px;
}

/* BOTÓN - Estilo Píldora M3 */
.card-btn {
    margin-top: 20px;
    background: #5a35ff;
    border: none;
    border-radius: 28px; /* Cambio de 8px a 28px para efecto píldora */
    color: white;
    padding: 12px 24px; /* Más alto y ancho */
    font-size: 0.95rem;
    font-weight: 500; /* Texto Medium para claridad */
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card-btn:hover {
    background: #4328f2;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

/* --- SECCIÓN SOBRE EL PROYECTO (Contenedor Elevado) --- */

.about-editorial {
    background: transparent;
    padding: 40px 20px;
}

.about-content {
    background: #ffffff;
    max-width: 900px;
    margin: auto;
    padding: 48px;
    border-radius: 28px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.about-content h2 {
    font-family: 'Roboto', sans-serif;
    color: #49454f;
    font-weight: 400;
}



  /* -------- BUSCADOR ----------- */

.search-container {
    background: white;
    max-width: 700px;
    margin: -30px auto 40px; /* Eleva el buscador sobre el hero */
    padding: 8px 16px;
    border-radius: 32px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
    z-index: 10;
}

.search-container input {
    border: none;
    flex-grow: 1;
    padding: 10px;
    font-size: 1rem;
    outline: none;
}

.search-container button {
    background: #2c3e50; /* Color oscuro profesional */
    color: white;
    border-radius: 24px;
    padding: 10px 25px;
    font-weight: 500;
}

.search-container input:focus {
	border-color: #2c3e50;
	box-shadow: 0 0 5px rgba(44, 62, 80, 0.5);
}

.search-container button:hover {
	background-color: #1a252f;
}

/* --- Ajuste del Buscador --- */
.search-bar {
    display: flex;
    align-items: center;
    background: white;
    padding: 8px 16px;
    border-radius: 32px; /* Efecto Píldora */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 700px;
}

.search-icon {
    color: #757575;
    margin-right: 10px;
}

.search-bar input {
    border: none;
    flex-grow: 1;
    font-size: 1rem;
    outline: none;
}

.search-btn {
    background: #2c3e50; /* Color oscuro como en tu imagen */
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 500;
}

/* --- Chips de Filtro (Sugerencia) --- */
.filter-chips {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.chip {
    padding: 8px 16px;
    border-radius: 16px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    transition: 0.3s;
}

.chip.active {
    background: #6750A4;
    color: white;
    border-color: #6750A4;
}

/* --------------------------- BIBLIOTECA -------------------------- */

/* --- Contenedor Principal --- */
.main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* Grilla de libros */
.books-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px;
}

.book-card {
    display: flex;
    background: #ffffff;
    border-radius: 28px;
    margin-bottom: 25px;
    padding: 20px;
    border: 1px solid #f0f0f0;
    transition: box-shadow 0.3s ease;
}

.book-card img {
    width: 140px;
    height: 190px;
    border-radius: 16px;
    object-fit: contain;
    background: #f8f9fa;
    margin-right: 25px;
}

.book-card-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.book-card-content h3 {
    font-size: 1.5rem;
    color: #1d1d1d;
    margin-bottom: 10px;
}

.book-card-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* --- RESPONSIVE: IMAGEN ARRIBA EN PANTALLAS CHICAS --- */
@media (max-width: 600px) {
    .book-card {
        flex-direction: column; /* Cambia de horizontal a vertical */
        align-items: center;    /* Centra los elementos */
        text-align: center;     /* Centra el texto */
        padding: 15px;
    }

    .book-card img {
        margin-right: 0;        /* Elimina el margen lateral */
        margin-bottom: 15px;    /* Añade espacio debajo de la imagen */
        width: 100%;            /* Ocupa el ancho disponible */
        max-width: 160px;       /* Pero con un límite para no pixelarse */
        height: auto;
    }

    .book-card-content {
        align-items: center;    /* Centra el botón y el texto */
    }

    .book-card-content button {
        align-self: center;     /* Asegura que el botón píldora esté centrado */
    }


}

/* --- BOTÓN PÍLDORA (Específico para Cards) --- */
.card-btn-pill {
    background: #6750A4; /* Morado primario */
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    cursor: pointer;
    font-weight: 500;
    align-self: flex-start;
    transition: background 0.2s;
}

.card-btn-pill:hover {
    background: #5a35ff;
}



/* FOOTER */
.footer {
    padding: 20px;
    text-align: center;
    background: #e9e8fc;
    margin-top: 30px;
    color: #333;
    font-weight: 500;
}

/* RESPONSIVE */
@media (max-width: 600px) {
    .nav-menu {
        display: none;
    }
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #444;
    background: #fff;
    cursor: pointer;
    border-radius: 5px;
}

.pagination button.active {
    background: #444;
    color: white;
}

.pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#paginado {
    font-size: 1.3rem;       /* Aumenta tamaño */
}
#paginado button {
    font-size: 1.1rem;       /* Tamaño de letra dentro de botones */
}

/* ===========================
   MATERIALES - GRID DE CARDS
   =========================== */

.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); /* cards más anchas */
    gap: 30px;
    padding: 50px 25px;
}

.material-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.14);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}

.material-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.2);
}


.material-card img {
    width: 100%;
    height: 200px;        /* más alto */
    object-fit: cover;
    background: #eee;
}

.material-card-content {
    padding: 18px;
    display: flex;
    flex-direction: column;
}

.material-card-content h3 {
    margin: 0 0 8px;
    font-size: 1.2rem;
}

.material-card-content p {
    font-size: 0.95rem;
    color: #555;
    flex-grow: 1;
}


.material-card-content button {
    align-self: flex-start;
    margin-top: 12px;
    background: #5a35ff;
    border: none;
    border-radius: 8px;
    color: white;
    padding: 8px 14px;
    cursor: pointer;
}

.material-card-content button:hover {
    background: #4328f2;
}

.material-text-card {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.material-text-card {
    animation: fadeUp .5s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.video-modal-content {
    background: #000;
    padding: 12px;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    position: relative;
}

.video-modal video {
    width: 100%;
    border-radius: 8px;
}

.video-close {
    position: absolute;
    top: -12px;
    right: -12px;
    background: white;
    border-radius: 50%;
    padding: 6px 10px;
    cursor: pointer;
    font-weight: bold;
}

.video-modal iframe {
    width: 100%;
    height: 500px;
    border-radius: 8px;
}

.con-imagen {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.material-img {
    width: 140px;
    flex-shrink: 0;
}


.material-img img {
    width: 100%;
    height: 160px;
    object-fit: cover;
	object-position: top; /* 🔥 CLAVE */
    border-radius: 10px;
    cursor: pointer;
}

.material-img img:hover {
    transform: scale(1.05);
}

.material-texto {
    flex: 1;
}

.material-info {
    flex: 1;
}

.material-titulo {
    margin: 0 0 10px 0;
}
@media (max-width: 600px) {
    .con-imagen {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .material-img img {
        width: 100%;
        max-width: 250px;
    }
}

.img-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.img-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
}

.img-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

.popup-fondo{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.6);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    z-index: 9999;
}

.popup-box{
    background: white;
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 25px;
    border-radius: 12px;
    box-sizing: border-box;
}

.popup-botones button{
    background: #6750A4;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.popup-botones button:hover{
    background: #574191;
}

.popup-botones{
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 40px;
    padding: 15px;
    cursor: pointer;
    border-radius: 50%;
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.4);
}

/* =========================
   GALERÍA FULLSCREEN
========================= */

.image-modal {

    display: none;

    position: fixed;

    z-index: 99999;

    left: 0;
    top: 0;

    width: 100%;
    height: 100%;

    background: rgba(0,0,0,0.92);

    justify-content: center;
    align-items: center;
}

.modal-content {

    max-width: 90%;
    max-height: 90%;

    object-fit: contain;

    border-radius: 12px;
}

.close-modal {

    position: absolute;

    top: 20px;
    right: 35px;

    color: white;

    font-size: 45px;

    cursor: pointer;

    z-index: 100000;
}

.nav-btn {

    position: absolute;

    top: 50%;

    transform: translateY(-50%);

    background: rgba(255,255,255,0.2);

    border: none;

    color: white;

    font-size: 40px;

    padding: 15px 20px;

    cursor: pointer;

    border-radius: 50%;

    z-index: 100000;
}

.prev-btn {
    left: 25px;
}

.next-btn {
    right: 25px;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.4);
}

.book-image {
    cursor: pointer;
}


/* =========================
   HERO MOBILE FIX
========================= */

@media (max-width: 600px) {

    .hero {

        padding: 70px 20px 120px;

        clip-path: none;

        border-bottom-left-radius: 40px;
        border-bottom-right-radius: 40px;

        min-height: 320px;

        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;

        text-align: center;
    }

    .hero h1 {

        font-size: 3.2rem;

        line-height: 1.1;

        margin-bottom: 20px;
    }

    .hero p {

        font-size: 1.15rem;

        line-height: 1.5;

        max-width: 95%;
    }

    .heroi {

        background-position: center;
        background-size: cover;
    }
}

/* =========================
   LOGO NAVBAR
========================= */

.nav-logo {

    display: flex;

    align-items: center;
}

.nav-logo img {

    height: 52px;

    width: auto;

    opacity: 0.92;

    margin-left: 6px;
}

/* MOBILE */

@media (max-width: 768px) {

    .nav-logo img {

        height: 42px;
    }
}