
/* B04: Galería de RoboGenius Fest */

.robofest-gallery {
    --robofest-gallery-ink: var(--color-text, #171717);
    --robofest-gallery-paper: var(--color-background, #f7f8f6);
    --robofest-gallery-blue: var(--color-primary, #2563eb);
    --robofest-gallery-orange: #ff7139;
    --robofest-gallery-green: #c7f36b;
    --robofest-gallery-border: 3px solid var(--robofest-gallery-ink);
    --robofest-gallery-shadow: 6px 6px 0 var(--robofest-gallery-ink);

    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: clamp(4rem, 8vw, 7rem);
    background: var(--robofest-gallery-paper);
    color: var(--robofest-gallery-ink);
}

.robofest-gallery__container {
    position: relative;
    z-index: 1;
    width: min(100% - 2.5rem, 1280px);
    margin-inline: auto;
}

.robofest-gallery__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.robofest-gallery__heading {
    min-width: 0;
}

.robofest-gallery__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 1.5rem;
    padding: 0.55rem 0.75rem;
    border: 2px solid var(--robofest-gallery-ink);
    background: var(--robofest-gallery-green);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    line-height: 1.4;
    text-transform: uppercase;
}

.robofest-gallery__eyebrow::before {
    width: 0.65rem;
    height: 0.65rem;
    flex: 0 0 auto;
    background: var(--robofest-gallery-ink);
    content: "";
}

.robofest-gallery__title {
    max-width: 15ch;
    margin: 0;
    font-size: clamp(2.75rem, 6vw, 5.25rem);
    font-weight: 950;
    line-height: 0.97;
    letter-spacing: -0.075em;
    overflow-wrap: break-word;
    text-wrap: balance;
}

.robofest-gallery__title-highlight {
    color: var(--robofest-gallery-blue);
    text-decoration: underline;
    text-decoration-thickness: 0.07em;
    text-underline-offset: 0.1em;
    text-decoration-skip-ink: none;
}

.robofest-gallery__intro {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    max-width: 230px;
    margin: 0 0 0.4rem;
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1.5;
}

.robofest-gallery__intro-marker {
    width: 0.85rem;
    height: 0.85rem;
    flex: 0 0 auto;
    background: var(--robofest-gallery-orange);
    transform: rotate(45deg);
}

.robofest-gallery__grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    grid-auto-rows: minmax(210px, auto);
    gap: 1.25rem;
}

.robofest-gallery__item {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    margin: 0;
}

.robofest-gallery__item--featured {
    grid-column: span 6;
    grid-row: span 2;
}

.robofest-gallery__item--second,
.robofest-gallery__item--third,
.robofest-gallery__item--fourth {
    grid-column: span 2;
}

.robofest-gallery__frame {
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: var(--robofest-gallery-border);
    background: #e4e5e2;
    box-shadow: var(--robofest-gallery-shadow);
}

.robofest-gallery__item--featured .robofest-gallery__frame {
    min-height: 440px;
}

.robofest-gallery__image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
    object-position: center;
    transition: transform 250ms ease;
}

.robofest-gallery__item--featured .robofest-gallery__image {
    min-height: 440px;
}

.robofest-gallery__item:hover .robofest-gallery__image {
    transform: scale(1.035);
}

.robofest-gallery__image-number {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border: 2px solid var(--robofest-gallery-ink);
    background: var(--robofest-gallery-green);
    color: var(--robofest-gallery-ink);
    font-size: 0.75rem;
    font-weight: 950;
}

.robofest-gallery__item--second .robofest-gallery__image-number {
    background: var(--robofest-gallery-blue);
    color: #fff;
}

.robofest-gallery__item--third .robofest-gallery__image-number {
    background: var(--robofest-gallery-orange);
}

.robofest-gallery__item--fourth .robofest-gallery__image-number {
    background: var(--robofest-gallery-paper);
}

.robofest-gallery__caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 3.25rem;
    padding: 0.7rem 0.1rem 0;
}

.robofest-gallery__caption-label {
    font-size: 0.8rem;
    font-weight: 850;
    line-height: 1.4;
}

.robofest-gallery__caption-symbol {
    flex: 0 0 auto;
    font-size: 1.1rem;
    font-weight: 900;
}

.robofest-gallery__closing {
    display: flex;
    grid-column: span 2;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    min-width: 0;
    min-height: 210px;
    padding: 1rem;
    border: var(--robofest-gallery-border);
    background: var(--robofest-gallery-blue);
    box-shadow: var(--robofest-gallery-shadow);
    color: #fff;
}

.robofest-gallery__closing-symbol {
    font-size: 3.5rem;
    font-weight: 400;
    line-height: 0.8;
}

.robofest-gallery__closing-text {
    max-width: 12ch;
    font-size: clamp(1.1rem, 1.5vw, 1.5rem);
    font-weight: 950;
    line-height: 1.1;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

.robofest-gallery__decoration {
    position: absolute;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.robofest-gallery__shape {
    position: absolute;
    display: block;
    width: clamp(2.5rem, 5vw, 5rem);
    height: auto;
    color: var(--robofest-gallery-orange);
}

.robofest-gallery__shape--square {
    top: 4%;
    right: 2%;
    transform: rotate(12deg);
}

.robofest-gallery__shape--cross {
    bottom: 7%;
    left: 1%;
    color: var(--robofest-gallery-green);
    transform: rotate(-12deg);
}

@media (max-width: 1000px) {
    .robofest-gallery__container {
        width: min(100% - 2rem, 850px);
    }

    .robofest-gallery__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: auto;
        gap: 1.25rem;
    }

    .robofest-gallery__item--featured {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .robofest-gallery__item--featured .robofest-gallery__frame {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .robofest-gallery__item--featured .robofest-gallery__image {
        min-height: 0;
    }

    .robofest-gallery__item--second,
    .robofest-gallery__item--third,
    .robofest-gallery__item--fourth {
        grid-column: span 1;
    }

    .robofest-gallery__item:not(.robofest-gallery__item--featured) .robofest-gallery__frame {
        min-height: 0;
        aspect-ratio: 4 / 3;
    }

    .robofest-gallery__item:not(.robofest-gallery__item--featured) .robofest-gallery__image {
        min-height: 0;
    }

    .robofest-gallery__closing {
        grid-column: span 1;
        min-height: 0;
    }
}

@media (max-width: 600px) {
    .robofest-gallery {
        padding-block: 3.5rem;
    }

    .robofest-gallery__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 1.25rem;
        margin-bottom: 2rem;
    }

    .robofest-gallery__eyebrow {
        margin-bottom: 1.25rem;
        font-size: 0.65rem;
    }

    .robofest-gallery__title {
        font-size: clamp(2.6rem, 11vw, 3.8rem);
        letter-spacing: -0.065em;
    }

    .robofest-gallery__intro {
        max-width: none;
        font-size: 0.8rem;
    }

    .robofest-gallery__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }

    .robofest-gallery__item--featured,
    .robofest-gallery__item--second,
    .robofest-gallery__item--third,
    .robofest-gallery__item--fourth,
    .robofest-gallery__closing {
        grid-column: 1;
    }

    .robofest-gallery__item--featured .robofest-gallery__frame {
        aspect-ratio: 4 / 3;
    }

    .robofest-gallery__item:not(.robofest-gallery__item--featured) .robofest-gallery__frame {
        aspect-ratio: 5 / 4;
    }

    .robofest-gallery__closing {
        min-height: 150px;
    }

    .robofest-gallery__shape--square {
        right: -0.75rem;
    }

    .robofest-gallery__shape--cross {
        left: -0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .robofest-gallery__image {
        transition: none;
    }
}
