/* ============================================
   EXPERT CARDS BASE - Базові стилі для карток експертів
   Universal стилі, які використовуються на всіх сторінках
   ============================================ */

/* === КОНТЕЙНЕР КАРУСЕЛІ === */
.experts-carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* === КОНТЕЙНЕР СІТКИ === */
.experts-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 24px;
    align-items: stretch;
    max-width: 100%;
    margin: 20px auto 30px auto;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === БАЗОВА КАРТКА === */
.expert-card {
    background: transparent;
    border: none;
    padding: 0;
    text-align: center;
    height: 100%;
    flex: 0 0 calc(25% - 18px);
    width: calc(25% - 18px);
    min-width: calc(25% - 18px);
    max-width: calc(25% - 18px);
}

/* === ФОТО ЕКСПЕРТА === */
.expert-photo {
    width: 100%;
    height: 250px;
    border-radius: 0;
    background: #e8e8e8;
    margin: 0;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.expert-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background: #f5f5f5;
    display: block;
}

/* === КОНТЕНТ КАРТКИ === */
.expert-card-content {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* === ІМ'Я ЕКСПЕРТА === */
.expert-name {
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2a2a2a;
    line-height: 1.2;
    text-shadow: none;
    text-align: center;
}

/* === СПЕЦІАЛІЗАЦІЯ === */
.expert-specialization {
    color: #757575;
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1;
    font-size: 0.8rem;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
}

/* === ПОСИЛАННЯ === */
.expert-link {
    color: #d32f2f;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    margin-top: auto;
    font-size: 0.9375rem;
    font-family: 'Roboto', sans-serif;
    transition: all 0.3s ease;
}

.expert-link:hover {
    color: #b71c1c;
    text-decoration: underline;
}

/* ============================================
   АДАПТИВНІСТЬ - ПЛАНШЕТИ (769px - 1024px)
   ============================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .experts-grid {
        gap: 20px;
    }

    .expert-card {
        flex: 0 0 calc(33.333% - 13px);
        width: calc(33.333% - 13px);
        min-width: calc(33.333% - 13px);
        max-width: calc(33.333% - 13px);
    }

    .expert-photo {
        height: 280px;
    }

    .expert-card-content {
        padding: 20px 16px;
    }

    .expert-name {
        font-size: 1.0625rem;
        font-family: 'Roboto', sans-serif;
    }

    .expert-specialization {
        font-size: 0.875rem;
        font-family: 'Roboto', sans-serif;
    }

    .expert-link {
        font-size: 0.875rem;
        font-family: 'Roboto', sans-serif;
    }
}

/* ============================================
   HEADER З НАВІГАЦІЄЮ (ЯК В MAIN-COURSES)
   ============================================ */
.experts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
}

.experts-header .section-title {
    color: #2a2a2a;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: left;
    margin: 0;
    text-shadow: none;
}

[data-theme="dark"] .experts-header .section-title {
    color: var(--color-text);
}

@media (prefers-color-scheme: dark) {
    [data-theme="auto"] .experts-header .section-title {
        color: var(--color-text);
    }
}

/* ============================================
   НАВІГАЦІЯ - В HEADER (ЯК В MAIN-COURSES)
   ============================================ */
.experts-navigation {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
}

/* Стрілки навігації */
.expert-nav-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #171717;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.expert-nav-btn:hover:not(:disabled) {
    background: #171717;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.expert-nav-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.expert-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

[data-theme="dark"] .expert-nav-btn {
    background: #e9e9e9;
    color: #000000;
}

[data-theme="dark"] .expert-nav-btn:hover:not(:disabled) {
    background: #f0f0f0;
}

@media (prefers-color-scheme: dark) {
    [data-theme="auto"] .expert-nav-btn {
        background: #e9e9e9;
        color: #000000;
    }

    [data-theme="auto"] .expert-nav-btn:hover:not(:disabled) {
        background: #f0f0f0;
    }
}

.expert-nav-btn svg {
    max-width: 24px;
    max-height: 24px;
}

/* ============================================
   КАРУСЕЛЬ ДЛЯ МОБІЛЬНИХ (≤768px)
   ============================================ */

/* ==================== MOBILE CAROUSEL (≤768px) ==================== */

/* ==================== SMALL MOBILE (< 576px) ==================== */
@media (max-width: 767px) {
    .experts-section .section-content {
        display: flex;
        flex-direction: column;
    }

    .experts-header {
        display: contents;
    }

    .experts-header .section-title {
        font-size: 1.75rem;
        order: 1;
        margin-bottom: 16px;
    }

    .experts-subtitle {
        order: 2;
        margin-bottom: 24px;
    }

    .experts-carousel-container {
        order: 3;
        overflow: hidden;
    }

    .experts-navigation {
        order: 4;
        align-self: center;
        width: fit-content;
        padding-top: 20px;
    }

    .experts-grid {
        gap: 12px;
    }

    .experts-grid .expert-card {
        flex: 0 0 calc(50% - 6px);
        width: calc(50% - 6px);
        min-width: calc(50% - 6px);
        max-width: calc(50% - 6px);
    }

    .expert-photo {
        height: 180px;
    }

    .expert-card-content {
        padding: 12px 8px;
    }

    .expert-name {
        font-size: 0.667rem;
        font-family: 'Roboto', sans-serif;
        text-align: center;
    }

    .expert-specialization {
        font-size: 0.6875rem;
        font-family: 'Roboto', sans-serif;
    }

    .expert-link,
    .expert-detail-link {
        font-size: 0.6875rem;
        font-family: 'Roboto', sans-serif;
    }

    .expert-nav-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }

    .expert-nav-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================
   iOS SAFARI ОПТИМІЗАЦІЯ
   ============================================ */
@supports (-webkit-touch-callout: none) {
    .expert-card,
    .expert-photo {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    .expert-photo img {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    /* iOS Safari оптимізація для каруселі */
    @media (max-width: 767px) {
        .experts-grid {
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }

        .expert-nav-btn {
            -webkit-tap-highlight-color: transparent;
            -webkit-touch-callout: none;
        }
    }
}

/* ============================================
   DARK THEME
   ============================================ */
[data-theme="dark"] .expert-photo {
    background: var(--color-bg-dark);
}

[data-theme="dark"] .expert-name {
    color: var(--color-text);
    text-shadow: none;
}

[data-theme="dark"] .expert-specialization {
    color: var(--color-text-light);
}

@media (prefers-color-scheme: dark) {
    [data-theme="auto"] .expert-photo {
        background: var(--color-bg-dark);
    }

    [data-theme="auto"] .expert-name {
        color: var(--color-text);
        text-shadow: none;
    }

    [data-theme="auto"] .expert-specialization {
        color: var(--color-text-light);
    }
}

