/* ۱. تنظیم کانتینر اصلی برای ایجاد فاصله از طرفین (مدرن‌سازی) */
body.pkp_page_index.pkp_op_index .pkp_structure_content.container {
    width: 100% !important;        /* به جای 100%، کمی فاصله از طرفین */
    max-width: 1300px !important; /* محدود کردن عرض برای جلوگیری از کشیدگی */
    margin: 2px auto !important; /* وسط‌چین کردن کانتینر */
    padding: 2px !important;     /* فاصله داخلی برای محتوا */
    /* background: #ffffff; */
    /* border-radius: 16px;         
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);  */
}

/* ۲. حذف مارجین‌های منفی بوت‌استرپ */
body.pkp_page_index.pkp_op_index .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* ۳. مدیریت ستون‌ها با فاصله داخلی (Gutter) */
body.pkp_page_index.pkp_op_index .homepage-image-col {
    padding-left: 0 !important;
    padding-right: 15px !important; 
}

body.pkp_page_index.pkp_op_index .journal-description-col {
    padding-left: 5px !important;
    padding-right: 0 !important;
}

/* ۴. استایل مدرن عکس */
.homepage-image-custom img {
    display: block !important;
    width: 100% !important;
    height: 500px !important; /* ارتفاع کمتر برای شکیل‌تر شدن */
    object-fit: cover !important;
    border-radius: 12px !important; /* گرد کردن عکس */
    transition: transform 0.3s ease;
}

/* ۵. استایل متن (برای خوانایی بهتر) */
.journal-description-custom {
    font-size: 16px;
    line-height: 1.6;
    margin-top:0 !important;
}

/* Footer Base Styles */
.custom-footer {
    background: #1e293b !important;
    color: #ffffff;
    padding-top: 40px;
    /* margin: 50px; */
    
}
.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.footer-row { display: flex; flex-wrap: wrap; gap: 30px; }
.footer-col { flex: 1; min-width: 250px; }
.footer-title { 
    font-size: 18px; color: #f8fafc; border-bottom: 2px solid #3b82f6; 
    display: inline-block; padding-bottom: 4px; margin-bottom: 15px; 
}
.footer-links { list-style: none; padding: 0; }
.footer-links li a { color: #cbd5e1; text-decoration: none; }
.footer-links li a:hover { color: #fff; }
.footer-bottom { 
    margin-top: 30px; padding: 20px 0; background: rgba(0,0,0,0.2); 
    font-size: 13px; color: #94a3b8; text-align: center; 
}

.modal__content label[for^="familyName"]::after {
    content: " *";
    color: #d81b60;
    font-weight: bold;
}


/* ۶. تنظیم ریسپانسیو فوتر و هوم‌پیج (موبایل و تبلت) */
@media (max-width: 991px) {
    body.pkp_page_index.pkp_op_index .pkp_structure_content.container {
        width: 98% !important;
        padding: 10px !important;
    }
    .homepage-image-col, 
    .journal-description-col {
        padding: 0 !important;
        margin-bottom: 20px !important;
    }
    .homepage-image-custom img {
        height: auto !important;
    }
}
@media (max-width: 768px) {
    .footer-row { flex-direction: column; }
}


/* =========================================================
   استایل‌های جدید: صفحه مقاله (سایدبار اختصاصی و حذف سایدبار مزاحم)
   ========================================================= */

/* مخفی کردن سایدبار پیش‌فرض OJS فقط در صفحه مقاله */
.pkp_structure_content:has(.page_article) .pkp_structure_sidebar,
.pkp_structure_content:has(.page_article) aside#sidebar.pkp_structure_sidebar[role="complementary"] {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    position: absolute !important;
}

/* تمام‌عرض کردن کانتینر اصلی محتوا در صفحه مقاله (خنثی کردن گرید بوت‌استرپ) */
.pkp_structure_content:has(.page_article) .pkp_structure_main {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    float: none !important;
}

/* ساختار دو ستونه فلکس برای مقاله */
.custom-article-layout {
    display: flex;
    gap: 40px;          /* فاصله بین محتوا و سایدبار */
    align-items: flex-start;
    margin-top: 20px;
}

/* ستون سمت چپ (محتوای اصلی) */
.custom-main-content {
    flex: 1;            /* پر کردن تمام فضای باقی‌مانده */
    min-width: 0;       /* جلوگیری از بیرون زدن محتوا (Overflow) */
}

/* ستون سمت راست (سایدبار اختصاصی ما) */
.custom-right-sidebar {
    width: 320px;       /* عرض دقیق سایدبار */
    flex-shrink: 0;     /* جلوگیری از کوچکتر شدن سایدبار */
}

/* استایل‌دهی جزئی به آیتم‌های داخل سایدبار برای زیبایی بیشتر */
.custom-right-sidebar .download-section a {
    display: block;
    margin-bottom: 10px;
}

.custom-right-sidebar .list-group-item {
    border: none;
    border-bottom: 1px solid #f1f1f1;
    padding: 15px 10px;
}
.custom-right-sidebar .list-group-item:last-child {
    border-bottom: none;
}

/* =========================================================
   استایل‌های مشابه عکس برای صفحه مقاله
   ========================================================= */

/* متغیرهای رنگی برای یکپارچگی */
:root {
    --primary-blue: #15428f; /* رنگ آبی تیره‌ی تیترها و سایدبار */
    --border-color: #e5e7eb;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
}

/* --- استایل‌های ستون اصلی (سمت چپ) --- */

.custom-main-content h1.page_title {
    color: var(--primary-blue) !important;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 15px;
}

.custom-main-content .document-type {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.custom-main-content .authors-list {
    margin-bottom: 20px;
}

.custom-main-content .authors-list .author {
    color: var(--primary-blue);
    font-weight: 500;
    margin-right: 15px;
}

.custom-main-content .author-affiliations {
    font-size: 13px;
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 20px;
}

.custom-main-content .item.abstract h2 {
    color: var(--text-dark);
    font-size: 18px;
    font-weight: bold;
    border-bottom: none;
}

.custom-main-content .item.abstract p {
    text-align: justify;
    line-height: 1.8;
    color: #374151;
}

/* --- استایل‌های سایدبار جدید (سمت راست) --- */

.article-sidebar-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* کارت مربوط به اطلاعات ژورنال (عکس و دوره) */
.issue-info-card {
    display: flex;
    padding: 15px;
    gap: 15px;
    align-items: center;
}

.issue-info-card img {
    width: 100px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.issue-info-details {
    font-size: 14px;
    color: var(--text-dark);
}

.issue-info-details .volume {
    color: var(--primary-blue);
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

/* هدرهای آبی رنگ سایدبار */
.article-sidebar-card .card-header {
    background-color: var(--primary-blue);
    color: #ffffff;
    padding: 12px 15px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.article-sidebar-card .card-header i {
    margin-right: 8px;
}

/* آیکون فلش (Chevron) در سمت راست هدر */
.article-sidebar-card .card-header .toggle-icon {
    margin-right: 0;
    margin-left: auto;
}

/* محتوای داخل باکس‌های سایدبار */
.article-sidebar-card .card-body {
    padding: 15px;
    background: #fff;
}

/* دکمه‌های دانلود داخل باکس Files */
.file-download-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
}

.file-download-btn:last-child {
    border-bottom: none;
}

.file-download-btn .file-type {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-download-btn .file-size {
    font-size: 12px;
    color: var(--text-muted);
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 12px;
}

/* رنگ آیکون فایل‌ها */
.icon-xml { color: #eab308; } /* زرد */
.icon-pdf { color: #ef4444; } /* قرمز */

/* مخفی کردن How to Cite پیش‌فرض در ستون اصلی */
.custom-main-content .panel.citation_format,
.custom-main-content .item.citation,
.custom-main-content .how-to-cite {
    display: none !important;
}

/* رفع مشکل بریده شدن منوی کشویی در سایدبار */
.article-sidebar-card,
.article-sidebar-card .card-body {
    overflow: visible !important;
}

/* اطمینان از اینکه منو روی بقیه عناصر قرار میگیره */
.citation_formats .dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
}


/* ریسپانسیو کردن مقاله برای موبایل و تبلت */
@media (max-width: 991px) {
    .custom-article-layout {
        flex-direction: column; /* زیر هم قرار گرفتن ستون‌ها در موبایل */
    }
    .custom-right-sidebar {
        width: 100%; /* سایدبار در موبایل تمام‌عرض می‌شود */
        margin-top: 30px;
    }
}
