/* =====================================================================
   Загальні сторінки: помилки, авторизація, списки, кабінет користувача
   ===================================================================== */

/* Підвал притискається донизу навіть на коротких сторінках */
body { display: flex; flex-direction: column; min-height: 100vh; }
.page { flex: 1 0 auto; display: flex; flex-direction: column; }
.footer { flex-shrink: 0; }

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px 28px 72px;
}
.container--narrow { max-width: 780px; }

.page-head { margin-bottom: 26px; }
.page-head__title { font-size: var(--t-3xl); letter-spacing: -0.025em; margin-bottom: 6px; }
.page-head__subtitle { color: var(--text-muted); font-size: var(--t-md); }
.page-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* --- Помилка ---------------------------------------------------------- */
.error-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 90px 24px;
    gap: 12px;
}
.error-page__code {
    font-size: 76px;
    font-weight: 600;
    letter-spacing: -0.04em;
    color: var(--line-bright);
    line-height: 1;
}
.error-page__title { font-size: var(--t-2xl); }
.error-page__text { color: var(--text-muted); max-width: 440px; }
.error-page__actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }

/* --- Авторизація ------------------------------------------------------- */
.auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth__box { width: min(420px, 100%); }
.auth__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 22px;
}
.auth__card {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    background: var(--bg-raised);
}
.auth__title { font-size: var(--t-xl); margin-bottom: 4px; }
.auth__subtitle { color: var(--text-muted); font-size: var(--t-base); margin-bottom: 22px; }
.auth__foot {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-size: var(--t-base);
    color: var(--text-muted);
    text-align: center;
}
.auth__foot a { color: var(--accent-text); }
.auth__foot a:hover { text-decoration: underline; }
.auth__links { display: flex; justify-content: space-between; gap: 12px; margin-top: -6px; margin-bottom: 16px; }
.auth__links a { font-size: var(--t-sm); color: var(--text-muted); }
.auth__links a:hover { color: var(--text); }

/* --- Списки публікацій та акцій ---------------------------------------- */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

/* --- Стаття ------------------------------------------------------------- */
.article { max-width: 780px; margin: 0 auto; }
.article__cover {
    width: 100%;
    aspect-ratio: 16 / 7;
    object-fit: cover;
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    margin-bottom: 24px;
}
.article__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: var(--t-sm);
    color: var(--text-muted);
    margin-bottom: 12px;
}
.article__title { font-size: var(--t-3xl); letter-spacing: -0.025em; margin-bottom: 10px; }
.article__subtitle { font-size: var(--t-lg); color: var(--text-soft); margin-bottom: 24px; }
.article__author {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--bg-raised);
    margin: 28px 0;
}
.article__author-body { flex: 1; min-width: 0; }
.article__author-name { font-size: var(--t-md); font-weight: 550; }
.article__author-meta { font-size: var(--t-sm); color: var(--text-muted); }

/* --- Кабінет користувача ------------------------------------------------ */
.account {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}
.account__body { min-width: 0; }

.account__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: sticky;
    top: calc(var(--topbar-h) + 20px);
}
.account__link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border-radius: var(--r-md);
    font-size: var(--t-base);
    color: var(--text-muted);
    transition: all var(--fast) var(--ease);
}
.account__link:hover { background: var(--tint-soft); color: var(--text); }
.account__link.is-active { background: var(--accent-soft); color: var(--accent-text); }
.account__link svg { width: 15px; height: 15px; }
.account__link .counter { margin-left: auto; }

.chat-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--bg-raised);
    min-height: 520px;
}
.chat-layout__list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 640px; }
.chat-layout__view { display: flex; flex-direction: column; min-height: 0; }

.notification {
    display: flex;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
}
.notification:last-child { border-bottom: none; }
.notification.is-unread { background: rgba(201, 174, 133, 0.05); }
.notification__icon {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    color: var(--text-muted);
    flex-shrink: 0;
}
.notification__title { font-size: var(--t-base); font-weight: 500; }
.notification__body { font-size: var(--t-base); color: var(--text-muted); }
.notification__time { font-size: var(--t-sm); color: var(--text-faint); margin-top: 3px; }

@media (max-width: 900px) {
    .account { grid-template-columns: minmax(0, 1fr); }
    .account__nav {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--line);
        margin-bottom: 18px;
    }
    .account__nav::-webkit-scrollbar { display: none; }
    .account__link { white-space: nowrap; }
    .chat-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .chat-layout__list {
        border-right: none;
        border-bottom: 1px solid var(--line);
        max-height: 40vh;
        height: auto;
    }
    .chat-layout__view { min-height: 320px; }
    .container { padding: 22px 18px 60px; }
}
