@import url('https://fonts.googleapis.com/css2?family=Old+Standard+TT:ital,wght@0,400;0,700;1,400&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
    outline: none;
    border: none;
    text-decoration: none;
    transition: .2s linear;
}

.contenedor {
    background-color: #ebebeb;
}

.main {
    height: 100vh;
    width: 100%;
}

#sidebar {
    position: fixed;
    width: 200px;
    height: calc(100vh - 70px);
    background: #1e2e52;
    top: 70px;
    right: -210px;
    transition: right 0.3s ease;
    z-index: 999;
    font-size: 16px;
}

#sidebar.active {
    right: 0;
}

#sidebar ul {
    list-style: none;
    padding: 0;
}

#sidebar ul li {
    color: rgba(230, 230, 230, .9);
    padding: 15px 10px;
    border-bottom: 1px solid rgba(100, 100, 100, .3);
    text-align: center;
}

#sidebar .toggle-btn {
    position: absolute;
    right: 220px;
    top: 20px;
    cursor: pointer;
}


#sidebar .toggle-btn span {
    display: block;
    width: 40px;
    text-align: center;
    font-size: 30px;
    border: 1px solid #ffffff;
}

#sidebar ul li a:hover {
    text-decoration: none !important;
    color: black;
}

#sidebar ul li a {
    text-decoration: none !important;
    color: inherit;
}

:root {
    --main: #a08a70;
    --bg: #f1e1d2;
    --black: #000;
    --white: #fff;
    --box-shadow: 0 .5rem 1rem rgba(0, 0, 0, 0.1);
}


html {
    font-size: 62.5%;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scroll-padding-top: 4rem;
}

html::-webkit-scrollbar {
    width: 1rem;
}

html::-webkit-scrollbar-track {
    background: transparent;
}

html::-webkit-scrollbar-thumb {
    background: var(--main);
    border-radius: 5rem;
}

section {
    padding: 3rem 7%;
}

.heading {
    text-align: center;
    font-size: 4rem;
    color: var(--main);
    text-transform: uppercase;
    margin-bottom: 3rem;
    padding: 1.2rem 0;
}

.btn {
    font-size: 1.7rem;
    display: inline-block;
    background: var(--main);
    color: var(--white);
    box-shadow: var(--box-shadow);
    border-radius: 5rem;
    padding: 0.9rem 3rem;
    margin-top: 1rem;
    z-index: 0;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    height: 100%;
    width: 0%;
    background: #ae992e;
    z-index: -1;
    transition: .3s linear;
    left: 0;
}

.btn:hover::before {
    width: 100%;
}


/* header */

.header {
    width: 100%;
    height: 70px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header img {
    display: block;
    width: 250px;
    /* Ajusta el tamaño de la imagen según tu preferencia */
    height: auto;
    margin-top: 10px;
    /* Ajusta el margen superior según sea necesario */
}

/* end */

/* home */

.home {
    min-height: 100vh;
    display: flex;
    align-items: center;
    color: rgba(0, 0, 0, 0.5);
    background: url('../img/libro-enrique-ruelas-ug-ugto.jpg') no-repeat;
    background-size: cover;
    background-position: center;
    /* Centra la imagen en la pantalla */
}

.home .content {
    max-width: 60rem;
}

.home .content h3 {
    color: var(--white);
    font-size: 60px;
    line-height: 1.4;
    font-weight: 400;
    text-align: center;
    position: absolute;
    right: 28%;
    left: 30%;
    top: 40%;
    font-family: "Old Standard TT", serif;
    font-weight: 400;
    font-style: normal;
    background-color: rgba(100, 100, 100, 0.1)
}

.home .wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
}

/* end */

.about .content .title {
    font-size: 35px;
    color: var(--black);
}

.about .content p {
    font-size: 30px;
    color: #444;
    padding: 10px 0;
    line-height: 2;
}

/* footer */

.footer {
    background: #19284c;
    background-size: cover;
    padding: 3rem 7%;
}

.footer .box-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(25px, 1fr));
    gap: 1.5px;
}

.footer .box-container .box h3 {
    font-size: 2.5rem;
    color: var(--main);
    padding: 1rem 0;
}

.footer .box-container .box p {
    font-size: 1.5rem;
    line-height: 1.8;
    color: var(--white);
    padding: 1rem 0;
}

.footer .box-container .box .links {
    display: block;
    font-size: 1.5rem;
    color: var(--white);
    padding: 1rem 0;
}

.footer .box-container .box .links i {
    color: var(--main);
    padding-right: .5rem;
}

.footer .box-container .box .links:hover i {
    padding-right: 2rem;
}

.footer .box-container .box .days {
    margin-left: 2.2rem;
    line-height: .2;
}

.footer .box-container .box .email {
    width: 100%;
    margin: .7rem 0;
    padding: 1rem;
    border-radius: .5rem;
    background: var(--white);
    font-size: 1.6rem;
    color: var(--black);
    text-transform: none;
}

.footer .box-container .box .share a {
    height: 3rem;
    width: 3rem;
    line-height: 3rem;
    color: var(--black);
    background: var(--white);
    font-size: 1.2rem;
    border-radius: 5rem;
    margin-right: .8rem;
    text-align: center;
    margin-top: 10%;
}

.footer .box-container .box .share a:hover {
    background: var(--main);
}

.footer .credit {
    font-size: 2rem;
    text-align: center;
    margin-top: 2rem;
    padding-top: 2.5rem;
    color: var(--black);
    border-top: .2rem solid rgba(0, 0, 0, 0.2);
}

.footer .credit .link {
    color: var(--main);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    border-radius: 10px;
    position: relative;
    display: flex;
    align-items: center;

    /* Centro verticalmente */
}

.close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-content img {
    width: 40%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 10px;
    margin-left: 20px;
}

.modal-text {
    width: 85%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Centro verticalmente el texto */
    padding-right: 20px;
    /* Ajusta este valor para mover el texto a la izquierda */
    font-family: 'Poppins', sans-serif;
    /* Tipo de letra específico */
    font-size: 14px;
    /* Tamaño de letra */
    line-height: 1.5;
    /* Espaciado entre líneas */
    text-align: justify;
    /* Justificar texto */
}

.modal-text h2 {
    margin-top: 0;
    font-size: 18px;
    /* Tamaño de letra del título */
    text-align: left;
    /* Alineación del título */
}

.modal-text p {
    margin: 10px 0;
}

/* Ajustes del contenedor principal */
.contenedor .box-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* Cuatro columnas */
    gap: 20px;
    /* Ajuste del espacio entre elementos */
}

/* Ajustes del contenedor de cada tarjeta */
.contenedor .box-container .card-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    /* Asegura que cada tarjeta ocupe el 100% de su columna */
}

/* Ajustes del artículo de cada tarjeta */
.card-article {
    position: relative;
    overflow: hidden;
    width: 100%;
    /* Asegura que el contenido de la tarjeta ocupe el 100% de la tarjeta */
}

/* Ajustes de la imagen de la tarjeta */
.card-img {
    width: 100%;
    height: 450px;
    border-radius: 1.5rem;
    transition: transform 0.3s;
}

/* Ajustes del contenido de la tarjeta */
.card-data {
    background-color: var(--white);
    padding: 1.5rem 2rem;
    box-shadow: 0 8px 24px hsla(0, 0%, 0%, .15);
    border-radius: 1rem;
    position: absolute;
    bottom: -9rem;
    left: 0;
    right: 0;
    margin-inline: auto;
    opacity: 0;
    transition: opacity 1s 1s;
    text-align: justify;
    font-size: 16px;
}

.card-description {
    display: block;
    font-size: var(--small-font-size);
    margin-bottom: .25rem;
}

.card-title {
    font-size: var(--h2-font-size);
    font-weight: 500;
    color: var(--title-color);
    margin-bottom: .75rem;
}

.card-button {
    text-decoration: none;
    font-size: var(--small-font-size);
    font-weight: 500;
    color: var(--first-color);
    background-color: var(--container-color);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.card-button:hover {
    background-color: var(--first-color);
    color: white;
    text-decoration: none;
}

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

.card-article:hover .card-data {
    animation: show-data 1s forwards;
    opacity: 1;
    transition: opacity .3s;
}

.card-article:hover {
    animation: remove-overflow 2s forwards;
}

.card-article:not(:hover) {
    animation: show-overflow 2s forwards;
}

.card-article:not(:hover) .card-data {
    animation: remove-data 1s forwards;
}

@keyframes show-data {
    50% {
        transform: translateY(-10rem);
    }

    100% {
        transform: translateY(-7rem);
    }
}

@keyframes remove-overflow {
    to {
        overflow: initial;
    }
}

@keyframes remove-data {
    0% {
        transform: translateY(-7rem);
    }

    50% {
        transform: translateY(-10rem);
    }

    100% {
        transform: translateY(.5rem);
    }
}

@keyframes show-overflow {
    0% {
        overflow: initial;
        pointer-events: none;
    }

    50% {
        overflow: hidden;
    }
}

/* Ajustes del contenido del box */
.contenedor .box-container .box {
    position: relative;
    overflow: hidden;
    height: auto;
    margin: 0;
    padding: 0;
}

.contenedor .box-container .box img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.contenedor .box-container .box:hover img {
    transform: scale(1.1);
}

.contenedor .box-container .box:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--black);
    opacity: 0.5;
    transition: 0.5s ease;
}

.contenedor .box-container .box .content h3 {
    text-align: justify;
    font-size: 2rem;
    color: var(--white);
}

.contenedor .box-container .box:is(:hover, :focus-within) .content {
    transform: translateY(-20px);
}

@media (max-width: 768px) {
    .contenedor .box-container {
        grid-template-columns: 1fr;
        /* Una columna */
    }

    .contenedor .box-container .card-container {
        margin-bottom: 20px;
        /* Añadir espacio entre tarjetas */
    }

    .card-data {
        position: relative;
        /* Asegura que el contenido se adapte dentro de la tarjeta */
        bottom: 0;
        opacity: 1;
        /* Hace que el contenido esté siempre visible en dispositivos móviles */
        transition: none;
        /* Elimina la transición en dispositivos móviles */
        text-align: left;
        /* Ajusta el texto a la izquierda */
    }

    .card-article:hover .card-data {
        animation: none;
        /* Elimina la animación en dispositivos móviles */
    }

    .card-img {
        width: 100%;
        /* Mantiene el ancho de la imagen igual al ancho del contenedor */
        height: auto;
        border-radius: 1.5rem;
        transition: transform 0.3s;
    }
}

/* media queries */
@media (max-width: 768px) {
    #menu-btn {
        display: inline-block;
    }

    .home {

        background-position: center;
     
    }

    .home .content h3 {
        font-size: 5rem;
        text-align: center;
        right: 10%;
        /* Ajusta los márgenes para centrar el texto en pantallas pequeñas */
        left: 10%;
        top: 40%;
    }

    .deco-title {
        display: none;
    }

    .home .wave {
        height: 50px;
        /* Ajusta la altura de la imagen decorativa en pantallas más pequeñas */
    }
}

@media (max-width: 450px) {
    .home .content h3 {
        font-size: 4rem;
        right: 5%;
        /* Ajusta los márgenes para centrar el texto en pantallas muy pequeñas */
        left: 5%;
    }

    .home .wave {
        height: 30px;
        /* Ajusta la altura de la imagen decorativa en pantallas muy pequeñas */
    }
}