
/* B03: RoboGenius Fest en cifras */

.robofest-stats {
    --robofest-stats-ink: var(--color-text, #171717);
    --robofest-stats-paper: var(--color-background, #f7f8f6);
    --robofest-stats-blue: var(--color-primary, #2563eb);
    --robofest-stats-orange: #ff7139;
    --robofest-stats-green: #c7f36b;
    --robofest-stats-border: 3px solid var(--robofest-stats-ink);
    --robofest-stats-shadow: 6px 6px 0 var(--robofest-stats-ink);

    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: clamp(4rem, 8vw, 7rem);
    background: var(--robofest-stats-ink);
    color: var(--robofest-stats-paper);
}

.robofest-stats__container {
    position: relative;
    z-index: 1;
    width: min(100% - 2.5rem, 1280px);
    margin-inline: auto;
}

.robofest-stats__header {
    max-width: 850px;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.robofest-stats__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-stats-paper);
    background: var(--robofest-stats-green);
    color: var(--robofest-stats-ink);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    line-height: 1.4;
    text-transform: uppercase;
}

.robofest-stats__eyebrow::before {
    width: 0.65rem;
    height: 0.65rem;
    flex: 0 0 auto;
    background: var(--robofest-stats-ink);
    content: "";
}

.robofest-stats__title {
    max-width: 14ch;
    margin: 0;
    font-size: clamp(2.75rem, 6.5vw, 5.5rem);
    font-weight: 950;
    line-height: 0.95;
    letter-spacing: -0.075em;
    overflow-wrap: break-word;
    text-wrap: balance;
    color: var(--color-whithe);
}

.robofest-stats__title-highlight {
    color: var(--robofest-stats-green);
    text-decoration: underline;
    text-decoration-thickness: 0.07em;
    text-underline-offset: 0.1em;
    text-decoration-skip-ink: none;
}

.robofest-stats__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
}

.robofest-stats__card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 300px;
    flex-direction: column;
    align-items: flex-start;
    padding: clamp(1.25rem, 2vw, 1.75rem);
    overflow: hidden;
    border: var(--robofest-stats-border);
    background: var(--robofest-stats-paper);
    box-shadow: var(--robofest-stats-shadow);
    color: var(--robofest-stats-ink);
    transition:
        transform 180ms ease,
        box-shadow 180ms ease;
}

.robofest-stats__card:hover {
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0 var(--robofest-stats-paper);
}

.robofest-stats__card--editions {
    background: var(--robofest-stats-green);
}

.robofest-stats__card--attendees {
    background: var(--robofest-stats-blue);
    color: #fff;
}

.robofest-stats__card--schools {
    background: var(--robofest-stats-orange);
}

.robofest-stats__card--categories {
    background: var(--robofest-stats-paper);
}

.robofest-stats__index {
    display: inline-block;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid currentColor;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.robofest-stats__value {
    position: relative;
    z-index: 1;
    margin: auto 0 0.75rem;
    font-size: clamp(2.8rem, 4vw, 4.5rem);
    font-weight: 950;
    line-height: 0.95;
    letter-spacing: -0.085em;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.robofest-stats__card--attendees .robofest-stats__value {
    font-size: clamp(2.35rem, 3.4vw, 3.8rem);
}

.robofest-stats__label {
    position: relative;
    z-index: 1;
    max-width: 24ch;
    margin: 0;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    font-weight: 800;
    line-height: 1.5;
    text-wrap: pretty;
}

.robofest-stats__marker {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    transform: rotate(45deg);
}

.robofest-stats__card--attendees .robofest-stats__marker {
    border-color: #fff;
}

.robofest-stats__decoration {
    position: absolute;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.robofest-stats__shape {
    position: absolute;
    display: block;
    width: clamp(2.5rem, 5vw, 5rem);
    height: auto;
    color: var(--robofest-stats-green);
}

.robofest-stats__shape--square {
    top: 15%;
    right: 8%;
    color: var(--robofest-stats-orange);
    transform: rotate(12deg);
}

.robofest-stats__shape--cross {
    bottom: 5%;
    left: 3%;
    color: var(--robofest-stats-blue);
    transform: rotate(12deg);
}

@media (min-width: 1500px) {
    .robofest-stats__container {
        width: min(100% - 4rem, 1360px);
    }

    .robofest-stats__card {
        min-height: 330px;
    }

    .robofest-stats__value {
        font-size: clamp(4rem, 4vw, 5rem);
    }
}

@media (max-width: 1100px) {
    .robofest-stats__container {
        width: min(100% - 2rem, 850px);
    }

    .robofest-stats__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }

    .robofest-stats__card {
        min-height: 270px;
        padding: 1.5rem;
    }

    .robofest-stats__value {
        font-size: clamp(3.5rem, 7vw, 5rem);
    }

    .robofest-stats__card--attendees .robofest-stats__value {
        font-size: clamp(2.8rem, 6vw, 4rem);
    }

    .robofest-stats__label {
        font-size: 0.95rem;
    }
}

@media (max-width: 600px) {
    .robofest-stats {
        padding-block: 3.5rem;
    }

    .robofest-stats__container {
        width: calc(100% - 2rem);
    }

    .robofest-stats__header {
        margin-bottom: 2rem;
    }

    .robofest-stats__eyebrow {
        margin-bottom: 1.25rem;
        font-size: 0.65rem;
    }

    .robofest-stats__title {
        font-size: clamp(2.65rem, 11vw, 4rem);
        line-height: 0.98;
        letter-spacing: -0.065em;
    }

    .robofest-stats__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    .robofest-stats__card {
        min-height: 220px;
        padding: 1.25rem;
        box-shadow: 5px 5px 0 var(--robofest-stats-paper);
    }

    .robofest-stats__card:hover {
        transform: translate(2px, 2px);
        box-shadow: 3px 3px 0 var(--robofest-stats-paper);
    }

    .robofest-stats__value {
        margin-top: 2rem;
        font-size: clamp(3.5rem, 15vw, 5rem);
    }

    .robofest-stats__card--attendees .robofest-stats__value {
        font-size: clamp(2.8rem, 12vw, 4rem);
    }

    .robofest-stats__label {
        max-width: 32ch;
        font-size: 0.9rem;
    }

    .robofest-stats__shape--square {
        top: 3%;
        right: -1rem;
        width: 2.5rem;
    }

    .robofest-stats__shape--cross {
        bottom: 2%;
        left: -1rem;
        width: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .robofest-stats__card {
        transition: none;
    }
}
