/* ==========================================================================
   SINGLE DOCTOR PAGE
   Template: single-employees_id.php
   Dependency: base.css (variables)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.single-doctor-hero {
    max-width: var(--container-width, 1400px);
    margin: 48px auto 56px;
    background: #FEFADF;
    border-radius: 30px;
    border: 3px solid var(--color-cta-orange, #FF6633);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.single-doctor-hero__container {
    /* Fluid hero (clamp) between 768px and 1536px viewport — no breakpoint jumps.
       Mobile (≤767.98px) is overridden separately in the SM media query. */
    padding: clamp(24px, calc(12px + 1.56vw), 36px) clamp(28px, calc(-59px + 11.33vw), 115px);
    display: grid;
    grid-template-columns: clamp(200px, calc(60px + 18.23vw), 340px) 1fr clamp(180px, calc(140px + 5.21vw), 220px);
    gap: clamp(20px, calc(8px + 1.56vw), 32px);
    align-items: start;
}

/* Photo */
.single-doctor-hero__photo-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(180deg, #D4EDDA 0%, #C3E6CB 50%, #B8DFC2 100%);
    border: 3px solid var(--color-cta-orange, #FF6633);
    flex-shrink: 0;
}

.single-doctor-hero__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.single-doctor-hero__photo--placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Info */
.single-doctor-hero__info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 8px;
}

.single-doctor-hero__name {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(25, 95, 64, 0.15);
}

.single-doctor-hero__surname {
    font-size: clamp(24px, calc(16px + 1.04vw), 32px);
    font-weight: 800;
    text-transform: uppercase;
    color: var(--color-primary-green, #195F40);
    letter-spacing: 0.5px;
    line-height: 1.15;
}

.single-doctor-hero__firstname {
    font-size: clamp(24px, calc(16px + 1.04vw), 32px);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-primary-green, #195F40);
    line-height: 1.2;
}

/* Specialties */
.single-doctor-hero__specialties {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.single-doctor-hero__specialty {
    color: var(--color-cta-orange, #FF6633);
    font-size: clamp(16px, calc(14px + 0.26vw), 18px);
    font-weight: 600;
    line-height: 1.4;
}

/* Meta: experience + category */
.single-doctor-hero__meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.single-doctor-hero__experience,
.single-doctor-hero__category {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-primary-green, #195F40);
}

/* Clinic */
.single-doctor-hero__clinic {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-primary-green, #195F40);
    line-height: 1.5;
    margin-top: 4px;
}

.single-doctor-hero__clinic strong {
    color: var(--color-primary-green, #195F40);
    font-weight: 700;
    font-size: 18px;
}

/* Right Sidebar */
.single-doctor-hero__sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    align-self: start;
}

/* CTA Actions */
.single-doctor-hero__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.single-doctor-hero__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(10px, calc(8px + 0.26vw), 12px) clamp(16px, 2.08vw, 32px);
    border-radius: 25px;
    font-size: clamp(15px, calc(8px + 0.91vw), 22px);
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    line-height: 1.3;
}

.single-doctor-hero__btn--appointment {
    background-color: var(--color-cta-orange, #FF6633);
    color: #fff;
}

.single-doctor-hero__btn--appointment:hover {
    background-color: #e55a2a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 51, 0.3);
}

.single-doctor-hero__btn--reviews {
    background-color: var(--color-cta-orange, #FF6633);
    color: #fff;
}

.single-doctor-hero__btn--reviews:hover {
    background-color: var(--color-primary-green, #195F40);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 95, 64, 0.3);
}

/* QR Code */
.single-doctor-hero__qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: #fff;
    border-radius: 20px;
    border: 3px solid var(--color-cta-orange, #FF6633);
}

.single-doctor-hero__qr-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.single-doctor-hero__qr-logo-img {
    height: 28px;
    width: auto;
    object-fit: contain;
}

.single-doctor-hero__qr-img {
    width: 100%;
    max-width: clamp(100px, calc(20px + 10.42vw), 180px);
    height: auto;
    object-fit: contain;
}


/* PD Disclaimer (152-FZ §6) */
.single-doctor-hero__pd-disclaimer {
    padding: 0 var(--container-padding, 115px);
    margin: 16px 50px 32px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(25, 95, 64, 0.6);
    line-height: 1.5;
    text-align: center;
}

.single-doctor-hero__pd-disclaimer a {
    color: rgba(25, 95, 64, 0.55);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.single-doctor-hero__pd-disclaimer a:hover {
    color: var(--color-primary-green, #195F40);
}

/* ==========================================================================
   EDUCATION TIMELINE (inside hero card)
   ========================================================================== */
.education-section__container {
    padding: 32px var(--container-padding, 115px) 40px;
    border-top: 2px solid rgba(25, 95, 64, 0.12);
    margin: 0 50px;
}

.education-section__title {
    text-align: center;
    font-size: 32px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--color-cta-orange, #FF6633);
    margin: 0 0 48px;
    letter-spacing: 1px;
}

/* Timeline container */
.education-timeline {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

/* Vertical line — thin, matching original */
.education-timeline__line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #ddd;
    transform: translateX(-50%);
    overflow: hidden;
}

.education-timeline__line-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--color-cta-orange, #FF6633) 0%, #B4CD8E 100%);
    transform: scaleY(0);
    transform-origin: top;
    will-change: transform;
}

/* Timeline item — tighter grid with smaller center column */
.education-timeline__item {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 44px 1fr;
    gap: 0;
    align-items: center;
    margin-bottom: 36px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.education-timeline__item:last-child {
    margin-bottom: 0;
}

.education-timeline__item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Left items: card | marker | year — natural DOM flow */
.education-timeline__item--left .education-timeline__card {
    text-align: left;
    margin-right: 16px;
}

.education-timeline__item--left .education-timeline__year {
    text-align: left;
    padding-left: 10px;
}

/* Right items: year | marker | card — natural DOM flow */
.education-timeline__item--right .education-timeline__year {
    text-align: right;
    padding-right: 10px;
}

.education-timeline__item--right .education-timeline__card {
    text-align: left;
    margin-left: 16px;
}

/* Marker (center circle) — slightly smaller, matching original */
.education-timeline__marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-cta-orange, #FF6633);
    color: #fff;
    margin: 0 auto;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(255, 102, 51, 0.3);
}

.education-timeline__icon {
    width: 20px;
    height: 20px;
}

/* Year label — compact, close to marker */
.education-timeline__year {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-cta-orange, #FF6633);
    white-space: nowrap;
}

/* Card — matching original styling */
.education-timeline__card {
    background: #fff;
    border: 2px solid var(--color-cta-orange, #FF6633);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
}

.education-timeline__text {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-primary-green, #195F40);
    line-height: 1.6;
    margin: 0;
}

/* Card arrow (pointer) — left item → right arrow, reaching toward marker */
.education-timeline__item--left .education-timeline__card::after {
    content: '';
    position: absolute;
    right: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 14px solid var(--color-cta-orange, #FF6633);
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
}

.education-timeline__item--left .education-timeline__card::before {
    content: '';
    position: absolute;
    right: -11px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid #fff;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    z-index: 1;
}

/* Card arrow — right item → left arrow */
.education-timeline__item--right .education-timeline__card::after {
    content: '';
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-right: 14px solid var(--color-cta-orange, #FF6633);
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
}

.education-timeline__item--right .education-timeline__card::before {
    content: '';
    position: absolute;
    left: -11px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-right: 12px solid #fff;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    z-index: 1;
}


/* ==========================================================================
   REVIEWS SECTION (static cards + "Show More")
   ========================================================================== */
.doctor-reviews {
    padding: 32px var(--container-padding, 115px) 40px;
    margin: 24px 50px 32px;
    background: #faf6e0;
    border-radius: 20px;
}

.doctor-reviews__header {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.doctor-reviews__title {
    font-size: 28px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--color-primary-green, #195F40);
    margin: 0;
}

.doctor-reviews__count {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-primary-green, #195F40);
    opacity: 0.6;
}

.doctor-reviews__empty {
    text-align: center;
    font-size: 16px;
    color: #888;
    padding: 40px 0;
}

/* Grid: reuse .reviews-grid from reviews.css (CSS columns masonry) */
.doctor-reviews__grid {
    columns: 2;
    column-gap: 28px;
}

/* Hidden cards — initially not visible */
.doctor-reviews__grid .review-card.is-hidden {
    display: none;
}

/* Stagger reveal animation for newly shown cards */
.doctor-reviews__grid .review-card.is-revealing {
    animation: doctorReviewFadeIn 0.4s cubic-bezier(0.23, 1, 0.32, 1) both;
}

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

/* "Show More" button */
.doctor-reviews__more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.doctor-reviews__show-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    background: var(--color-cta-orange, #FF6633);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.15s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 16px rgba(255, 102, 51, 0.3);
}

.doctor-reviews__show-more:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 102, 51, 0.4);
}

.doctor-reviews__show-more:active {
    transform: scale(0.96);
}

.doctor-reviews__show-more svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.doctor-reviews__show-more:hover svg {
    transform: translateY(2px);
}



/* ==========================================================================
   RESPONSIVE — XL/LG hero sizing is fluid (clamp) in the base rules above.
   Only non-hero adjustments remain here.
   ========================================================================== */
@media (max-width: 1279.98px) {
    .education-section__title,
    .doctor-reviews__title {
        font-size: 28px;
    }
}


/* ==========================================================================
   RESPONSIVE — MD (≤1024px)
   ========================================================================== */
@media (max-width: 1023.98px) {
    .single-doctor-hero {
        padding: 32px 0 40px;
    }

    /* Hero sizing (grid, photo, fonts, buttons, QR) is fluid in base rules. */

    /* Timeline: single column — marker left, year+card right */
    .education-timeline__item {
        position: relative;
        grid-template-columns: 48px 1fr;
        grid-template-rows: auto auto;
        gap: 0 16px;
        filter: drop-shadow(4px 4px 12px rgba(0, 0, 0, 0.1));
    }

    .education-timeline__line {
        left: 24px;
    }

    /* LEFT items: DOM = card(1) marker(2) year(3) */
    .education-timeline__item--left .education-timeline__marker {
        grid-column: 1;
        grid-row: 1 / 3;
        align-self: center;
        padding-top: 0;
    }

    .education-timeline__item--left .education-timeline__year {
        grid-column: 2;
        grid-row: 1;
        order: -1;
        text-align: left;
        background: #fff;
        border: 2px solid var(--color-cta-orange, #FF6633);
        border-bottom: none;
        border-radius: 16px 16px 0 0;
        padding: 12px 16px 4px;
        font-size: 16px;
        font-weight: 700;
        color: var(--color-cta-orange, #FF6633);
        line-height: 1.2;
        margin: 0;
    }

    .education-timeline__item--left .education-timeline__card {
        grid-column: 2;
        grid-row: 2;
        margin: 0;
        border-top: none;
        border-radius: 0 0 16px 16px;
        padding: 4px 16px 14px;
        box-shadow: none;
    }

    /* RIGHT items: DOM = year(1) marker(2) card(3) */
    .education-timeline__item--right .education-timeline__marker {
        grid-column: 1;
        grid-row: 1 / 3;
        align-self: center;
        padding-top: 0;
    }

    .education-timeline__item--right .education-timeline__year {
        grid-column: 2;
        grid-row: 1;
        text-align: left;
        background: #fff;
        border: 2px solid var(--color-cta-orange, #FF6633);
        border-bottom: none;
        border-radius: 16px 16px 0 0;
        padding: 12px 16px 4px;
        font-size: 16px;
        font-weight: 700;
        color: var(--color-cta-orange, #FF6633);
        line-height: 1.2;
        margin: 0;
    }

    .education-timeline__item--right .education-timeline__card {
        grid-column: 2;
        grid-row: 2;
        margin: 0;
        border-top: none;
        border-radius: 0 0 16px 16px;
        padding: 4px 16px 14px;
        box-shadow: none;
    }

    /* Card arrows disabled (moved to .item::after/::before below) */
    .education-timeline__card::after,
    .education-timeline__card::before {
        display: none;
    }

    /* Уголок-стрелка: col1(48px) + gap(16px) + card border(2px) = 66px */
    .education-timeline__item::after {
        content: '';
        position: absolute;
        left: 52px;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-right: 14px solid var(--color-cta-orange, #FF6633);
        border-top: 12px solid transparent;
        border-bottom: 12px solid transparent;
    }

    .education-timeline__item::before {
        content: '';
        position: absolute;
        left: 55px;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-right: 12px solid #fff;
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
        z-index: 2;
    }

    .education-section__container {
        padding: 32px 28px 40px;
    }

    .doctor-reviews {
        padding: 24px 32px 32px;
        margin: 0 16px;
    }

    .doctor-reviews__grid {
        columns: 1;
    }
}


/* ==========================================================================
   RESPONSIVE — SM (≤768px, Mobile)
   ========================================================================== */
@media (max-width: 767.98px) {
    .single-doctor-hero {
        padding: 20px 0 32px;
    }

    .single-doctor-hero__container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
        border-radius: 20px;
        margin: 0 16px;
    }

    .single-doctor-hero__photo-wrap {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
        aspect-ratio: 1 / 1;
    }

    .single-doctor-hero__info {
        text-align: center;
        align-items: center;
    }

    .single-doctor-hero__name {
        align-items: center;
    }

    .single-doctor-hero__surname {
        font-size: 22px;
    }

    .single-doctor-hero__firstname {
        font-size: 22px;
    }

    .single-doctor-hero__specialties {
        align-items: center;
    }

    .single-doctor-hero__specialty {
        font-size: 15px;
    }

    .single-doctor-hero__meta {
        align-items: center;
    }

    .single-doctor-hero__clinic {
        justify-content: center;
        text-align: center;
    }

    .single-doctor-hero__actions {
        justify-content: center;
        flex-wrap: wrap;
        max-width: 280px;
        margin: 0 auto;
    }

    .single-doctor-hero__btn {
        font-size: 14px;
        padding: 10px 24px;
        width: 100%;
    }

    .single-doctor-hero__qr {
        flex-direction: row;
        max-width: 280px;
        margin: 0 auto;
    }

    .single-doctor-hero__qr-img {
        width: 100px;
        height: 100px;
    }

    /* Education */
    .education-section__container {
        padding: 24px 16px 32px;
    }

    .education-section__container {
        padding: 0 16px;
    }

    .education-section__title {
        font-size: 24px;
        margin-bottom: 32px;
    }

    .education-timeline__item {
        position: relative;
        gap: 0 16px;
        margin-bottom: 28px;
        filter: drop-shadow(4px 4px 12px rgba(0, 0, 0, 0.1));
    }

    /* Маркер — по центру высоты карточки (override MD: align-self: start) */
    .education-timeline__item--left .education-timeline__marker,
    .education-timeline__item--right .education-timeline__marker {
        align-self: center;
        padding-top: 0;
    }

    .education-timeline__marker {
        width: 40px;
        height: 40px;
    }

    .education-timeline__icon {
        width: 20px;
        height: 20px;
    }

    /* Год — визуально верхняя часть карточки (год+текст = единый блок) */
    .education-timeline__item--left .education-timeline__year,
    .education-timeline__item--right .education-timeline__year {
        text-align: left;
        background: #fff;
        border: 2px solid var(--color-cta-orange, #FF6633);
        border-bottom: none;
        border-radius: 16px 16px 0 0;
        padding: 12px 16px 4px;
        font-size: 16px;
        font-weight: 700;
        color: var(--color-cta-orange, #FF6633);
        line-height: 1.2;
        margin: 0;
    }

    /* Карточка — нижняя часть единого блока, тень перенесена на родителя */
    .education-timeline__card {
        border-top: none;
        border-radius: 0 0 16px 16px;
        padding: 4px 16px 14px;
        box-shadow: none;
    }

    .education-timeline__text {
        font-size: 14px;
    }

    /* Уголок-стрелка слева — на родителе, по центру всего блока year+card.
       Геометрия и цвета — копия десктопного --right .card::after/::before (стр. 390–415). */
    .education-timeline__item::after {
        content: '';
        position: absolute;
        /* col1(48px) + gap(16px) + card border(2px) - arrow width(14px) = 52px */
        left: 52px;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-right: 14px solid var(--color-cta-orange, #FF6633);
        border-top: 12px solid transparent;
        border-bottom: 12px solid transparent;
    }

    .education-timeline__item::before {
        content: '';
        position: absolute;
        /* col1(48px) + gap(16px) + card border(2px) - inner arrow(11px) = 55px */
        left: 55px;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-right: 12px solid #fff;
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
        z-index: 2;
    }

    /* Reviews */
    .doctor-reviews {
        padding: 20px 12px 24px;
        margin: 16px 8px 20px;
    }

    .doctor-reviews__title {
        font-size: 20px;
    }

    .doctor-reviews__count {
        font-size: 13px;
    }

    .doctor-reviews__grid {
        columns: 1;
    }

    .doctor-reviews__show-more {
        font-size: 14px;
        padding: 12px 28px;
    }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .education-timeline__item {
        transition: none;
        opacity: 1;
        transform: none;
    }

    .education-timeline__line-fill {
        will-change: auto;
    }

    .doctor-reviews__grid .review-card.is-revealing {
        animation: none;
    }
}