/*
 * Carousel-container/college-card carousel, ported verbatim from the
 * colleges-section of https://www.wfmca.org/project/ (frontend_assets/css/
 * home.css there). Only the carousel itself was taken from that source -
 * the section heading above it keeps its original hsc-section-head styling
 * (from home-content.css), unrelated to this file.
 */

.carousel-container {
    width: 100%;
    margin: 0 15px;
    position: relative;
    overflow: hidden;
    padding: 20px 0;
}

.carousel-track {
    display: flex;
    gap: 20px;
    width: max-content;
    will-change: transform;
    /* Transition lives here permanently, same as .slider in the reference
       hero slider (https://www.wfmca.org/project/frontend_assets/css/home.css)
       - colleges-section.js only ever sets `transform`, never toggles this. */
    transition: transform 0.5s ease-in-out;
}

.college-card {
    flex: 0 0 330px;
    min-width: 330px;
    background: white;
    flex-shrink: 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
    transition: all .4s cubic-bezier(.4, 0, .2, 1);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
}

.college-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.college-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, .1), rgba(118, 75, 162, .1));
    opacity: 0;
    transition: opacity .4s ease;
    z-index: 1;
}

.college-card:hover::before { opacity: 1; }

.college-image-wrapper {
    overflow: hidden;
    position: relative;
}

/* Marks the single newest active college (featuredColleges() sorts newest
   first) so a visitor can tell which card that is at a glance, rather than
   only being implied by carousel position - the auto-advancing carousel
   itself has no stable "first" card on screen once it's cycled a bit. */
.college-badge-newest {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: var(--wfm-primary-blue, rgb(42, 81, 136));
    color: #fff;
    font-family: var(--wfm-font-body, 'Poppins', sans-serif);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
    padding: 5px 12px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

.college-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform .4s ease;
}

.college-card:hover .college-image { transform: scale(1.1); }

/* Inactive colleges (status_ind = 0) stay visible in the carousel - always
   last, after every active college - but greyed out, so partner colleges
   that are no longer active don't read as a current, active partner.
   Scoped to this modifier only so active cards are untouched. */
.college-card--inactive {
    opacity: .55;
    filter: grayscale(1);
}

.college-card--inactive:hover {
    opacity: .75;
}

.college-content {
    padding: 20px;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.college-name {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 12px !important;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.college-location {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #7f8c8d;
    font-size: 15px;
    margin-bottom: 15px;
}

.location-icon {
    font-size: 18px;
    color: #e74c3c;
}

.college-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 15px;
    border-top: 2px solid #ecf0f1;
    /* auto (not a fixed 15px) so this row always sits at the same height at
       the bottom of the card, regardless of how many lines the address text
       above it wraps to - otherwise a short address left it noticeably
       higher than in cards with a longer, wrapped address. */
    margin-top: auto;
}

.college-stat { text-align: center; }

.college-stat-number {
    font-size: 20px;
    font-weight: 700;
    color: #2a5188;
    display: block;
}

.college-stat-label {
    font-size: 13px;
    color: #95a5a6;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: .5px;
    margin-top: 3px;
}

.arrow-btn {
    background: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .3);
    transition: all .3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    z-index: 10;
}

.arrow-btn:hover {
    color: rgb(53, 116, 205);
    box-shadow: 0 12px 35px rgba(102, 126, 234, .4);
}

.carousel-controls .arrow-btn.arrow-prev,
.carousel-controls .arrow-btn.arrow-next {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #2a5188, #173968);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .25);
    box-shadow: 0 8px 24px rgba(20, 55, 100, .28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    line-height: 1;
    transition: background .3s ease, transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.carousel-controls .arrow-btn.arrow-prev::before,
.carousel-controls .arrow-btn.arrow-next::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .38), rgba(255, 255, 255, 0) 65%);
}

.carousel-controls .arrow-btn.arrow-prev:hover,
.carousel-controls .arrow-btn.arrow-next:hover {
    background: linear-gradient(135deg, #03152e, #174b82);
    color: #fff;
    border-color: rgba(255, 255, 255, .4);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 14px 32px rgba(3, 21, 46, .38);
}

.carousel-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
}

@media (max-width: 1024px) {
    .college-card { flex: 0 0 330px; }
    .arrow-btn { width: 40px; height: 40px; font-size: 20px; }
}

@media (max-width: 768px) {
    .colleges-section { padding: 60px 0; }
    .colleges-header { padding: 0 20px; margin-bottom: 40px; }
    .colleges-header h2 { font-size: 32px; }
    .colleges-header p { font-size: 16px; }
    .college-card { flex: 0 0 330px; }
    .carousel-track { gap: 20px; }
    .arrow-btn { width: 65px; height: 65px; font-size: 18px; background: rgba(255, 255, 255, .95); }
}

@media (max-width: 480px) {
    .college-card { flex: 0 0 330px; }
    .college-name { font-size: 18px; }
    .arrow-btn { width: 45px; height: 45px; font-size: 20px; }
}
