/* ==================== RESET ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden; /* sin scroll en el body */
}

body {
    font-family: 'Poppins', sans-serif;
    background: #2c1a14;
    color: #fff;
    overflow-x: hidden;
}


/* ==================== HEADER ==================== */

header {
    width: 100%;
    height: 72px;
    padding: 0 32px;
    background: rgba(44, 20, 14, .95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(230, 198, 141, .2);

    display: flex;
    justify-content: space-between;
    align-items: center;

    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.logo i {
    font-size: 32px;
    color: #e6c68d;
}

.logo h2 {
    font-size: 12px;
    letter-spacing: 3px;
    font-weight: 400;
    color: #d7c8bb;
}

.logo span {
    letter-spacing: 5px;
    font-size: 16px;
    color: #f7e7c4;
    display: block;
}

nav {
    display: flex;
    gap: 2px;
}

.nav-link {
    color: #d7c8bb;
    text-decoration: none;
    font-size: 11px;
    letter-spacing: 1px;
    padding: 8px 10px;
    border-radius: 8px;
    transition: .25s;
    cursor: pointer;
    border: 1px solid transparent;
}

.nav-link:hover {
    color: #e6c68d;
    background: rgba(230, 198, 141, .08);
}

.nav-link.activo {
    color: #1d0d07;
    background: #e6c68d;
    border-color: #e6c68d;
    font-weight: 600;
}

/* Reloj */
.reloj-fecha {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.reloj-fecha > i {
    color: #e6c68d;
    font-size: 18px;
}

.reloj-fecha div {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#reloj-digital {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 700;
    color: #f7e7c4;
    letter-spacing: 3px;
    line-height: 1.1;
}

#fecha-actual {
    font-size: 11px;
    color: #a08070;
    letter-spacing: .5px;
}


/* ==================== SISTEMA DE PÁGINAS ==================== */

.pagina {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    height: calc(100vh - 72px);
    overflow-y: auto;
}

.pagina.activa {
    display: block;
}

/* Scrollbar personalizado */
.pagina::-webkit-scrollbar {
    width: 6px;
}
.pagina::-webkit-scrollbar-track {
    background: #2c1a14;
}
.pagina::-webkit-scrollbar-thumb {
    background: #7d3a3a;
    border-radius: 3px;
}


/* ==================== PAGE CONTENT (contenedor interior) ==================== */

.page-content {
    max-width: 1300px;
    margin: 0 auto;
    padding: 50px 60px 60px;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 45px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(230, 198, 141, .2);
}

.page-header > i {
    font-size: 42px;
    color: #e6c68d;
    flex-shrink: 0;
}

.page-header h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 40px;
    color: #f7e7c4;
    line-height: 1.1;
}

.page-header p {
    color: #a08070;
    font-size: 14px;
    margin-top: 4px;
}


/* ==================== INICIO / HERO ==================== */

#page-inicio {
    background:
        linear-gradient(rgba(20, 10, 6, .60), rgba(20, 10, 6, .80)),
        url("img/fondo-biblioteca-general.jpg");
    background-size: cover;
    background-position: center;
}

.hero {
    height: 100%;
    display: flex;
    align-items: center;
}

.contenido-hero {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.texto-hero {
    max-width: 560px;
}

.texto-hero h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 86px;
    line-height: 1;
    margin-bottom: 28px;
    color: #f6e8d2;
}

.texto-hero > p {
    font-size: 22px;
    line-height: 2;
    color: #f3e3d2;
}

.hero-btns {
    display: flex;
    gap: 16px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.btn-nav {
    background: transparent;
    border: 2px solid #9f4b33;
    color: white;
    padding: 15px 32px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 17px;
    font-family: 'Poppins', sans-serif;
    transition: .3s;
}

.btn-nav:hover {
    background: #8f3f28;
}

.btn-nav i {
    margin-left: 8px;
}

.btn-secundario {
    border-color: rgba(230, 198, 141, .5);
    color: #e6c68d;
}

.btn-secundario:hover {
    background: rgba(230, 198, 141, .1);
    border-color: #e6c68d;
}

.imagen-libros img {
    width: 580px;
    max-width: 100%;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,.5));
}


/* ==================== HISTORIA ==================== */

#page-historia {
    background: #2c1a14;
}

.historia-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.historia-card {
    background: linear-gradient(160deg, rgba(110, 35, 35, .65), rgba(65, 20, 15, .85));
    border: 1px solid rgba(255, 190, 120, .2);
    border-radius: 20px;
    padding: 32px;
}

.historia-card.destacada {
    border-color: rgba(230, 198, 141, .45);
    background: linear-gradient(160deg, rgba(125, 48, 20, .75), rgba(80, 25, 12, .9));
}

.historia-card-icon {
    width: 56px;
    height: 56px;
    background: rgba(230, 198, 141, .1);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.historia-card-icon i {
    font-size: 26px;
    color: #e6c68d;
}

.historia-card h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    color: #f0c47d;
    margin-bottom: 16px;
}

.historia-card p {
    color: #f0e3d8;
    line-height: 1.85;
    font-size: 14px;
    margin-bottom: 12px;
}

.historia-card strong {
    color: #f7d89a;
}

.himno-institucional {
    margin-top: 28px;
    padding: 24px;
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.2fr);
    gap: 28px;
    align-items: center;
    background: linear-gradient(160deg, rgba(125, 48, 20, .75), rgba(80, 25, 12, .9));
    border: 1px solid rgba(230, 198, 141, .35);
    border-radius: 20px;
}

.himno-info .historia-card-icon {
    margin-bottom: 14px;
}

.himno-info h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    color: #f0c47d;
    margin-bottom: 8px;
}

.himno-info p {
    color: #f0e3d8;
    font-size: 14px;
    line-height: 1.7;
}

.himno-video {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: #1d0d07;
}

.himno-portada {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.himno-portada img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform .3s;
}

.himno-portada:hover img {
    transform: scale(1.03);
}

.himno-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #e6c68d;
    color: #1d0d07;
    font-size: 20px;
    padding-left: 3px;
}

.himno-youtube {
    display: block;
    padding: 10px 14px;
    color: #e6c68d;
    font-size: 12px;
    text-align: right;
    text-decoration: none;
}

.himno-youtube:hover {
    color: #fff;
}

.himno-youtube i {
    margin-left: 5px;
}

.himno-video iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 240px;
    border: 0;
}

.himno-video.reproduciendo {
    background: #000;
}


/* ==================== BIBLIOTECA ==================== */

#page-biblioteca {
    background: #2c1a14;
}

.biblioteca-intro {
    display: grid;
    grid-template-columns: 1.4fr .6fr;
    gap: 32px;
    align-items: stretch;
    margin-bottom: 36px;
}

.biblioteca-intro > div:first-child {
    padding: 8px 0;
}

.biblioteca-etiqueta {
    color: #e6c68d;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.biblioteca-intro h3 {
    max-width: 620px;
    margin: 10px 0 16px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 38px;
    line-height: 1.1;
    color: #f7e7c4;
}

.biblioteca-intro p {
    max-width: 700px;
    margin-bottom: 12px;
    color: #d7c8bb;
    font-size: 15px;
    line-height: 1.8;
}

.biblioteca-dato {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 28px;
    background: linear-gradient(160deg, rgba(125, 48, 20, .75), rgba(80, 25, 12, .9));
    border: 1px solid rgba(230, 198, 141, .3);
    border-radius: 18px;
}

.biblioteca-dato i {
    margin-bottom: 16px;
    color: #e6c68d;
    font-size: 24px;
}

.biblioteca-dato p {
    margin: 0;
    color: #f0c47d;
    font-family: 'Cormorant Garamond', serif;
    font-size: 27px;
    line-height: 1.25;
}

.biblioteca-galeria {
    display: grid;
    grid-template-columns: 1.35fr .825fr .825fr;
    gap: 18px;
}

.biblioteca-foto {
    position: relative;
    min-height: 300px;
    overflow: hidden;
    margin: 0;
    border: 1px solid rgba(255, 190, 120, .2);
    border-radius: 16px;
    background: #1d0d07;
}

.biblioteca-foto img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 300px;
    object-fit: cover;
    transition: transform .35s;
}

.biblioteca-foto:hover img {
    transform: scale(1.04);
}

.biblioteca-foto figcaption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 38px 16px 14px;
    background: linear-gradient(transparent, rgba(20, 10, 6, .9));
    color: #f7e7c4;
    font-size: 13px;
}


/* ==================== CATÁLOGO ==================== */

#page-catalogo {
    background: #2c1a14;
}

.buscador-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255, 190, 120, .25);
    border-radius: 14px;
    padding: 13px 22px;
    margin-bottom: 22px;
    max-width: 480px;
}

.buscador-wrap i {
    color: #e6c68d;
    font-size: 17px;
    flex-shrink: 0;
}

.buscador-wrap input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    width: 100%;
}

.buscador-wrap input::placeholder {
    color: #7a6058;
}

.categorias {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.categoria {
    border: 1px solid #7a3030;
    background: rgba(100, 35, 35, .3);
    color: #d7c8bb;
    padding: 8px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    transition: .25s;
}

.categoria:hover {
    border-color: #e6c68d;
    color: #e6c68d;
}

.categoria.activa {
    background: #e6c68d;
    border-color: #e6c68d;
    color: #1d0d07;
    font-weight: 600;
}

/* Grid libros */
.libros {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 20px;
    align-items: start;
}

.libro {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    padding: 14px;
    transition: transform .25s, border-color .25s;
    display: flex;
    flex-direction: column;
    cursor: default;
}

.libro:hover {
    transform: translateY(-7px);
    border-color: rgba(230, 198, 141, .3);
}

.libro img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(20, 12, 18, .72);
    display: block;
    flex-shrink: 0;
}

.portada-recortada {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    background-repeat: no-repeat;
    background-size: 300% 200%;
    background-position: center;
    background-color: rgba(80, 20, 20, .6);
    flex-shrink: 0;
}

.portada-pendiente {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    background: rgba(255,255,255,.06);
    border: 1px dashed rgba(230, 198, 141, .35);
    color: #a08070;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    padding: 12px;
    flex-shrink: 0;
}

.libro h3 {
    margin-top: 12px;
    font-size: 15px;
    line-height: 1.3;
    color: #f7e7c4;
}

.libro > span {
    color: #a08070;
    font-size: 12px;
    display: block;
    margin-top: 4px;
}

.disponible {
    color: #54d66c;
    margin-top: 8px;
    font-size: 12px;
}

.no-disponible {
    color: #e06060;
    margin-top: 8px;
    font-size: 12px;
}

.badge-categoria {
    display: inline-block;
    margin-top: 8px;
    background: rgba(230, 198, 141, .1);
    color: #c9a56a;
    border: 1px solid rgba(230, 198, 141, .2);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 11px;
}

.sin-resultados {
    color: #7a6058;
    font-size: 15px;
    padding: 40px 0;
    text-align: center;
    width: 100%;
    grid-column: 1 / -1;
}

.btn-solicitar-libro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(230, 198, 141, .45);
    border-radius: 10px;
    background: rgba(230, 198, 141, .1);
    color: #f7e7c4;
    cursor: pointer;
    font: 500 11px 'Poppins', sans-serif;
    transition: .25s;
}

.btn-solicitar-libro:hover {
    background: #e6c68d;
    color: #1d0d07;
    transform: translateY(-2px);
}

.btn-solicitar-libro i {
    font-size: 10px;
}

/* ==================== MODAL DE PRÉSTAMO ==================== */

.modal-abierto {
    overflow: hidden;
}

.modal-prestamo[hidden] {
    display: none;
}

.modal-prestamo {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: grid;
    place-items: center;
    padding: 24px;
}

.modal-prestamo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 7, 4, .78);
    backdrop-filter: blur(6px);
    animation: aparecer-prestamo .2s ease-out;
}

.modal-prestamo-card {
    position: relative;
    z-index: 1;
    width: min(100%, 500px);
    max-height: calc(100vh - 48px);
    overflow: hidden;
    padding: 34px;
    border: 1px solid rgba(230, 198, 141, .4);
    border-radius: 24px;
    background: linear-gradient(150deg, #4b2119, #24120e);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
    animation: subir-prestamo .25s ease-out;
}

.modal-prestamo-cerrar {
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 2;
    display: grid;
    place-items: center;
    margin: 0;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    color: #d7c8bb;
    cursor: pointer;
    transition: .2s;
}

.modal-prestamo-cerrar:hover {
    background: #e6c68d;
    color: #1d0d07;
}

.modal-prestamo-cerrar i {
    display: block;
    font-size: 16px;
    line-height: 1;
}

.modal-prestamo-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    border-radius: 16px;
    background: rgba(230, 198, 141, .14);
    color: #e6c68d;
    font-size: 23px;
}

.modal-prestamo-etiqueta {
    color: #e6c68d;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.modal-prestamo-card h2 {
    margin-top: 5px;
    color: #f7e7c4;
    font: 700 34px/1.1 'Cormorant Garamond', serif;
}

.modal-prestamo-libro {
    margin: 14px 0 24px;
    padding: 12px 14px;
    border-left: 3px solid #e6c68d;
    background: rgba(255,255,255,.06);
    color: #f0e3d8;
    font-size: 13px;
}

#form-prestamo {
    display: grid;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    padding-right: 3px;
    gap: 8px;
}

#form-prestamo label {
    margin-top: 6px;
    color: #f0e3d8;
    font-size: 12px;
}

#form-prestamo label span {
    color: #a08070;
}

#form-prestamo input,
#form-prestamo textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(230, 198, 141, .25);
    border-radius: 10px;
    outline: none;
    background: rgba(0,0,0,.18);
    color: #fff;
    font: 13px 'Poppins', sans-serif;
    resize: vertical;
}

#form-prestamo input:focus,
#form-prestamo textarea:focus {
    border-color: #e6c68d;
    box-shadow: 0 0 0 3px rgba(230, 198, 141, .1);
}

#form-prestamo input::placeholder,
#form-prestamo textarea::placeholder {
    color: #8f7165;
}

.btn-solicitar-prestamo {
    margin-top: 14px;
    padding: 13px 18px;
    border: 0;
    border-radius: 11px;
    background: #e6c68d;
    color: #1d0d07;
    cursor: pointer;
    font: 600 13px 'Poppins', sans-serif;
    transition: .25s;
}

.btn-solicitar-prestamo:hover {
    background: #f7e7c4;
    transform: translateY(-2px);
}

@keyframes aparecer-prestamo {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes subir-prestamo {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}


/* ==================== ACCESO Y ADMINISTRACIÓN ==================== */

#page-acceso {
    background: #2c1a14;
}

#page-admin {
    background: #2c1a14;
}

.acceso-wrap {
    max-width: 720px;
    margin: 0 auto;
}

.login-card,
.admin-panel {
    background: linear-gradient(160deg, rgba(110, 35, 35, .65), rgba(65, 20, 15, .85));
    border: 1px solid rgba(255, 190, 120, .2);
    border-radius: 20px;
    padding: 34px;
}

.login-card {
    max-width: 430px;
    margin: 0 auto;
}

.login-card[hidden],
.admin-panel[hidden] {
    display: none;
}

.login-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 14px;
    background: rgba(230, 198, 141, .1);
    color: #e6c68d;
    font-size: 24px;
}

.login-card h3,
.admin-panel h3 {
    margin-bottom: 8px;
    color: #f0c47d;
    font-family: 'Cormorant Garamond', serif;
    font-size: 30px;
}

.login-card > p,
.admin-panel-header p {
    margin-bottom: 24px;
    color: #d7c8bb;
    font-size: 13px;
    line-height: 1.6;
}

.login-card label,
.form-libro label {
    display: block;
    margin: 14px 0 6px;
    color: #c9a56a;
    font-size: 12px;
}

.login-card input,
.form-libro input,
.form-libro select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 190, 120, .25);
    border-radius: 9px;
    outline: none;
    background: rgba(255, 255, 255, .05);
    color: #fff;
    font: inherit;
}

.form-libro select option {
    background: #2c1a14;
    color: #fff;
}

.login-card input:focus,
.form-libro input:focus,
.form-libro select:focus {
    border-color: #e6c68d;
}

.btn-admin,
.btn-salir {
    border: 1px solid #e6c68d;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    transition: .25s;
}

.btn-admin {
    width: 100%;
    margin-top: 22px;
    padding: 12px 18px;
    background: #e6c68d;
    color: #1d0d07;
    font-weight: 600;
}

.btn-admin:hover {
    background: #f7e7c4;
}

.login-mensaje,
.form-mensaje {
    min-height: 20px;
    margin-top: 12px;
    color: #e06060;
    font-size: 12px;
}

.form-mensaje {
    color: #54d66c;
}

.btn-cancelar {
    width: 100%;
    margin-top: 10px;
    padding: 10px 18px;
    border: 1px solid rgba(255, 190, 120, .3);
    border-radius: 9px;
    background: transparent;
    color: #d7c8bb;
    cursor: pointer;
    font: inherit;
}

.btn-cancelar:hover {
    border-color: #e6c68d;
    color: #e6c68d;
}

.admin-lista-wrap {
    margin-top: 34px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.admin-lista-wrap h4 {
    margin-bottom: 14px;
    color: #f0c47d;
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
}

.admin-lista-libros {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
}

.admin-libro-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 190, 120, .14);
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
}

.admin-libro-item strong,
.admin-libro-item span {
    display: block;
}

.admin-libro-item strong {
    color: #f7e7c4;
    font-size: 13px;
}

.admin-libro-item span {
    margin-top: 3px;
    color: #a08070;
    font-size: 11px;
}

.admin-libro-acciones {
    display: flex;
    gap: 7px;
    flex-shrink: 0;
}

.admin-libro-acciones button {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(230, 198, 141, .3);
    border-radius: 7px;
    background: transparent;
    color: #e6c68d;
    cursor: pointer;
}

.admin-libro-acciones button:hover {
    background: rgba(230, 198, 141, .12);
}

.admin-libro-acciones .btn-eliminar-libro {
    border-color: rgba(224, 96, 96, .35);
    color: #e06060;
}

.admin-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.admin-panel-header h3 {
    margin-top: 8px;
}

.btn-salir {
    padding: 9px 12px;
    background: transparent;
    color: #e6c68d;
    font-size: 12px;
    white-space: nowrap;
}

.btn-salir:hover {
    background: rgba(230, 198, 141, .1);
}

.check-disponible {
    display: flex !important;
    align-items: center;
    gap: 8px;
    color: #d7c8bb !important;
}

.check-disponible input {
    width: auto;
    accent-color: #e6c68d;
}


/* ==================== CALENDARIO ==================== */

#page-calendario {
    background: #2c1a14;
}

.calendario-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}

.calendario-box {
    background: linear-gradient(160deg, rgba(110, 35, 35, .65), rgba(65, 20, 15, .85));
    border: 1px solid rgba(255, 190, 120, .2);
    border-radius: 20px;
    padding: 35px;
}

#mes-anio {
    text-align: center;
    margin-bottom: 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    color: #f0c47d;
    letter-spacing: 2px;
    flex: 1;
}

/* Navegación del calendario */
.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    gap: 10px;
}

.cal-nav button {
    background: rgba(230, 198, 141, .1);
    border: 1px solid rgba(230, 198, 141, .25);
    color: #e6c68d;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: .2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-nav button:hover {
    background: rgba(230, 198, 141, .25);
    border-color: #e6c68d;
}

table {
    width: 100%;
    text-align: center;
    border-collapse: collapse;
}

th {
    color: #c9a56a;
    padding: 10px 6px;
    font-size: 12px;
    letter-spacing: 1px;
    font-weight: 500;
}

.hoy {
    background: #e6c68d;
    color: #1d0d07;
    border-radius: 50%;
    font-weight: 700;
    position: relative;
}

.dia-pasado {
    color: #6a4238;
}

.celda-vacia {
    color: transparent;
    pointer-events: none;
}

/* Celda con número + punto */
td {
    padding: 6px 4px;
    font-size: 14px;
    color: #f0e3d8;
    vertical-align: top;
    text-align: center;
    line-height: 1.2;
}

.cal-num {
    display: block;
}

/* Puntos de color bajo el número */
.dot {
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin: 3px auto 0;
}

.dot-verde    { background: #54d66c; box-shadow: 0 0 6px #54d66c88; }
.dot-amarillo { background: #f5c842; box-shadow: 0 0 6px #f5c84288; }
.dot-rojo     { background: #e05c5c; box-shadow: 0 0 6px #e05c5c88; }

/* Tarjetas de fecha con borde de color */
.fecha-card-verde    { border-left: 3px solid #54d66c !important; }
.fecha-card-amarillo { border-left: 3px solid #f5c842 !important; }
.fecha-card-rojo     { border-left: 3px solid #e05c5c !important; }

/* Leyenda */
.leyenda-calendario {
    background: rgba(0,0,0,.25);
    border: 1px solid rgba(255,190,120,.12);
    border-radius: 16px;
    padding: 20px;
}

.leyenda-titulo {
    font-size: 12px;
    color: #a08070;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.leyenda-titulo i {
    margin-right: 6px;
    color: #e6c68d;
}

.leyenda-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.leyenda-item:last-child {
    margin-bottom: 0;
}

.leyenda-item .dot {
    flex-shrink: 0;
    margin-top: 5px;
    width: 10px;
    height: 10px;
}

.leyenda-item strong {
    display: block;
    font-size: 13px;
    color: #f0c47d;
    margin-bottom: 2px;
}

.leyenda-item p {
    font-size: 12px;
    color: #a08070;
    line-height: 1.5;
}

/* Panel lateral calendario */
.calendario-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.fecha-card {
    background: linear-gradient(160deg, rgba(110, 35, 35, .65), rgba(65, 20, 15, .85));
    border: 1px solid rgba(255, 190, 120, .2);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    gap: 16px;
    align-items: center;
}

.fecha-card > i {
    font-size: 28px;
    color: #e6c68d;
    flex-shrink: 0;
}

.fecha-card span {
    font-size: 12px;
    color: #a08070;
    display: block;
    margin-bottom: 4px;
}

.fecha-card h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    color: #f0c47d;
}

.calendario-nota {
    background: rgba(230, 198, 141, .06);
    border: 1px solid rgba(230, 198, 141, .15);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.calendario-nota > i {
    color: #e6c68d;
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.calendario-nota p {
    font-size: 13px;
    color: #c9b8ad;
    line-height: 1.7;
}

.calendario-nota strong {
    color: #e6c68d;
}


/* ==================== CONTACTO ==================== */

#page-contacto {
    background: #2c1a14;
}

.contacto-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 50px;
}

.contacto-card {
    background: linear-gradient(160deg, rgba(110, 35, 35, .65), rgba(65, 20, 15, .85));
    border: 1px solid rgba(255, 190, 120, .2);
    border-radius: 20px;
    padding: 32px 26px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.contacto-icon {
    width: 52px;
    height: 52px;
    background: rgba(230, 198, 141, .1);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.contacto-icon i {
    font-size: 24px;
    color: #e6c68d;
}

.contacto-card h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    color: #f0c47d;
    margin-bottom: 4px;
}

.contacto-card p {
    font-size: 14px;
    color: #d7c8bb;
    line-height: 1.6;
}

.contacto-card a {
    font-size: 13px;
    color: #d7c8bb;
    text-decoration: none;
    word-break: break-all;
    transition: .3s;
}

.contacto-card a:hover {
    color: #e6c68d;
}

.contacto-card .horario {
    font-size: 12px;
    color: #7a6058;
}

.badge-dev {
    display: inline-block;
    margin-top: 6px;
    background: rgba(230, 198, 141, .1);
    color: #c9a56a;
    border: 1px solid rgba(230, 198, 141, .2);
    border-radius: 8px;
    padding: 4px 14px;
    font-size: 12px;
}

.redes-contacto {
    text-align: center;
    padding: 40px 0 20px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.redes-contacto > p {
    font-size: 13px;
    color: #7a6058;
    margin-bottom: 16px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.redes-icons {
    display: flex;
    justify-content: center;
    gap: 22px;
    margin-bottom: 28px;
}

.redes-icons i {
    font-size: 30px;
    color: #c9a56a;
    cursor: pointer;
    transition: .3s;
}

.redes-icons i:hover {
    color: #fff;
    transform: scale(1.1);
}

.frase-footer {
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    color: #8c5e42;
    font-style: italic;
}


/* ==================== RESPONSIVE ==================== */

@media (max-width: 1200px) {

    .historia-grid {
        grid-template-columns: 1fr 1fr;
    }

    .contacto-grid {
        grid-template-columns: 1fr 1fr;
    }

    .calendario-layout {
        grid-template-columns: 1fr;
    }

    .texto-hero h1 {
        font-size: 66px;
    }

    .imagen-libros img {
        width: 420px;
    }
}

@media (max-width: 900px) {

    header {
        padding: 0 14px;
        gap: 12px;
    }

    .reloj-fecha {
        display: none;
    }

    .logo h2 {
        display: none;
    }

    .logo span {
        font-size: 13px;
    }

    nav {
        flex: 1;
        min-width: 0;
        gap: 4px;
        justify-content: flex-end;
        overflow-x: auto;
        scrollbar-width: none;
    }

    nav::-webkit-scrollbar {
        display: none;
    }

    .nav-link {
        font-size: 11px;
        padding: 7px 8px;
        flex-shrink: 0;
    }

    .page-content {
        padding: 36px 28px 50px;
    }

    .contenido-hero {
        flex-direction: column;
        text-align: center;
        padding: 0 28px;
        justify-content: center;
    }

    .texto-hero h1 {
        font-size: 52px;
    }

    .hero-btns {
        justify-content: center;
    }

    .imagen-libros img {
        width: 300px;
    }

    .historia-grid {
        grid-template-columns: 1fr;
    }

    .himno-institucional {
        grid-template-columns: 1fr;
    }

    .biblioteca-intro,
    .biblioteca-galeria {
        grid-template-columns: 1fr;
    }

    .biblioteca-foto,
    .biblioteca-foto img {
        min-height: 360px;
    }

    .contacto-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {

    .logo {
        gap: 8px;
    }

    .logo i {
        font-size: 25px;
    }

    .logo span {
        font-size: 11px;
        letter-spacing: 3px;
    }

    nav {
        justify-content: flex-start;
        overflow-x: auto;
    }

    #reloj-digital {
        font-size: 17px;
    }

    #fecha-actual {
        display: none;
    }

    .contacto-grid {
        grid-template-columns: 1fr;
    }

    .modal-prestamo {
        padding: 14px;
    }

    .modal-prestamo-card {
        padding: 28px 22px 22px;
    }

    .modal-prestamo-card h2 {
        font-size: 30px;
    }
}
