/* Experienced Teachers gallery — animations + standard carousel UI */

.teachers-section {
    padding: 80px 0;
    overflow: hidden;
}

.teachers-section__inner {
    display: grid;
    gap: 40px;
    align-items: center;
}

@media (min-width: 992px) {
    .teachers-section__inner {
        grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr);
        gap: 48px;
    }
}

.teachers-section .sec-heading h2 {
    margin: 0 0 16px;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    line-height: 1.15;
    color: #002039;
    letter-spacing: -0.02em;
}

.teachers-section .sec-heading p {
    margin: 0;
    max-width: 22rem;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--muted);
}

.text-gradiant {
    background: linear-gradient(90deg, #002039 45%, #73c3ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 400;
}

.gallery-slider {
    position: relative;
}

.gallery-slider__status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.gallery-slider__slider {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-slider__wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 20px;
    overflow: hidden;
    padding: 0 8px;
}

.gallery-slider__slide {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    width: 140px;
    height: 420px;
    max-width: 498px;
    filter: grayscale(100%);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1), filter 0.65s ease, box-shadow 0.65s ease, transform 0.35s ease;
}

.gallery-slider__slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(15, 23, 42, 0.55) 100%);
    opacity: 0.85;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.5s ease;
}

.gallery-slider__slide.active {
    width: min(52vw, 520px);
    filter: none;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
    animation: teacherSlideGlow 4s ease-in-out infinite;
}

.gallery-slider__slide.active::after {
    opacity: 1;
}

.gallery-slider__slide:hover,
.gallery-slider__slide:focus-visible {
    filter: grayscale(40%);
    outline: none;
}

.gallery-slider__slide.active:hover {
    filter: none;
}

.gallery-slider__image {
    position: absolute;
    left: 50%;
    top: 0;
    width: 100%;
    height: 100%;
    transform: translateX(-50%);
}

.gallery-slider__img-prev,
.gallery-slider__img-next {
    position: absolute;
    top: 0;
    object-fit: cover;
    width: 100%;
    height: 100%;
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s ease, visibility 0.8s ease;
}

.gallery-slider__img-prev {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.gallery-slider__img-next {
    opacity: 0;
    visibility: hidden;
}

.gallery-slider__slide.active .gallery-slider__img-prev {
    width: 55%;
    z-index: 1;
    animation: galleryZoomImg 1.1s ease-in-out 0.2s 1 forwards;
}

.gallery-slider__slide.active .gallery-slider__img-next {
    width: 55%;
    left: auto;
    right: 0;
    opacity: 1;
    visibility: visible;
}

.gallery-slider .teacher {
    position: absolute;
    bottom: 28px;
    left: 20px;
    z-index: 3;
    pointer-events: none;
}

.gallery-slider .teacher h3 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 600;
    line-height: 1.2;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.gallery-slider__slide.active .teacher h3,
.gallery-slider__slide.active .teacher p {
    animation: teacherLabelIn 0.55s cubic-bezier(0.33, 1, 0.68, 1) 0.15s both;
}

.gallery-slider__slide:not(.active) .teacher h3 {
    transform: rotate(-90deg);
    transform-origin: left bottom;
    white-space: nowrap;
    font-size: 1.1rem;
    font-weight: 500;
    bottom: 48px;
    left: 24px;
}

.gallery-slider .teacher p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.gallery-slider__slide:not(.active) .teacher p {
    display: none;
}

.gallery-slider__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4338ca, #6366f1);
    color: #fff;
    font-size: 2.5rem;
    font-weight: 800;
    z-index: 1;
}

.gallery-slider__footer {
    margin-top: 20px;
    padding: 0 8px;
}

.gallery-slider__progress {
    height: 3px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 14px;
}

.gallery-slider__progress-bar {
    display: block;
    height: 100%;
    width: 100%;
    transform-origin: left center;
    transform: scaleX(0);
    background: linear-gradient(90deg, var(--primary-mid), #73c3ff);
    border-radius: inherit;
}

.gallery-slider.is-autoplaying .gallery-slider__progress-bar {
    animation: teacherProgress var(--teacher-autoplay, 5s) linear forwards;
}

.gallery-slider.is-paused .gallery-slider__progress-bar {
    animation-play-state: paused;
}

.gallery-slider__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.gallery-slider__dots {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gallery-slider__dot {
    width: 0.55rem;
    height: 0.55rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease;
}

.gallery-slider__dot.is-active {
    background: var(--primary);
    transform: scale(1.25);
}

.gallery-slider__dot:hover,
.gallery-slider__dot:focus-visible {
    background: var(--primary-mid);
    outline: none;
    transform: scale(1.15);
}

.gallery-slider__counter {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.slider-btn {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.gallery-slider .prev-btn,
.gallery-slider .next-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    transition: border-color 0.2s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
}

.gallery-slider .prev-btn:hover,
.gallery-slider .next-btn:hover,
.gallery-slider .prev-btn:focus-visible,
.gallery-slider .next-btn:focus-visible {
    border-color: var(--primary-mid);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 56, 202, 0.18);
    outline: none;
}

.gallery-slider .prev-btn:active,
.gallery-slider .next-btn:active {
    transform: translateY(0) scale(0.96);
}

.gallery-slider .prev-btn img,
.gallery-slider .next-btn img {
    width: 22px;
    height: 22px;
    display: block;
}

@keyframes galleryZoomImg {
    0% { opacity: 1; transform: scale(1); }
    45% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

@keyframes teacherLabelIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes teacherSlideGlow {
    0%, 100% { box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12); }
    50% { box-shadow: 0 12px 40px rgba(67, 56, 202, 0.22); }
}

@keyframes teacherProgress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.teachers-section.animate-on-scroll:not(.in-view) .teachers-section__heading {
    opacity: 0;
    transform: translateX(-24px);
}

.teachers-section.animate-on-scroll.in-view .teachers-section__heading {
    animation: slideInLeft 0.65s ease forwards;
}

.teachers-section.animate-on-scroll:not(.in-view) .teachers-section__slider {
    opacity: 0;
    transform: translateX(28px);
}

.teachers-section.animate-on-scroll.in-view .teachers-section__slider {
    animation: slideInRight 0.7s ease 0.12s forwards;
}

.teachers-section.animate-on-scroll.in-view .gallery-slider__slide:nth-child(1) { animation: fadeUp 0.55s ease 0.2s both; }
.teachers-section.animate-on-scroll.in-view .gallery-slider__slide:nth-child(2) { animation: fadeUp 0.55s ease 0.26s both; }
.teachers-section.animate-on-scroll.in-view .gallery-slider__slide:nth-child(3) { animation: fadeUp 0.55s ease 0.32s both; }
.teachers-section.animate-on-scroll.in-view .gallery-slider__slide:nth-child(4) { animation: fadeUp 0.55s ease 0.38s both; }
.teachers-section.animate-on-scroll.in-view .gallery-slider__slide:nth-child(5) { animation: fadeUp 0.55s ease 0.44s both; }
.teachers-section.animate-on-scroll.in-view .gallery-slider__slide:nth-child(6) { animation: fadeUp 0.55s ease 0.5s both; }
.teachers-section.animate-on-scroll.in-view .gallery-slider__slide:nth-child(7) { animation: fadeUp 0.55s ease 0.56s both; }
.teachers-section.animate-on-scroll.in-view .gallery-slider__slide:nth-child(8) { animation: fadeUp 0.55s ease 0.62s both; }

@media (prefers-reduced-motion: reduce) {
    .gallery-slider__slide,
    .gallery-slider__slide.active,
    .gallery-slider__img-prev,
    .gallery-slider__img-next {
        transition: none;
        animation: none !important;
    }

    .gallery-slider__slide.active .gallery-slider__img-prev {
        animation: none;
    }

    .gallery-slider__progress-bar {
        animation: none !important;
        transform: scaleX(1);
    }

    .teachers-section.animate-on-scroll.in-view .gallery-slider__slide {
        animation: none !important;
    }
}

@media (max-width: 1024px) {
    .gallery-slider__slide {
        width: 100px;
        height: 360px;
    }

    .gallery-slider__slide.active {
        width: min(70vw, 360px);
    }
}

@media (max-width: 768px) {
    .teachers-section__inner {
        gap: 28px;
    }

    .gallery-slider__wrapper {
        flex-direction: column;
        gap: 12px;
    }

    .gallery-slider__slide,
    .gallery-slider__slide.active {
        width: 100%;
        max-width: 100%;
        height: 300px;
        animation: none;
    }

    .gallery-slider__slide:not(.active) {
        display: none;
    }

    .gallery-slider__slide.active .gallery-slider__img-prev,
    .gallery-slider__slide.active .gallery-slider__img-next {
        width: 50%;
    }

    .gallery-slider__slide:not(.active) .teacher h3 {
        transform: none;
    }

    .gallery-slider__slide.active .teacher p {
        display: block;
    }

    .gallery-slider__controls {
        flex-direction: column;
        align-items: stretch;
    }

    .slider-btn {
        margin-left: 0;
        justify-content: center;
    }
}
