/* Сторінка «Клінічна ротація з хірургії хребта імені Івана Олійника, 2026 р.»
   Макет: Figma «АУМФ», фрейм «3». Контентна ширина 1200px. */

.rotation_page {
    --rt-text: #222222;
    --rt-blue: #005daa;
    --rt-blue-dark: #004883;
    --rt-gold: #b4975a;
    --rt-gold-line: #d4bfa1;
    --rt-bg-cream: #fdfaf4;
    --rt-bg-blue: #f1f4f6;
    --rt-width: 1200px;

    /* header_page має margin-bottom: 30px; у макеті перший блок стикається з шапкою */
    margin-top: -30px;
    /* компенсуємо бічні відступи .container (7px), щоб контент був рівно 1200px, як у макеті */
    margin-left: -7px;
    margin-right: -7px;
    color: var(--rt-text);
    font-size: 16px;
    line-height: 1.5;
}

/* ---------- Шапка цієї сторінки: довгий заголовок в один рядок (макет: 30px, ширина 1003px) ---------- */
/* Шаблон header_page.tpl не змінюємо: сторінку розпізнаємо за наявністю .rotation_page в документі */
html:has(.rotation_page) .header_page-content {
    max-width: 1100px;
    padding: 0 15px;
}
html:has(.rotation_page) .header_page-content h1 {
    font-size: 30px;
    line-height: 1.4;
}
@media (max-width: 1199px) {
    /* на вузьких екранах заголовок природно переноситься */
    html:has(.rotation_page) .header_page-content h1 {
        font-size: 26px;
    }
}
@media (max-width: 575px) {
    html:has(.rotation_page) .header_page-content h1 {
        font-size: 22px;
    }
}

/* Плавний скрол до якоря (напр. «Читати більше» → біографія) */
html:has(.rotation_page) {
    scroll-behavior: smooth;
}

/* ---------- Каркас секції: фон на всю ширину екрана, контент 1200px ---------- */
.rotation_section {
    --rt-section-bg: #fff;
    position: relative;
    box-shadow: 0 0 0 100vmax var(--rt-section-bg);
    clip-path: inset(0 -100vmax);
    background-color: var(--rt-section-bg);
}
.rotation_section--cream { --rt-section-bg: var(--rt-bg-cream); }
.rotation_section--blue  { --rt-section-bg: var(--rt-bg-blue); }

.rotation_inner {
    width: 100%;
    max-width: var(--rt-width);
    margin: 0 auto;
    padding: 50px 0;
}

/* ---------- Типографіка ---------- */
.rotation_title {
    margin: 0;
    font-size: 30px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--rt-text);
}
.rotation_text {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--rt-text);
}
.rotation_text p {
    margin: 0;
}
.rotation_text p + p {
    /* у макеті між абзацами порожній рядок = висота рядка (24px) */
    margin-top: 24px;
}

/* ---------- Посилання «Читати більше ↓» ---------- */
.rotation_more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    color: var(--rt-blue);
    text-decoration: none;
    transition: color .3s ease;
}
.rotation_more svg {
    flex: none;
    transform: rotate(90deg);
    transition: transform .3s ease;
}
.rotation_more:hover {
    color: var(--rt-blue-dark);
}
.rotation_more:hover svg {
    transform: rotate(90deg) translateX(4px);
}

/* ========== Блок 1. Вступ ========== */
.rotation_intro__inner {
    display: grid;
    grid-template-columns: minmax(0, 750px) minmax(0, 406px);
    justify-content: space-between;
    align-items: center;
    gap: 30px 45px;
}
.rotation_intro__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
}
.rotation_intro__photo {
    position: relative;
    width: 100%;
    aspect-ratio: 406 / 417;
    margin: 0;
    overflow: hidden;
}
.rotation_intro__photo picture,
.rotation_intro__photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* Розчинення країв фото у фон секції (два градієнти з макета) */
.rotation_intro__photo::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(to bottom, var(--rt-bg-cream) 0%, rgba(253, 250, 244, 0) 17%, rgba(253, 250, 244, 0) 77%, var(--rt-bg-cream) 100%),
        linear-gradient(to right, var(--rt-bg-cream) 0%, rgba(253, 250, 244, 0) 22%, rgba(253, 250, 244, 0) 78%, var(--rt-bg-cream) 100%);
}
/* Підпис під портретом: «скляна» плашка із золотою акцентною планкою зверху */
.rotation_intro__caption {
    position: absolute;
    left: 50%;
    bottom: 24px;
    z-index: 1;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 32px);
    padding: 16px 24px 14px;
    font-size: 14px;
    font-weight: 600;
    font-style: italic;
    line-height: 1.4;
    letter-spacing: .2px;
    text-align: center;
    color: var(--rt-text);
    background: rgba(253, 250, 244, .85);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(180, 151, 90, .35);
    border-radius: 3px;
    box-shadow: 0 10px 28px rgba(34, 34, 34, .14);
}
.rotation_intro__caption::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -2px;
    transform: translateX(-50%);
    width: 56px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--rt-gold), var(--rt-gold-line));
}

/* ========== Блок 2. Розвиток спінальної хірургії в Україні ========== */
/* білі секції 2 і 3 йдуть підряд: відступ між ними — один (50px), тому нижній padding у блоку 2 нульовий */
.rotation_inner--flush-bottom {
    padding-bottom: 0;
}
.rotation_spine__inner {
    display: grid;
    grid-template-columns: 386px minmax(0, 750px);
    justify-content: space-between;
    align-items: center;
    gap: 30px 64px;
}
/* фото 370×464 + синя рамка зі зсувом 16px (як у макеті) */
.rotation_spine__photo {
    position: relative;
    width: 370px;
    max-width: 100%;
    margin: 0 16px 16px 0;
    aspect-ratio: 370 / 464;
}
.rotation_spine__photo::before {
    content: "";
    position: absolute;
    top: 16px;
    left: 16px;
    width: 100%;
    height: 100%;
    background: var(--rt-blue);
}
.rotation_spine__photo picture,
.rotation_spine__photo img {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.rotation_spine__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
}
/* заголовок + синя планка під ним */
.rotation_heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}
.rotation_heading::after {
    content: "";
    width: 84px;
    height: 4px;
    background: var(--rt-blue);
}
.rotation_text strong {
    font-weight: 600;
}

/* ========== Блок 3. Програма клінічного стажування ========== */
.rotation_title--md {
    font-size: 24px;
}
.rotation_program__inner {
    display: flex;
    flex-direction: column;
    gap: 30px;
}
.rotation_program__cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 380px));
    justify-content: space-between;
    align-items: stretch; /* усі картки однієї висоти — за найвищою */
    gap: 30px;
}
.rotation_card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    color: var(--rt-text);
    text-decoration: none;
    background: #fff;
    box-shadow: 0 4px 24px rgba(6, 12, 21, .1);
    transition: transform .3s ease, box-shadow .3s ease;
}
/* золота кнопка 50×50 із шевроном */
.rotation_card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 50px;
    height: 50px;
    margin-bottom: 8px; /* 20 (відступ) + 50 (кнопка) + 20 = заголовок з y=90 */
    color: #fff;
    background: linear-gradient(135deg, #b4975a 0%, #90753d 100%);
}
.rotation_card__icon img {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
}
.rotation_card__title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--rt-text);
}
.rotation_card--link:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 32px rgba(6, 12, 21, .16);
}

/* ---------- Адаптивність ---------- */
/* Ноутбук / планшет-ландшафт: поля по краях */
@media (max-width: 1239px) {
    .rotation_inner {
        padding-left: 15px;
        padding-right: 15px;
    }
}
/* Планшет-портрет: фото під текстом, по центру */
@media (max-width: 960px) {
    .rotation_intro__inner {
        grid-template-columns: minmax(0, 1fr);
    }
    .rotation_intro__photo {
        max-width: 406px;
        margin: 0 auto;
    }
    .rotation_spine__inner {
        grid-template-columns: minmax(0, 1fr);
    }
    .rotation_program__cards {
        grid-template-columns: minmax(0, 1fr);
        justify-content: stretch;
    }
    .rotation_spine__photo {
        width: 100%;
        max-width: 370px;
        margin-left: auto;
        margin-right: auto;
        /* зсув синьої рамки не повинен виходити за краї */
        left: -8px;
    }
}
/* Мобільні */
@media (max-width: 575px) {
    .rotation_inner {
        padding-top: 30px;
        padding-bottom: 30px;
    }
    .rotation_title {
        font-size: 24px;
    }
    .rotation_intro__text {
        gap: 20px;
    }
}
@media (max-width: 359px) {
    .rotation_title {
        font-size: 22px;
    }
}
