/* ============================================================
   ФОРУМ — современный дизайн в стиле каталога,
   но с сохранением живого «обсуждающего» духа
   (аватарки авторов, счётчики подтем/сообщений, метки статусов)
   ============================================================ */

/* ============================================================
   HERO
   ============================================================ */
.forum-hero {
    position: relative;
    margin: 1.2rem 0 2rem;
    padding: 2.4rem 2rem 2.2rem;
    border-radius: 22px;
    overflow: hidden;
    border: 2px solid var(--border);
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    isolation: isolate;
}

.forum-hero__bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 18% 28%, rgba(255, 94, 0, 0.22), transparent 55%),
        radial-gradient(circle at 82% 72%, rgba(255, 140, 0, 0.15), transparent 50%);
    animation: heroShine 9s ease-in-out infinite alternate;
}

@keyframes heroShine {
    0%   { filter: hue-rotate(0deg) brightness(1); }
    100% { filter: hue-rotate(-10deg) brightness(1.08); }
}

.forum-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 4px;
    background: var(--orange-gradient);
    z-index: 1;
}

/* Вариант с большой картинкой темы на заднике */
.forum-hero--topic {
    min-height: 240px;
    padding-top: 2.6rem;
}

.forum-hero__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    opacity: 0.5;
    filter: saturate(0.9) blur(1px);
}

.forum-hero--topic::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(10, 10, 10, 0.92) 0%,
        rgba(10, 10, 10, 0.7) 50%,
        rgba(10, 10, 10, 0.55) 100%
    );
    z-index: -1;
}

.forum-hero__kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    background: rgba(255, 94, 0, 0.12);
    border: 1px solid rgba(255, 94, 0, 0.35);
    border-radius: 30px;
    color: var(--orange);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.forum-hero__title {
    background: var(--orange-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 0.6rem;
    padding: 0.1rem 0;
    word-break: break-word;
}

.forum-hero__sub {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.55;
    margin: 0 0 1.2rem;
    max-width: 640px;
}

/* ===== Мета-инфо внутри HERO (для under_topic_list) ===== */
.forum-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1.2rem;
    align-items: center;
    margin-bottom: 1.2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.forum-hero__author {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
    transition: color 0.2s ease;
}

.forum-hero__author:hover {
    color: var(--orange);
}

.forum-hero__author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--orange-gradient);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    border: 2px solid rgba(255, 94, 0, 0.3);
}

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

.forum-hero__date {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.forum-hero__date i {
    color: var(--orange);
}

/* ===== Hero-кнопки ===== */
.forum-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.btn-hero-primary,
.btn-hero-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.3rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 30px;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.btn-hero-primary {
    background: var(--orange-gradient);
    color: #fff;
    box-shadow: var(--shadow-orange);
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px var(--orange-glow);
    color: #fff;
}

.btn-hero-ghost {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
    color: var(--text-soft);
}

.btn-hero-ghost:hover {
    border-color: var(--orange);
    color: var(--orange);
    background: rgba(255, 94, 0, 0.08);
}

/* ============================================================
   Хлебные крошки
   ============================================================ */
.forum-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.4rem 0 0.8rem;
    padding: 0.4rem 0.9rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.forum-breadcrumb a {
    color: var(--text-soft);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s ease;
}

.forum-breadcrumb a:hover {
    color: var(--orange);
}

.forum-breadcrumb__sep {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================================
   GRID
   ============================================================ */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1.4rem;
    margin: 0 0 3rem;
}

/* ============================================================
   TOPIC CARD
   ============================================================ */
.topic-card {
    --delay: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--black-card, #111);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    isolation: isolate;
    animation: fadeUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(var(--delay) * 55ms);
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
                border-color 0.25s ease,
                box-shadow 0.35s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.topic-card:hover {
    transform: translateY(-8px);
    border-color: var(--orange);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 94, 0, 0.2),
        0 0 42px rgba(255, 94, 0, 0.15);
}

.topic-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--orange-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    z-index: 4;
}

.topic-card:hover::before {
    transform: scaleX(1);
}

/* Жёлтая полоса для неодобренных (на модерации) */
.topic-card--pending::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #fbbf24, #f59e0b);
    z-index: 4;
}

/* ===== VISUAL ===== */
.topic-card__visual {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--black);
    text-decoration: none;
    color: inherit;
}

.topic-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.4s ease;
    filter: saturate(0.9) brightness(0.9);
}

.topic-card:hover .topic-card__img {
    transform: scale(1.08);
    filter: saturate(1.1) brightness(1);
}

.topic-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.92) 0%,
        rgba(0, 0, 0, 0.72) 35%,
        rgba(0, 0, 0, 0.2) 60%,
        rgba(0, 0, 0, 0) 85%
    );
    z-index: 1;
}

/* ===== Плейсхолдер ===== */
.topic-card__pattern {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 94, 0, 0.25), transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 140, 0, 0.18), transparent 55%),
        linear-gradient(135deg, #1a1a1a, #0a0a0a);
    overflow: hidden;
}

.topic-card__pattern::before,
.topic-card__pattern::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: var(--orange-gradient);
    opacity: 0.15;
    filter: blur(40px);
}

.topic-card__pattern::before {
    width: 180px; height: 180px;
    top: -40px; left: -40px;
}

.topic-card__pattern::after {
    width: 220px; height: 220px;
    bottom: -60px; right: -60px;
}

.topic-card__pattern-letter {
    position: relative;
    z-index: 1;
    background: var(--orange-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 5.5rem;
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1;
    opacity: 0.65;
    transition: transform 0.5s ease, opacity 0.4s ease;
}

.topic-card:hover .topic-card__pattern-letter {
    transform: scale(1.08) rotate(-4deg);
    opacity: 0.85;
}

/* ===== Бейджи ===== */
.topic-card__badges {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    pointer-events: none;
    flex-wrap: wrap;
}

.topic-card__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 700;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.topic-card__chip i {
    color: var(--orange);
    font-size: 0.82rem;
}

.topic-card__chip--pending {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.95), rgba(245, 158, 11, 0.95));
    border-color: transparent;
    color: #1a1100;
}

.topic-card__chip--pending i {
    color: #1a1100;
}

/* ===== Titlebox (название + превью) ===== */
.topic-card__titlebox {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 1.15rem 1.25rem 1rem;
    z-index: 2;
    color: #fff;
}

.topic-card__title {
    margin: 0 0 0.35rem;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.22;
    color: #fff;
    letter-spacing: -0.2px;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.topic-card:hover .topic-card__title {
    color: var(--orange);
}

.topic-card__preview {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.85rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* ============================================================
   FOOTER (автор + действия)
   ============================================================ */
.topic-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(0, 0, 0, 0));
    flex-wrap: wrap;
    z-index: 2;
    position: relative;
}

.topic-card__author {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    flex: 1;
}

.topic-card__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--orange-gradient);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
    border: 2px solid rgba(255, 94, 0, 0.3);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.topic-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topic-card__author:hover .topic-card__avatar {
    transform: scale(1.06);
    border-color: var(--orange);
}

.topic-card__author-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topic-card__author-name {
    color: var(--text);
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.2;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.topic-card__author:hover .topic-card__author-name {
    color: var(--orange);
}

.topic-card__date {
    color: var(--text-muted);
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 2px;
}

.topic-card__date i {
    font-size: 0.78rem;
    color: var(--orange);
}

/* ===== Actions ===== */
.topic-card__actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.topic-card__btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    font-size: 0.85rem;
    padding: 0;
}

.topic-card__btn--edit:hover {
    background: rgba(255, 94, 0, 0.12);
    border-color: var(--orange);
    color: var(--orange);
    transform: scale(1.08);
}

.topic-card__btn--delete:hover {
    background: rgba(248, 113, 113, 0.12);
    border-color: #f87171;
    color: #f87171;
    transform: scale(1.08);
}

.topic-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: rgba(255, 94, 0, 0.1);
    color: var(--orange);
    border: 1px solid rgba(255, 94, 0, 0.3);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease, transform 0.3s ease;
    white-space: nowrap;
}

.topic-card__cta i {
    transition: transform 0.3s ease;
}

.topic-card__cta:hover {
    background: var(--orange);
    color: #fff;
    transform: translateY(-1px);
}

.topic-card__cta:hover i {
    transform: translateX(4px);
}

/* ============================================================
   THREAD (сообщения под подтемой)
   Двухколоночная карточка: слева автор, справа тело
   ============================================================ */
.messages-thread {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0 0 2rem;
}

.thread-message {
    --delay: 0;
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 0;
    background: linear-gradient(135deg, var(--black-lighter, #161616), var(--black-card, #0f0f0f));
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    animation: fadeUp 0.35s ease both;
    animation-delay: calc(var(--delay) * 40ms);
    transition: border-color 0.2s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.thread-message:hover {
    border-color: var(--orange);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 94, 0, 0.12);
}

.thread-message:target {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 94, 0, 0.2);
}

/* ===== Левая колонка ===== */
.thread-message__side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.1rem 0.8rem;
    background: rgba(0, 0, 0, 0.25);
    border-right: 1px solid var(--border);
    text-align: center;
}

.thread-message__avatar-link {
    text-decoration: none;
}

.thread-message__avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--orange-gradient);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    overflow: hidden;
    border: 3px solid rgba(255, 94, 0, 0.35);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.thread-message__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thread-message__avatar-link:hover .thread-message__avatar {
    transform: scale(1.05);
    border-color: var(--orange);
}

.thread-message__nickname {
    color: var(--text);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.thread-message__nickname:hover {
    color: var(--orange);
}

.thread-message__user-badges {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.3rem;
}

.thread-message__user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.thread-message__user-badge--admin {
    background: linear-gradient(135deg, #f87171, #dc2626);
    color: #fff;
}

.thread-message__user-badge--mod {
    background: rgba(255, 94, 0, 0.15);
    color: var(--orange);
    border: 1px solid rgba(255, 94, 0, 0.4);
}

.thread-message__user-badge--verified {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.35);
    padding: 3px 7px;
}

/* ===== Правая колонка ===== */
.thread-message__body {
    display: flex;
    flex-direction: column;
    padding: 1.1rem 1.3rem;
    min-width: 0;
}

.thread-message__head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    padding-bottom: 0.7rem;
    margin-bottom: 0.9rem;
    border-bottom: 1px dashed var(--border);
    color: var(--text-muted);
    font-size: 0.82rem;
}

.thread-message__num {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: var(--orange-gradient);
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    border-radius: 20px;
    box-shadow: var(--shadow-orange);
}

.thread-message__date {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.thread-message__date i {
    color: var(--orange);
    font-size: 0.85rem;
}

.thread-message__date--edited {
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.85;
}

.thread-message__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.thread-message__content {
    color: var(--text);
    line-height: 1.65;
    font-size: 0.98rem;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* ===== Галерея картинок в сообщении ===== */
.thread-message__gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.55rem;
    margin-top: 0.9rem;
    padding-top: 0.7rem;
    border-top: 1px dashed var(--border);
}

.thread-message__img-wrap {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: var(--black);
    border: 1.5px solid var(--border);
    transition: border-color 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease;
}

.thread-message__img-wrap:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: var(--orange);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 94, 0, 0.25);
}

.thread-message__img-wrap::after {
    content: '\F43A';               /* bi-zoom-in (Bootstrap Icons glyph) */
    font-family: 'bootstrap-icons';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    transform: translateY(-4px);
    pointer-events: none;
}

.thread-message__img-wrap:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.thread-message__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.thread-message__img-wrap:hover .thread-message__img {
    transform: scale(1.06);
}

@media (max-width: 576px) {
    .thread-message__gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* ===== Адаптив thread ===== */
@media (max-width: 768px) {
    .thread-message {
        grid-template-columns: 1fr;
    }
    .thread-message__side {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        text-align: left;
        padding: 0.8rem 1rem;
        gap: 0.7rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .thread-message__avatar {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
        border-width: 2px;
    }
    .thread-message__nickname {
        font-size: 0.88rem;
        max-width: none;
    }
    .thread-message__user-badges {
        flex-direction: row;
        margin-top: 0;
        flex-wrap: wrap;
    }
    .thread-message__head {
        font-size: 0.78rem;
    }
}


/* ============================================================
   EMPTY STATE
   ============================================================ */
.forum-empty {
    text-align: center;
    padding: 4rem 1rem;
}

.forum-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 86px;
    height: 86px;
    background: rgba(255, 94, 0, 0.08);
    border: 2px dashed var(--border);
    border-radius: 50%;
    color: var(--orange);
    font-size: 2.2rem;
    margin: 0 auto 1.1rem;
}

.forum-empty h3 {
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.forum-empty p {
    color: var(--text-muted);
    margin: 0 0 1.4rem;
}

/* ============================================================
   ПАГИНАЦИЯ (оставляем как в products)
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.8rem;
    border-radius: 10px;
    background: var(--black-light);
    border: 1px solid var(--border);
    color: var(--text-soft);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pagination a:hover {
    background: var(--black-lighter);
    border-color: var(--orange);
    color: var(--orange);
}

.pagination .current {
    background: var(--orange-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: var(--shadow-orange);
}

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 992px) {
    .forum-hero {
        padding: 1.8rem 1.4rem 1.6rem;
    }
    .topic-grid {
        grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
        gap: 1.1rem;
    }
}

@media (max-width: 576px) {
    .forum-hero {
        padding: 1.5rem 1.2rem;
    }
    .forum-hero__title { font-size: 1.5rem; }
    .forum-hero__sub   { font-size: 0.92rem; }
    .topic-grid {
        grid-template-columns: 1fr;
    }
    .topic-card__title { font-size: 1.1rem; }
    .topic-card__author-name { max-width: 90px; }
}


/* ============================================================
   ГЛОБАЛЬНЫЕ ПЛАВНЫЕ ПЕРЕХОДЫ
   ============================================================ */

/* HERO / breadcrumbs — плавный вход при загрузке */
.forum-hero {
    animation: heroFadeIn 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.forum-breadcrumb {
    animation: crumbFadeIn 0.4s ease both;
    animation-delay: 60ms;
}

@keyframes crumbFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Унифицированные transition-свойства для всех интерактивных элементов */
.topic-card,
.topic-card__visual,
.topic-card__img,
.topic-card__cta,
.topic-card__btn,
.topic-card__avatar,
.thread-message,
.thread-message__avatar,
.btn-hero-primary,
.btn-hero-ghost,
.forum-hero__author,
.forum-breadcrumb a,
.pagination a {
    transition-property: background, color, border-color, box-shadow, transform, opacity, filter;
    transition-duration: 0.28s;
    transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Thread-сообщения — более чувствительная stagger-анимация */
.thread-message {
    animation: threadIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(var(--delay, 0) * 45ms);
}

@keyframes threadIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Плавная трансформация :target (при якоре #message-N) */
.thread-message:target {
    animation: targetPulse 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes targetPulse {
    0%   { box-shadow: 0 0 0 6px rgba(255, 94, 0, 0.35); }
    60%  { box-shadow: 0 0 0 3px rgba(255, 94, 0, 0.2);  }
    100% { box-shadow: 0 0 0 0   rgba(255, 94, 0, 0);    }
}

/* Плавное появление пустого состояния */
.forum-empty {
    animation: fadeUp 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* ===== Уважение системных настроек reduce motion ===== */
@media (prefers-reduced-motion: reduce) {
    .forum-hero,
    .forum-breadcrumb,
    .topic-card,
    .thread-message,
    .forum-empty {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
