/* ======================== 
   ESTRUCTURA MASONRY / GRID 
   ======================== */
.te-gallery-grid {
    display: grid;
    /* grid-template-columns y gap son inyectados dinámicamente por Elementor */
}

.te-gallery-masonry {
    display: block !important;
    box-sizing: border-box;
}

.te-gallery-masonry .te-gallery-item {
    float: left;
    display: block !important;
    box-sizing: border-box;
    /* width, padding-left y padding-bottom inyectados dinámicamente */
}

.te-gallery-masonry::after {
    content: "";
    display: table;
    clear: both;
}

/* ======================== 
   COMUNES 
   ======================== */
.te-gallery-item {
    position: relative;
    overflow: hidden;
}

.te-gallery-lightbox-link {
    display: block !important;
    position: relative;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.te-gallery-item .te-gallery-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* ======================== 
   CAPA DE TEXTO / overlays 
   ======================== */
.te-gallery-text {
    position: absolute;
    z-index: 10;
    pointer-events: none; /* Que no bloquee clicks a posibles lightbox de la imagen */
    box-sizing: border-box;
    transition: all 0.3s ease-in-out;
}

/* Posiciones dinámicas gracias a la directiva prefix_class de Elementor */
.te-text-pos-top-left .te-gallery-text {
    top: 0;
    left: 0;
}

.te-text-pos-center .te-gallery-text {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Centrado absoluto perfecto */
    text-align: center;
}

.te-text-pos-bottom-left .te-gallery-text {
    bottom: 0;
    left: 0;
}

.te-text-pos-bottom-right .te-gallery-text {
    bottom: 0;
    right: 0;
}
