/* shared layout identical to index side panels */
:root {
    --desktop-side-top: 170px;
    --home-fixed-total: 0px;
}

@media (min-width: 1201px) {
    body.fixed-home-header {
        padding-top: var(--home-fixed-total) !important;
    }

    body.fixed-home-header .header-top {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 4100 !important;
    }

    body.fixed-home-header .header {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 4090 !important;
    }

    body.fixed-home-header .main-nav {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 4080 !important;
    }

    .container {
        max-width: 100%;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .main-content-wrapper {
        padding: 0.65rem 0;
    }

    .content-layout {
        display: block;
    }

    .site-right-menu {
        position: fixed;
        width: 220px;
        overflow-y: auto;
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        padding: 0.55rem 0.45rem;
        z-index: 999;
        text-align: right;
        top: var(--desktop-side-top);
        right: 8px;
        max-height: calc(100vh - var(--desktop-side-top) - 12px);
    }

    .main-sidebar {
        position: fixed;
        top: var(--desktop-side-top);
        left: 8px;
        width: 330px;
        max-height: calc(100vh - var(--desktop-side-top) - 12px);
        overflow-y: auto;
        padding: 0.2rem;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        background: #f8fafc;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
        z-index: 999;
    }

    .main-sidebar .widget {
        width: 100%;
        background: white;
        border-radius: 8px;
        padding: 1rem;
        margin-bottom: 0.6rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        overflow: hidden;
    }

    .main-sidebar .widget:last-child {
        margin-bottom: 0;
    }

    .main-content-area {
        margin-left: 344px;
        margin-right: 234px;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        background: #ffffff;
        padding: 0.35rem 0.45rem;
        min-width: 0;
    }

    .footer {
        width: auto !important;
        max-width: none !important;
        margin-left: 344px !important;
        margin-right: 234px !important;
        box-sizing: border-box !important;
        border-radius: 14px !important;
        overflow: hidden !important;
    }

    .footer > .container,
    .footer .footer-bottom > .container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding-left: 0.45rem !important;
        padding-right: 0.45rem !important;
        box-sizing: border-box !important;
    }
}

/* تمام‌عرض محتوای داخل ستون مرکزی (خبر، لیست اخبار، …) — مثل صفحهٔ نخست؛ غلبه بر max-width:1280px قالب‌های دیگر */
.main-content-area .container {
    max-width: 100%;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

/* همان محدودیت برای لایهٔ بیرونی؛ وگرنه کل ناحیهٔ میانی داخل یک باکس 1280px وسط صفحه می‌ماند */
.main-content-wrapper > .container {
    max-width: 100%;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

.site-right-menu .menu-brand {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
    color: #123d85;
    padding: 0.4rem 0.55rem 0.7rem 0.55rem;
    border-bottom: 2px solid #f1f5f9;
}

.site-right-menu .menu-brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
}

.site-right-menu .menu-brand-icon {
    font-size: 1.6rem;
    color: #f3b61f;
}

.site-right-menu .menu-items {
    list-style: none;
    margin: 0;
    padding: 0.1rem 0.2rem;
}

.site-right-menu .menu-items li {
    border-bottom: 1px solid #edf0f5;
}

.site-right-menu .menu-items li:last-child {
    border-bottom: none;
}

.site-right-menu .menu-item-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    color: #202634;
    text-decoration: none;
    padding: 0.58rem 0.45rem;
    font-size: 0.97rem;
    font-weight: 700;
    border-radius: 8px;
}

.site-right-menu .menu-item-link:hover,
.site-right-menu .menu-item-link.active {
    color: #123d85;
    background: #f3f6fb;
}

.site-right-menu .menu-item-link i {
    font-size: 1.45rem;
    width: 24px;
    text-align: center;
    color: #2a2f39;
}

.main-sidebar .widget-header {
    margin: -1rem -1rem 0.75rem -1rem;
    padding: 0.65rem 1rem;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, #6d28d9 0%, #5b21b6 100%);
    color: #fff;
}

.main-sidebar .widget-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.main-sidebar .widget-title i {
    color: rgba(255, 255, 255, 0.95);
}

/* پربازدیدها و هم‌ردیف‌ها — هم‌سو با SingleMode4، فقط داخل سایدبار چپ */
.main-sidebar .most-read-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.main-sidebar .most-read-item {
    display: flex;
    gap: 0.65rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #e8ecf1;
}

.main-sidebar .most-read-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.main-sidebar .most-read-rank {
    font-size: 1.5rem;
    font-weight: 800;
    color: #8b5cf6;
    opacity: 0.35;
    line-height: 1;
    flex-shrink: 0;
    width: 30px;
    text-align: center;
}

.main-sidebar .most-read-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.main-sidebar .most-read-title a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s ease;
}

.main-sidebar .most-read-title a:hover {
    color: #6d28d9;
}

.main-sidebar .most-read-meta {
    color: #6b7280;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.main-sidebar .side-search-wrap {
    position: relative;
}

.main-sidebar .side-search-input {
    width: 100%;
    border: 1px solid #d7dee8;
    border-radius: 10px;
    padding: 0.65rem 2.2rem 0.65rem 0.65rem;
    background: #f8fafc;
    font-family: inherit;
    color: #1f2937;
}

.main-sidebar .side-search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.main-sidebar .member-box-title {
    margin: 0 0 0.55rem;
    color: #122760;
    font-size: 1.05rem;
    font-weight: 800;
}

.main-sidebar .member-box-text {
    margin: 0 0 0.7rem;
    color: #4b5563;
    line-height: 1.75;
    font-size: 0.92rem;
}

.main-sidebar .member-login-btn {
    display: block;
    text-decoration: none;
    text-align: center;
    background: #6d28d9;
    color: #fff;
    border-radius: 10px;
    padding: 0.6rem 0.7rem;
    font-weight: 700;
}

.main-sidebar .member-login-btn:hover {
    background: #5b21b6;
}

.main-sidebar .hot-topics-widget {
    background: linear-gradient(160deg, #f5f7f3 0%, #e7ece1 48%, #dbe4cc 100%);
    border: 1px solid rgba(166, 180, 132, 0.3);
    box-shadow: 0 6px 12px rgba(107, 114, 128, 0.1);
}

.main-sidebar .hot-topics-widget .member-box-title {
    color: #374151;
}

.main-sidebar .hot-topics-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-sidebar .hot-topics-widget .hot-topics-list li {
    border-bottom: 1px solid rgba(107, 114, 128, 0.18);
}

.main-sidebar .hot-topics-widget .hot-topics-list li:last-child {
    border-bottom: none;
}

.main-sidebar .hot-topics-widget .hot-topics-list a {
    display: flex;
    justify-content: space-between;
    text-decoration: none;
    color: #1f2937;
    padding: 0.55rem 0;
    font-weight: 700;
}

.main-sidebar .hot-topics-widget .hot-topics-list span {
    color: #6b7280;
    font-size: 0.84rem;
}

/* scrollbars */
.site-right-menu,
.main-sidebar,
html {
    scrollbar-width: thin;
    scrollbar-color: #8b5cf6 #eef2f7;
}

.site-right-menu::-webkit-scrollbar,
.main-sidebar::-webkit-scrollbar,
html::-webkit-scrollbar {
    width: 5px;
}

.site-right-menu::-webkit-scrollbar-track,
.main-sidebar::-webkit-scrollbar-track,
html::-webkit-scrollbar-track {
    background: #eef2f7;
    border-radius: 999px;
}

.site-right-menu::-webkit-scrollbar-thumb,
.main-sidebar::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8b5cf6 0%, #6d28d9 100%);
    border-radius: 999px;
}

@media (max-width: 1200px) {
    body.fixed-home-header {
        padding-top: 0 !important;
    }

    .site-right-menu {
        display: none;
    }

    .main-content-area {
        margin: 0;
    }

    .main-sidebar {
        position: static;
        width: auto;
        max-height: none;
        margin-top: 10px;
        padding: 0;
        border: 0;
        box-shadow: none;
        background: transparent;
    }

    .main-sidebar .widget {
        overflow: hidden;
    }
}
