/* ============================================================
   ABM Partner — СЕКЦИЯ «О КОМПАНИИ»
   Общий блок «раздел внутри компании» (.split) лежит в layout.css.
   Здесь: шапка раздела, блок «О компании», команда и карточка
   руководителя в модальном окне.
   ============================================================ */

.about {
    background:
        radial-gradient(60% 34% at 12% 6%, rgba(234, 179, 101, 0.14), transparent 65%),
        radial-gradient(46% 30% at 95% 18%, rgba(176, 125, 58, 0.10), transparent 60%),
        var(--color-bg);
    padding-block: calc(var(--pad-section) * 1.3);
}

/* ===== Сетка «медиа / текст» ===== */
.about__inner {
    display: grid;
    grid-template-columns: var(--cols-feature);
    grid-template-areas:
        "media head"
        "media body";
    align-items: start;
    row-gap: var(--gap-section-title-tight);
    column-gap: var(--gap-columns);
}

.about__head {
    grid-area: head;
    min-width: 0;
}

.about__head .section__pretitle {
    margin-bottom: var(--gap-pretitle);
}

.about__head .section__title {
    margin-bottom: 0;
}

.about__media {
    grid-area: media;
    min-width: 0;
    position: relative;
    padding-bottom: clamp(3.2rem, 6vw, 4.2rem);
}

.about__body {
    grid-area: body;
    min-width: 0;
}

/* Абзацы на главной лежат в div-обёртках (HTML из БД), поэтому отбивку
   между ними даёт сам блок, как :where(p) в base.css. */
.about__body .split__content > div:not(:last-child) {
    margin-block-end: var(--gap-text);
}

.about__lead strong {
    color: var(--color-ink);
}

/* ===== Документы поверх фото ===== */
.about__docs {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    gap: 0.6rem;
    padding: 2.4rem 1rem 1rem;
}

.about__doc {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding: 0.65rem 0.9rem;
    font-size: var(--fs-base);
}

.about__doc span {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.1rem;
}

.about__doc small {
    display: none;
    font-size: var(--fs-xs);
    font-weight: 500;
    letter-spacing: 0.04em;
    opacity: 0.75;
}

/* ============================================================
   КОМАНДА
   ============================================================ */
.team {
    margin-top: clamp(4rem, 9vw, 7.5rem);
}

.team__heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem 3rem;
    margin-bottom: clamp(2.5rem, 5vw, 3.75rem);
}

.team__heading .section__title {
    margin-bottom: 0;
}

.team__lead {
    max-width: 36rem;
    margin: 0 0 0.35rem;
    color: var(--color-ink-soft);
    font-size: var(--fs-base);
    line-height: var(--lh-lg);
}

.team__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(1.25rem, 2.5vw, 2rem);
}

.team__card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-line-faint);
    border-radius: var(--radius-xl);
    overflow: hidden;
    cursor: pointer;
    /* border-color не должен затирать появление карточки (.reveal) */
    transition:
        border-color var(--dur-base) ease,
        opacity var(--dur-reveal) var(--ease-out) var(--d, 0s),
        transform var(--dur-reveal) var(--ease-out) var(--d, 0s);
}

.team__card:hover {
    border-color: var(--color-cream-soft);
}

.team__photo {
    position: relative;
    margin: 0;
    aspect-ratio: 1.28;
    overflow: hidden;
    background: var(--color-photo-bg);
}

.team__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.team__card:hover .team__photo img {
    transform: scale(1.05);
}

/* Затемнение снизу под подписью роли */
.team__photo::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 42%;
    background: linear-gradient(transparent, rgba(20, 14, 7, 0.45));
    pointer-events: none;
}

/* Роль руководителя поверх фото */
.team__role {
    position: absolute;
    left: 0.9rem;
    bottom: 0.9rem;
    z-index: 2;
    max-width: calc(100% - 1.8rem);
    margin: 0;
    padding: 0.38rem 0.85rem;
    border-radius: 0.75rem;
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.1);
    font-size: var(--fs-xs);
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: var(--lh-tight);
}

@supports ((backdrop-filter: blur(6px)) or (-webkit-backdrop-filter: blur(6px))) {
    .team__role {
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
    }
}

.team__body {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.4rem 1.4rem 1.5rem;
    flex: 1;
}

.team__name {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--fs-h4);
    font-weight: var(--fw-h4);
    line-height: var(--lh-h4);
    letter-spacing: var(--ls-h4);
}

.team__note {
    margin: 0;
    color: var(--color-ink-soft);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
}

/* Кнопка «Образование и опыт» */
.team__link {
    margin-top: auto;
    padding: 0.8rem 0 0;
    border: none;
    border-top: 1px dashed var(--color-line-dashed);
    background: none;
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: var(--fs-base);
    letter-spacing: 0.04em;
    color: var(--color-accent-strong);
    cursor: pointer;
    text-align: left;
}

.team__link svg {
    width: 0.75rem;
    height: 0.75rem;
    transition: transform var(--dur-base) ease;
}

.team__card:hover .team__link svg,
.team__link:hover svg {
    transform: translateX(0.25rem);
}

.team__link:hover span {
    text-decoration: underline;
    text-underline-offset: 0.25rem;
}

/* ============================================================
   КАРУСЕЛЬ РУКОВОДСТВА
   Включается, когда карточек больше четырех (.team--rail ставит
   шаблон). Нативный горизонтальный скролл со snap и стрелками:
   без клонов и постоянных анимаций. Правый край ленты уходит
   за контейнер до края вьюпорта.
   ============================================================ */
.team__nav {
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem;
    margin-top: clamp(1.5rem, 3vw, 2rem);
}

.team__nav-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

@media (min-width: 61.25rem) {  /* 980px */
    .team--rail {
        --team-rail-gap: clamp(1.25rem, 2.5vw, 2rem);
        --team-rail-card: clamp(13rem, 21vw, 18.75rem);
    }

    .team--rail .team__grid {
        display: flex;
        gap: var(--team-rail-gap);
        /* Правый край ленты выходит за контейнер к краю вьюпорта */
        margin-right: calc(50% - 50vw);
        padding-right: var(--gutter);
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        cursor: grab;
        /* Карточки у правого края растворяются */
        -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent);
        mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent);
    }

    .team--rail .team__grid::-webkit-scrollbar {
        display: none;
    }

    .team--rail .team__grid.is-dragging {
        cursor: grabbing;
        scroll-snap-type: none;
        -webkit-user-select: none;
        user-select: none;
    }

    .team--rail .team__card {
        flex: 0 0 var(--team-rail-card);
        scroll-snap-align: start;
    }

    .team--rail .team__photo img {
        -webkit-user-drag: none;
    }
}

@media (max-width: 61.25rem) {  /* 980px */
    .team__nav {
        display: none;
    }
}

/* ============================================================
   КАРТОЧКА РУКОВОДИТЕЛЯ (модальное окно)
   ============================================================ */
.person__head {
    display: flex;
    align-items: center;
    gap: 1.375rem;
    margin-bottom: 2.125rem;
    padding-right: 3.5rem;
}

.person__photo {
    width: 5.25rem;
    height: 5.25rem;
    flex: none;
    margin: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-photo-bg);
}

.person__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.person__name {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: var(--fw-h3);
    font-size: var(--fs-h3);
    line-height: var(--lh-h3);
    letter-spacing: var(--ls-h3);
}

.person__role {
    margin: 0.375rem 0 0;
    color: var(--color-muted);
    font-size: var(--fs-base);
    line-height: var(--lh-tight);
}

.person__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

.person__subtitle {
    margin: 0 0 0.875rem;
    font-family: var(--font-heading);
    font-weight: var(--fw-h6);
    font-size: var(--fs-h6);
    line-height: var(--lh-h6);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.person__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.person__list li {
    position: relative;
    padding: 0.5rem 0 0.5rem 1.125rem;
    font-size: var(--fs-base);
    line-height: 1.55;
    color: var(--color-ink-soft);
}

.person__list li::before {
    content: "";
    position: absolute;
    left: 0.125rem;
    top: 1.1875rem;
    width: 0.5rem;
    height: 0.125rem;
    background: var(--color-accent-strong);
}

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 61.25rem) {  /* 980px */
    .about__inner {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "head"
            "media"
            "body";
        gap: clamp(1.25rem, 4vw, 2rem);
    }

    /* Мобильный ритм: после H2 секции — такой же отступ, как у
       «Услуг», «Клиентов» и «Писем». Десктоп не трогаем. */
    .about__head {
        margin-bottom: calc(var(--gap-section-title) - var(--gap-section-title-tight));
    }

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

    .team__heading {
        align-items: start;
        flex-direction: column;
    }
}

@media (max-width: 43.75rem) {  /* 700px */
    .person__body {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
}

@media (max-width: 37.5rem) {  /* 600px */
    .about__media {
        padding-bottom: 0;
    }
    .about__docs {
        padding: 1.8rem 0.7rem 0.7rem;
        gap: 0.5rem;
    }
    .about__doc {
        padding: 0.55rem 0.7rem;
        font-size: var(--fs-xs);
        gap: 0.5rem;
    }
    .about__doc svg {
        width: 0.95rem;
        height: 0.95rem;
    }
    .split__cta {
        width: 100%;
    }
    .split__cta .btn {
        width: 100%;
        justify-content: center;
    }
    .team__grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Карточка-строка: портрет слева, текст справа — фото не
       растягивается на всю ширину экрана. */
    .team__card {
        flex-direction: row;
        border-radius: 0.6rem;
    }

    .team__photo {
        flex: 0 0 40%;
        min-width: 7.5rem;
        max-width: 11rem;
        aspect-ratio: auto;
    }

    .team__photo img {
        position: absolute;
        inset: 0;
    }

    .team__body {
        padding: 1.1rem 1.15rem 1.2rem;
        gap: 0.5rem;
    }

    .team__note {
        font-size: 0.875rem;
        line-height: 1.5;
    }

    .team__role {
        left: 0.6rem;
        bottom: 0.6rem;
        max-width: calc(100% - 1.2rem);
        padding: 0.3rem 0.55rem;
        border-radius: 0.6rem;
        font-size: var(--fs-3xs);
        letter-spacing: 0.02em;
    }

    .team__link {
        padding-top: 0.7rem;
    }
}

/* Очень узкие экраны: в строку карточка не помещается — возвращаем
   вертикальную, но фото ограничиваем по высоте. */
@media (max-width: 26.25rem) {  /* 360px */
    .team__card {
        flex-direction: column;
    }

    .team__photo {
        flex: none;
        min-width: 0;
        max-width: none;
        width: 100%;
        aspect-ratio: 1.6;
    }

    .team__body {
        padding: 1.1rem 1.15rem 1.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .about *,
    .about *::before,
    .about *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ============================================================
   КОМАНДА В СТАТЬЕ «О КОМПАНИИ»
   В статье колонка уже, поэтому карточки идут по две в ряд.
   ============================================================ */
.team--article .team__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 37.5rem) {  /* 600px */
    .team--article .team__grid {
        grid-template-columns: 1fr;
    }
}
