/*
 * Babakhan Foundation — карточки людей
 * --------------------------------------------------------------------------
 * Вкладки «Фонд тузилиши» и «Фонд таъсисчилари» (страница «Фонд ҳақида»).
 * Разметка: template-parts/inc/member-card.php.
 * Все правила ограничены классами .bf-member* — остальные изображения
 * и блоки сайта не затрагиваются.
 *
 * Кадрирование фото (на запись, поля ACF «Сурат кадри»):
 *   --bf-photo-y     вертикальная точка фокуса (по умолчанию 20%);
 *   --bf-photo-zoom  увеличение (по умолчанию 1).
 */

.bf-member {
    --bf-photo-ratio: 125%;        /* единое соотношение сторон фото 4:5 */
    --bf-photo-bg: #f2f4f3;        /* нейтральный фон области фото */
    --bf-accent: #0a993c;

    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bf-member:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ---------- Фото ---------- */

.bf-member__photo {
    position: relative;
    flex: 0 0 auto;
    overflow: hidden;
    background: var(--bf-photo-bg);
}

/* Фиксированная пропорция области фото (работает и без aspect-ratio). */
.bf-member__photo::before {
    content: "";
    display: block;
    padding-top: var(--bf-photo-ratio);
}

.bf-member .bf-member__photo .bf-member__img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
    border-radius: 0;
    object-fit: cover;                                 /* без растягивания */
    object-position: 50% var(--bf-photo-y, 20%);
    transform: scale(var(--bf-photo-zoom, 1));
    transform-origin: 50% var(--bf-photo-y, 20%);
}

/* Заглушка: логотип целиком, по центру, с отступами и ограничением размера. */
.bf-member .bf-member__photo--placeholder .bf-member__img {
    top: 50%;
    left: 50%;
    width: 44%;
    max-width: 170px;
    height: auto;
    max-height: 60%;
    object-fit: contain;
    object-position: 50% 50%;
    transform: translate(-50%, -50%);
    opacity: 0.85;
}

/* ---------- Текст ---------- */

.bf-member__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 22px 20px 24px;
    text-align: center;
}

.bf-member__text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bf-member .bf-member__name {
    margin: 0;
    font-family: 'Philosopher', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: #212121;
    overflow-wrap: break-word;
    hyphens: auto;
}

.bf-member .bf-member__position {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
    color: var(--bf-accent);
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Соцсети прижаты к низу: в ряду карточек одной высоты они на одной линии. */
.bf-member__social {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #f2f2f2;
}

/* Минимальный отступ между текстом и соцсетями. */
.bf-member__text:not(:last-child) {
    margin-bottom: 18px;
}

.bf-member__social a {
    color: #999;
    font-size: 1.1rem;
    line-height: 1;
    transition: color 0.3s;
}

.bf-member__social a:hover,
.bf-member__social a:focus-visible {
    color: var(--bf-accent);
}

/* ---------- Адаптивность ---------- */

/* Телефоны: одна колонка, карточка не шире 400px, чтобы фото 4:5 не было огромным. */
@media (max-width: 767.98px) {
    .bf-member {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .bf-member__body {
        padding: 18px 16px 20px;
    }

    .bf-member .bf-member__name {
        font-size: 1.125rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bf-member {
        transition: none;
    }

    .bf-member:hover {
        transform: none;
    }
}
