/* ==========================================================================
   Top Universities — single row logo carousel (arrow navigation, no autoplay)
   ========================================================================== */

.uni-carousel-section {
    --uni-ink: #092E55;
    --uni-accent: #1C5B86;
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.uni-carousel-container {
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* ---------- Heading ---------- */
.uni-carousel-head {
    text-align: center;
    max-width: 60rem;
    margin: 0 auto 2.75rem;
}

.uni-carousel-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .85rem;
}

.uni-carousel-eyebrow__icon {
    font-size: 1.35rem;
    line-height: 1;
}

.uni-carousel-eyebrow__text {
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--uni-accent);
}

.uni-carousel-title {
    font-family: 'Jost', sans-serif;
    font-size: clamp(28px, 4.4vw, 42px);
    font-weight: 600;
    line-height: 1.2em;
    text-transform: uppercase;
    color: #0f172a;
    margin: 0 0 1.1rem;
}

.uni-carousel-intro {
    color: #64748b;
    line-height: 1.65;
    margin: 0;
}

/* ---------- Panel ---------- */
.uni-carousel {
    position: relative;
    border-radius: 28px;
    padding: 34px 76px;
    background:
        radial-gradient(130% 150% at 0% 0%, #ffffff 0%, rgba(255, 255, 255, 0) 55%),
        linear-gradient(135deg, #f7fafd 0%, #e7eef6 100%);
    box-shadow: 0 18px 50px rgba(9, 46, 85, .08);
}

.uni-carousel::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(9, 46, 85, .07);
    pointer-events: none;
}

/* ---------- Track ---------- */
.uni-carousel__track {
    --uni-per-view: 2;
    --uni-gap: 16px;
    list-style: none;
    display: flex;
    gap: var(--uni-gap);
    margin: 0;
    padding: 6px 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.uni-carousel__track::-webkit-scrollbar {
    display: none;
}

.uni-carousel.is-static .uni-carousel__track {
    justify-content: center;
    overflow-x: visible;
}

/* ---------- Card ---------- */
.uni-card {
    flex: 0 0 calc((100% - (var(--uni-per-view) - 1) * var(--uni-gap)) / var(--uni-per-view));
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 150px;
    padding: 20px 16px;
    background: #fff;
    border: 1px solid rgba(9, 46, 85, .07);
    border-radius: 18px;
    box-shadow: 0 6px 18px rgba(9, 46, 85, .06);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.uni-card:hover {
    transform: translateY(-6px);
    border-color: rgba(28, 91, 134, .22);
    box-shadow: 0 16px 34px rgba(9, 46, 85, .15);
}

.uni-card__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 56px;
}

.uni-card__logo img {
    max-height: 56px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: .78;
    transition: opacity .3s ease, transform .3s ease;
    pointer-events: none;
}

.uni-card__logo svg {
    height: 56px;
    width: auto;
    max-width: 100%;
    border-radius: 8px;
    opacity: .85;
    transition: opacity .3s ease, transform .3s ease;
    pointer-events: none;
}

.uni-card:hover .uni-card__logo img,
.uni-card:hover .uni-card__logo svg {
    opacity: 1;
    transform: scale(1.05);
}

.uni-card__name {
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    color: #5b6b7d;
    min-height: 2.7em; /* keeps logos on one baseline when a name wraps */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Arrows ---------- */
.uni-carousel__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--uni-ink);
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(9, 46, 85, .18);
    transition: background .25s ease, color .25s ease, box-shadow .25s ease, transform .25s ease, opacity .25s ease;
}

.uni-carousel__nav--prev { left: 16px; }
.uni-carousel__nav--next { right: 16px; }

.uni-carousel__nav svg {
    width: 17px;
    height: 17px;
}

.uni-carousel__nav:hover {
    background: var(--uni-ink);
    color: #fff;
    box-shadow: 0 12px 28px rgba(9, 46, 85, .32);
    transform: translateY(-50%) scale(1.08);
}

.uni-carousel__nav:focus-visible {
    outline: 3px solid rgba(28, 91, 134, .4);
    outline-offset: 3px;
}

.uni-carousel__nav:disabled {
    opacity: .32;
    cursor: default;
    box-shadow: 0 4px 12px rgba(9, 46, 85, .1);
}

.uni-carousel__nav:disabled:hover {
    background: #fff;
    color: var(--uni-ink);
    transform: translateY(-50%);
}

.uni-carousel.is-static .uni-carousel__nav {
    display: none;
}

/* The theme-wide reveal animation targets every <button>; controls must stay visible. */
.uni-carousel__nav.reveal {
    opacity: 1;
    transform: translateY(-50%);
}

.uni-carousel__nav.reveal:disabled {
    opacity: .32;
}

/* ---------- Responsive ---------- */
@media (min-width: 480px) {
    .uni-carousel__track { --uni-per-view: 3; --uni-gap: 18px; }
}

@media (min-width: 768px) {
    .uni-carousel__track { --uni-per-view: 4; --uni-gap: 20px; }
}

@media (min-width: 1024px) {
    .uni-carousel__track { --uni-per-view: 5; --uni-gap: 22px; }
}

@media (min-width: 1280px) {
    .uni-carousel__track { --uni-per-view: 6; --uni-gap: 24px; }
}

@media (max-width: 991px) {
    .uni-carousel { padding: 30px 64px; border-radius: 24px; }
    .uni-card { min-height: 138px; padding: 18px 14px; }
    .uni-card__logo { height: 50px; }
    .uni-card__logo img { max-height: 50px; }
    .uni-card__logo svg { height: 50px; }
}

@media (max-width: 767px) {
    .uni-carousel-section { padding-top: 3.5rem; padding-bottom: 3.5rem; }
    .uni-carousel { padding: 26px 54px; }
    .uni-carousel__nav { width: 40px; height: 40px; }
    .uni-carousel__nav svg { width: 15px; height: 15px; }
    .uni-carousel__nav--prev { left: 10px; }
    .uni-carousel__nav--next { right: 10px; }
    .uni-card { min-height: 126px; }
    .uni-card__logo { height: 44px; }
    .uni-card__logo img { max-height: 44px; }
    .uni-card__logo svg { height: 44px; }
    .uni-card__name { font-size: .72rem; }
}

@media (max-width: 479px) {
    .uni-carousel { padding: 22px 46px; border-radius: 20px; }
    .uni-carousel__nav { width: 36px; height: 36px; }
    .uni-carousel__nav--prev { left: 6px; }
    .uni-carousel__nav--next { right: 6px; }
    .uni-card { min-height: 116px; padding: 14px 10px; gap: 8px; }
    .uni-card__logo { height: 38px; }
    .uni-card__logo img { max-height: 38px; }
    .uni-card__logo svg { height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
    .uni-carousel__track { scroll-behavior: auto; }
    .uni-card,
    .uni-card__logo img,
    .uni-card__logo svg,
    .uni-carousel__nav {
        transition: none;
    }
    .uni-card:hover { transform: none; }
}
