/*
 * Normal tab layout
 */

.course-variant-tabs {
    gap: 2rem;
}

.course-variant-navigation {
    flex: 0 0 25%;
}

#v-pills-tabContent {
    flex: 1 1 auto;
    min-width: 0;
}


/*
 * Comparison view
 */

.course-variant-comparison {
    scroll-margin-top: 100px;
}

.comparison-scroll-wrapper {
    position: relative;
    width: 100%;
}


/*
 * Horizontally scrolling card container
 */

.comparison-scroll {
    display: flex;
    align-items: stretch;
    gap: 1.5rem;

    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;

    padding: 0.5rem 3.75rem 1.5rem;

    scroll-behavior: smooth;
    scroll-padding-inline: 3.75rem;
    scroll-snap-type: x mandatory;

    scrollbar-width: auto;
    scrollbar-color: #9261aa #e9ecef;

    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}


/*
 * Visible scrollbar for Chromium and Safari
 */

.comparison-scroll::-webkit-scrollbar {
    height: 14px;
}

.comparison-scroll::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 999px;
}

.comparison-scroll::-webkit-scrollbar-thumb {
    min-width: 80px;
    background: #9261aa;
    border: 3px solid #e9ecef;
    border-radius: 999px;
}

.comparison-scroll::-webkit-scrollbar-thumb:hover {
    background: #754d88;
}


/*
 * Individual comparison cards
 *
 * The cards are deliberately narrower than the available screen
 * so that part of the next card remains visible.
 */

.course-comparison-column {
    flex: 0 0 clamp(300px, 36vw, 410px);
    min-width: 0;
    scroll-snap-align: start;
}

.course-comparison-card {
    position: relative;
    height: 100%;

    background: #fff;
    border-color: #d9d9d9 !important;

    box-shadow: 0 0.25rem 1rem rgb(0 0 0 / 8%);
}

.course-comparison-title {
    color: #9261aa;
}

.course-comparison-content {
    width: 100%;
    max-width: none;
    padding: 0;
}


/*
 * Avoid unwanted widths inherited from the original Bootstrap column.
 */

.course-comparison-content[class*="col-"] {
    flex: none;
    width: 100%;
    max-width: 100%;
}


/*
 * Make buttons inside the cards easy to compare.
 */

.course-comparison-content .btn {
    width: 100%;
}


/*
 * Left and right navigation buttons
 */

.comparison-arrow {
    position: absolute;
    top: 50%;
    z-index: 5;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;
    padding: 0;

    color: #fff;
    background: #9261aa;
    border: 2px solid #fff;
    border-radius: 50%;

    box-shadow: 0 0.25rem 0.9rem rgb(0 0 0 / 25%);

    transform: translateY(-50%);
    transition:
        background-color 0.2s ease,
        opacity 0.2s ease,
        transform 0.2s ease;
}

.comparison-arrow:hover,
.comparison-arrow:focus-visible {
    color: #fff;
    background: #754d88;
    transform: translateY(-50%) scale(1.06);
}

.comparison-arrow:focus-visible {
    outline: 3px solid rgb(146 97 170 / 35%);
    outline-offset: 3px;
}

.comparison-arrow--left {
    left: 0.5rem;
}

.comparison-arrow--right {
    right: 0.5rem;
}

.comparison-arrow.is-disabled,
.comparison-arrow:disabled {
    opacity: 0.2;
    pointer-events: none;
}


/*
 * Instruction underneath the scrollbar
 */

.comparison-scroll-hint {
    color: #555;
    font-size: 0.95rem;
}

.comparison-scroll-hint i {
    margin-right: 0.4rem;
    color: #9261aa;
}


/*
 * Mobile layout
 */

@media (max-width: 767.98px) {
    .course-variant-tabs {
        flex-direction: column;
    }

    .course-variant-navigation {
        width: 100% !important;
        flex-basis: auto;
    }

    #v-pills-tabContent {
        width: 100%;
    }

    .comparison-scroll {
        gap: 1rem;
        padding-right: 2.5rem;
        padding-left: 1rem;
        scroll-padding-inline: 1rem;
    }

    .course-comparison-column {
        /*
         * 84vw leaves part of the next card visible.
         */
        flex-basis: 84vw;
        max-width: 360px;
    }

    .course-comparison-card {
        padding: 1.25rem !important;
    }

    .comparison-arrow {
        width: 42px;
        height: 42px;
    }

    .comparison-arrow--left {
        left: 0.25rem;
    }

    .comparison-arrow--right {
        right: 0.25rem;
    }
}


/*
 * Respect reduced-motion preferences.
 */

@media (prefers-reduced-motion: reduce) {
    .comparison-scroll {
        scroll-behavior: auto;
    }

    .comparison-arrow {
        transition: none;
    }
}