/* ==========================================================================
   Styles for Single Article Page
   ========================================================================== */
/* --- ОСНОВНІ НАЛАШТУВАННЯ --- */
main {
    width: 100%;
    padding: 20px 0px;
    /* Градієнтний фон зверху вниз: від світло-сірого до білого */
    background: linear-gradient(to bottom, #ffffff 0%, #f8f6f3 100%);
    /* Невеликий бордер внизу */
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
}

/* Main container for the article content */
.article-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 20px;
    background-color: #ffffff;
    border-radius: 0px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.07);
}

/* Main image of the article */
.article-main-image {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin-bottom: 25px;
    object-fit: cover;
}

/* Styling for the text content */
.article-body {
    font-size: 1.0em;
    line-height: 1.7;
    color: var(--secondary-text-color);
}

.article-body p {
    margin-bottom: 1.3em;
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.2em;
    padding-left: 25px;
}

.article-body li {
    margin-bottom: 0.5em;
}

.article-body a {
    text-decoration: underline;
    font-weight: 500;
}

/* Call-to-action block at the end of the article */
.article-cta {
    background-color: #f8f8f8;
    border: 1px solid #b9b9b9;
    border-radius: 0px;
    padding: 25px;
    margin-top: 40px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.article-cta-title {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-text-color);
    margin-top: 0;
    margin-bottom: 16px;
}

.article-cta-button {
    display: inline-block;
    padding: 0px 0px;
    background-color: var(--link-color);
    color: #fff !important;
    /* Ensure text is white */
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.article-cta-button:hover {
    background-color: #2d1efd;
    transform: translateY(-2px);
    text-decoration: none;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .article-header h1 {
        font-size: 1.8em;
    }

    .article-body {
        font-size: 0.9em;
    }
}



/* === СТИЛІ ДЛЯ ГАЛЕРЕЇ В СТАТТІ === */
/* Контейнер для зображень, що розташовані в ряд */
.image-gallery-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    /* Відстань між зображеннями */
    margin: 25px 25px;
    /* Вертикальні відступи від тексту */
}

/* Обгортка для кожного зображення */
.gallery-image-wrapper {
    flex: 1;
    /* Кожне зображення займає однакову ширину */
    min-width: 0;
}

/* Стиль самого зображення */
.gallery-image {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    border: 1px solid #adadad;
    border-radius: 16px;
    display: block;
}

/* Адаптивність для мобільних пристроїв */
@media (max-width: 600px) {
    .image-gallery-row {
        flex-direction: column;
        /* Розташовуємо зображення одне під одним */
    }
}

/* --- Контейнер для 1 зображення --- */
.container-image-single {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.single-image {
    max-height: 640px;
    max-width: 100%;
    border: 1px solid #adadad;
    border-radius: 16px;
    object-fit: contain;
}



/* CSS-стиль для "картки-підпису" з ефектом глибини.*/
/* --- Основний контейнер (тепер як картка) --- */
.specialist-signature-block {
    font-family: 'Montserrat', sans-serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 800px;
    /* Задаємо відступ зверху, щоб було місце для фото */
    margin: 60px auto 30px auto;
    padding: 20px 30px;
    gap: 30px;
    /* Створюємо ефект картки */
    background-color: #ffffff;
    border-radius: 0px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    border-top: 3px solid transparent;
    /* М'який градієнт для преміального вигляду */
    border-image: linear-gradient(to right, #e0c39a, #c8a77e) 1;
    position: relative;
}

/* --- Контейнер для сертифіката (ліва частина) --- */
.certificate-container {
    flex: 1;
    max-width: 250px;
}

.certificate-img {
    width: 100%;
    height: auto;
    max-height: 150px;
    object-fit: contain;
    border-radius: 0px;
    /* Ефект підняття при наведенні */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.certificate-img:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* --- Блок з інформацією про спеціаліста (права частина) --- */
.specialist-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Оболонка для фото для кращого позиціонування */
.specialist-photo-wrapper {
    position: absolute;
    top: -50px;
    /* Висуваємо фото вгору */
    right: 30px;
}

.specialist-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    /* Градієнтна рамка, що пасує до рамки картки */
    border: 5px solid;
    border-image: linear-gradient(to bottom, #e0c39a, #c8a77e) 1;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.specialist-description {
    text-align: right;
    /* Збільшуємо відступ, щоб текст не залазив під фото */
    margin-top: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #333;
    line-height: 1.5;
}

/* --- Адаптивність для мобільних пристроїв (ОНОВЛЕНО) --- */
@media (max-width: 768px) {
    .specialist-signature-block {
        padding: 20px;
        padding-top: 60px;
        /* Місце для фото зверху */
        margin-top: 80px;
        /* Збільшено відступ зверху для мобільних */
        gap: 0;
        /* Прибираємо flex-gap */
        /* Важливо: задаємо мінімальну висоту, щоб елементи вмістилися */
        min-height: 180px;
        display: block;
        /* Змінюємо flex на block для простого позиціонування */
    }

    .specialist-info {
        display: block;
        position: static;
    }

    .specialist-photo-wrapper {
        top: -55px;
        /* Регулюємо положення фото */
        right: 20px;
        /* Відступ від краю картки */
        transform: none;
    }

    .specialist-photo {
        width: 110px;
        height: 110px;
    }

    .specialist-description {
        text-align: right;
        margin-top: 0;
        /* Скидаємо відступ */
        font-size: 0.9rem;
        /* Залишаємо місце зліва для сертифікату */
        padding-left: 45%;
    }

    .certificate-container {
        /* Позиціонуємо сертифікат абсолютно */
        position: absolute;
        bottom: 20px;
        /* Відступ від низу картки */
        left: 20px;
        /* Відступ від лівого краю картки */
        max-width: 40%;
        /* Обмежуємо ширину */
        margin: 0;
        order: 0;
    }
}