@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Poppins-Regular.ttf');
}

@font-face {
    font-family: 'Poppins Bold';
    src: url('../fonts/Poppins-Bold.ttf');
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;700&display=swap');
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

:root {
    --col-yellow: #FCD116;
    --col-blue: #003893;
    --col-red: #CE1126;
}


/* --- Sección Hero --- */

.hero {
    position: relative;
    color: white;
    padding: 120px 20px;
    text-align: center;
    background-image: url('../img/topics.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 56, 147, 0.7); /* Azul con opacidad */
    z-index: 1;
}

.hero-text {
    position: relative;
    z-index: 2;
}

.overlaytemas {
    display: none;
}

.hero-texttemas {
    position: relative;
    z-index: 1;
    animation: fadeIn 1.5s ease-in-out;
}

.hero-texttemas h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--col-blue);
    position: relative;
    display: inline-block;
    margin-bottom: 0;
}

.hero-texttemas h1::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 5px;
    background-color: var(--col-yellow);
    border-radius: 3px;
}

.hero-texttemas p {
    font-size: 18px;
    font-weight: 300;
}


/* --- Animaciones --- */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- Responsividad --- */

@media screen and (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        background: rgba(0, 0, 0, 0.9);
        position: absolute;
        top: 60px;
        right: 0;
        width: 200px;
        text-align: right;
        padding: 15px;
    }
    .nav-links.active {
        display: flex;
    }
    .nav-links li {
        margin: 10px 0;
    }
    .hamburger {
        display: block;
    }
    .hero-text h1 {
        font-size: 36px;
    }
    .hero-text p {
        font-size: 16px;
    }
}

.btn {
    background-color: white;
    border: 1px solid gray-light;
    border-radius: 1rem;
    color: gray-dark;
    padding: 0.5rem;
    text-transform: lowercase;
}

.btn--block {
    display: block;
    width: 100%;
}


/* 🔹 Mantén la cuadrícula como estaba */


/* 🔹 Mantiene la cuadrícula de 4 columnas */


/* 🔹 Ajustar el contenedor principal */

.parent {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* Centrar elementos */
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}


/* 🔹 Establecer tamaño fijo para TODAS las tarjetas */

.topic {
    background: white;
    border-radius: 5px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
    text-align: center;
    padding: 5px;
    transition: transform 0.3s ease-in-out;
    width: calc(25% - 20px);
    /* 4 columnas en desktop */
    max-width: 260px;
    height: 260px;
    /* Fijar altura */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-bottom: 80PX;
}


/* 🔹 Asegurar que las imágenes sean iguales */

.topic img {
    width: 100%;
    height: 180px;
    /* Altura fija */
    object-fit: cover;
    border-radius: 5px;
}


/* 🔹 Asegurar que los títulos ocupen el mismo espacio */

.topic h3 {
    font-size: 16px;
    margin-top: 10px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}


/* 🔹 Ajustar las filas de 3 elementos */

#myImg {
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
    z-index: 1;
    height: 200px;
    width: 600px;
}

#myImg:hover {
    opacity: 0.7;
}


/* The Modal (background) */

.modal-window {
    position: fixed;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.9);
    /* Black w/ opacity */
    top: 0;
    left: 0;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
    width: 100%;
    /* Full width */
    height: 100%;
    /* Full height */
    justify-content: center;
    align-items: center;
    z-index: 1;
    /* Sit on top */
    padding-top: 170px;
    /* Location of the box */
}

.modal-window:target {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    text-align: center;
}

.modal-window>.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
}


/* Caption of Modal Image - Same Width as the Image */

#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ffffff;
    padding: 10px 0;
    height: 150px;
    align-content: center;
}


/* The Close Button */

.close {
    position: absolute;
    top: 45px;
    right: 35px;
    color: #f1f1f1;
    font-size: 55px;
    font-weight: bold;
    transition: 0.3s;
    text-decoration: none;
}

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


/* Add Animation - Zoom in the Modal */

.modal-content,
#caption {
    animation-name: zoom; /* Animación de zoom */
    animation-duration: 0.6s;
}

@keyframes zoom {
    from {
        transform: scale(0)
    }
    to {
        transform: scale(1)
    }
}


/* ----- Ajustes Generales ----- */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}


/* HERO SECTION: Ajuste del texto para pantallas pequeñas */

@media screen and (max-width: 768px) {
    .hero-texttemas h1 {
        font-size: 36px;
    }
    .hero-texttemas p {
        font-size: 16px;
    }
}


/* HACER QUE LAS TARJETAS SE ADAPTEN A DIFERENTES PANTALLAS */

@media screen and (max-width: 1024px) {
    .topic {
        width: calc(33.33% - 20px);
        /* 3 columnas en tablets */
    }
}

@media screen and (max-width: 768px) {.topic {
        width: calc(50% - 20px);
        /* 2 columnas en pantallas medianas */
    }
}

@media screen and (max-width: 480px) {
    .topic {
        width: 100%;
        /* 1 columna en pantallas pequeñas */
        max-width: 100%;
    }
}


/* HACER QUE LAS IMÁGENES DENTRO DE LAS TARJETAS SEAN RESPONSIVAS */

.topic img {
    width: 100%;
    height: auto;
    /* Permitir que la altura se ajuste automáticamente */
    object-fit: cover;
}


/* HACER QUE LOS BOTONES SEAN MÁS FÁCILES DE USAR EN MÓVILES */

@media screen and (max-width: 480px) {
    .btn {
        width: 100%;
        font-size: 14px;
    }
}


/* HACER QUE EL MODAL NO SE DESBORDE EN MÓVILES */

@media screen and (max-width: 768px) {
    .modal-window>.modal-content {
        width: 90%;
        max-width: 500px;
    }
}
h2 {
    font-size: 24px;
    margin-bottom: 20px;
}
