/* ILYK — стилі лише сторінки курсу (04.12.2026). Блоки перенесено з css/course-sidebar.css БЕЗ ЗМІН, у тому ж порядку:
   ті, що на 21 типі сторінок × 2 ширини збігалися лише на сторінках курсу. Підключення — inc/enqueue.php, одразу
   після course-sidebar.css і лише на is_singular('ilyk_course'). Перевірка — зліпок обчислених стилів до/після. */

/* =====================================================
   ILYK Child Theme — course-sidebar.css
   Кастомні стилі для сторінок курсів
   ===================================================== */


/* =====================================================
   1. САЙДБАР СТОРІНКИ КУРСУ
   ===================================================== */

/* Статус-бейдж (Йде набір / Набір завершено) */
.ilyk-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}
/* =====================================================
   Сторінка курсу — layout двох колонок
   ===================================================== */

/* =====================================================
   LAYOUT двох колонок сторінки курсу
   ===================================================== */

/* Row — stretch: col-lg-4 розтягується на висоту col-lg-8
   Це дає sticky простір для прокрутки */
.tp-course-details-2-area .row {
    align-items: stretch;
}

/* Ліва колонка */
.tp-course-details-2-area .col-lg-8 {
    min-height: 420px;
}

/* Права колонка — розтягується, але сайдбар всередині sticky */
.tp-course-details-2-area .col-lg-4 {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

/* Дозволяємо сайдбару виїжджати вгору */
.tp-course-details-2-area {
    overflow: visible !important;
}

/* =====================================================
   САЙДБАР — sticky з overlap в зону hero
   ===================================================== */
.ilyk-course-sidebar {
    position: sticky !important;
    top: calc(var(--ilyk-header-h, 72px) + var(--ilyk-admin-bar-h, 0px) + 20px) !important;
    /* margin-top встановлюється динамічно через JS (course-tabs.js) */
    z-index: 9;
    /* Сайдбар не тягнеться на всю висоту col-lg-4 */
    align-self: flex-start;
}

/* Обкладинка */
/* Cover всередині card — картка має overflow:hidden і обрізає по своєму border-radius */
.ilyk-course-sidebar__cover {
    margin: -24px -24px 24px -24px;
    position: relative;
}
.ilyk-course-sidebar__cover img {
    width: calc(100% + 48px);
    height: auto;
    display: block;
}

/* Play-кнопка поверх фото */
.ilyk-course-video-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.ilyk-course-video-play__icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    /* Анімований пульс */
    animation: ilyk-play-pulse 2s ease-in-out infinite;
}
.ilyk-course-video-play:hover .ilyk-course-video-play__icon {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    background: #fff;
    animation: none;
}
.ilyk-course-video-play__icon svg {
    margin-left: 4px; /* візуальний центр трикутника */
}

/* Мета-картка */
.ilyk-course-sidebar__card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.07);
    padding: 24px;
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden; /* фото заповнює кути без прогалин */
}

/* Кнопка реєстрації */
.ilyk-course-sidebar__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 20px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    text-align: center;
}
body.term-program .ilyk-course-sidebar__btn:not(.ilyk-course-sidebar__btn--disabled),
.ilyk-course-sidebar__btn:not(.ilyk-course-sidebar__btn--disabled) {
    background: #5169F1;
    color: #fff;
    box-shadow: 0 4px 20px rgba(81,105,241,0.3);
}
body.term-training .ilyk-course-sidebar__btn:not(.ilyk-course-sidebar__btn--disabled) {
    background: #2D6E63;
    color: #fff;
    box-shadow: 0 4px 20px rgba(45,110,99,0.3);
}
.ilyk-course-sidebar__btn:not(.ilyk-course-sidebar__btn--disabled):hover {
    color: #fff;
    transform: translateY(-2px);
}
body.term-program .ilyk-course-sidebar__btn:not(.ilyk-course-sidebar__btn--disabled):hover,
.ilyk-course-sidebar__btn:not(.ilyk-course-sidebar__btn--disabled):hover {
    background: #3a52d4;
    box-shadow: 0 8px 30px rgba(81,105,241,0.35);
}
body.term-training .ilyk-course-sidebar__btn:not(.ilyk-course-sidebar__btn--disabled):hover {
    background: #225a50;
    box-shadow: 0 8px 30px rgba(45,110,99,0.35);
}

/* Мета-рядки */
.ilyk-course-sidebar__rows {}
.ilyk-course-sidebar__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid #f5f5f5;
    gap: 12px;
}
.ilyk-course-sidebar__row:last-child {
    border-bottom: none;
    padding-bottom: 4px;
}

/* ── Блок поділитись в сайдбарі */
.ilyk-course-sidebar__share.ilyk-article-share {
    margin-top: 12px;
}
@media (max-width: 991px) {
    .ilyk-course-sidebar__share.ilyk-article-share {
        margin-top: 20px;
    }
}


.ilyk-course-sidebar__label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    flex-shrink: 0;
}
body.term-program .ilyk-course-sidebar__label i { color: #5169F1; }
body.term-training .ilyk-course-sidebar__label i { color: #2D6E63; }
.ilyk-course-sidebar__label i { color: #5169F1; }

.ilyk-course-sidebar__value {
    font-size: 14px;
    color: #333;
    font-weight: 400;
    text-align: right;
}

/* =====================================================
   МОБІЛЬНИЙ
   ===================================================== */
@media only screen and (max-width: 991px) {
    .tp-course-details-2-area .row {
        display: flex;
        flex-direction: column;
    }
    .tp-course-details-2-area .col-lg-8 {
        order: 2;
        width: 100%;
    }
    .tp-course-details-2-area .col-lg-4 {
        order: 1;
        width: 100%;
        align-self: auto;
        margin-top: 0;
        margin-bottom: 40px;
    }
    .ilyk-course-sidebar {
        position: static !important;
        margin-top: 0 !important;
    }
}

/* Tooltip для сертифікату */
.ilyk-tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.ilyk-certificate-value {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.ilyk-tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background-color: #1e1e2f;
    color: #ffffff !important; /* Примусово робимо текст білим */
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    padding: 10px 14px;
    border-radius: 8px;
    width: 240px;
    white-space: normal;
    text-align: left;
    z-index: 100;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Стрілочка знизу тултіпа */
.ilyk-tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 16px;
    border: 6px solid transparent;
    border-top-color: #1e1e2f;
}

.ilyk-tooltip-wrapper:hover .ilyk-tooltip-content {
    visibility: visible;
    opacity: 1;
}
/* =====================================================
   МОБІЛЬНИЙ — скидаємо sticky сайдбару
   ===================================================== */
@media only screen and (max-width: 991px) {
    .tp-course-details-2-area .row {
        display: flex;
        flex-direction: column;
    }
    .tp-course-details-2-area .col-lg-8 {
        order: 2;
        width: 100%;
        min-height: 0;
    }
    .tp-course-details-2-area .col-lg-4 {
        order: 1;
        width: 100%;
        align-self: auto;
        margin-top: 0;
        margin-bottom: 40px;
    }
    .ilyk-course-sidebar {
        position: static !important;
        margin-top: 0 !important;
        top: auto !important;
    }
}
/* =====================================================
   Плашки тегів у Hero (наживо / онлайн)
   ===================================================== */
.ilyk-course-tag-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 50px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 12px;
    margin-right: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.ilyk-course-tag-badge--live {
    background: #5169F1;
    color: #fff;
}
/* Fallback якщо slug не відомий */
.ilyk-course-tag-badge:not(.ilyk-course-tag-badge--live):not(.ilyk-course-tag-badge--online) {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
}

/* =====================================================
   [ILYK 06.12.2026] Ширший сайдбар курсу — лише ≥992px (на телефоні й вертикальному планшеті колонки й так одна під одною).
   Було 8/4 колонки (сайдбар 296px на 992–1199, 384px на ≥1200). Тепер 60/40 → 360px і 62,5/37,5 → ~435px.
   Заголовок у шапці курсу обмежений лівою колонкою (css/course-tabs.css: .col-sm-12 {max-width:65%}) — звужуємо в тій самій
   пропорції, щоб текст шапки не заходив під сайдбар, який наїжджає на неї (js/course-tabs.js, margin-top).
   Sticky не зачіпаємо: він на .ilyk-course-sidebar і від ширини колонки не залежить. Відкат — прибрати цей блок.
   ===================================================== */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .tp-course-details-2-area .row > .col-lg-8 { width: 60%; }
    .tp-course-details-2-area .row > .col-lg-4 { width: 40%; }
    .tp-breadcrumb__area .row > .col-sm-12 { max-width: 58.3%; }
}
@media (min-width: 1200px) {
    .tp-course-details-2-area .row > .col-lg-8 { width: 62.5%; }
    .tp-course-details-2-area .row > .col-lg-4 { width: 37.5%; }
    .tp-breadcrumb__area .row > .col-sm-12 { max-width: 60.8%; }
}
