
/* B06: Galería de momentos */

.robofest-moments {
    --robofest-moments-ink: var(--color-text, #171717);
    --robofest-moments-paper: var(--color-background, #f7f8f6);
    --robofest-moments-blue: var(--color-primary, #2563eb);
    --robofest-moments-orange: #ff7139;
    --robofest-moments-border: 2px solid var(--robofest-moments-ink);
    --robofest-moments-gap: clamp(0.75rem, 1.8vw, 1.5rem);

    position: relative;
    isolation: isolate;
    overflow: clip;
    padding-block: clamp(4.5rem, 9vw, 9rem);
    color: var(--robofest-moments-ink);
    background: var(--robofest-moments-paper);
}

.robofest-moments *,
.robofest-moments *::before,
.robofest-moments *::after {
    box-sizing: border-box;
}

.robofest-moments__container {
    width: min(100% - 2.5rem, 1440px);
    margin-inline: auto;
}

/* Encabezado */

.robofest-moments__header {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.7fr);
    align-items: end;
    column-gap: clamp(2rem, 6vw, 6rem);
    row-gap: 1.5rem;
    margin-bottom: clamp(2.5rem, 5vw, 5rem);
}

.robofest-moments__eyebrow {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    line-height: 1.4;
    text-transform: uppercase;
}

.robofest-moments__eyebrow::before {
    width: 2rem;
    height: 3px;
    flex: 0 0 auto;
    background: var(--robofest-moments-orange);
    content: "";
}

.robofest-moments__title {
    max-width: 900px;
    margin: 0;
    font-size: clamp(2.7rem, 6.5vw, 6.5rem);
    font-weight: 900;
    letter-spacing: -0.075em;
    line-height: 0.94;
    text-wrap: balance;
}

.robofest-moments__title-highlight {
    display: block;
    color: var(--robofest-moments-blue);
}

.robofest-moments__intro {
    max-width: 390px;
    margin: 0 0 0.25rem;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.8;
    color: var(--color-text-secondary, #555);
}

/* Composición fotográfica */

.robofest-moments__grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(220px, 24vw));
    gap: var(--robofest-moments-gap);
}

.robofest-moments__item {
    position: relative;
    min-width: 0;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    border: var(--robofest-moments-border);
    background: #e8e8e5;
    isolation: isolate;
}

.robofest-moments__item--featured {
    grid-column: 1 / 8;
    grid-row: 1 / 3;
}

.robofest-moments__item--second {
    grid-column: 8 / 13;
    grid-row: 1;
}

.robofest-moments__item--third {
    grid-column: 8 / 13;
    grid-row: 2;
}

.robofest-moments__item--fourth {
    grid-column: 1 / 7;
    grid-row: 3;
    display: none;
}

.robofest-moments__item--fifth {
    grid-column: 7 / 13;
    grid-row: 3;
    display: none;
}

/*
 * La composición base usa una imagen protagonista
 * y dos imágenes secundarias en escritorio.
 * Las cinco imágenes se muestran en pantallas amplias
 * mediante las reglas responsive inferiores.
 */

.robofest-moments__image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: center;
    transition:
        transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1),
        filter 500ms ease;
}

.robofest-moments__item--featured .robofest-moments__image {
    object-position: center;
}

.robofest-moments__item:hover .robofest-moments__image {
    transform: scale(1.045);
}

/* Pie de cada fotografía */

.robofest-moments__caption {
    position: absolute;
    z-index: 1;
    inset: auto 0 0;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 4rem;
    padding: 1rem 1.1rem;
    color: #fff;
    background: linear-gradient(
        to top,
        rgb(0 0 0 / 88%),
        rgb(0 0 0 / 55%) 65%,
        transparent
    );
}

.robofest-moments__number {
    display: grid;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgb(255 255 255 / 75%);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 800;
}

.robofest-moments__label {
    font-size: clamp(0.8rem, 1.1vw, 1rem);
    font-weight: 800;
    line-height: 1.3;
}

/* Cierre */

.robofest-moments__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.1rem;
    border-top: var(--robofest-moments-border);
}

.robofest-moments__footer-index {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.robofest-moments__footer-note {
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: right;
}

/* Escritorio amplio: mostrar las cinco fotografías */

@media (min-width: 1100px) {
    .robofest-moments__grid {
        grid-template-rows: minmax(300px, 32vw) minmax(200px, 20vw);
    }

    .robofest-moments__item--featured {
        grid-column: 1 / 8;
        grid-row: 1 / 3;
    }

    .robofest-moments__item--second {
        grid-column: 8 / 13;
        grid-row: 1;
    }

    .robofest-moments__item--third {
        grid-column: 8 / 13;
        grid-row: 2;
    }

    .robofest-moments__item--fourth {
        grid-column: 1 / 7;
        grid-row: 3;
        display: block;
        aspect-ratio: 5 / 3;
    }

    .robofest-moments__item--fifth {
        grid-column: 7 / 13;
        grid-row: 3;
        display: block;
        aspect-ratio: 5 / 3;
    }
}

/* Tabletas */

@media (max-width: 1099px) {
    .robofest-moments__container {
        width: min(100% - 2rem, 900px);
    }

    .robofest-moments__header {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .robofest-moments__intro {
        max-width: 650px;
    }

    .robofest-moments__grid {
        grid-template-rows: minmax(300px, 55vw) minmax(200px, 32vw);
    }

    .robofest-moments__item--featured {
        grid-column: 1 / 13;
        grid-row: 1;
    }

    .robofest-moments__item--second {
        grid-column: 1 / 7;
        grid-row: 2;
    }

    .robofest-moments__item--third {
        grid-column: 7 / 13;
        grid-row: 2;
    }

    .robofest-moments__item--fourth,
    .robofest-moments__item--fifth {
        display: block;
        grid-row: 3;
    }

    .robofest-moments__item--fourth {
        grid-column: 1 / 7;
    }

    .robofest-moments__item--fifth {
        grid-column: 7 / 13;
    }
}

/* Móviles */

@media (max-width: 600px) {
    .robofest-moments {
        padding-block: 4rem;
    }

    .robofest-moments__container {
        width: calc(100% - 1.5rem);
    }

    .robofest-moments__title {
        font-size: clamp(2.5rem, 12vw, 4rem);
        letter-spacing: -0.065em;
    }

    .robofest-moments__grid {
        grid-template-columns: repeat(1, 1fr);
        grid-template-rows: 300px repeat(2, minmax(180px, 45vw));
        gap: 0.65rem;
    }

    .robofest-moments__item--featured {
        grid-column: 1/2;
        grid-row: 1;
    }

    .robofest-moments__item--second {
        grid-column: 1/2;
        grid-row: 2;
    }

    .robofest-moments__item--third {
        grid-column: 1/2;
        grid-row: 3;
    }

    .robofest-moments__item--fourth {
        grid-column: 1/2;
        grid-row: 4;
    }

    .robofest-moments__item--fifth {
        grid-column: 1/2;
        grid-row: 5;
    }

    .robofest-moments__caption {
        gap: 0.5rem;
        min-height: 3.25rem;
        padding: 0.75rem 0.55rem;
    }

    .robofest-moments__number {
        width: 1.65rem;
        height: 1.65rem;
        font-size: 0.65rem;
    }

    .robofest-moments__label {
        font-size: 0.75rem;
    }

    .robofest-moments__footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .robofest-moments__footer-note {
        text-align: left;
    }
}

/* Preferencia de movimiento reducido */

@media (prefers-reduced-motion: reduce) {
    .robofest-moments__image {
        transition: none;
    }

    .robofest-moments__item:hover .robofest-moments__image {
        transform: none;
    }
}
