/* Современное оформление галереи фото обучения */
.main-slide {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 10px 0;
}

.slideshow-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 420px;
    max-height: 75vh;
    background: #0f172a;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px -5px rgba(15, 23, 42, 0.25), 0 5px 15px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.ySlides {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ySlides.active {
    display: flex;
    opacity: 1;
    z-index: 5;
}

.ySlides img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.3s ease;
}

/* Счетчик слайдов (1 / X) */
.numbertext {
    position: absolute;
    top: 18px;
    left: 18px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    color: #f8fafc;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 10;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Оверлей или номер внизу */
.overlay {
    position: absolute;
    bottom: 18px;
    right: 18px;
    background: rgba(30, 58, 138, 0.85);
    backdrop-filter: blur(8px);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Контейнер кнопок навигации */
.nav-buttons {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 15;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
}

/* Современные кнопки-стрелки (Glassmorphism) */
.prev,
.next {
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    color: #ffffff !important;
    font-weight: bold;
    font-size: 20px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
}

.prev:hover,
.next:hover {
    background: #2563eb;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
    border-color: #60a5fa;
}

.prev:active,
.next:active {
    transform: scale(0.95);
}

.gallery-heading {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e3a8a;
    margin: 0 0 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
    text-align: left;
}


/* Адаптивность для мобильных экранов и планшетов */
@media (max-width: 768px) {
    .slideshow-container {
        min-height: 300px;
        aspect-ratio: 4 / 3;
        border-radius: 14px;
    }

    .ySlides {
        padding: 12px;
    }

    .prev,
    .next {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .numbertext {
        top: 12px;
        left: 12px;
        font-size: 0.75rem;
        padding: 4px 10px;
    }

    .overlay {
        bottom: 12px;
        right: 12px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .slideshow-container {
        min-height: 240px;
        aspect-ratio: 1 / 1;
    }

    .nav-buttons {
        padding: 0 8px;
    }

    .prev,
    .next {
        width: 38px;
        height: 38px;
        background: rgba(15, 23, 42, 0.6);
    }
}