﻿/* ============================================
   CONTENEDOR GENERAL DEL MOSAICO V1 15/12/2025
   ============================================ */

.mosaic-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 120px;
    gap: 12px;
    padding: 20px;
    background-color: #faf7f2;
}

    .mosaic-container a:hover {
        color: var(--color-piedra) !important;
        text-decoration-color: var(--color-piedra) !important;
    }

    /* ============================================
   CONTENEDOR: ALINEACIÓN DERECHA (CASO ESPECÍFICO)
   Aplica a contenedores con la clase mosaic-content-alignment-right
   Los elementos del grid se colocarán desde la derecha hacia la izquierda
   y se restaura la dirección LTR en el contenido interno para mantener
   la dirección de texto habitual.
   ============================================ */

    .mosaic-container.mosaic-content-alignment-right {
        direction: rtl;
    }

        .mosaic-container.mosaic-content-alignment-right .tile,
        .mosaic-container.mosaic-content-alignment-right .tile * {
            direction: ltr;
        }

/* ============================================
   TILE BASE
   ============================================ */

.tile {
    background: #e9e5df;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 0;
    text-decoration: none;
    color: inherit;
    transition: transform 300ms cubic-bezier(.2,.9,.2,1), box-shadow 300ms cubic-bezier(.2,.9,.2,1);
    will-change: transform, box-shadow;
    box-sizing: border-box;
}

    .tile:hover {
        /* Hover más perceptible pero elegante: mayor elevación y sombra sutil */
        transform: translateY(-6px) scale(1.02);
        /* Sombra ligeramente más notoria, sin exagerar */
        box-shadow: 0 14px 30px rgba(15,15,15,0.09);
    }

.no-hover:hover {
    transform: none !important;
    box-shadow: none;
}

/* Tiles dentro de grupos horizontales no deben tener hover */
.tile-group-horizontal .tile:hover {
    transform: none;
    box-shadow: none;
}

/* Evitar efectos internos de hover en elementos visuales dentro de grupos */
.tile-group-horizontal .video-thumb-wrapper:hover {
    transform: none;
}

/* ============================================
   CONTENIDO INTERNO (OVERLAY / CENTRADO)
   ============================================ */

.tile-content {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

    .tile-content h2 {
        font-size: 1.6rem;
        font-weight: 400;
        margin: 0;
        text-align: center;
    }

/* ============================================
   ANCHOS PERSONALIZADOS
   ============================================ */

.tile-wide {
    grid-column: span 2;
}

.tile-xwide {
    grid-column: span 3;
}

.tile-xxwide {
    grid-column: span 4;
}

/* ============================================
   ALTURAS PERSONALIZADAS
   ============================================ */

.tile-h1 {
    grid-row: span 1;
}

.tile-h2 {
    grid-row: span 2;
}

.tile-h3 {
    grid-row: span 3;
}

/* ============================================
   TILE TEXTO (TEXTBOX)
   ============================================ */

.tile-textbox {
    background: var(--color-fondo-secundario);
    padding: 16px;
    box-sizing: border-box;
}

.textbox-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    height: 100%;
    overflow: hidden;
    gap: 8px;
}

    .textbox-content * {
        font-family: inherit;
        color: inherit;
        margin: 0;
    }

/* ============================================
   VIDEO TILE
   ============================================ */

.video-inner {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 14px;
    box-sizing: border-box;
    gap: 10px;
}

.video-thumb-wrapper {
    width: 100%;
    height: 75%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden;
    transition: transform 0.25s ease;
}

    .video-thumb-wrapper:hover {
        transform: scale(1.04);
    }

.video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-title {
    font-family: 'Jost', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0;
    text-align: left;
    width: 100%;
}

/* ============================================
   GRUPO HORIZONTAL
   ============================================ */

.tile-group-horizontal {
    grid-column: span 2;
    grid-row: span 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    overflow: hidden;
    --tile-group-bg: #f7f3ee;
    background: var(--tile-group-bg);
}

    .tile-group-horizontal .tile-textbox {
        background: var(--tile-group-bg) !important;
    }

/* ============================================
   TILE INTERNO (LOGOS / BLOQUES)
   ============================================ */

.tile-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.tile-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    text-align: center;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

/* ============================================
   IMÁGENES
   ============================================ */

.tile-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.tile-img-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}


/* ============================================
   TILE IMAGEN ZOOM (LLENA EL CONTENEDOR)
   ============================================ */
.tile-img-zoom {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .tile-img-zoom .tile-img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* La imagen llena el contenedor y se recorta si es necesario */
        transition: transform 0.4s cubic-bezier(.2,.9,.2,1);
        display: block;
    }

    .tile-img-zoom:hover .tile-img {
        transform: scale(1.08); /* Efecto de zoom al pasar el mouse */
    }





/* ============================================
   TEXTO SIMPLE DENTRO DE TILE
   ============================================ */

.tile-text {
    margin-top: 0.5em;
    font-size: 1rem;
    line-height: 1.3em;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {

    .mosaic-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .tile-wide,
    .tile-xwide,
    .tile-xxwide {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {

    .mosaic-container {
        grid-template-columns: repeat(1, 1fr);
        grid-auto-rows: 280px;
    }

    .tile-wide,
    .tile-xwide,
    .tile-xxwide,
    .tile-h2,
    .tile-h3 {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    .tile-empty {
        display: none !important;
    }
}

/* ============================================
   NUEVO: CLASE tile-img-caption
   Muestra una imagen que ocupa todo el tile y un texto fijo
   en la base (overlay). Diseñada para integrarse con la estructura
   de .tile existente sin cambiar nombres de clases.
   ============================================ */

.tile-img-caption {
    position: relative;
    padding: 0; /* quitar padding por defecto si existiera */
    display: block; /* evitar centrado interno que pueda romper el layout de imagen */
    overflow: hidden;
}

    .tile-img-caption .tile-img-wrapper {
        width: 100%;
        height: 100%;
        display: block; /* el wrapper ocupa todo el tile */
        overflow: hidden;
    }

    .tile-img-caption .tile-img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* cubrir todo el área del tile */
        display: block;
    }

    .tile-img-caption .tile-caption {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 10px 12px;
        background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0.18));
        color: #ffffff;
        font-size: 1rem;
        line-height: 1.2;
        box-sizing: border-box;
        text-align: left;
    }

    /* Si se quiere centrar el texto en la base, descomentar:
.tile-img-caption .tile-caption { text-align: center; }
*/

    /* Evitar que el hover de .tile afecte el comportamiento de escala en imagen si .no-hover está presente */
    .tile-img-caption.no-hover:hover {
        transform: none !important;
        box-shadow: none;
    }
