/* ===== RESETEO Y FUENTE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f8f9fa;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0; /*este padin es el que define el espacio superior del header*/
    
}

/* ===== HEADER ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 10px; /*este  define la separacion de ambas orillas a los objetos*/
    background: #e9eaeb;           
    color: rgb(65, 62, 62);
    width: 100%;
    flex-wrap: wrap;
    gap: 5px;
    border-bottom: 3.5px solid #e40e9d;
}

.logo-ine, .logo-iso {
    height: 50px;
    object-fit: contain;
}

.titulo-header {
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.4;
    flex: 1;
    min-width: 400px;
}

.titulo-header strong {
    font-weight: 600;
    font-size: 1rem;
}

/* ===== TÍTULO PRINCIPAL ===== */
.main-title {
    text-align: center;
    margin: 30px 0 40px;
    font-size: 2.2rem;
    color: #0f3470;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== GRID DE TARJETAS ===== */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    padding: 0 40px;
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
}

.card {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 12px;
    border: 2.3px solid #197edd; /* Grosor | Estilo | Color */
    box-shadow: 0 6px 16px rgba(112, 108, 108, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white;
    text-decoration: none;
    aspect-ratio: 4 / 3;     /* puedes cambiar a 1/1 si quieres cuadradas */
    /* o si prefieres altura fija en px: */
    /* height: 300px; */
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 14px 28px rgba(0,0,0,0.18);
}

.card img {
    width: 85%;
    height: 85%;
    object-fit: contain;        /* ← cambia de "cover" a "contain" */
    object-position: center;    /* ← centra perfectamente la imagen */
    padding: 30px;              /* ← este es el "margen" interno que hace que se vea más pequeña y elegante */
    box-sizing: border-box;
    transition: transform 0.4s ease;
    

}


.card-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(156, 153, 153, 0.8));
    color: rgb(30, 77, 206);
    padding: 30px 15px 15px;
    font-size: 1rem;
    font-weight: 650;
    text-align: center;
}

/* ===== BOTÓN CERRAR ===== */
.cerrar-container {
    text-align: center;
    margin-top: 80px;
    margin-bottom: 20px;
}

.btn-cerrar {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    transition: transform 0.2s;
}

.btn-cerrar:hover {
    transform: scale(1.15);
}

.btn-cerrar img {
    height: 60px;
}

/* ===== RESPONSIVE FINO ===== */
@media (max-width: 900px) {
    .header {
        padding: 15px 20px;
    }
    .logo-ine, .logo-iso {
        height: 65px;
    }
    .titulo-header {
        font-size: 1rem;
    }
    .titulo-header strong {
        font-size: 1.1rem;
    }
    .grid-container {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        padding: 0 20px;
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .header {
        flex-direction: column;
        text-align: center;
    }
    .logo-ine, .logo-iso {
        height: 40px;
    }
    .main-title {
        font-size: 1.8rem;
        margin: 20px 0;
    }
    .grid-container {
        grid-template-columns: 1fr;
        padding: 0 15px;
    }

    .card{
        border: .9px solid #f41cfc; /* Grosor | Estilo | Color */
    }
    .card-text{
        padding: 10px;
    }
}

/* ==================== MODALES ==================== */


.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    backdrop-filter: blur(5px);
}/*este codigo es para la cobertura al rededor de la ventana emergente modal */

.modal {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    max-width: 90%;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    z-index: 1001;
    overflow: auto;
    opacity: 0;
    transition: all 0.3s ease;
}

.modal.active {
    display: block;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.modal-overlay.active {
    display: block;
}

.modal-content {
    position: relative;
    padding: 30px;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 1px;
    right: 20px;
    font-size: 2.5rem;
    cursor: pointer;
    color: #aaa;
    font-weight: bold;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #e40e9d;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #0f3470;
    font-size: 1.8rem;
}

.modal-img {
    max-width: 90%;
    height: auto;
    max-height: 50vh;
    object-fit: contain;
    margin: 20px auto;
    border-radius: 8px;
}

.modal-links {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 25px;
}

.modal-links a {
    display: block;
    padding: 14px 20px;
    background: #ff27edf1;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.modal-links a:hover {
    background: #259dbe;
    transform: translateY(-3px);
}

/* Responsive modal */
@media (max-width: 600px) {
    .modal-content {
        padding: 20px;
    }
    .modal-content h2 {
        font-size: 1.5rem;
    }
}