/* Страница «О компании».
   Секции: интро + видео, обращение гендиректора, корпоративная культура,
   история развития, отраслевые награды. Заголовки — общий .section__title. */

body {
    display: flex;
    flex-flow: column;
    min-height: 100dvh;
}

footer {
    margin-top: auto;
}

.about {
    display: flex;
    flex-flow: column;
    gap: 80px;
    padding: 48px 0 96px;
}

.about-history__list p {
    color: var(--primary-text-900);
}

/* ---------- интро + видео ---------- */
.about-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 648px;
    column-gap: 58px;
    row-gap: 36px; /* отступ заголовок → контент */
    align-items: start;
}

/* заголовок — на всю ширину над текстом и видео */
.about-intro__title {
    grid-column: 1 / -1;
}

.about-intro__text {
    color: var(--primary-text-1000);
    font-size: 14px;
    line-height: 135%;
    white-space: pre-line;
}

.about-intro__video {
    position: relative;
    aspect-ratio: 648 / 313;
    border-radius: 14px;
    overflow: hidden;
    background: var(--darken-gradient);
}

/* заглушка вместо видео */
.about-intro__video img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-intro__video::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
}

.about-intro__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: 62px;
    height: 62px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    transition: opacity var(--primary-transition-config);
}

.about-intro__play:hover {
    opacity: 0.85;
}

.about-intro__play svg {
    display: block;
    width: 62px;
    height: 62px;
}

/* ---------- обращение гендиректора ---------- */
.about-ceo__inner {
    background: #F4F4F4;
    border-radius: 14px;
    padding: 64px 56px;
    display: grid;
    grid-template-columns: 353px minmax(0, 1fr);
    column-gap: 92px;
    align-items: center;
}

/* правая колонка: заголовок над текстом */
.about-ceo__title {
    margin-bottom: 24px;
}

.about-ceo__photo {
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 353 / 411;
    background: #DDD;
}

.about-ceo__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-ceo__text {
    color: var(--primary-text-1000);
    font-size: 14px;
    line-height: 160%;
    white-space: pre-line;
}

.about-ceo__sign {
    display: block;
    width: 150px;
    height: auto;
    margin: 24px 0 0 auto;
}

/* ---------- корпоративная культура ---------- */
.about-culture__list {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.about-culture__card {
    background: #F4F4F4;
    border-radius: 14px;
    padding: 40px 24px;
    min-height: 460px;
    text-align: center;
    display: flex;
    flex-flow: column;
    align-items: center;
    justify-content: center;
}

.about-culture__icon {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 24px;
}

.about-culture__name {
    color: var(--primary-text-1000);
    font-weight: bold;
    font-size: 18px;
    line-height: 110%;
    margin-bottom: 12px;
}

.about-culture__desc {
    color: var(--primary-text-900);
    font-size: 14px;
    line-height: 150%;
}

/* ---------- история развития ---------- */
.about-history__body {
    margin-top: 40px;
    display: grid;
    grid-template-columns: 584px minmax(0, 1fr);
    column-gap: 80px;
    align-items: start;
}

.about-history__years {
    display: flex;
    flex-flow: column;
    align-items: flex-start;
}

/* «20» (статично) + колесо двузначных годов + стрелки в один ряд.
   Префикс и барабан — вплотную (читается как «2021»), отступ только до стрелок. */
.about-history__current {
    display: flex;
    align-items: flex-start;
}

.about-history__big-prefix {
    font-weight: bold;
    line-height: 1;
    color: var(--primary-color-1000);
    font-size: 200px;
}

/* окно колеса: видны активный + 2 следующих (все по 200px) */
.about-history__reel {
    overflow: hidden;
    height: 648px;
}

.about-history__reel-track {
    display: flex;
    flex-flow: column;
    gap: 24px;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* год в колесе: все одного размера (200px), активный отличается только цветом */
.about-history__reel-item {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    height: 1em;
    line-height: 1;
    font-family: inherit;
    font-weight: bold;
    font-size: 200px;
    color: #ECECEC;
    cursor: pointer;
    transition: color 0.4s ease;
}

.about-history__reel-item:hover {
    color: var(--primary-color-1000);
}

.about-history__reel-item--active {
    color: var(--primary-color-1000);
    cursor: default;
}

@media (prefers-reduced-motion: reduce) {
    .about-history__reel-track,
    .about-history__reel-item {
        transition: none;
    }

    .about-history__panels,
    .about-history__panels-track {
        transition: none;
    }
}

.about-history__nav {
    display: flex;
    flex-flow: column;
    gap: 12px;
    margin-left: 32px;
    align-self: flex-start;
    height: 200px;            /* высота одной цифры (1em при 200px) */
    justify-content: center;  /* стрелки по центру активной даты */
    transform: translateY(-10px); /* оптическая компенсация: цифра «сидит» выше середины строки */
}

.about-history__arrow {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 1px solid var(--primary-border-900);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--primary-transition-config);
    transition-property: border-color, color;
    color: var(--primary-text-900);
}

.about-history__arrow:hover {
    border-color: var(--primary-color-900);
    color: var(--primary-color-900);
}

.about-history__arrow svg {
    width: 24px;
    height: 24px;
}

/* окно списка: вертикальный reel — видна только активная панель,
   высота подгоняется под активный список (анимируется) */
.about-history__panels {
    overflow: hidden;
    transition: height 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.about-history__panels-track {
    position: relative;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.about-history__list {
    display: flex;
    flex-flow: column;
    gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.about-history__item {
    position: relative;
    padding-left: 22px;
    color: var(--primary-text-1000);
    font-size: 16px;
    line-height: 145%;
}

.about-history__item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color-1000);
}

.about-history__item--empty {
    color: var(--primary-text-900);
}

.about-history__item--empty::before {
    background: #CFCFCF;
}

/* ---------- отраслевые награды ---------- */
.about-awards__inner {
    background: #F4F4F4;
    border-radius: 14px;
    padding: 40px 64px 56px;
    margin-top: 0;
}

.about-awards__title {
    margin-bottom: 40px;
}

/* слайды-награды — карусель та же, что на главной (style/carousel),
   но со своими размерами: активный 277×391, неактивные ≈233×316 (scale 0.84). */
.about-awards .carousel__slide {
    position: relative;
    width: 277px;
    transform: scale(0.84);
}

.about-awards .carousel__slide.is-active {
    transform: scale(1);
}

.about-awards .carousel__track {
    padding-inline: calc(50% - 138.5px); /* половина 277 */
}

.about-awards .carousel__slide img,
.about-awards .award-slide {
    display: block;
    width: 100%;
    height: 391px;
    border-radius: 10px;
    background: #DDDDDD;
    object-fit: cover;
}

/* тултип с названием награды — по наведению на слайд */
.about-awards__tip {
    position: absolute;
    left: 50%;
    top: 38%;
    transform: translate(-50%, -6px);
    z-index: 5;
    padding: 12px 16px;
    border-radius: 10px;
    background: #3A3A3A;
    color: #fff;
    font-size: 14px;
    line-height: 1.2;
    width: max-content;
    max-width: 240px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: var(--primary-transition-config);
    transition-property: opacity, transform;
}

.about-awards__tip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #3A3A3A;
}

/* тултип по ховеру — только десктоп (≥769). На ≤768 подпись показывается
   по тапу (см. media ≤768 + scripts/about), ховер-сдвиг там не нужен. */
@media screen and (min-width: 769px) {
    .about-awards .carousel__slide.is-active:hover .about-awards__tip {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* ===================== адаптив ===================== */
/* ≤1439: интро складывается — видео сверху на всю ширину, текст ниже */
@media screen and (max-width: 1439px) {
    .about-ceo {
        max-width: 100%;
    }
    .about-intro {
        display: flex;
        flex-flow: column;
        align-items: stretch; /* иначе видео (пустой блок) схлопывается в ширину 0 */
        gap: 32px;
    }

    .about-intro__video {
        order: -1;
        width: 100%;
        aspect-ratio: 16 / 7;
    }
}

/* 1439–1024 */
@media screen and (max-width: 1439px) and (min-width: 1024px) {
    .about-culture__card {
        justify-content: start;
        min-height: 350px;
    }

    /* блок директора: картинка 292×339, отступы 40 (фото↔текст) и 32 (заголовок↔текст) */
    .about-ceo__inner {
        grid-template-columns: 292px minmax(0, 1fr);
        column-gap: 40px;
    }

    .about-ceo__photo {
        aspect-ratio: 292 / 339;
    }

    .about-ceo__title {
        margin-bottom: 32px;
    }

    /* история: цифры 160px, отступ слайдер↔текст 32px */
    .about-history__body {
        grid-template-columns: max-content minmax(0, 1fr);
        column-gap: 32px;
    }

    .about-history__big-prefix,
    .about-history__reel-item {
        font-size: 160px;
    }

    .about-history__reel {
        height: 528px;
    }

    /* стрелки — по центру одной цифры (160px) */
    .about-history__nav {
        height: 160px;
        transform: translateY(-8px);
    }
}

@media screen and (max-width: 1439px){
    .about-awards__inner {
        background: none;
        padding: 0 !important;
    }
}

@media screen and (max-width: 1023px) {
    .about {
        gap: 56px;
    }

    .about-culture__card {
        min-height: auto;
    }

    /* блок директора складывается: фото сверху по центру, под ним заголовок, затем текст */
    .about-ceo__inner {
        grid-template-columns: 1fr;
        row-gap: 24px;
        padding: 40px 32px;
    }

    .about-ceo__photo {
        width: 280px;
        margin: 0 auto;
    }

    .about-culture__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .about-history__body {
        grid-template-columns: 1fr;
        row-gap: 40px;
    }

    /* показываем только активный год — окно высотой в одну цифру (200px) */
    .about-history__reel {
        height: 200px;
    }
}

/* 1023–768: карточки культуры — горизонтальные (иконка слева, текст справа),
   разложены в 2 колонки */
@media screen and (max-width: 1023px) and (min-width: 768px) {
    .about-culture__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .about-culture__card {
        flex-flow: row;
        align-items: flex-start;
        justify-content: flex-start;
        text-align: left;
        gap: 20px;
        padding: 28px 24px;
    }

    .about-culture__icon {
        flex: 0 0 auto;
        width: 96px;
        height: 96px;
        margin-bottom: 0;
    }

    .about-culture__body {
        flex: 1;
    }

    .about-culture__name {
        margin-bottom: 8px;
    }
}

@media screen and (max-width: 767px) {
    .about-ceo {
        padding: 0;
    }
    .about-ceo__inner {
        border-radius: 0;
    }
    .about {
        gap: 40px;
        padding: 32px 0 64px;
    }

    .about-intro__video {
        aspect-ratio: 16 / 9;
    }

    .about-ceo__inner {
        padding: 24px 16px;
    }

    .about-ceo__photo {
        width: 240px;
    }

    .about-culture__list {
        grid-template-columns: 1fr;
    }

    /* компактнее карточки на мобайле */
    .about-culture__card {
        padding: 28px 20px;
    }

    .about-culture__icon {
        width: 88px;
        height: 88px;
        margin-bottom: 16px;
    }

    .about-history__big-prefix {
        font-size: 120px;
    }

    /* только активный год — окно высотой в одну цифру (120px) */
    .about-history__reel {
        height: 120px;
    }

    .about-history__reel-item {
        font-size: 120px;
    }

    .about-history__list {
        gap: 12px;
    }

    .about-history__nav {
        height: 120px;
        transform: translateY(-6px);
    }

    .about-history__arrow {
        width: 44px;
        height: 44px;
    }

    .about-awards__inner {
        padding: 24px 16px 32px;
    }
}

/* ============ адаптация под CMS (контент приходит из БД как HTML) ============ */
.about-intro__text,
.about-ceo__text {
    white-space: normal;
}

/* реальное видео в интро */
.about-intro__video video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-intro__video.is-playing::after,
.about-intro__video.is-playing .about-intro__play {
    display: none;
}

/* пункты истории приходят как <p> внутри .about-history__list */
.about-history__list p {
    position: relative;
    margin: 0;
    padding-left: 22px;
    color: var(--primary-text-900);
    font-size: 16px;
    line-height: 145%;
}

.about-history__list p::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color-1000);
}

.about-culture__desc p {
    margin: 0;
}

/* ≤767: текст пунктов истории (перебивает CMS-правило выше) */
@media screen and (max-width: 767px) {
    .about-history__list p,
    .about-history__item {
        font-size: 16px;
    }
}

/* ≤768: награды — слайд 214×303, наименование статичной подписью под изображением */
@media screen and (max-width: 768px) {
    .about-history__list {
        gap: 12px !important;
        font-size: 14px;
    }
    .about-awards .carousel__slide {
        width: 214px;
    }

    /* слайды разной высоты (открытая подпись) не растягивают соседей */
    .about-awards .carousel__track {
        padding-inline: calc(50% - 107px); /* половина 214 */
        align-items: flex-start;
    }

    /* вернуть стрелки навигации (глобально карусель прячет их на мобайле) */
    .about-awards .carousel__controls {
        display: flex;
    }

    .about-awards .carousel__slide img,
    .about-awards .award-slide {
        height: 303px;
    }

    /* наименование награды — статичная подпись под картинкой (видна всегда) */
    .about-awards__tip {
        position: static;
        transform: none;
        opacity: 1;
        display: block;
        margin-top: 12px;
        margin-inline: auto;
        padding: 0;
        width: fit-content;
        max-width: 100%;
        background: none;
        color: var(--primary-text-1000);
        font-weight: bold;
        font-size: 14px;
        line-height: 1.3;
        text-align: center;
        white-space: normal;
        pointer-events: auto;
        transition: none;
    }

    .about-awards__tip::after {
        display: none;
    }
}
