/* ============================================================
   Race Results — Main Container
   ============================================================ */

.xio-race-results {
    display: flex;
    gap: 30px;
    width: 100%;
    position: relative;
    font-family: 'Outfit', sans-serif;
}

/* ============================================================
   Stages Column (Left)
   ============================================================ */

.xio-race-results__stages {
    width: 35%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   Stage Block
   ============================================================ */

.xio-race-results__stage {
    border-bottom: 1px solid #eee;
}

.xio-race-results__stage:last-child {
    border-bottom: none;
}

/* ============================================================
   Stage Toggle (Accordion Header)
   ============================================================ */

.xio-race-results__stage-toggle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    width: 100%;
    padding: 14px 18px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    color: #444;
    text-align: left;
    position: relative;
    transition: background-color 0.3s ease, padding-left 0.3s ease;
}

.xio-race-results__stage-toggle::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(180deg, #EAA383, #836890);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.xio-race-results__stage-toggle:hover {
    background-color: #fff;
    padding-left: 24px;
}

.xio-race-results__stage-toggle:hover::before {
    width: 4px;
}

.xio-race-results__stage--active .xio-race-results__stage-toggle {
    background: linear-gradient(90deg, #EAA383 0%, #836890 100%);
    color: #fff;
    padding-left: 18px;
}

.xio-race-results__stage--active .xio-race-results__stage-name,
.xio-race-results__stage--active .xio-race-results__stage-date,
.xio-race-results__stage--active .xio-race-results__stage-distance {
    color: #fff;
    opacity: 1;
}

.xio-race-results__stage--active .xio-race-results__stage-toggle::before {
    width: 0;
}

.xio-race-results__stage-date {
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.xio-race-results__stage-name {
    font-weight: 500;
    font-size: 13px;
    line-height: 1.3;
    flex: 1 1 auto;
    min-width: 0;
}

.xio-race-results__stage-distance {
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    opacity: 0.8;
}

.xio-race-results__stage-icon {
    flex-shrink: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.xio-race-results__stage--active .xio-race-results__stage-icon {
    transform: rotate(180deg);
    color: #fff;
}

/* ============================================================
   Stage Content (Accordion Body)
   ============================================================ */

.xio-race-results__stage-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s ease;
}

.xio-race-results__stage--active .xio-race-results__stage-content {
    opacity: 1;
}

/* ============================================================
   Result Row
   ============================================================ */

.xio-race-results__result {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.25s ease, padding-left 0.3s ease;
    border-bottom: 1px solid #f5f3f3;
    position: relative;
}

.xio-race-results__result:last-child {
    border-bottom: none;
}

.xio-race-results__result:hover {
    background-color: rgba(234, 163, 131, 0.05);
    padding-left: 28px;
}

.xio-race-results__result:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(212, 123, 79, 0.4);
}

/* --- Podium highlights --- */

.xio-race-results__result--gold .xio-race-results__position {
    color: #D4A017;
}

.xio-race-results__result--silver .xio-race-results__position {
    color: #8E8E8E;
}

.xio-race-results__result--bronze .xio-race-results__position {
    color: #CD7F32;
}

/* --- Position --- */

.xio-race-results__position {
    font-size: 18px;
    font-weight: 700;
    min-width: 46px;
    color: #D47B4F;
    flex-shrink: 0;
}

/* --- Flag --- */

.xio-race-results__flag {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

/* --- Rider Link --- */

.xio-race-results__rider-link {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: color 0.25s ease;
    flex: 1;
    min-width: 0;
}

.xio-race-results__result:hover .xio-race-results__rider-link {
    color: #D47B4F;
}

/* ============================================================
   Slider Column (Right)
   ============================================================ */

.xio-race-results__slider {
    width: 65%;
    display: flex;
    gap: 30px;
    align-items: flex-end;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    overflow: hidden;
}

/* ============================================================
   Featured Rider
   ============================================================ */

.xio-race-results__featured {
    position: relative;
    width: 380px;
    min-width: 380px;
    height: 500px;
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.xio-race-results__featured:hover {
    transform: none;
}

.xio-race-results__featured-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 80%;
    height: 100%;
    background-image: url('../../../assets/image/background-slider.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.xio-race-results__featured-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    z-index: 1;
    transition: opacity 0.15s ease;
}

.xio-race-results__featured-info {
    width: 50%;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
}

.xio-race-results__featured-flag {
    font-size: 24px;
    line-height: 1;
    min-height: 24px;
}

.xio-race-results__featured-position {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.xio-race-results__featured-name {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    margin: 0;
}

.xio-race-results__featured-quote {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    color: #fff;
    margin: 0;
    opacity: 0.85;
    max-width: 160px;
    font-style: italic;
}

.xio-race-results__featured-image {
    width: 50%;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.xio-race-results__featured-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: bottom center;
    transition: opacity 0.3s ease;
}

/* ============================================================
   Carousel (Swiper)
   ============================================================ */

.xio-race-results__carousel {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    position: relative;
    padding-bottom: 40px;
}

.xio-race-results__swiper {
    width: 100%;
    overflow: hidden;
}

.xio-race-results__slide {
    width: auto;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.xio-race-results__slide:hover {
    transform: scale(1.03);
}

.xio-race-results__slide-image {
    width: 140px;
    height: 320px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.xio-race-results__slide-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: bottom center;
}

.xio-race-results__slide-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 5px;
    width: 140px;
}

.xio-race-results__slide-flag {
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}

.xio-race-results__slide-name {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #7d5ca8;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Pagination --- */

.xio-race-results__pagination {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 10;
}

.xio-race-results__pagination .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #ddd;
    opacity: 1;
    margin: 0 4px;
    transition: all 0.3s ease;
}

.xio-race-results__pagination .swiper-pagination-bullet-active {
    background: #D47B4F;
    width: 24px;
    border-radius: 5px;
}

/* ============================================================
   Entrance Animation
   ============================================================ */

.xio-race-results__stage {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease, border-bottom-color 0.3s ease;
}

.xio-race-results__stage--visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   Responsive — 1200px
   ============================================================ */

@media (max-width: 1200px) {
    .xio-race-results {
        gap: 24px;
    }

    .xio-race-results__featured {
        width: 340px;
        min-width: 340px;
        height: 450px;
    }

    .xio-race-results__featured-name {
        font-size: 20px;
    }

    .xio-race-results__featured-position {
        font-size: 24px;
    }

    .xio-race-results__slide-image {
        width: 120px;
        height: 280px;
    }

    .xio-race-results__slide-meta {
        width: 120px;
    }

    .xio-race-results__slide-name {
        font-size: 11px;
    }
}

/* ============================================================
   Responsive — 1024px (single column)
   ============================================================ */

@media (max-width: 1024px) {
    .xio-race-results {
        flex-direction: column;
        gap: 30px;
    }

    .xio-race-results__stages {
        width: 100%;
    }

    .xio-race-results__slider {
        width: 100%;
        position: static;
    }

    .xio-race-results__featured {
        width: 340px;
        min-width: 340px;
        height: 460px;
    }

    .xio-race-results__featured-bg {
        width: 55%;
    }

    .xio-race-results__featured-image {
        width: 55%;
    }

    .xio-race-results__slide-image {
        width: 110px;
        height: 250px;
    }

    .xio-race-results__slide-meta {
        width: 110px;
    }
}

/* ============================================================
   Responsive — 768px
   ============================================================ */

@media (max-width: 768px) {
    .xio-race-results {
        padding: 0;
        gap: 20px;
    }

    .xio-race-results__slider {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .xio-race-results__featured {
        width: 100%;
        min-width: 100%;
        max-width: 340px;
        height: 480px;
    }

    .xio-race-results__featured-bg {
        width: 58%;
    }

    .xio-race-results__featured-info {
        padding: 20px;
        gap: 8px;
    }

    .xio-race-results__featured-name {
        font-size: 20px;
    }

    .xio-race-results__featured-position {
        font-size: 22px;
    }

    .xio-race-results__featured-quote {
        max-width: 140px;
        font-size: 11px;
    }

    .xio-race-results__featured-image {
        width: 58%;
        justify-content: left;
    }

    .xio-race-results__featured-image img {
        max-width: 98%;
        max-height: 100%;
        transform: translateX(-3%);
    }

    .xio-race-results__carousel {
        width: 100%;
    }

    .xio-race-results__slide-image {
        width: 100px;
        height: 220px;
    }

    .xio-race-results__slide-meta {
        width: 100px;
        padding: 10px 3px;
    }

    .xio-race-results__slide-name {
        font-size: 10px;
    }

    .xio-race-results__stage-toggle {
        padding: 12px 14px;
    }

    .xio-race-results__stage-name {
        font-size: 12px;
    }

    .xio-race-results__stage-date,
    .xio-race-results__stage-distance {
        font-size: 10px;
    }

    .xio-race-results__result {
        gap: 10px;
        padding: 10px 14px;
    }

    .xio-race-results__position {
        font-size: 16px;
        min-width: 38px;
    }

    .xio-race-results__rider-link {
        font-size: 12px;
    }
}

/* ============================================================
   Responsive — 480px (Mobile)
   ============================================================ */

@media (max-width: 480px) {
    .xio-race-results {
        gap: 20px;
    }

    /* --- Stages as cards --- */

    .xio-race-results__stage {
        border-bottom: none;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        margin-bottom: 8px;
        overflow: hidden;
    }

    .xio-race-results__stage--active {
        box-shadow: 0 2px 12px rgba(212, 123, 79, 0.12);
    }

    .xio-race-results__stage-toggle {
        padding: 10px 12px;
        gap: 8px;
    }

    .xio-race-results__stage-name {
        font-size: 12px;
    }

    .xio-race-results__stage-date,
    .xio-race-results__stage-distance {
        font-size: 10px;
    }

    .xio-race-results__result {
        gap: 8px;
        padding: 10px 12px;
    }

    .xio-race-results__position {
        font-size: 15px;
        min-width: 34px;
    }

    .xio-race-results__flag {
        font-size: 16px;
    }

    .xio-race-results__rider-link {
        font-size: 11px;
    }

    /* --- Featured compact --- */

    .xio-race-results__featured {
        max-width: 300px;
        height: 420px;
    }

    .xio-race-results__featured-info {
        padding: 18px;
        gap: 6px;
    }

    .xio-race-results__featured-flag {
        font-size: 20px;
    }

    .xio-race-results__featured-position {
        font-size: 20px;
    }

    .xio-race-results__featured-name {
        font-size: 18px;
    }

    .xio-race-results__featured-quote {
        font-size: 11px;
        max-width: 120px;
    }

    .xio-race-results__featured-bg {
        width: 60%;
    }

    .xio-race-results__featured-image {
        width: 60%;
    }

    .xio-race-results__featured-image img {
        max-width: 95%;
        max-height: 100%;
        transform: translateX(-2%);
    }

    .xio-race-results__slide-image {
        width: 85px;
        height: 180px;
    }

    .xio-race-results__slide-meta {
        width: 85px;
        gap: 4px;
        padding: 8px 2px;
    }

    .xio-race-results__slide-flag {
        font-size: 14px;
    }

    .xio-race-results__slide-name {
        font-size: 9px;
    }
}
