/*
 * Подвал сайта по макету Figma (node 3566:28200, ПК 1920 px).
 * Разметка: include/site-footer.php, меню и тексты: include/footer-menus.php.
 * Мобильная версия в макете не нарисована: на экранах до 1040 px колонки складываются сеткой 2 колонки, до 540 px
 * отступы уменьшаются. Горизонтальной прокрутки нет: блоки сжимаются, длинный текст переносится.
 */

.site-footer {
    --sf-ink: #1d1d1b;
    --sf-grey: #737373; /* в макете #767676: на фоне #fafafa контраст 4.35, для AA нужно 4.5 */
    --sf-line: #e5e5e5;
    --sf-link: #404040;

    display: flex;
    flex-direction: column;
    gap: 24px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: 24px 40px;
    overflow-x: clip;
    background-color: #fafafa;
    color: var(--sf-ink);
    font-weight: 200;
}

/* ---------- название бренда крупными буквами ---------- */
.site-footer__brand {
    box-sizing: border-box;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--sf-line);
    overflow: hidden;
    container-type: inline-size;
}

.site-footer__wordmark {
    display: block;
    font-family: "Geologica Brand", "Geologica", sans-serif;
    font-size: 11.5vw; /* запасное значение для браузеров без cqw */
    font-size: 11.957cqw; /* 220 px при ширине содержимого 1840 px (макет 1920 px) */
    font-weight: 600;
    font-synthesis: none;
    line-height: 1;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--sf-ink);
}

/* ---------- колонки ---------- */
.site-footer__body {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 0 20px;
}

.site-footer__cols {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-right: 48px;
    font-size: 14px;
}

.site-footer__group {
    display: flex;
    flex: 1 1 0;
    gap: 64px;
    min-width: 0;
}

.site-footer__group--right {
    justify-content: flex-end;
}

.site-footer__col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.site-footer__title {
    margin: 0;
    font-size: 14px;
    font-weight: 200;
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--sf-grey);
}

.site-footer__list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.site-footer__link {
    display: block;
    font-size: 14px;
    font-weight: 200;
    line-height: 24px;
    letter-spacing: -0.28px;
    white-space: nowrap;
    color: var(--sf-ink);
}

.site-footer__link a {
    color: inherit;
}

.site-footer__line {
    display: block;
}

/* наведение на ссылки (как в шапке): цвет #808080 за 333 мс и тонкая линия, которая выезжает под текстом */
a.site-footer__link,
.site-footer__link a,
.site-footer__legal-link {
    position: relative;
    width: fit-content;
    transition: all 333ms ease;
}

.site-footer__link a {
    width: auto;
}

a.site-footer__link::before,
.site-footer__link a::before,
a.site-footer__legal-link::before {
    content: " ";
    position: absolute;
    bottom: -0.2em;
    left: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    pointer-events: none;
    visibility: hidden;
    transform: scaleX(0);
    transform-origin: left center;
    transition: 0.25s linear;
}

/* у ссылок нижней строки увеличена область нажатия (padding 5 px), линия остаётся под текстом */
a.site-footer__legal-link::before {
    bottom: calc(5px - 0.2em);
}

a.site-footer__link:hover,
a.site-footer__link:focus-visible,
.site-footer__link a:hover,
.site-footer__link a:focus-visible,
a.site-footer__legal-link:hover,
a.site-footer__legal-link:focus-visible {
    color: #808080;
}

a.site-footer__link:hover::before,
a.site-footer__link:focus-visible::before,
.site-footer__link a:hover::before,
.site-footer__link a:focus-visible::before,
a.site-footer__legal-link:hover::before,
a.site-footer__legal-link:focus-visible::before {
    visibility: visible;
    transform: scaleX(1);
}

/* список по центру: заглавные, с небольшим разрядом */
.site-footer__center {
    flex: 0 0 auto;
    padding: 0 20px;
}

.site-footer__list--center {
    align-items: center;
    gap: 2px;
}

.site-footer__list--center .site-footer__link {
    letter-spacing: 0.28px;
    text-align: center;
    text-transform: uppercase;
}

/* ---------- нижняя часть ---------- */
.site-footer__bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.site-footer__legal-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 32px;
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: -0.24px;
}

.site-footer__copy {
    color: var(--sf-grey);
    /* в макете прозрачность 0.7 (контраст 2.6), для читаемости (WCAG AA) прозрачность убрана */
}

.site-footer__legal-link {
    color: var(--sf-link);
}

.site-footer__legal {
    width: 100%;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    color: #000000;
    opacity: 0.7;
}

.site-footer__legal p {
    margin: 0;
    overflow-wrap: anywhere;
}

.site-footer__pay {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.site-footer__pay-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 57px;
    height: 32px;
    border-radius: 8px;
    background-color: #fafafa;
}

.site-footer__pay-item svg {
    display: block;
    width: 48px;
    height: 16px;
}

/* ---------- ширина до 1280 px ---------- */
@media screen and (max-width: 1280px) {
    .site-footer {
        padding-left: 24px;
        padding-right: 24px;
    }

    .site-footer__body {
        padding-left: 0;
        padding-right: 0;
    }

    .site-footer__cols {
        padding-right: 0;
    }

    .site-footer__group {
        gap: 40px;
    }

    .site-footer__center {
        padding: 0 16px;
    }
}

/* ---------- планшет и телефон: колонки сеткой ---------- */
@media screen and (max-width: 1040px) {
    .site-footer__cols {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px 24px;
    }

    .site-footer__group {
        display: contents;
    }

    .site-footer__col {
        min-width: 0;
    }

    .site-footer__link {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    /* список по центру уходит вниз колонок на всю ширину */
    .site-footer__center {
        grid-column: 1 / -1;
        order: 2;
        padding: 24px 0 0;
        border-top: 1px solid var(--sf-line);
    }

    .site-footer__list--center {
        align-items: flex-start;
        gap: 4px;
    }

    .site-footer__list--center .site-footer__link {
        text-align: left;
    }

    .site-footer__legal-links {
        gap: 8px 24px;
    }
}

/* ---------- телефон ---------- */
@media screen and (max-width: 540px) {
    .site-footer {
        gap: 20px;
        padding: 20px 16px;
    }

    .site-footer__brand {
        padding-bottom: 16px;
    }

    .site-footer__body {
        gap: 20px;
    }

    .site-footer__cols {
        gap: 28px 16px;
    }

    .site-footer__legal-links {
        flex-direction: column;
        gap: 8px;
    }

    .site-footer__legal {
        text-align: left;
    }
}

@media screen and (max-width: 540px) {
    .site-footer__legal-links {
        align-items: flex-start;
    }

    .site-footer__pay {
        justify-content: flex-start;
    }
}

@media screen and (max-width: 540px) {
    .site-footer__bottom {
        align-items: stretch;
    }

    .site-footer__legal-links {
        justify-content: flex-start;
    }
}

/* ---------- доступность ---------- */
.site-footer a:focus-visible {
    outline: 2px solid var(--sf-ink);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .site-footer * {
        transition: none !important;
    }
}

/* увеличенная область нажатия у ссылок нижней строки (не меньше 24 px по высоте, WCAG 2.2), вёрстка не меняется */
.site-footer__legal-link {
    display: inline-block;
    padding: 5px 0;
    margin: -5px 0;
}

@media screen and (max-width: 540px) {
    .site-footer__legal-links {
        gap: 0;
    }

    .site-footer__legal-link,
    .site-footer__copy {
        margin: 0;
        padding: 5px 0;
    }
}
