/* ================================================================
   ПОДВАЛ — единый язык с остальным сайтом
   ------------------------------------------------------------
   Раньше подвал был отдельным тёмным миром: свой #0F172A, свои
   фиолетовые рамки, своя плотность. На странице AST AI это
   выглядело как чужой блок, приклеенный снизу. Теперь подвал
   берёт те же токены, что и страница, и отличается только
   тоном подложки — так он читается частью композиции.
   ================================================================ */

.footer {
    background: var(--ast-bg-deep, #0b0c0e);
    border-top: 1px solid var(--ast-line, rgba(255,255,255,.075));
    padding: var(--ast-space-12, 48px) 0 var(--ast-space-6, 24px);
    margin-top: var(--ast-space-12, 48px);
}

/* Мягкий переход сверху: подвал не обрубается стеной, а уходит
   из страницы как продолжение фона. Свечения нет — вместо него
   тонкая линия по краю фона. */
.footer::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ast-line-strong, rgba(255,255,255,.14)) 22%, var(--ast-line-strong, rgba(255,255,255,.14)) 78%, transparent);
    pointer-events: none;
}

.footer .container {
    position: relative;
    max-width: 1200px;
}

/* --- Колонки ----------------------------------------------------- */

/* Четыре колонки: бренд, навигация, ресурсы, документы.
   Первая шире — в ней логотип и каналы связи. */
.footer .footer-content {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.9fr);
    gap: var(--ast-space-8, 32px);
    align-items: start;
    margin-bottom: var(--ast-space-10, 40px);
}

.footer .footer-panel {
    min-width: 0;
    height: fit-content;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

/* Подложки колонок подвала — тихие. Раньше здесь стояла рамка,
   тень и стеклянные блики: подвал читался как набор вложенных
   коробок и перетягивал внимание с последнего экрана страницы.
   Теперь колонки разделены воздухом, а не рамками. */
.footer .footer-panel--brand,
.footer .footer-col-card {
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.footer .footer-panel--brand {
    text-align: left;
}

.footer .footer-panel--brand .logo-img-small {
    margin: 0 0 0.35rem;
    max-width: 180px;
    height: auto;
}

/* --- Заголовки колонок ------------------------------------------- */

.footer .footer-links-title {
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ast-text, #e9eaee);
    margin: 0;
}

/* Короткая линия под заголовком — единственный цветной знак в
   колонке. Она отмечает раздел, а не украшает его. */
.footer .footer-title-accent {
    display: block;
    width: 20px;
    height: 1px;
    margin: 0.6rem 0 0.9rem;
    background: var(--ast-accent, #4f46e5);
    opacity: 0.7;
}

.footer .footer-note {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--ast-text-3, #92949d);
}

/* --- Ссылки ------------------------------------------------------ */

/* Селекторы намеренно длиннее, чем в style.css: подвал должен
   выглядеть частью страницы, а не отдельным блоком из другой
   темы, поэтому он перекрывает старые правила без !important. */
.footer .footer-link--item,
.footer .footer-link--doc {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    width: auto;
    padding: 0.34rem 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 0.88rem;
    line-height: 1.35;
    color: var(--ast-text-2, #9ea1aa);
    text-decoration: none;
    transition: color var(--ast-dur-fast, 120ms) ease;
    white-space: normal;
    overflow: visible;
}

.footer .footer-link--item:hover,
.footer .footer-link--doc:hover {
    transform: none;
    padding: 0.34rem 0;
    background: transparent;
    border-color: transparent;
    color: var(--ast-text, #e9eaee);
}

.footer .footer-link--item:focus-visible,
.footer .footer-link--doc:focus-visible {
    outline: 2px solid var(--ast-accent, #4f46e5);
    outline-offset: 3px;
}

/* Иконка ссылки — без подложки. Раньше вокруг каждой иконки была
   рамка с фоном: колонка читалась как список кнопок, а не как
   список ссылок. Теперь иконка просто обозначает строку. */
.footer .footer-item-icon,
.footer .footer-doc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin-top: 2px;
    border-radius: 0;
    border: 0;
    background: transparent;
    color: var(--ast-text-3, #92949d);
    transition: color var(--ast-dur-fast, 120ms) ease;
}

.footer .footer-link--item:hover .footer-item-icon,
.footer .footer-link--doc:hover .footer-doc-icon {
    background: transparent;
    border-color: transparent;
    color: var(--ast-accent, #4f46e5);
}

.footer .footer-nav-divider {
    height: 1px;
    margin: 0.5rem 0;
    background: var(--ast-line, rgba(255,255,255,.075));
}

/* Каналы связи. Раньше каждая кнопка была отдельной карточкой с
   рамкой и подложкой, а сама группа — ещё одной карточкой: три
   слоя вложенности на одну ссылку. Теперь это тихие строки
   с иконкой, а разделение — линия. */
.footer .footer-social-card {
    margin-top: 1rem;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-width: 320px;
}

.footer .footer-social-title {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ast-text-3, #92949d);
    margin-bottom: 0.25rem;
}

.footer .footer-social-divider {
    height: 1px;
    margin: 0.4rem 0;
    background: var(--ast-line, rgba(255,255,255,.075));
}

.footer .footer-social-btn {
    text-decoration: none;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    align-items: center;
    gap: 0.7rem;
    padding: 0.35rem 0;
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--ast-text, #e9eaee);
    transition: color 180ms ease;
}

.footer .footer-social-btn:hover {
    transform: none;
    border-color: transparent;
    background: transparent;
    color: var(--ast-text, #e9eaee);
}

.footer .footer-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 0;
    background: transparent;
    border: 0;
    color: var(--ast-text-3, #92949d);
    transition: color 180ms ease;
}

.footer .footer-social-btn:hover .footer-social-icon {
    color: var(--ast-accent, #4f46e5);
}

.footer .footer-social-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.footer .footer-social-name {
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--ast-text, #e9eaee);
    line-height: 1.25;
}

.footer .footer-social-sub {
    font-size: 0.76rem;
    color: var(--ast-text-3, #92949d);
    line-height: 1.3;
}

/* --- Нижняя полоса ----------------------------------------------- */

.footer .footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    flex-wrap: wrap;
    padding-top: 1.5rem;
    border-top: 1px solid var(--ast-line, rgba(255,255,255,.075));
    color: var(--ast-text-3, #92949d);
    font-size: 0.85rem;
}

.footer .footer-copyright {
    margin: 0;
    color: var(--ast-text-3, #92949d);
}

.footer .footer-bottom-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* Кнопки нижней полосы — тихие текстовые ссылки, не пилюли.
   Пилюля здесь читалась как третья кнопка подвала. */
.footer .footer-bottom-btn {
    padding: 0;
    border-radius: 0;
    border: 0;
    background: transparent;
    color: var(--ast-text-3, #92949d);
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    transition: color 180ms ease;
}

.footer .footer-bottom-btn:hover {
    color: var(--ast-text, #e9eaee);
    border-color: transparent;
    background: transparent;
}

/* Строка «AST AI — часть экосистемы Astrafic» — тихая подпись,
   не крик. */
.footer .footer-ecosystem {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--ast-text-3, #92949d);
}

/* На узких экранах подвал перестраивается в одну колонку.
   Селектор уточнён префиксом `.footer`, иначе правила из
   style.css перебивают grid и колонки схлопываются в 20px. */
@media (max-width: 900px) {
    .footer .footer-content {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

@media (max-width: 560px) {
    .footer .footer-content {
        grid-template-columns: minmax(0, 1fr);
    }
}
