/* Torkzt · footer.css — подвал сайта.
 *
 * Вынесено из инлайнового <style> в stdfoot.php: он ехал в каждый ответ и
 * не кэшировался.
 *
 * Главная правка вёрстки — раскладка ссылок. Было три бутстраповских
 * колонки, где на телефоне ссылки делились на две по col-6. Подпись
 * «Пользовательское соглашение» в половину ширины экрана не помещалась и
 * рвалась на две строки с большим межстрочным интервалом — читалось как
 * сбой. Теперь на телефоне один столбец, на десктопе — две тематические
 * колонки рядом с логотипом.
 */

.site-footer {
    margin-top: 40px;
    padding: 40px 0 28px;
    border-top: 1px solid rgba(128, 128, 128, .18);
    background: #fff;
}

/* ── верхняя часть ── */

.footer-top {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.footer-brand { min-width: 0; }

.footer-logo {
    display: inline-block;
    margin-bottom: 10px;
}

.footer-logo img { display: block; height: auto; }

.footer-tagline {
    /* тэглайн на index.php выводится как <h1> ради SEO — размер задаём
       здесь, чтобы он не наследовал кегль заголовка первого уровня */
    font-size: .9rem;
    font-weight: 400;
    line-height: 1.5;
    color: #6c757d;
    margin: 0;
    max-width: 280px;
}

.footer-col { min-width: 0; }

.footer-col-title {
    margin-bottom: 12px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #9aa2ab;
}

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

.footer-links li { margin-bottom: 9px; }
.footer-links li:last-child { margin-bottom: 0; }

.footer-links a {
    text-decoration: none;
    font-size: .9rem;
    line-height: 1.45;
    color: #6c757d;
    transition: color .15s;
}

.footer-links a:hover { color: #0a58ca; }
.footer-links a.active-link { color: #0a58ca; font-weight: 600; }

/* ── нижняя строка ── */

.footer-sep {
    margin: 28px 0 18px;
    opacity: .15;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    font-size: .85rem;
    color: #6c757d;
}

.footer-rights { white-space: nowrap; }
.footer-counters { line-height: 0; }

.footer-debug {
    margin-top: 14px;
    font-size: .78rem;
    line-height: 1.6;
    color: #8a9099;
    text-align: center;
}

/* ── тост нового сообщения ──
   Инлайновые style с карточки тоста переехали сюда. */

#newMsgToast {
    border-radius: 16px;
    background: rgba(28, 30, 33, .85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#newMsgToast .toast-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    font-size: 22px;
}

#newMsgToast .toast-title {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .3px;
}

#newMsgToast .btn-close { opacity: .6; }

/* ── лог SQL ── */

.sql-debug {
    max-width: 100%;
    margin: 12px 0 0;
    padding: 10px 12px;
    border-top: 1px solid rgba(128, 128, 128, .2);
    background: rgba(128, 128, 128, .06);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    line-height: 1.5;
    color: #7a828a;
    overflow-x: auto;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.sql-debug b { color: #5a6169; }

/* ── тёмная тема ── */

body[data-bs-theme='dark'] .site-footer { background: rgb(33, 37, 41); }
body[data-bs-theme='dark'] .footer-tagline,
body[data-bs-theme='dark'] .footer-bottom,
body[data-bs-theme='dark'] .footer-links a { color: #9aa0a6; }
body[data-bs-theme='dark'] .footer-links a:hover { color: #5aa9ff; }
body[data-bs-theme='dark'] .footer-col-title { color: #7d858e; }

/* ── планшет ── */

@media (max-width: 991px) {
    .footer-top { grid-template-columns: 1fr 1fr; gap: 28px; }
    .footer-brand { grid-column: 1 / -1; }
    .footer-tagline { max-width: none; }
}

/* ── телефон ── */

@media (max-width: 575px) {
    .site-footer { margin-top: 32px; padding: 32px 0 24px; }

    /* Один столбец вместо двух: в половину ширины экрана длинные подписи
       не помещались и разрывались посередине слова. */
    .footer-top { grid-template-columns: 1fr; gap: 26px; }
    .footer-brand { grid-column: auto; }

    .footer-links li { margin-bottom: 12px; }
    .footer-links a { font-size: .95rem; }

    .footer-sep { margin: 22px 0 16px; }

    .footer-bottom { justify-content: center; text-align: center; }
    .footer-rights { white-space: normal; }
}
