/* --- RESET Y TIPOGRAFÍA --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    padding-bottom: 80px;
    line-height: 1.5;
}

/* --- HEADER --- */
.contenedor1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5%;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 3.5px solid #e40e9d;
}

.ine, .iso {
    height: 60px;
    width: auto;
}

.direccion {
    text-align: center;
    font-size: 0.85em;
    font-weight: 600;
    color: #555;
}

/* --- TÍTULOS --- */
.sustantivos {
    text-align: center;
    margin: 40px auto 20px;
    color: #004d99;
    font-size: 1.8em;
    font-weight: 700;
    border-bottom: 2px solid #b8b0b0;
    padding-bottom: 10px;
    width: 90%;
    max-width: 1000px;
}

/* --- TARJETAS --- */
.tarjetas-enlaces {
    margin: 30px 0;
    padding: 0 5%;
}

.grid-tarjetas {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 10px 0;
}

.tarjeta {
    position: relative;
    width: 190px;
    height: 110px;
    background-color: #b3cfdf;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: all 0.4s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* Texto siempre visible por defecto */
.texto {
    position: relative;
    z-index: 2;
    color: #004d99;
    font-weight: 600;
    font-size: .85em;
    text-align: center;
    padding: 12px;
    transition: all 0.4s ease;
}

/* Imagen de fondo: por defecto OCULTA y más pequeña */
.tarjeta::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;                    /* Imagen más pequeña */
    height: 70%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 1;
}

/* Asignamos la imagen correcta según la clase */
.tarjeta.ficha::after     { background-image: url('../button/procesos_sustantivos/fichas.png'); }
.tarjeta.manual::after    { background-image: url('../button/procesos_sustantivos/manuales.png'); }
.tarjeta.documento::after { background-image: url('../button/procesos_sustantivos/documentos.png'); }

/* HOVER: imagen aparece pequeña y centrada, texto desaparece */
.tarjeta:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.25);
    background-color: #9cbccc;   /* Mantiene el color claro */
}

.tarjeta:hover .texto {
    opacity: 0;
    transform: scale(0.8);
}

.tarjeta:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* --- BOTÓN SALIR --- */
.salir {
    text-align: center;
    margin: 50px 0 30px;
}

.btn-salir {
    background: none;
    border: none;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.btn-salir:hover {
    transform: scale(1.4);
}

.cerrar {
    width: 34px;
    height: 34px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .contenedor1 { flex-direction: column; gap: 12px; padding: 12px 5%; }
    .ine, .iso { height: 50px; }
    .direccion { font-size: 0.8em; }
    .sustantivos { font-size: 1.5em; }

    .tarjeta {
        width: 100%;
        max-width: 350px;
        height: 90px;
    }
    
    .tarjeta::after {
        width: 60%;
        height: 60%;
    }
}

@media (max-width: 480px) {
    .sustantivos { font-size: 1.4em; width: 95%; }
    .tarjeta { height: 80px; }
}