/* ═══════════════════════════════════════════════════════════
   HAMINJA MAGAZINE & BLOG — مجله هامینجا (طراحی مدرن و هماهنگ)
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg-primary: var(--hmj-primary, #0F9F8A);
    --bg-primary-dark: var(--hmj-primary-dark, #087F70);
    --bg-primary-light: var(--hmj-primary-light, #E6F7F4);
    --bg-primary-soft: rgba(15, 159, 138, 0.10);
    --bg-primary-soft-15: rgba(15, 159, 138, 0.15);
    --bg-accent: #f59e0b;
    --bg-text-main: #0f172a;
    --bg-text-sub: #475569;
    --bg-text-muted: #94a3b8;
    --bg-card-bg: #ffffff;
    --bg-border: #e2e8f0;
    --bg-border-soft: rgba(15, 159, 138, 0.12);
    --bg-shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.04);
    --bg-shadow-md: 0 10px 25px -4px rgba(15, 23, 42, 0.06), 0 4px 10px -2px rgba(15, 23, 42, 0.03);
    --bg-shadow-hover: 0 18px 36px -6px rgba(15, 159, 138, 0.15), 0 8px 16px -4px rgba(15, 23, 42, 0.04);
    --bg-radius: 18px;
    --bg-ease: cubic-bezier(0.32, 0.72, 0, 1);
}

/* ═══════════════════════════════════════════════════════════
   BASE PAGE CONTAINER
   حل مشکل تداخل و افتادن زیر هدر سایت
   ═══════════════════════════════════════════════════════════ */
.bg-page {
    direction: rtl;
    min-height: 100vh;
    padding-top: 1.75rem;
    padding-bottom: 4rem;
    color: var(--bg-text-main);
    background: var(--hmj-bg-page, #f8fafc);
}

.bg-page--detail {
    padding-top: 2.25rem;
}

@media (max-width: 768px) {
    .bg-page {
        padding-top: 1.25rem;
        padding-bottom: 3rem;
    }
    .bg-page--detail {
        padding-top: 1.5rem;
    }
}

.bg-page .container-xl {
    max-width: 1400px;
    padding-inline: 1.25rem;
}

/* ═══════════════════════════════════════════════════════════
   HERO & SEARCH (صفحه اصلی مقالات)
   ═══════════════════════════════════════════════════════════ */
.bg-hero {
    position: relative;
    border-radius: 26px;
    padding: 2.75rem 2rem 2.1rem;
    margin-bottom: 2rem;
    overflow: hidden;
    background: linear-gradient(135deg, #0b5d51 0%, #0F9F8A 52%, #077465 100%);
    box-shadow: 0 20px 48px -12px rgba(15, 159, 138, 0.30);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.bg-hero__pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: 0.45;
    pointer-events: none;
}

.bg-hero__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
    opacity: 0.38;
}

.bg-hero__glow--1 {
    width: 320px;
    height: 320px;
    top: -90px;
    right: -60px;
    background: rgba(255, 255, 255, 0.45);
}

.bg-hero__glow--2 {
    width: 260px;
    height: 260px;
    bottom: -80px;
    left: -40px;
    background: rgba(245, 158, 11, 0.34);
}

.bg-hero__content {
    position: relative;
    z-index: 2;
    max-width: 780px;
    margin: 0 auto;
}

.bg-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.38rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 750;
    margin-bottom: 0.95rem;
}

.bg-hero__title {
    color: #ffffff;
    font-size: clamp(1.65rem, 3.2vw, 2.35rem);
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1.35;
    margin: 0 0 0.65rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
}

.bg-hero__desc {
    color: rgba(255, 255, 255, 0.90);
    font-size: 0.96rem;
    line-height: 1.75;
    margin: 0 auto 1.6rem;
    max-width: 600px;
}

/* Sleek Search Bar */
.bg-search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 999px;
    padding: 0.35rem 0.45rem 0.35rem 1.25rem;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
    max-width: 620px;
    margin: 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.bg-search-bar:focus-within {
    border-color: #ffffff;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24), 0 0 0 4px rgba(255, 255, 255, 0.28);
    transform: translateY(-2px);
}

.bg-search-bar__icon {
    color: var(--bg-primary);
    font-size: 1.05rem;
    flex-shrink: 0;
    margin-left: 0.75rem;
}

.bg-search-bar__input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 0.65rem 0.25rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--bg-text-main);
    min-width: 0;
}

.bg-search-bar__input::placeholder {
    color: var(--bg-text-muted);
    font-weight: 400;
}

.bg-search-bar__clear {
    color: var(--bg-text-muted);
    padding: 0.4rem;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.35rem;
    transition: color 0.2s ease;
}

.bg-search-bar__clear:hover {
    color: #ef4444;
}

.bg-search-bar__btn {
    border: none;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-primary-dark) 100%);
    color: #ffffff;
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 750;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(15, 159, 138, 0.32);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bg-search-bar__btn:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(15, 159, 138, 0.44);
}

/* Quick Category Pills inside Hero */
.bg-hero-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.bg-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.95rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.bg-hero-pill:hover {
    background: rgba(255, 255, 255, 0.26);
    color: #ffffff;
    transform: translateY(-1px);
}

.bg-hero-pill.is-active {
    background: #ffffff;
    color: var(--bg-primary-dark);
    border-color: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

@media (max-width: 640px) {
    .bg-hero {
        padding: 1.85rem 1.15rem 1.55rem;
        border-radius: 20px;
        margin-bottom: 1.35rem;
    }
    .bg-search-bar {
        padding: 0.25rem 0.35rem 0.25rem 0.9rem;
    }
    .bg-search-bar__btn span {
        display: none;
    }
    .bg-search-bar__btn {
        width: 42px;
        height: 42px;
        padding: 0;
        justify-content: center;
    }
    .bg-hero-pills {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        scrollbar-width: none;
    }
    .bg-hero-pills::-webkit-scrollbar {
        display: none;
    }
    .bg-hero-pill {
        flex-shrink: 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   MAIN SHELL: CATEGORIES SIDEBAR (RIGHT) + CONTENT (LEFT)
   ═══════════════════════════════════════════════════════════ */
.bg-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 1.85rem;
    align-items: start;
    direction: rtl;
}

@media (max-width: 991.98px) {
    .bg-shell {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* ─── Categories Tree Sidebar (Right) ─── */
.bg-cats-sidebar {
    position: sticky;
    top: calc(var(--hmj-nav-h, 72px) + 18px);
    z-index: 10;
}

@media (max-width: 991.98px) {
    .bg-cats-sidebar {
        position: static;
    }
}

.bg-cats-card {
    background: var(--bg-card-bg);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 20px;
    padding: 1.05rem 0.9rem 1.15rem;
    box-shadow: 0 8px 24px -6px rgba(15, 23, 42, 0.05);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.bg-cats-card:hover {
    border-color: rgba(15, 159, 138, 0.22);
    box-shadow: 0 12px 30px -6px rgba(15, 23, 42, 0.08);
}

.bg-cats-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.2rem 0.45rem 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 0.7rem;
}

.bg-cats-card__title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.9rem;
    font-weight: 850;
    color: var(--bg-text-main);
}

.bg-cats-card__title-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--bg-primary-soft);
    color: var(--bg-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
}

.bg-cats-card__mobile-toggle {
    border: none;
    background: var(--bg-primary-soft);
    color: var(--bg-primary-dark);
    padding: 0.35rem 0.75rem;
    border-radius: 9px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}

.bg-cats-card__mobile-toggle i {
    transition: transform 0.25s ease;
}

.bg-cats-card__mobile-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

@media (max-width: 991.98px) {
    .bg-cats-tree {
        display: none;
        padding-top: 0.5rem;
    }
    .bg-cats-tree.is-open-mobile {
        display: flex;
    }
}

.bg-cats-tree {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    max-height: calc(100vh - 170px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-primary-soft) transparent;
    padding-left: 0.2rem;
}

.bg-cats-tree::-webkit-scrollbar {
    width: 4px;
}

.bg-cats-tree::-webkit-scrollbar-thumb {
    background: var(--bg-primary-soft);
    border-radius: 4px;
}

.bg-tree-node {
    position: relative;
    display: flex;
    flex-direction: column;
}

.bg-tree-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.bg-tree-link {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.52rem 0.65rem;
    border-radius: 12px;
    color: var(--bg-text-main);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 650;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.bg-tree-link:hover {
    background: rgba(15, 159, 138, 0.08);
    color: var(--bg-primary-dark);
    transform: translateX(-2px);
}

.bg-tree-link.is-active {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-primary-dark) 100%);
    color: #ffffff !important;
    font-weight: 750;
    box-shadow: 0 6px 16px rgba(15, 159, 138, 0.26);
}

.bg-tree-link__avatar {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    overflow: hidden;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary-soft);
    border: 1px solid rgba(15, 159, 138, 0.14);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.bg-tree-link__avatar--all {
    color: var(--bg-primary);
    font-size: 0.85rem;
}

.bg-tree-link__avatar--child {
    width: 24px;
    height: 24px;
    border-radius: 7px;
}

.bg-tree-link__avatar--grand {
    width: 20px;
    height: 20px;
    border-radius: 6px;
}

.bg-tree-link__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bg-tree-link__placeholder {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    font-size: 0.72rem;
}

.bg-tree-link.is-active .bg-tree-link__avatar {
    border-color: rgba(255, 255, 255, 0.45);
}

.bg-tree-link.is-active .bg-tree-link__avatar--all,
.bg-tree-link.is-active .bg-tree-link__placeholder {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.bg-tree-badge {
    margin-right: auto;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.12rem 0.48rem;
    border-radius: 999px;
    background: var(--bg-primary-soft);
    color: var(--bg-primary-dark);
    flex-shrink: 0;
    line-height: 1.2;
}

.bg-tree-badge--sm {
    font-size: 0.62rem;
    padding: 0.08rem 0.35rem;
}

.bg-tree-link.is-active .bg-tree-badge {
    background: rgba(255, 255, 255, 0.24);
    color: #ffffff;
}

.bg-tree-link__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bg-tree-toggle {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--bg-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.75rem;
    transition: transform 0.22s var(--bg-ease), background 0.18s ease, color 0.18s ease;
}

.bg-tree-toggle:hover {
    background: var(--bg-primary-soft);
    color: var(--bg-primary-dark);
}

.bg-tree-node.is-open > .bg-tree-row > .bg-tree-toggle {
    transform: rotate(-90deg);
    color: var(--bg-primary-dark);
}

.bg-tree-children {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-right: 1.1rem;
    padding-right: 0.65rem;
    border-right: 2px dashed rgba(15, 159, 138, 0.22);
    margin-top: 0.2rem;
    margin-bottom: 0.35rem;
}

.bg-tree-children[hidden] {
    display: none !important;
}

.bg-tree-link--child {
    font-size: 0.81rem;
    font-weight: 550;
    padding: 0.42rem 0.55rem;
    color: var(--bg-text-sub);
}

.bg-tree-link--grand {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.35rem 0.5rem;
    color: var(--bg-text-muted);
}

/* ═══════════════════════════════════════════════════════════
   MAIN SECTION, ACTIVE FILTERS & SORT TOOLBAR
   ═══════════════════════════════════════════════════════════ */
.bg-main {
    min-width: 0;
}

.bg-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    background: var(--bg-card-bg);
    border: 1px solid rgba(15, 159, 138, 0.18);
    border-radius: 16px;
    padding: 0.65rem 1rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--bg-shadow-sm);
}

.bg-filter-bar__pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.bg-filter-bar__label {
    font-size: 0.8rem;
    font-weight: 750;
    color: var(--bg-text-sub);
}

.bg-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.78rem;
    border-radius: 999px;
    background: var(--bg-primary-soft);
    border: 1px solid rgba(15, 159, 138, 0.2);
    color: var(--bg-primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
}

.bg-filter-chip a {
    color: var(--bg-primary-dark);
    display: inline-flex;
    align-items: center;
    margin-right: 0.15rem;
    transition: color 0.18s ease;
}

.bg-filter-chip a:hover {
    color: #ef4444;
}

.bg-filter-bar__clear {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 750;
    color: #ef4444;
    text-decoration: none;
    padding: 0.28rem 0.6rem;
    border-radius: 8px;
    transition: background 0.18s ease;
}

.bg-filter-bar__clear:hover {
    background: rgba(239, 68, 68, 0.08);
}

.bg-content-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 1.35rem;
}

.bg-content-header__right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.bg-content-header__title {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--bg-text-main);
    margin: 0;
    letter-spacing: -0.02em;
}

.bg-content-header__count {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    background: rgba(15, 159, 138, 0.10);
    color: var(--bg-primary-dark);
    font-size: 0.78rem;
    font-weight: 750;
}

.bg-sort-pills {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 0.25rem;
    gap: 0.2rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.bg-sort-pill {
    padding: 0.36rem 0.82rem;
    border-radius: 9px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--bg-text-sub);
    text-decoration: none;
    transition: all 0.18s ease;
}

.bg-sort-pill:hover {
    color: var(--bg-primary-dark);
    background: rgba(15, 159, 138, 0.06);
}

.bg-sort-pill.is-active {
    background: var(--bg-primary);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(15, 159, 138, 0.26);
}

/* ═══════════════════════════════════════════════════════════
   FEATURED ARTICLE SPOTLIGHT (مقاله برگزیده)
   ═══════════════════════════════════════════════════════════ */
.bg-featured {
    display: grid;
    grid-template-columns: 1.12fr 1fr;
    background: var(--bg-card-bg);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 22px;
    overflow: hidden;
    margin-bottom: 1.65rem;
    box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.07);
    transition: transform 0.3s var(--bg-ease), box-shadow 0.3s ease, border-color 0.3s ease;
}

.bg-featured:hover {
    transform: translateY(-4px);
    border-color: rgba(15, 159, 138, 0.30);
    box-shadow: var(--bg-shadow-hover);
}

.bg-featured__media {
    position: relative;
    display: block;
    min-height: 290px;
    background: #e6f4f1;
    overflow: hidden;
}

.bg-featured__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.55s var(--bg-ease);
}

.bg-featured:hover .bg-featured__img {
    transform: scale(1.05);
}

.bg-featured__spotlight {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.36rem 0.88rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fbbf24;
    font-size: 0.76rem;
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.bg-featured__spotlight span {
    color: #ffffff;
}

.bg-featured__body {
    display: flex;
    flex-direction: column;
    padding: 1.65rem 1.75rem;
    gap: 0.85rem;
}

.bg-featured__top-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.9rem;
    font-size: 0.78rem;
    color: var(--bg-text-muted);
    font-weight: 600;
}

.bg-featured__cat {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: var(--bg-primary-soft);
    color: var(--bg-primary-dark);
    font-weight: 800;
    font-size: 0.74rem;
}

.bg-featured__date,
.bg-featured__read {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
}

.bg-featured__date i,
.bg-featured__read i {
    color: var(--bg-primary);
}

.bg-featured__title {
    margin: 0;
    font-size: 1.32rem;
    font-weight: 900;
    line-height: 1.5;
    letter-spacing: -0.02em;
}

.bg-featured__title a {
    color: var(--bg-text-main);
    text-decoration: none;
    transition: color 0.2s ease;
}

.bg-featured:hover .bg-featured__title a {
    color: var(--bg-primary);
}

.bg-featured__desc {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--bg-text-sub);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bg-featured__footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.bg-featured__author {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.bg-featured__author-img,
.bg-featured__author-fallback {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.bg-featured__author-fallback {
    background: var(--bg-primary-soft);
    color: var(--bg-primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
}

.bg-featured__author-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--bg-text-sub);
}

.bg-featured__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.52rem 1.15rem;
    border-radius: 999px;
    background: var(--bg-primary);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(15, 159, 138, 0.26);
    transition: transform 0.2s ease, background 0.2s ease;
}

.bg-featured__cta:hover {
    background: var(--bg-primary-dark);
    color: #ffffff;
    transform: translateX(-2px);
}

@media (max-width: 767.98px) {
    .bg-featured {
        grid-template-columns: 1fr;
    }
    .bg-featured__media {
        min-height: 210px;
        aspect-ratio: 16 / 10;
    }
    .bg-featured__body {
        padding: 1.2rem 1.15rem;
    }
    .bg-featured__title {
        font-size: 1.12rem;
    }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE CARD GRID (3 Columns Desktop -> 2 Tablet -> 1 Mobile)
   ═══════════════════════════════════════════════════════════ */
.bg-grid--cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.35rem;
}

@media (max-width: 1199.98px) {
    .bg-grid--cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.15rem;
    }
}

@media (max-width: 575.98px) {
    .bg-grid--cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ─── Premium Article Card ─── */
.bg-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: var(--bg-card-bg);
    border: 1px solid rgba(15, 23, 42, 0.07);
    box-shadow: 0 6px 20px -6px rgba(15, 23, 42, 0.05);
    transition: transform 0.3s var(--bg-ease), box-shadow 0.3s ease, border-color 0.3s ease;
}

.bg-card:hover {
    transform: translateY(-6px);
    border-color: rgba(15, 159, 138, 0.32);
    box-shadow: var(--bg-shadow-hover);
}

.bg-card__media-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.bg-card__media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #e6f4f1 0%, #edf7f5 100%);
}

.bg-card__media-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.14) 0%, transparent 45%, rgba(15, 23, 42, 0.18) 100%);
    pointer-events: none;
}

.bg-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s var(--bg-ease);
}

.bg-card:hover .bg-card__img {
    transform: scale(1.07);
}

.bg-card__badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.78rem;
    border-radius: 999px;
    background: rgba(15, 159, 138, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.3;
    max-width: calc(100% - 4.5rem);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.bg-card__badge span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bg-card__rate {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.24rem 0.58rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
}

.bg-card__rate i {
    color: #fbbf24;
    font-size: 0.68rem;
}

.bg-card__body {
    display: flex;
    flex-direction: column;
    padding: 1.1rem 1.2rem 1.2rem;
    flex: 1;
    gap: 0.55rem;
}

.bg-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bg-text-muted);
}

.bg-card__date,
.bg-card__reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
}

.bg-card__date i,
.bg-card__reading-time i {
    color: var(--bg-primary);
    font-size: 0.76rem;
}

.bg-card__title {
    margin: 0.15rem 0 0;
    font-size: 1.02rem;
    font-weight: 850;
    line-height: 1.55;
    letter-spacing: -0.015em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bg-card__title a {
    color: var(--bg-text-main);
    text-decoration: none;
    transition: color 0.2s ease;
}

.bg-card:hover .bg-card__title a {
    color: var(--bg-primary);
}

.bg-card__desc {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.7;
    color: var(--bg-text-sub);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.bg-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.bg-card__author {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
    font-weight: 650;
    color: var(--bg-text-muted);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bg-card__author-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bg-primary);
    opacity: 0.65;
    flex-shrink: 0;
}

.bg-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--bg-primary);
    text-decoration: none;
    flex-shrink: 0;
    transition: gap 0.2s ease, color 0.2s ease;
}

.bg-card__link i {
    font-size: 0.72rem;
    transition: transform 0.2s ease;
}

.bg-card:hover .bg-card__link {
    color: var(--bg-primary-dark);
    gap: 0.6rem;
}

.bg-card:hover .bg-card__link i {
    transform: translateX(-3px);
}

/* ═══════════════════════════════════════════════════════════
   PAGINATION & EMPTY STATE
   ═══════════════════════════════════════════════════════════ */
.bg-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
}

.bg-pager__numbers {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.bg-pager__num {
    min-width: 40px;
    height: 40px;
    padding: 0 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--bg-border);
    background: var(--bg-card-bg);
    color: var(--bg-text-sub);
    font-size: 0.88rem;
    font-weight: 750;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: var(--bg-shadow-sm);
    transition: all 0.2s ease;
}

.bg-pager__num:hover {
    border-color: var(--bg-primary);
    color: var(--bg-primary);
    background: var(--bg-primary-soft);
    transform: translateY(-2px);
}

.bg-pager__num.is-active {
    background: var(--bg-primary);
    border-color: var(--bg-primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(15, 159, 138, 0.35);
}

.bg-pager__dots {
    color: var(--bg-text-muted);
    padding: 0 0.25rem;
}

.bg-pager__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--bg-border);
    background: var(--bg-card-bg);
    color: var(--bg-text-sub);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--bg-shadow-sm);
    transition: all 0.2s ease;
}

.bg-pager__btn:hover {
    border-color: var(--bg-primary);
    color: var(--bg-primary);
    background: var(--bg-primary-soft);
}

.bg-empty-card {
    background: var(--bg-card-bg);
    border: 1px dashed rgba(15, 159, 138, 0.3);
    border-radius: 22px;
    padding: 3.5rem 2rem;
    text-align: center;
    margin-top: 1rem;
    box-shadow: var(--bg-shadow-sm);
}

.bg-empty-card__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--bg-primary-soft);
    color: var(--bg-primary);
    font-size: 1.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.bg-empty-card__title {
    font-size: 1.25rem;
    font-weight: 850;
    color: var(--bg-text-main);
    margin: 0 0 0.5rem;
}

.bg-empty-card__desc {
    color: var(--bg-text-sub);
    font-size: 0.92rem;
    max-width: 440px;
    margin: 0 auto 1.5rem;
    line-height: 1.7;
}

.bg-empty-card__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.45rem;
    border-radius: 999px;
    background: var(--bg-primary);
    color: #ffffff;
    font-weight: 750;
    font-size: 0.88rem;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(15, 159, 138, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bg-empty-card__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 159, 138, 0.4);
    color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════
   ARTICLE DETAILS PAGE (صفحه خود مقاله)
   ═══════════════════════════════════════════════════════════ */
.bg-crumb-nav {
    margin-bottom: 1.5rem;
}

.bg-crumb-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    align-items: center;
    gap: 0.45rem;
    list-style: none;
    padding: 0.65rem 1.15rem;
    margin: 0;
    background: var(--bg-card-bg);
    border: 1px solid var(--bg-border-soft);
    border-radius: 999px;
    box-shadow: var(--bg-shadow-sm);
    font-size: 0.82rem;
    font-weight: 600;
}

.bg-crumb-list::-webkit-scrollbar {
    display: none;
}

.bg-crumb-item,
.bg-crumb-sep {
    flex-shrink: 0;
    white-space: nowrap;
}

.bg-crumb-link {
    color: var(--bg-text-sub);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.18s ease;
}

.bg-crumb-link:hover {
    color: var(--bg-primary);
}

.bg-crumb-sep {
    color: var(--bg-text-muted);
    font-size: 0.65rem;
    display: inline-flex;
    align-items: center;
}

.bg-crumb-item--active {
    color: var(--bg-primary-dark);
    font-weight: 750;
    max-width: 480px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .bg-crumb-list {
        padding: 0.5rem 0.85rem;
    }
    .bg-crumb-item--active {
        max-width: 280px;
    }
}

/* ─── Detail Layout: Main Article (Right) + Sidebar (Left in RTL) ─── */
.bg-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 2rem;
    align-items: start;
    direction: rtl;
}

@media (max-width: 1024px) {
    .bg-detail-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.bg-detail-main {
    min-width: 0;
}

/* Article Sheet */
.bg-article-sheet {
    background: var(--bg-card-bg);
    border: 1px solid var(--bg-border-soft);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--bg-shadow-sm);
}

.bg-article-header {
    padding: 2rem 2.25rem 1.5rem;
}

.bg-article-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.95rem;
    border-radius: 999px;
    background: var(--bg-primary-soft);
    border: 1px solid rgba(15, 159, 138, 0.2);
    color: var(--bg-primary-dark);
    font-size: 0.8rem;
    font-weight: 800;
    text-decoration: none;
    margin-bottom: 1rem;
    transition: background 0.18s ease;
}

.bg-article-badge:hover {
    background: var(--bg-primary-soft-15);
    color: var(--bg-primary-dark);
}

.bg-article-title {
    margin: 0 0 1.25rem;
    font-size: clamp(1.45rem, 2.8vw, 2.1rem);
    font-weight: 850;
    line-height: 1.45;
    letter-spacing: -0.025em;
    color: var(--bg-text-main);
}

.bg-article-meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--bg-border);
}

.bg-article-author {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.bg-article-author__avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-primary-dark) 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(15, 159, 138, 0.25);
}

.bg-article-author__info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.bg-article-author__role {
    font-size: 0.72rem;
    color: var(--bg-text-muted);
}

.bg-article-author__name {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--bg-text-main);
}

.bg-article-meta-items {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 650;
    color: var(--bg-text-sub);
}

.bg-article-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.bg-article-meta-item i {
    color: var(--bg-primary);
}

.bg-article-meta-item--link {
    color: var(--bg-text-sub);
    text-decoration: none;
    transition: color 0.18s ease;
}

.bg-article-meta-item--link:hover {
    color: var(--bg-primary);
}

/* Cover Image */
.bg-article-cover {
    width: 100%;
    max-height: 480px;
    aspect-ratio: 21 / 9;
    overflow: hidden;
    background: #f1f5f9;
}

.bg-article-cover__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bg-article-inner {
    padding: 2.25rem 2.25rem 2.5rem;
}

@media (max-width: 640px) {
    .bg-article-header {
        padding: 1.25rem 1.25rem 1rem;
    }
    .bg-article-cover {
        aspect-ratio: 16 / 9;
        max-height: 260px;
    }
    .bg-article-inner {
        padding: 1.25rem 1.25rem 1.5rem;
    }
}

/* Lead Excerpt */
.bg-article-lead {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin: 0 0 2rem;
    padding: 1.15rem 1.35rem;
    border-right: 4px solid var(--bg-primary);
    background: linear-gradient(90deg, rgba(15, 159, 138, 0.08) 0%, rgba(15, 159, 138, 0.02) 100%);
    border-radius: 0 14px 14px 0;
}

.bg-article-lead__icon {
    color: var(--bg-primary);
    font-size: 1.35rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.bg-article-lead__text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.85;
    font-weight: 600;
    color: var(--bg-text-sub);
}

/* Rich Prose Body */
.bg-article-body {
    font-size: 1.05rem;
    line-height: 2.15;
    color: #1e293b;
    word-break: break-word;
}

.bg-article-body p {
    margin-bottom: 1.35rem;
}

.bg-article-body h2,
.bg-article-body h3,
.bg-article-body h4 {
    margin: 2rem 0 0.85rem;
    font-weight: 850;
    letter-spacing: -0.02em;
    color: var(--bg-text-main);
    line-height: 1.45;
}

.bg-article-body h2 {
    font-size: 1.4rem;
    border-bottom: 2px solid var(--bg-primary-light);
    padding-bottom: 0.5rem;
}

.bg-article-body h3 {
    font-size: 1.2rem;
}

.bg-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 1.5rem auto;
    display: block;
    box-shadow: var(--bg-shadow-md);
}

.bg-article-body a {
    color: var(--bg-primary);
    text-decoration: underline;
    font-weight: 650;
}

.bg-article-body ul,
.bg-article-body ol {
    margin: 1rem 0 1.5rem;
    padding-right: 1.5rem;
}

.bg-article-body li {
    margin-bottom: 0.5rem;
}

.bg-article-body blockquote {
    margin: 1.75rem 0;
    padding: 1.15rem 1.45rem;
    border-right: 4px solid var(--bg-primary);
    background: #f8fafc;
    border-radius: 0 14px 14px 0;
    font-style: italic;
    color: var(--bg-text-sub);
}

/* Footer: Tags + Share */
.bg-article-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 1.5rem;
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--bg-border);
}

.bg-article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.bg-article-tags__label {
    font-size: 0.82rem;
    font-weight: 750;
    color: var(--bg-text-sub);
}

.bg-tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.8rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--bg-text-sub);
    font-size: 0.78rem;
    font-weight: 650;
    text-decoration: none;
    transition: all 0.2s ease;
}

.bg-tag-pill:hover {
    background: var(--bg-primary);
    color: #ffffff;
    transform: translateY(-2px);
}

.bg-article-share {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.bg-article-share__label {
    font-size: 0.82rem;
    font-weight: 750;
    color: var(--bg-text-sub);
}

.bg-article-share__buttons {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.bg-share-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--bg-border);
    background: #ffffff;
    color: var(--bg-text-sub);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: var(--bg-shadow-sm);
    transition: all 0.2s ease;
}

.bg-share-btn--telegram:hover {
    background: #229ED9;
    border-color: #229ED9;
    color: #ffffff;
    transform: translateY(-3px);
}

.bg-share-btn--whatsapp:hover {
    background: #25D366;
    border-color: #25D366;
    color: #ffffff;
    transform: translateY(-3px);
}

.bg-share-btn--copy:hover {
    background: var(--bg-primary);
    border-color: var(--bg-primary);
    color: #ffffff;
    transform: translateY(-3px);
}

/* ─── Comments Section ─── */
.bg-comments-card {
    margin-top: 2rem;
    background: var(--bg-card-bg);
    border: 1px solid var(--bg-border-soft);
    border-radius: 24px;
    padding: 2rem 2.25rem;
    box-shadow: var(--bg-shadow-sm);
}

@media (max-width: 640px) {
    .bg-comments-card {
        padding: 1.25rem 1.25rem 1.5rem;
        border-radius: 18px;
    }
}

.bg-comments-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--bg-border);
    margin-bottom: 1.25rem;
}

.bg-comments-card__title-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--bg-primary-dark);
}

.bg-comments-card__title-wrap i {
    font-size: 1.25rem;
}

.bg-comments-card__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 850;
    color: var(--bg-text-main);
}

.bg-comments-card__badge {
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    background: var(--bg-primary-soft);
    color: var(--bg-primary-dark);
    font-size: 0.78rem;
    font-weight: 750;
}

.bg-comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bg-comment-item {
    display: flex;
    gap: 0.95rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--bg-border);
}

.bg-comment-item:last-child {
    border-bottom: none;
}

.bg-comment-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--bg-primary-soft) 0%, rgba(15, 159, 138, 0.2) 100%);
    color: var(--bg-primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 850;
    font-size: 1rem;
    flex-shrink: 0;
    border: 1px solid rgba(15, 159, 138, 0.2);
}

.bg-comment-content {
    flex: 1;
    min-width: 0;
}

.bg-comment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.bg-comment-author {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--bg-text-main);
}

.bg-comment-date {
    font-size: 0.75rem;
    color: var(--bg-text-muted);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.bg-comment-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--bg-text-sub);
}

.bg-comments-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--bg-text-muted);
}

.bg-comments-empty i {
    font-size: 2.25rem;
    color: var(--bg-primary-soft);
    margin-bottom: 0.75rem;
    display: block;
}

.bg-comments-empty p {
    margin: 0;
    font-size: 0.9rem;
}

/* Comment Form */
.bg-comment-form-wrap {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bg-border);
}

.bg-comment-form-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.98rem;
    font-weight: 850;
    color: var(--bg-text-main);
    margin: 0 0 1rem;
}

.bg-comment-form-title i {
    color: var(--bg-primary);
    font-size: 0.9rem;
}

.bg-comment-textarea {
    width: 100%;
    border: 1px solid var(--bg-border);
    border-radius: 14px;
    padding: 0.95rem 1.15rem;
    font-size: 0.92rem;
    line-height: 1.7;
    background: #f8fafc;
    color: var(--bg-text-main);
    resize: vertical;
    transition: all 0.2s ease;
    outline: none;
}

.bg-comment-textarea:focus {
    background: #ffffff;
    border-color: var(--bg-primary);
    box-shadow: 0 0 0 4px var(--bg-primary-soft);
}

.bg-comment-submit-btn {
    margin-top: 0.85rem;
    border: none;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-primary-dark) 100%);
    color: #ffffff;
    padding: 0.7rem 1.5rem;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 750;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(15, 159, 138, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bg-comment-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 159, 138, 0.4);
}

.bg-login-prompt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.35rem;
    background: #f8fafc;
    border: 1px solid var(--bg-border);
    border-radius: 14px;
}

.bg-login-prompt__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-primary-soft);
    color: var(--bg-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.bg-login-prompt__text {
    flex: 1;
    min-width: 220px;
}

.bg-login-prompt__text strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--bg-text-main);
    margin-bottom: 0.15rem;
}

.bg-login-prompt__text p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--bg-text-sub);
}

.bg-login-prompt__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    background: var(--bg-primary);
    color: #ffffff;
    font-weight: 750;
    font-size: 0.85rem;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(15, 159, 138, 0.25);
    transition: transform 0.2s ease;
}

.bg-login-prompt__btn:hover {
    transform: translateY(-2px);
    color: #ffffff;
}

/* ─── Detail Sidebar (Left Side in RTL) ─── */
.bg-detail-sidebar {
    position: sticky;
    top: calc(var(--hmj-nav-h, 72px) + 16px);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .bg-detail-sidebar {
        position: static;
    }
}

.bg-side-card {
    background: var(--bg-card-bg);
    border: 1px solid var(--bg-border-soft);
    border-radius: var(--bg-radius);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--bg-shadow-sm);
}

.bg-side-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--bg-border);
}

.bg-side-card__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 850;
    color: var(--bg-text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bg-side-card__title i {
    color: var(--bg-primary);
    font-size: 0.95rem;
}

.bg-side-card__more {
    font-size: 0.78rem;
    font-weight: 750;
    color: var(--bg-primary);
    text-decoration: none;
}

.bg-side-card__more:hover {
    text-decoration: underline;
}

.bg-side-search {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--bg-border);
    border-radius: 12px;
    padding: 0.25rem 0.35rem 0.25rem 0.85rem;
    margin-top: 0.85rem;
    transition: all 0.2s ease;
}

.bg-side-search:focus-within {
    background: #ffffff;
    border-color: var(--bg-primary);
    box-shadow: 0 0 0 3px var(--bg-primary-soft);
}

.bg-side-search input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 0.5rem 0.25rem;
    font-size: 0.85rem;
    font-weight: 550;
    color: var(--bg-text-main);
    min-width: 0;
}

.bg-side-search button {
    border: none;
    background: var(--bg-primary);
    color: #ffffff;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.bg-side-search button:hover {
    background: var(--bg-primary-dark);
}

/* Recent Blogs in Sidebar */
.bg-recent {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.bg-recent__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    padding: 0.45rem;
    border-radius: 12px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.bg-recent__item:hover {
    background: var(--bg-primary-soft);
    transform: translateX(-3px);
}

.bg-recent__thumb {
    width: 68px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f5f9;
}

.bg-recent__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bg-recent__meta {
    flex: 1;
    min-width: 0;
}

.bg-recent__meta h4 {
    margin: 0 0 0.25rem;
    font-size: 0.84rem;
    font-weight: 750;
    line-height: 1.45;
    color: var(--bg-text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.18s ease;
}

.bg-recent__item:hover .bg-recent__meta h4 {
    color: var(--bg-primary);
}

.bg-recent__meta time {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--bg-text-muted);
}

/* ══════════════════════════════════════════════════════════
   Modernized Blog Details Enhancements
   ══════════════════════════════════════════════════════════ */

/* Reading Progress Indicator */
.bg-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 9999;
    background: transparent;
    pointer-events: none;
}

.bg-reading-progress__bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--bg-primary) 0%, #06b6d4 100%);
    box-shadow: 0 0 10px rgba(15, 159, 138, 0.5);
    transition: width 0.08s ease-out;
}

/* Breadcrumb Truncate */
.bg-crumb-truncate {
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

/* Article Author Avatar & Image */
.bg-article-author__avatar {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-primary-dark) 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(15, 159, 138, 0.25), 0 0 0 2px #ffffff;
}

.bg-article-author__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.bg-article-author__role-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.bg-verified-icon {
    color: var(--bg-primary);
    font-size: 0.72rem;
}

/* Side Author Card */
.bg-side-author {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.6rem 1.25rem 1.4rem;
    background: linear-gradient(180deg, rgba(15, 159, 138, 0.05) 0%, #ffffff 55%);
    border: 1px solid var(--bg-border-soft);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.bg-side-author::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--bg-primary) 0%, #06b6d4 100%);
}

.bg-side-author__avatar-wrap {
    position: relative;
    margin-bottom: 0.85rem;
}

.bg-side-author__avatar {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(15, 159, 138, 0.25), 0 0 0 3px #ffffff, 0 0 0 5px var(--bg-primary-soft);
    background: #f1f5f9;
    display: block;
}

.bg-side-author__badge {
    position: absolute;
    bottom: -2px;
    left: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-primary);
    color: #ffffff;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

.bg-side-author__details {
    margin-bottom: 1rem;
}

.bg-side-author__subtitle {
    font-size: 0.74rem;
    color: var(--bg-text-muted);
    font-weight: 600;
}

.bg-side-author__name {
    margin: 0.25rem 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 850;
    color: var(--bg-text-main);
}

.bg-side-author__desc {
    margin: 0;
    font-size: 0.82rem;
    color: var(--bg-text-sub);
    line-height: 1.6;
}

.bg-side-author__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.15rem;
    border-radius: 12px;
    background: var(--bg-primary-soft);
    color: var(--bg-primary-dark);
    font-size: 0.8rem;
    font-weight: 750;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(15, 159, 138, 0.18);
    width: 100%;
    justify-content: center;
}

.bg-side-author__btn:hover {
    background: var(--bg-primary);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(15, 159, 138, 0.28);
}

/* Side Table of Contents (TOC) */
.bg-side-toc {
    background: #ffffff;
    border: 1px solid var(--bg-border-soft);
    border-radius: 20px;
    padding: 1.25rem;
}

.bg-side-toc__nav {
    margin-top: 0.85rem;
}

.bg-toc-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.bg-toc-item--sub {
    padding-right: 0.95rem;
}

.bg-toc-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 650;
    color: var(--bg-text-sub);
    text-decoration: none;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    transition: all 0.18s ease;
    line-height: 1.5;
}

.bg-toc-link i {
    font-size: 0.65rem;
    color: var(--bg-primary);
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.bg-toc-link:hover {
    background: var(--bg-primary-soft);
    color: var(--bg-primary-dark);
}

.bg-toc-link:hover i {
    transform: translateX(-3px);
}

/* Comment Form Header & Note */
.bg-comment-form-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.bg-comment-form-header .bg-comment-form-title {
    margin: 0;
}

.bg-comment-form-note {
    font-size: 0.74rem;
    color: var(--bg-text-muted);
    font-weight: 600;
}

/* Star Rating Selector in Comment Form */
.bg-comment-rating-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.95rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--bg-border);
    border-radius: 12px;
}

.bg-comment-rating-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--bg-text-main);
}

.bg-star-picker {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.bg-star-btn {
    border: none;
    background: transparent;
    padding: 0.2rem;
    cursor: pointer;
    font-size: 1.15rem;
    color: #cbd5e1;
    transition: transform 0.15s ease, color 0.15s ease;
    line-height: 1;
}

.bg-star-btn:hover {
    transform: scale(1.22);
}

.bg-star-btn.active {
    color: #f59e0b;
}

.bg-star-picker-text {
    font-size: 0.8rem;
    color: #d97706;
    font-weight: 750;
    margin-right: 0.5rem;
}

.bg-comment-char-counter {
    text-align: left;
    font-size: 0.72rem;
    color: var(--bg-text-muted);
    margin-top: 0.35rem;
    font-weight: 600;
    direction: ltr;
}

.bg-comment-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.85rem;
}

/* Comment Item Enhancements */
.bg-comment-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-primary-soft) 0%, rgba(15, 159, 138, 0.2) 100%);
    color: var(--bg-primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 850;
    font-size: 1rem;
    flex-shrink: 0;
    border: 1px solid rgba(15, 159, 138, 0.2);
}

.bg-comment-avatar__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.bg-comment-author-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.bg-comment-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.72rem;
}

.bg-star--filled {
    color: #f59e0b;
}

.bg-star--empty {
    color: #e2e8f0;
}

.bg-comment-replies {
    margin-top: 0.85rem;
    padding-right: 1.15rem;
    border-right: 2px dashed rgba(15, 159, 138, 0.25);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bg-comment-reply-item {
    display: flex;
    gap: 0.75rem;
    background: #f8fafc;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--bg-border-soft);
}

.bg-comment-avatar--reply {
    width: 36px;
    height: 36px;
    font-size: 0.82rem;
    border-radius: 10px;
}

