/* ===================================
   Fireflame Blog — Telegram-style
   =================================== */

/* ── Фон страницы ── */
.ffb-blog-page-bg {
    background: #dbcab4;
    min-height: 100vh;
}
/* ── Белый фон страницы блога ── */
.ffb-blog-wrap ~ * ,
.dashboard-page {
    background: #ffffff;
}

/* Внешняя обёртка — цветной фон с закруглёнными углами */
.ffb-blog-wrap {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    background: #dbcab4;
    border-radius: 20px;
    overflow: hidden;
}

/* Внутренний контейнер с отступами */
.ffb-blog-wrap__inner {
    padding: 20px 16px 60px;
}

/* ── Закреплённые разделы (табы сверху) ── */
.ffb-sections-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #dbcab4;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 14px 16px 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(0,0,0,0.07);
}

.ffb-section-pill {
    padding: 3px 8px;
    border-radius: 14px;
    border: 1.5px solid rgba(0,0,0,0.15);
    background: #fff;
    color: #6b5a4e;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.18s;
    font-family: var(--font-primary, inherit);
}

.ffb-section-pill:hover {
    border-color: var(--color-accent, #b8956a);
    color: var(--color-accent, #b8956a);
}

.ffb-section-pill.active {
    background: var(--color-accent, #b8956a);
    border-color: var(--color-accent, #b8956a);
    color: #fff;
}

/* ── Пост — белая подложка с закруглёнными углами ── */
.ffb-blog-wrap .ffb-post,
article.ffb-post {
    background: #ffffff !important;
    border: none !important;
    border-radius: 18px !important;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

.ffb-post.is-sticky {
    box-shadow: 0 0 0 2px var(--color-accent, #b8956a), 0 1px 4px rgba(0,0,0,0.06);
}

/* Закреплено */
.ffb-post__pinned {
    padding: 10px 18px 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-accent, #b8956a);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Метка раздела */
.ffb-post__section-label {
    padding: 10px 18px 0;
}

.ffb-section-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-accent, #b8956a);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    text-decoration: none;
}

.ffb-section-tag:hover { opacity: 0.75; }

/* ── Фото 4:3 ── */
.ffb-post__image-wrap {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    margin-top: 10px;
}

.ffb-post__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Видео */
.ffb-video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-top: 10px;
}

.ffb-video-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* ── Тело поста ── */
.ffb-post__body {
    padding: 16px 18px 14px;
}

.ffb-post__title {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 18px;
    font-weight: 600;
    color: #0b0806;
    margin: 0 0 10px;
    line-height: 1.3;
}

/* Контент */
.ffb-post__content {
    font-size: 14px;
    line-height: 1.5;
    color: #0b0806;
    margin-bottom: 12px;
    text-align: justify;
}

.ffb-post__content p {
    margin: 0 0 10px;
}

.ffb-post__content p:last-child { margin-bottom: 0; }

.ffb-post__content h2,
.ffb-post__content h3 {
    font-family: var(--font-serif, Georgia, serif);
    font-size: 16px;
    font-weight: 600;
    margin: 16px 0 7px;
    color: #0b0806;
    text-align: left;
}

.ffb-post__content img {
    max-width: 100%;
    border-radius: 10px;
    margin: 8px 0;
}

.ffb-post__content ul,
.ffb-post__content ol {
    padding-left: 20px;
    margin: 8px 0 10px;
    text-align: left;
}

.ffb-post__content li {
    margin-bottom: 4px;
}

/* Кнопка в посте */
.ffb-post__btn-wrap {
    margin: 14px 0 10px;
}

.ffb-post__btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--color-accent, #b8956a);
    color: #fff;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s;
}

.ffb-post__btn:hover { opacity: 0.85; color: #fff; }

/* Теги */
.ffb-post__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.ffb-post__tag {
    font-size: 13px;
    color: var(--color-accent, #b8956a);
    font-weight: 500;
}

/* ── Мета: дата + просмотры + комментарии ── */
.ffb-post__meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: #999;
    padding-top: 5px;
    border-top: 1px solid #f0ebe4;
    flex-wrap: wrap;
}

.ffb-post__date { color: #aaa; }

.ffb-post__views {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ffb-post__comments-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 16px;
    font-family: var(--font-primary, inherit);
    cursor: pointer;
    padding: 0;
    transition: color 0.18s;
}

.ffb-post__comments-toggle:hover,
.ffb-post__comments-toggle.is-open {
    color: var(--color-accent, #b8956a);
}

/* ── Реакции ── */
.ffb-post__reactions {
    padding: 10px 18px 14px;
    border-top: 1px solid #f0ebe4;
}

.ffb-reactions-block {
    background: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    text-align: left;
}

.ffb-reactions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.ffb-reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1.5px solid #e8e3dc;
    border-radius: 20px;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.18s;
    color: #999;
    font-family: var(--font-primary, inherit);
}

.ffb-reaction-btn:hover {
    border-color: var(--color-accent, #b8956a);
    background: rgba(184,149,106,0.06);
}

.ffb-reaction-btn.active {
    border-color: var(--color-accent, #b8956a);
    background: rgba(184,149,106,0.10);
    color: #0b0806;
}

.ffb-reaction-btn .ffb-reaction-emoji { font-size: 16px; line-height: 1; }
.ffb-reaction-btn .ffb-reaction-count { font-size: 12px; font-weight: 600; }

/* ── Попап реакций (двойной клик/тап) ── */
.ffb-reaction-popup {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.85);
    background: #ffffff;
    border-radius: 16px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: repeat(8, 44px);
    gap: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ffb-reaction-popup.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) scale(1);
}

/* Стрелочка вниз */
.ffb-reaction-popup::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #ffffff;
    border-bottom: none;
}

.ffb-reaction-popup__btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s;
    line-height: 1;
}

.ffb-reaction-popup__btn:hover {
    transform: scale(1.35);
}

/* Обёртка поста — relative для позиционирования попапа */
.ffb-post {
    position: relative;
}

/* ── Блок комментариев ── */
.ffb-post__comments {
    border-top: 1px solid #f0ebe4;
    padding: 16px 18px;
}

.ffb-comments-list { margin-bottom: 16px; }

/* Комментарий */
.ffb-comment {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.ffb-comment.is-reply {
    margin-left: 40px;
}

.ffb-comment__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f0e8dc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-accent, #b8956a);
    flex-shrink: 0;
    font-family: var(--font-serif, Georgia, serif);
}

.ffb-comment__body {
    flex: 1;
    background: #f9f6f2;
    border-radius: 12px;
    padding: 9px 13px;
}

.ffb-comment__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.ffb-comment__author {
    font-weight: 600;
    font-size: 13px;
    color: #0b0806;
}

.ffb-comment__date {
    font-size: 11px;
    color: #bbb;
}

.ffb-comment__text {
    font-size: 13px;
    line-height: 1.55;
    color: #0b0806;
    margin: 0 0 5px;
}

.ffb-comment__reply-btn {
    font-size: 12px;
    color: var(--color-accent, #b8956a);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font-primary, inherit);
    font-weight: 500;
}

.ffb-comment__reply-btn:hover { text-decoration: underline; }

/* Форма комментария */
.ffb-comment-form { margin-top: 4px; }

.ffb-comment-form__reply-to {
    font-size: 12px;
    color: var(--color-accent, #b8956a);
    margin-bottom: 8px;
    font-weight: 500;
}

.ffb-comment-form__form textarea {
    width: 100%;
    min-height: 68px;
    padding: 10px 14px;
    border: 1.5px solid #e8e3dc;
    border-radius: 12px;
    font-family: var(--font-primary, inherit);
    font-size: 13px;
    color: #0b0806;
    background: #fff;
    resize: none;
    box-sizing: border-box;
    transition: border-color 0.18s;
    outline: none;
}

.ffb-comment-form__form textarea:focus {
    border-color: var(--color-accent, #b8956a);
}

.ffb-comment-form__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.ffb-comment-submit {
    padding: 8px 20px;
    background: var(--color-accent, #b8956a);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: var(--font-primary, inherit);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.18s;
}

.ffb-comment-submit:hover { opacity: 0.85; }
.ffb-comment-submit:disabled { opacity: 0.5; cursor: default; }

.ffb-comment-cancel {
    padding: 8px 14px;
    background: none;
    border: 1.5px solid #e8e3dc;
    border-radius: 10px;
    font-family: var(--font-primary, inherit);
    font-size: 13px;
    color: #999;
    cursor: pointer;
    transition: all 0.18s;
}

.ffb-comment-cancel:hover { border-color: #999; }

.ffb-comment-login-note {
    text-align: center;
    padding: 12px;
    color: #aaa;
    font-size: 13px;
}

.ffb-comment-login-note a {
    color: var(--color-accent, #b8956a);
    text-decoration: underline;
}

/* ── Загрузить ещё ── */
.ffb-load-more-wrap {
    text-align: center;
    margin-top: 24px;
}

.ffb-load-more-btn {
    padding: 11px 36px;
    border: 1.5px solid rgba(0,0,0,0.15);
    border-radius: 20px;
    background: transparent;
    color: #6b5a4e;
    font-family: var(--font-primary, inherit);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
}

.ffb-load-more-btn:hover {
    border-color: var(--color-accent, #b8956a);
    color: var(--color-accent, #b8956a);
}

.ffb-load-more-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ── Toast ── */
.ffb-copy-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0b0806;
    color: #fff;
    padding: 10px 22px;
    border-radius: 20px;
    font-size: 13px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 9999;
    pointer-events: none;
}

.ffb-copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Адаптив мобильный ── */
@media (max-width: 768px) {
    .ffb-blog-wrap {
        border-radius: 14px;
    }

    .ffb-blog-wrap__inner {
        padding: 12px 20px 5px 5px;
        margin: 5px 0px;
    }

    .ffb-sections-bar {
        gap: 5px;
        padding: 10px 12px 11px;
        margin-bottom: 12px;
        border-radius: 14px 14px 0 0;
    }

    .ffb-section-pill {
        font-size: 12px;
        padding: 2px 8px;
    }

    .ffb-post {
        border-radius: 14px;
        margin-bottom: 10px;
    }

    .ffb-post__body {
        padding: 13px 14px 12px;
    }

    .ffb-post__title {
        font-size: 14px;
    }

    .ffb-post__content {
        font-size: 13px;
        line-height: 1.5;
    }

    .ffb-post__reactions,
    .ffb-post__comments {
        padding: 10px 14px;
    }

    .ffb-comment.is-reply { margin-left: 26px; }

    .ffb-comment__text { font-size: 13px; }
}
/* ── Заголовок страницы блога ───────────────────────────────── */
.ffb-page-title {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    padding:10px 20px;
}