.imagenIzquierda {
position: relative;

height: 50%;
width: 50%;
}

.imagenDerecha {
position: relative;
height: 50%;
width: 50%;
}

.TextoDe  {
	position:  relative;

}
.TextoIz {
	position: relative;
}


.tituloo {
	position: relative;
	text-align-last: center;
}


:root {

    --color-texto-dinamico: #4a154b;
}
[data-bs-theme="dark"] {
   
    --color-texto-dinamico: #f8f9fa;
}

/* --- CONTENEDORES BASE --- */
.tarjeta-historia,
.tarjeta-historia-inversa {
    display: grid;
    grid-template-areas: 
        "titulo"
        "imagen"
        "texto";
    gap: 15px;
    max-width: 1000px;
    margin: 0 auto 50px auto; 
    padding: 20px;
}


@media (min-width: 768px) {
    .tarjeta-historia,
    .tarjeta-historia-inversa {
        grid-template-columns: 1fr 1fr; 
        grid-template-rows: auto 1fr;
        column-gap: 30px; 
        row-gap: 10px;
    }


    .tarjeta-historia {
        grid-template-areas: 
            "imagen titulo"
            "imagen texto";
    }


    .tarjeta-historia-inversa {
        grid-template-areas: 
            "titulo imagen"
            "texto imagen";
    }
}

/* --- ESTILOS DE IMAGEN --- */
.tarjeta-historia .imagen,
.tarjeta-historia-inversa .imagen {
    grid-area: imagen; 
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.tarjeta-historia .imagen img,
.tarjeta-historia-inversa .imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- ESTILOS DE TÍTULO */
.tarjeta-historia .titulo,
.tarjeta-historia-inversa .titulo {
    grid-area: titulo; 
    

    color: white; 
    
    background-color: #df127b; 
    
    font-weight: bold;
    
    padding: 10px 20px; 
    
    font-size: clamp(1.5rem, 3vw, 2.5rem); 
    text-transform: uppercase;
    align-self: end; 
    width: fit-content; 
    text-align: center; 
    

}

/* --- ESTILOS DE DESCRIPCIÓN --- */
.tarjeta-historia .texto,
.tarjeta-historia-inversa .texto {
    grid-area: texto; 
    color: var(--color-texto-dinamico); 
    font-family: "Segoe UI", Arial, sans-serif; 
    font-size: clamp(1rem, 1.2vw, 1.15rem); 
    line-height: 1.35; 
    text-align: justify; 
    align-self: start; 
    margin: 0;
}