/* =============================================================
   WEB3RU v3.0.0 — фирменный слой поверх темы Journal
   -------------------------------------------------------------
   Подключается ПОСЛЕ built/screen.css и ghost_head, поэтому
   перекрывает базовую тему и остатки старой Code Injection.
   Файл намеренно не требует сборки: правится и деплоится как есть.

   Оглавление:
     01. Шрифты (кириллица + латиница, unicode-range)
     02. Токены и утилиты
     03. Кнопки, кикеры, чипы
     04. Шапка: десктоп
     05. Шапка: мобильная строка и панель меню
     06. Главная: свежая публикация
     07. Лента: единые карточки материалов
     08. Сайдбар: избранное и темы
     09. Статья: мета и paywall
     10. Каталог /pro/ и карточки-плитки
     11. Кабинет /library/
     12. Модалки и тост
     13. Футер
     14. Доступность и reduced motion
   ============================================================= */

/* ---------- 01. Шрифты ----------
   Inter и Lora с кириллицей. font-display: swap, загрузка
   по unicode-range: латиница и кириллица рендерятся одним
   и тем же семейством, ничего не падает в системный шрифт. */

@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Inter; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@font-face { font-family: Lora; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/lora-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Lora; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/lora-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Lora; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/lora-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Lora; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/lora-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Lora; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/lora-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Lora; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/lora-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Lora; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/lora-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Lora; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/lora-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Lora; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/lora-cyrillic-400-italic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Lora; font-style: italic; font-weight: 600; font-display: swap; src: url("../fonts/lora-cyrillic-600-italic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Lora; font-style: italic; font-weight: 700; font-display: swap; src: url("../fonts/lora-cyrillic-700-italic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Lora; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/lora-latin-400-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Lora; font-style: italic; font-weight: 600; font-display: swap; src: url("../fonts/lora-latin-600-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Lora; font-style: italic; font-weight: 700; font-display: swap; src: url("../fonts/lora-latin-700-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- 02. Токены и утилиты ---------- */

[hidden] { display: none !important; }

:root {
    --w3p-ink: #101014;
    --w3p-ink-soft: #1b1b20;
    --w3p-paper: #ffffff;
    --w3p-soft: #f6f6f3;
    --w3p-hairline: #e7e7e2;
    --w3p-line-strong: #d5d5cf;
    --w3p-muted: #6b6b72;
    --w3p-muted-dark: #3c3c42;
    --w3p-signal: #0e7a3f;
    --w3p-danger: #a82820;
    --w3p-telegram: #229ed9;
    --w3p-terminal-line: rgba(255, 255, 255, 0.14);
    --w3p-terminal-muted: #9a9aa2;
    --w3p-radius: 2rem;
    --w3p-radius-s: 1.4rem;
    --w3p-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
    --w3p-head-h: 6.4rem;
    --w3p-tap: 4.4rem; /* минимальный размер кликабельных элементов */
}

@media (min-width: 768px) {
    :root { --w3p-head-h: 7.2rem; }
}

.w3p-mono {
    font-family: var(--w3p-font-mono);
    font-feature-settings: "tnum" 1;
    letter-spacing: 0;
}

::selection { background: var(--w3p-ink); color: var(--w3p-paper); }

/* Excerpt: ровно 3 строки с многоточием */
.w3p-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.w3p-date { font-size: 1.2rem; color: var(--w3p-muted); }

/* ---------- 03. Кнопки, кикеры, чипы ---------- */

.w3p-kicker {
    display: inline-block;
    font-family: var(--w3p-font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--w3p-ink);
}

.w3p-kicker-paper { color: var(--w3p-terminal-muted); }

a.w3p-kicker:hover { opacity: 0.75; }

.w3p-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    font-family: var(--w3p-font-mono);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--w3p-paper);
    background: var(--w3p-ink);
    border-radius: 0.6rem;
}

/* Купленный материал: зелёная метка вместо чёрной */
.is-owned .w3p-chip { background: var(--w3p-signal); }

.w3p-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    min-height: var(--w3p-tap);
    padding: 0 2rem;
    font-family: var(--font-sans);
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
    text-decoration: none;
    cursor: pointer;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.w3p-btn:hover { opacity: 1; }
.w3p-btn:active { transform: translateY(1px); }
.w3p-btn:disabled { cursor: default; opacity: 0.55; transform: none; }

.w3p-btn-ink { color: var(--w3p-paper); background: var(--w3p-ink); border-color: var(--w3p-ink); }
.w3p-btn-ink:hover { color: var(--w3p-paper); background: var(--w3p-ink-soft); border-color: var(--w3p-ink-soft); }

.w3p-btn-ghost { color: var(--w3p-ink); background: transparent; border-color: var(--w3p-line-strong); }
.w3p-btn-ghost:hover { color: var(--w3p-ink); border-color: var(--w3p-ink); }

.w3p-btn-paper { color: var(--w3p-ink); background: var(--w3p-paper); border-color: var(--w3p-paper); }
.w3p-btn-paper:hover { color: var(--w3p-ink); background: #ececec; border-color: #ececec; }

.w3p-btn-ghost-paper { color: var(--w3p-paper); background: transparent; border-color: rgba(255, 255, 255, 0.32); }
.w3p-btn-ghost-paper:hover { color: var(--w3p-paper); border-color: rgba(255, 255, 255, 0.8); }

/* Авторизованному пользователю не показываем кнопку «Войти» в paywall */
body.w3p-authed [data-w3p-guest-only] { display: none !important; }

/* ---------- 04. Шапка: десктоп ---------- */

#gh-head.w3p-header {
    position: relative;
    z-index: 1000;
    height: var(--w3p-head-h);
    border-bottom: 1px solid var(--w3p-hairline);
    background-color: var(--w3p-paper);
}

#gh-head .gh-head-inner {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    height: var(--w3p-head-h);
    grid-template-columns: none;
}

#gh-head .gh-head-logo {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#gh-head .gh-head-logo img { max-height: 3.2rem; width: auto; }

/* Контейнер обязан занимать всю свободную ширину строки: скрипт Journal
   сворачивает пункты в «…», пока .nav шире контейнера. Без flex-grow
   контейнер сжимается по контенту и условие истинно всегда. */
#gh-head .gh-head-menu {
    flex: 1 1 auto;
    min-width: 0;
    height: auto;
    margin: 0 0 0 2.4rem;
    font-size: 1.42rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    text-transform: none;
}

#gh-head .gh-head-menu::before,
#gh-head .gh-head-menu::after { content: none; }

#gh-head .gh-head-menu .nav a {
    padding: 0.6rem 0.2rem;
    color: var(--w3p-muted-dark);
}

#gh-head .gh-head-menu .nav a:hover {
    color: var(--w3p-ink);
    opacity: 1;
}

/* Пункты Ghost Navigation, дублирующие встроенные разделы темы
   (/pro/, /library/), скрипт помечает классом и прячет */
#gh-head .gh-head-menu .nav li.w3p-nav-dup { display: none; }

.w3p-head-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    flex: 0 0 auto;
}

.w3p-search-btn {
    width: var(--w3p-tap);
    height: var(--w3p-tap);
    margin: 0;
    color: var(--w3p-ink);
    border-radius: 999px;
    transition: background-color 0.16s ease;
}

.w3p-search-btn:hover { background: var(--w3p-soft); opacity: 1; }
.w3p-search-btn svg { width: 2rem; height: 2rem; }

.w3p-head-pro {
    display: inline-flex;
    align-items: center;
    min-height: var(--w3p-tap);
    padding: 0 1.6rem;
    color: var(--w3p-paper) !important;
    font-family: var(--font-sans);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.05em;
    text-decoration: none;
    background: var(--w3p-ink);
    border-radius: 999px;
    transition: background-color 0.16s ease;
}

.w3p-head-pro:hover { background: var(--w3p-ink-soft); opacity: 1; }

.w3p-auth { display: flex; align-items: center; }

.w3p-auth-login {
    appearance: none;
    display: inline-flex;
    align-items: center;
    min-height: var(--w3p-tap);
    padding: 0 1.5rem;
    color: var(--w3p-ink);
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--w3p-line-strong);
    border-radius: 999px;
    transition: border-color 0.16s ease;
}

.w3p-auth-login:hover { border-color: var(--w3p-ink); }

.w3p-auth-account {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    min-height: var(--w3p-tap);
    padding: 0.3rem 1.1rem 0.3rem 0.4rem;
    color: var(--w3p-ink);
    border: 1px solid var(--w3p-hairline);
    border-radius: 999px;
    transition: border-color 0.16s ease;
}

.w3p-auth-account:hover { color: var(--w3p-ink); border-color: var(--w3p-line-strong); opacity: 1; }

.w3p-auth-name {
    max-width: 12ch;
    overflow: hidden;
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.w3p-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 3.4rem;
    height: 3.4rem;
    overflow: hidden;
    color: var(--w3p-paper);
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--w3p-ink);
    border-radius: 50%;
}

.w3p-avatar img { width: 100%; height: 100%; object-fit: cover; }

#gh-head .gh-burger { flex: 0 0 3rem; width: 3rem; height: var(--w3p-tap); margin: 0; }

/* Бургер прячется целиком, если содержательных пунктов меньше двух */
body.w3p-no-burger .gh-burger,
body.w3p-no-burger .w3p-menu { display: none !important; }

/* Мобильная панель по умолчанию скрыта */
.w3p-menu { display: none; }

@media (min-width: 768px) {
    #gh-head .gh-head-inner { padding: 0; }
}

/* ---------- 05. Шапка: мобильная строка и панель меню ---------- */

@media (max-width: 767px) {
    #gh-head .gh-head-inner { gap: 0.8rem; }

    #gh-head .gh-head-logo { font-size: 1.8rem; flex: 1 1 auto; }

    /* Текстовый wordmark: скрипт темы оборачивает хвост названия
       в .w3p-brand-rest, на узких экранах остаётся первое слово
       («web3ru research» → «web3ru») вместо обрезки многоточием */
    @media (max-width: 479px) {
        .w3p-brand-rest { display: none; }
    }

    /* Десктопную навигацию на мобильном не показываем никогда */
    #gh-head .gh-head-menu { display: none; }

    .w3p-head-actions { gap: 0.5rem; }
    .w3p-auth-name { display: none; }
    .w3p-auth-account { padding: 0.4rem; border: 0; }
    .w3p-search-btn { width: 4rem; }
    .w3p-auth-login { padding: 0 1.2rem; }
    .w3p-head-pro { padding: 0 1.2rem; }

    /* Открытое меню: класс is-head-open ставит main.min.js.
       built/screen.css при этом делает #gh-head фуллскрином
       (position: fixed; inset: 0; overflow-y: scroll) — возвращаем
       шапке высоту 100%, чтобы не зажимать панель в одну строку,
       и раскладываем панель ниже верхней строки внутри скролла. */
    body.is-head-open { overflow: hidden; }

    body.is-head-open #gh-head.w3p-header {
        height: 100%;
        overscroll-behavior: contain;
    }

    body.is-head-open .w3p-menu {
        display: block;
        padding-bottom: calc(4.8rem + env(safe-area-inset-bottom));
    }

    .w3p-menu-inner {
        display: flex;
        flex-direction: column;
        min-height: calc(100vh - var(--w3p-head-h) - 4rem);
        min-height: calc(100dvh - var(--w3p-head-h) - 4rem);
        padding-top: 2.4rem;
    }

    .w3p-menu-primary { display: grid; }

    .w3p-menu-primary a {
        display: flex;
        align-items: center;
        min-height: var(--w3p-tap);
        padding: 1.4rem 0;
        color: var(--w3p-ink);
        font-family: var(--font-sans);
        font-size: 2.4rem;
        font-weight: 650;
        line-height: 1.1;
        letter-spacing: -0.035em;
        border-bottom: 1px solid var(--w3p-hairline);
    }

    .w3p-menu-search {
        appearance: none;
        display: flex;
        align-items: center;
        gap: 1.2rem;
        width: 100%;
        min-height: var(--w3p-tap);
        margin-top: 2rem;
        padding: 1.3rem 1.6rem;
        color: var(--w3p-ink);
        font-family: var(--font-sans);
        font-size: 1.5rem;
        font-weight: 600;
        letter-spacing: -0.01em;
        cursor: pointer;
        background: var(--w3p-soft);
        border: 0;
        border-radius: var(--w3p-radius-s);
    }

    .w3p-menu-search svg { width: 1.8rem; height: 1.8rem; }

    .w3p-menu-links .nav {
        display: grid;
        gap: 0.2rem;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    #gh-head .w3p-menu-links .nav li { opacity: 1; transform: none; }
    #gh-head .w3p-menu-links .nav li.w3p-nav-dup { display: none; }

    #gh-head .w3p-menu-links .nav a {
        display: inline-flex;
        align-items: center;
        min-height: var(--w3p-tap);
        padding: 0.5rem 0;
        color: var(--w3p-muted-dark);
        font-size: 1.6rem;
        font-weight: 550;
        letter-spacing: -0.01em;
        text-transform: none;
    }

    .w3p-menu-auth { margin-top: auto; padding-top: 3.2rem; }

    .w3p-menu-auth > [data-w3p-login] { width: 100%; min-height: 5.2rem; font-size: 1.5rem; }

    .w3p-menu-account { display: grid; gap: 1rem; }

    .w3p-menu-account-user {
        display: flex;
        align-items: center;
        gap: 1.2rem;
        padding: 1.4rem 1.6rem;
        border: 1px solid var(--w3p-hairline);
        border-radius: var(--w3p-radius-s);
    }

    .w3p-menu-account-user .w3p-avatar { width: 4.2rem; height: 4.2rem; font-size: 1.4rem; }

    .w3p-menu-account-copy { display: grid; gap: 0.2rem; min-width: 0; }

    .w3p-menu-account-label {
        font-family: var(--w3p-font-mono);
        font-size: 1.05rem;
        color: var(--w3p-muted);
    }

    .w3p-menu-account-copy strong {
        overflow: hidden;
        font-family: var(--font-sans);
        font-size: 1.55rem;
        font-weight: 650;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .w3p-menu-account .w3p-btn { width: 100%; }
}

.w3p-menu-label {
    margin: 3.2rem 0 0.6rem;
    font-family: var(--w3p-font-mono);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.13em;
    color: var(--w3p-muted);
    text-transform: uppercase;
}

@media (min-width: 768px) {
    .w3p-menu { display: none !important; }
}

/* ---------- 06. Главная: свежая публикация ----------
   Десктоп: две колонки, текст — основная часть, изображение —
   вторичное. Мобильный: дата → заголовок → excerpt → мета →
   изображение снизу; картинка никогда не первая на странице. */

.w3p-latest {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: clamp(2.4rem, 4vw, 5.6rem);
    align-items: center;
    margin: 4rem 0 8rem;
}

.w3p-latest-link {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    gap: inherit;
    align-items: center;
}

.w3p-latest-link:hover { opacity: 1; }

.w3p-latest-eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.2rem;
}

.w3p-latest-title {
    margin-top: 1.4rem;
    font-size: clamp(2.8rem, 4.2vw, 4.4rem);
    font-weight: 650;
    line-height: 1.06;
    letter-spacing: -0.038em;
}

.w3p-latest-link:hover .w3p-latest-title { opacity: 0.82; }

.w3p-latest-excerpt {
    max-width: 56rem;
    margin-top: 1.6rem;
    color: var(--w3p-muted-dark);
    font-size: 1.7rem;
    line-height: 1.55;
    letter-spacing: -0.01em;
}

.w3p-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.2rem;
    margin-top: 2rem;
    color: var(--w3p-muted);
    font-size: 1.2rem;
}

.w3p-latest-media {
    margin: 0;
    overflow: hidden;
    background: var(--w3p-soft);
    border: 1px solid var(--w3p-hairline);
    border-radius: var(--w3p-radius);
}

.w3p-latest-media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

.w3p-latest-commerce {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 1.2rem;
    grid-column: 1 / -1;
    margin-top: 0.4rem;
    padding-top: 1.8rem;
    border-top: 1px solid var(--w3p-hairline);
}

.w3p-latest-commerce .w3p-card-commerce-copy { margin-right: auto; }

@media (max-width: 991px) {
    .w3p-latest { grid-template-columns: 1fr; margin: 2.4rem 0 6.4rem; }
    .w3p-latest-link { grid-template-columns: 1fr; }
    /* Изображение остаётся под текстом: порядок в DOM уже правильный */
    .w3p-latest-media { margin-top: 2.4rem; }
    .w3p-latest-commerce { justify-content: stretch; }
    .w3p-latest-commerce .w3p-btn { width: 100%; }
    .w3p-latest-commerce .w3p-card-commerce-copy { margin-right: 0; width: 100%; }
}

/* ---------- 07. Лента: единые карточки материалов ----------
   Бесплатные и платные материалы выглядят одинаково: текст слева,
   компактная миниатюра справа. Платные добавляют метку PRO и строку
   покупки — без размытия заголовков и плашек поверх текста. */

.gh-wrapper { row-gap: 6.4rem; }

@media (max-width: 991px) {
    .gh-wrapper { grid-template-columns: 1fr; }
    .gh-wrapper > .gh-section { max-width: none; }
}

.gh-feed .gh-card + .gh-card { margin-top: 4.8rem; }

.w3p-feed-card-link {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.w3p-feed-card-link:hover { opacity: 1; }
.w3p-feed-card-link:hover .gh-card-title { opacity: 0.8; }

.w3p-feed-card-copy { flex: 1 1 auto; min-width: 0; }

.gh-card-title { font-size: 2.4rem; font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; }

.gh-card-excerpt {
    margin-top: 0.9rem;
    color: var(--w3p-muted-dark);
    font-size: 1.55rem;
    line-height: 1.5;
}

.w3p-card-meta {
    margin-top: 1.3rem;
    text-transform: none;
    align-items: center;
    gap: 1.1rem;
}

.w3p-card-meta .w3p-mono { font-size: 1.15rem; }

.w3p-feed-card-thumb {
    flex: 0 0 13.2rem;
    margin: 0.4rem 0 0;
    overflow: hidden;
    background: var(--w3p-soft);
    border: 1px solid var(--w3p-hairline);
    border-radius: 1.2rem;
}

.w3p-feed-card-thumb img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

@media (max-width: 519px) {
    .w3p-feed-card-link { gap: 1.4rem; }
    .w3p-feed-card-thumb { flex-basis: 10rem; }
    .gh-card-title { font-size: 2rem; }
    .gh-card-excerpt { font-size: 1.45rem; }
}

/* Строка покупки в карточке */
.w3p-card-commerce {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    margin-top: 1.4rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--w3p-hairline);
}

.w3p-card-commerce-copy { display: grid; gap: 0.25rem; }

.w3p-card-commerce-label {
    color: var(--w3p-muted);
    font-family: var(--w3p-font-mono);
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.w3p-card-buy,
.w3p-card-owned {
    appearance: none;
    display: inline-flex;
    align-items: center;
    min-height: var(--w3p-tap);
    border: 0;
    padding: 0 0.4rem;
    color: var(--w3p-ink);
    background: transparent;
    font: inherit;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 0.3rem;
}

.w3p-card-buy:hover,
.w3p-card-owned:hover { opacity: 0.75; }

.w3p-card-buy:disabled {
    color: var(--w3p-muted);
    cursor: default;
    text-decoration: none;
    opacity: 1;
}

.w3p-card-owned { color: var(--w3p-signal); }

/* Непокупленный PRO-материал: конец excerpt мягко затухает.
   Текст не размывается и не закрывается плашкой. */
.gh-card.is-pro:not(.is-owned) .gh-card-excerpt,
.w3p-latest.is-pro:not(.is-owned) .w3p-latest-excerpt {
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}

.w3p-feed-note { color: var(--w3p-muted); font-size: 1.5rem; }

.gh-loadmore { margin-top: 5.6rem; min-height: var(--w3p-tap); border-radius: var(--w3p-radius-s); }

/* ---------- 08. Сайдбар: избранное и темы ---------- */

.w3p-featured { display: grid; }

.w3p-featured-item {
    display: grid;
    gap: 0.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--w3p-hairline);
}

.w3p-featured-item:first-child { padding-top: 0.4rem; }
.w3p-featured-item:hover { opacity: 1; }
.w3p-featured-item:hover .w3p-featured-title { opacity: 0.75; }

.w3p-featured-title {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--w3p-ink);
}

.w3p-featured-meta {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-size: 1.1rem;
    color: var(--w3p-muted);
}

.w3p-topics { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.w3p-topic {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 3.6rem;
    padding: 0.4rem 1.2rem;
    color: var(--w3p-ink);
    font-size: 1.3rem;
    font-weight: 550;
    letter-spacing: -0.01em;
    border: 1px solid var(--w3p-hairline);
    border-radius: 999px;
    transition: border-color 0.16s ease;
}

.w3p-topic:hover { border-color: var(--w3p-ink); opacity: 1; }

.w3p-topic-count { font-size: 1.05rem; color: var(--w3p-muted); }

/* ---------- 09. Статья: мета и paywall ---------- */

.w3p-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1.4rem;
    color: var(--w3p-muted);
}

.w3p-article-meta .w3p-mono { font-size: 1.2rem; }

.gh-article-image img { border-radius: 1rem; }

.gh-navigation-label { text-transform: none; letter-spacing: -0.01em; }

.w3p-article-purchase-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem 1.4rem;
    margin-top: 2rem;
    color: var(--w3p-muted);
    font-family: var(--w3p-font-mono);
    font-size: 1.2rem;
}

.w3p-article-purchase-meta strong { color: var(--w3p-ink); }

.w3p-article-purchase-meta [data-w3p-owned] {
    padding: 0.35rem 0.8rem;
    color: #fff;
    background: var(--w3p-signal);
    border-radius: 999px;
}

/* Полный текст куплен и подгружается с backend */
[data-w3p-article-page].is-content-loading [data-w3p-article-content] { opacity: 0.45; }
[data-w3p-article-content] { transition: opacity 0.2s ease; }

/* built задаёт 4.2rem на мобильных — для длинных русских заголовков
   это стена текста на весь первый экран */
@media (max-width: 767px) {
    .gh-article .gh-article-title {
        font-size: 3.4rem;
        line-height: 1.14;
        letter-spacing: -0.028em;
    }
}

/* Тёмная карточка paywall в конце бесплатного фрагмента */
.w3p-paywall {
    max-width: min(74rem, calc(100% - 8vmin));
    margin: 5.6rem auto 0;
    padding: clamp(2.8rem, 4.5vw, 4.4rem);
    color: var(--w3p-paper);
    background: var(--w3p-ink);
    border-radius: var(--w3p-radius);
}

.w3p-paywall-title {
    margin-top: 1.2rem;
    color: var(--w3p-paper);
    font-size: clamp(2.2rem, 3.2vw, 2.8rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.w3p-paywall-copy {
    max-width: 54rem;
    margin-top: 1.2rem;
    color: #c3c3ca;
    font-size: 1.5rem;
    line-height: 1.55;
}

.w3p-paywall-price {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 2.4rem;
    padding: 1.4rem 0;
    border-top: 1px solid var(--w3p-terminal-line);
    border-bottom: 1px solid var(--w3p-terminal-line);
    font-family: var(--w3p-font-mono);
}

.w3p-paywall-price span { color: var(--w3p-terminal-muted); }
.w3p-paywall-price strong { font-size: 2rem; }

.w3p-paywall-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.4rem; }

.w3p-paywall-note { margin-top: 1.6rem; color: var(--w3p-terminal-muted); font-size: 1.2rem; line-height: 1.5; }

@media (max-width: 519px) {
    .w3p-paywall-actions .w3p-btn { width: 100%; }
}

/* ---------- 10. Каталог /pro/ и карточки-плитки ---------- */

.w3p-store-page,
.w3p-library-page { padding: 0 0 clamp(6.4rem, 9vw, 9.6rem); }

/* Компактный верх страницы: без гигантского hero */
.w3p-store-head {
    padding-top: clamp(3.2rem, 5vw, 5.6rem);
    padding-bottom: clamp(2.4rem, 4vw, 4rem);
    border-bottom: 1px solid var(--w3p-hairline);
}

.w3p-store-title {
    margin-top: 1rem;
    font-size: clamp(2.8rem, 4.4vw, 4.2rem);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.w3p-store-sub {
    max-width: 62rem;
    margin-top: 1.4rem;
    color: var(--w3p-muted);
    font-size: 1.6rem;
    line-height: 1.55;
}

.w3p-store-sub a { color: var(--w3p-ink); text-decoration: underline; text-underline-offset: 0.25rem; }

.w3p-store-catalog { padding-top: clamp(3.2rem, 5vw, 4.8rem); }

.w3p-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
}

@media (max-width: 1023px) { .w3p-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 719px) { .w3p-cards-grid { grid-template-columns: 1fr; } }

.w3p-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--w3p-paper);
    border: 1px solid var(--w3p-hairline);
    border-radius: 1.8rem;
    transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.w3p-card:hover {
    border-color: var(--w3p-line-strong);
    transform: translateY(-2px);
    box-shadow: 0 1.2rem 3rem rgba(16, 16, 20, 0.07);
}

.w3p-card > a { display: block; flex: 1 1 auto; }
.w3p-card > a:hover { opacity: 1; }

.w3p-card-media { margin: 0; overflow: hidden; background: var(--w3p-soft); }

.w3p-card-media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.w3p-card-body { padding: 2rem 2.2rem 2rem; }

.w3p-card-body h3 {
    margin-top: 1.1rem;
    font-size: 1.9rem;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: var(--w3p-ink);
}

.w3p-card-body p {
    margin-top: 0.9rem;
    color: var(--w3p-muted-dark);
    font-size: 1.4rem;
    line-height: 1.5;
}

.w3p-card .w3p-card-meta { margin-top: 0; display: flex; flex-wrap: wrap; }

.w3p-store-card-buy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    padding: 1.5rem 2.2rem 2rem;
    border-top: 1px solid var(--w3p-hairline);
}

.w3p-store-card-buy strong { font-size: 1.5rem; }
.w3p-store-card-buy .w3p-btn { padding-inline: 1.6rem; }

@media (max-width: 519px) {
    .w3p-store-card-buy { flex-direction: column; align-items: stretch; }
    .w3p-store-card-buy .w3p-btn { width: 100%; }
}

/* Компактный FAQ */
.w3p-store-faq { padding-top: clamp(4.8rem, 7vw, 7.2rem); }

.w3p-store-faq-title {
    font-size: clamp(2.2rem, 3vw, 2.8rem);
    letter-spacing: -0.03em;
}

.w3p-faq { max-width: 72rem; margin-top: 2rem; border-top: 1px solid var(--w3p-hairline); }

.w3p-faq details { border-bottom: 1px solid var(--w3p-hairline); }

.w3p-faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    min-height: var(--w3p-tap);
    padding: 1.6rem 0;
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    cursor: pointer;
    list-style: none;
}

.w3p-faq summary::-webkit-details-marker { display: none; }

.w3p-faq summary::after {
    content: "+";
    flex: 0 0 auto;
    color: var(--w3p-muted);
    font-size: 2rem;
    font-weight: 400;
    line-height: 1;
    transition: transform 0.16s ease;
}

.w3p-faq details[open] summary::after { transform: rotate(45deg); }

.w3p-faq p {
    max-width: 60rem;
    margin: 0;
    padding: 0 0 2rem;
    color: var(--w3p-muted-dark);
    font-size: 1.5rem;
    line-height: 1.55;
}

.w3p-empty {
    display: grid;
    justify-items: start;
    gap: 0.8rem;
    max-width: 56rem;
    padding: 2.8rem;
    background: var(--w3p-soft);
    border-radius: var(--w3p-radius);
}

.w3p-empty strong { font-size: 1.7rem; letter-spacing: -0.02em; }
.w3p-empty span { color: var(--w3p-muted); font-size: 1.45rem; line-height: 1.5; }
.w3p-empty .w3p-btn { margin-top: 1.2rem; }

/* ---------- 11. Кабинет /library/ ---------- */

.w3p-library-main { padding-top: clamp(3.2rem, 5vw, 4.8rem); }

.w3p-guest-card {
    display: flex;
    gap: 2.4rem;
    align-items: flex-start;
    max-width: 68rem;
    padding: 2.8rem;
    background: var(--w3p-paper);
    border: 1px solid var(--w3p-hairline);
    border-radius: var(--w3p-radius);
}

.w3p-guest-icon {
    display: grid;
    place-items: center;
    flex: 0 0 5.4rem;
    width: 5.4rem;
    height: 5.4rem;
    color: var(--w3p-paper);
    background: var(--w3p-telegram);
    border-radius: 50%;
}

.w3p-guest-icon svg { width: 2.4rem; height: 2.4rem; }

.w3p-guest-copy h2 { font-size: 2.2rem; font-weight: 650; letter-spacing: -0.03em; }

.w3p-guest-copy p {
    max-width: 44rem;
    margin-top: 0.8rem;
    color: var(--w3p-muted);
    font-size: 1.5rem;
    line-height: 1.5;
}

.w3p-guest-copy .w3p-btn { margin-top: 2rem; }

.w3p-guest-note {
    display: block;
    margin-top: 1.4rem;
    font-family: var(--w3p-font-mono);
    font-size: 1.1rem;
    color: var(--w3p-muted);
}

@media (max-width: 519px) {
    .w3p-guest-card { flex-direction: column; padding: 2.2rem; }
}

.w3p-access-card {
    padding: 2rem 2.4rem;
    background: var(--w3p-paper);
    border: 1px solid var(--w3p-hairline);
    border-radius: var(--w3p-radius);
}

.w3p-access-user { display: flex; align-items: center; gap: 1.4rem; }

.w3p-access-copy { min-width: 0; }

.w3p-avatar-lg { width: 5.2rem; height: 5.2rem; font-size: 1.7rem; }

.w3p-access-label {
    font-family: var(--w3p-font-mono);
    font-size: 1.1rem;
    color: var(--w3p-muted);
}

.w3p-access-name {
    display: block;
    margin-top: 0.3rem;
    overflow: hidden;
    font-size: 1.8rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.w3p-access-logout {
    appearance: none;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: var(--w3p-tap);
    margin-left: auto;
    padding: 0 0.6rem;
    color: var(--w3p-muted);
    font-family: var(--font-sans);
    font-size: 1.3rem;
    font-weight: 550;
    cursor: pointer;
    background: transparent;
    border: 0;
}

.w3p-access-logout:hover { color: var(--w3p-ink); }

.w3p-library-catalog { margin-top: clamp(3.2rem, 5vw, 4.8rem); }

.w3p-section-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem 2rem;
    margin-bottom: 2rem;
}

.w3p-section-heading h2 { font-size: 2.2rem; letter-spacing: -0.03em; }

.w3p-heading-link { font-size: 1.4rem; font-weight: 600; color: var(--w3p-ink); }
.w3p-heading-link:hover { opacity: 0.75; }

.w3p-library-loading { padding: 2.4rem 0; color: var(--w3p-muted); font-family: var(--w3p-font-mono); font-size: 1.3rem; }

.w3p-library-read {
    display: inline-flex;
    align-items: center;
    min-height: var(--w3p-tap);
    padding: 0 2.2rem 1rem;
    color: var(--w3p-signal);
    font-weight: 700;
}

.w3p-card-purchased { color: var(--w3p-muted); font-family: var(--w3p-font-mono); font-size: 1.1rem; }

/* ---------- 12. Модалки и тост ---------- */

.w3p-modal-open { overflow: hidden; }

.w3p-modal {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.w3p-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 13, 16, 0.6);
    backdrop-filter: blur(6px);
}

.w3p-modal-dialog {
    position: relative;
    width: min(44rem, 100%);
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 4.4rem 3.6rem 3rem;
    text-align: center;
    color: var(--w3p-ink);
    background: var(--w3p-paper);
    border-radius: var(--w3p-radius);
    box-shadow: 0 2.4rem 7rem rgba(13, 13, 16, 0.3);
    outline: none;
}

.w3p-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: grid;
    place-items: center;
    width: var(--w3p-tap);
    height: var(--w3p-tap);
    color: var(--w3p-muted);
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 50%;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.w3p-modal-close:hover { color: var(--w3p-ink); background: var(--w3p-soft); }
.w3p-modal-close svg { width: 1.8rem; height: 1.8rem; }

.w3p-modal-title {
    margin-top: 1.2rem;
    font-size: 2.8rem;
    font-weight: 650;
    letter-spacing: -0.038em;
}

.w3p-modal-copy {
    max-width: 32rem;
    margin: 1.2rem auto 2.4rem;
    color: var(--w3p-muted);
    font-size: 1.5rem;
    line-height: 1.5;
}

.w3p-telegram-widget {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 5rem;
}

.w3p-widget-fallback {
    font-family: var(--w3p-font-mono);
    font-size: 1.2rem;
    color: var(--w3p-muted);
}

.w3p-auth-status {
    min-height: 2.2rem;
    margin: 1.4rem 0 0;
    color: var(--w3p-signal);
    font-size: 1.35rem;
}

.w3p-auth-status.is-error { color: var(--w3p-danger); }

.w3p-modal-note {
    max-width: 34rem;
    margin: 1.2rem auto 0;
    color: #9a9aa0;
    font-size: 1.15rem;
    line-height: 1.5;
}

.w3p-checkout-dialog { width: min(48rem, 100%); }

.w3p-checkout-price {
    margin: 2.4rem 0;
    font-family: var(--w3p-font-mono);
    font-size: clamp(2.6rem, 5vw, 3.6rem);
    font-weight: 750;
}

.w3p-checkout-actions { display: grid; gap: 1rem; }
.w3p-checkout-actions .w3p-btn { width: 100%; }

@media (max-width: 767px) {
    .w3p-modal { align-items: end; padding: 0; }
    .w3p-modal-dialog {
        width: 100%;
        max-height: calc(100vh - 3.2rem);
        max-height: calc(100dvh - 3.2rem);
        padding: 4.2rem 2.2rem calc(2.4rem + env(safe-area-inset-bottom));
        border-radius: 2.4rem 2.4rem 0 0;
    }
    .w3p-modal-title { font-size: 2.5rem; }
}

.w3p-toast {
    position: fixed;
    left: 50%;
    bottom: 2.4rem;
    z-index: 99999999;
    width: min(48rem, calc(100% - 3.2rem));
    padding: 1.5rem 2rem;
    color: var(--w3p-paper);
    font-family: var(--font-sans);
    font-size: 1.35rem;
    font-weight: 550;
    line-height: 1.45;
    text-align: center;
    background: rgba(16, 16, 20, 0.96);
    border-radius: var(--w3p-radius-s);
    box-shadow: 0 1.6rem 4.4rem rgba(13, 13, 16, 0.28);
    transform: translateX(-50%);
    animation: w3p-toast-in 0.22s ease;
}

@keyframes w3p-toast-in {
    from { opacity: 0; transform: translate(-50%, 0.8rem); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- 13. Футер ---------- */

/* База Journal ставит white-space: nowrap на весь .gh-foot —
   возвращаем нормальный перенос, иначе длинные строки
   (дисклеймер, описание) вызывают горизонтальный скролл */
.w3p-foot,
.w3p-foot * { white-space: normal; }

.w3p-foot { padding: clamp(4rem, 6vw, 6.4rem) 0 3.2rem; border-top: 1px solid var(--w3p-hairline); }

.w3p-foot-bottom > * { min-width: 0; }

.w3p-foot-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(16rem, 1fr));
    gap: 3.2rem 4rem;
}

.w3p-foot-logo { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em; color: var(--w3p-ink); }
.w3p-foot-logo:hover { opacity: 0.75; }

.w3p-foot-brand p {
    max-width: 34rem;
    margin-top: 1rem;
    color: var(--w3p-muted);
    font-size: 1.35rem;
    line-height: 1.5;
}

.w3p-foot-col .w3p-menu-label { margin-top: 0; }

.w3p-foot-col .nav {
    display: grid;
    gap: 0.2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.w3p-foot-col .nav a {
    display: inline-flex;
    align-items: center;
    min-height: 3.2rem;
    color: var(--w3p-muted-dark);
    font-size: 1.4rem;
    font-weight: 500;
}

.w3p-foot-col .nav a:hover { color: var(--w3p-ink); opacity: 1; }

.w3p-foot-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 2.4rem;
    margin-top: clamp(3.2rem, 5vw, 4.8rem);
    padding-top: 2rem;
    border-top: 1px solid var(--w3p-hairline);
    color: var(--w3p-muted);
    font-size: 1.25rem;
    line-height: 1.5;
}

.w3p-foot-disclaimer { max-width: 72rem; }

@media (max-width: 719px) {
    .w3p-foot-grid { grid-template-columns: 1fr; gap: 2.8rem; }
}

/* ---------- 14. Доступность и reduced motion ---------- */

:focus-visible {
    outline: 2px solid var(--w3p-ink);
    outline-offset: 2px;
    border-radius: 0.4rem;
}

.w3p-btn:focus-visible,
.w3p-head-pro:focus-visible,
.w3p-auth-login:focus-visible,
.w3p-auth-account:focus-visible,
.w3p-topic:focus-visible { outline-offset: 3px; border-radius: 999px; }

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Кнопка перехода из /tag/pro/ в каталог */
.w3p-tag-pro-cta { margin: 2.4rem 0 0; }
