/* ==========================================================
   OJS 3 Final Complete Academic Theme (Summary & Details)
   - ATU Inspired / Vazir Font / Full Justify / Fixed Authors & ORCID
   ========================================================== */

/* 1. Import Vazirmatn Font for Persian */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

/* Academic Color Palette */
:root {
    --atu-primary: #003366;      /* سرمه‌ای رسمی آکادمیک */
    --atu-secondary: #005B99;    /* آبی ملایم دانشگاهی */
    --atu-text: #2c3e50;         /* رنگ متن اصلی */
    --atu-border: #d1d8dd;       /* حاشیه‌ها */
    --orcid-green: #A6CE39;      /* رنگ ارکید */
}

/* 2. Global Typography & Full Justify */
body {
    color: var(--atu-text) !important;
    background-color: #ffffff !important;
    font-size: 15px;
    line-height: 1.8;
}

/* Force Full Text Justification Everywhere */
p, 
div.abstract, 
.value, 
.description, 
.article-abstract, 
.obj_article_details .item .value,
.obj_article_summary .abstract {
    text-align: justify !important;
    text-justify: inter-word !important;
}

/* Persian Language & RTL Settings + Vazir Font */
html[lang="fa"] body, body.rtl {
    direction: rtl !important;
    text-align: right !important;
    font-family: 'Vazirmatn', sans-serif !important;
}

html[lang="fa"] h1, html[lang="fa"] h2, html[lang="fa"] h3, 
html[lang="fa"] h4, html[lang="fa"] h5, html[lang="fa"] h6,
html[lang="fa"] .title, html[lang="fa"] a, html[lang="fa"] .authors,
body.rtl h1, body.rtl h2, body.rtl h3, body.rtl h4, body.rtl h5, body.rtl h6 {
    font-family: 'Vazirmatn', sans-serif !important;
}

/* English Language & LTR Settings */
html[lang="en"] body, body.ltr {
    direction: ltr !important;
    text-align: left !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* 3. Article Summary Boxes / Cards (باکس‌بندی مقالات در فهرست و صفحه اصلی) */
.obj_article_summary, 
.issues_iterator .obj_article_summary,
.item.toc_item {
    background: #ffffff !important;
    border: 1px solid var(--atu-border) !important;
    border-radius: 8px !important;
    padding: 22px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
}

.obj_article_summary:hover {
    box-shadow: 0 6px 18px rgba(0,51,102,0.08);
    border-color: var(--atu-secondary) !important;
}

.obj_article_summary .title a {
    color: var(--atu-primary) !important;
    font-size: 1.25rem;
    font-weight: bold;
    text-decoration: none;
}

/* 4. اصلاح اسامی نویسندگان و لینک‌دار کردن آن‌ها در بخش SUMMARY (فهرست و شماره‌ها) */
.obj_article_summary .authors,
.issues_iterator .authors,
.item.toc_item .authors {
    font-size: 1.05rem !important; /* اندازه استاندارد و خوانا برای نام نویسندگان */
    color: var(--atu-secondary) !important;
    margin: 8px 0 12px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

/* تبدیل اسامی نویسندگان به لینک با قابلیت هاور */
.obj_article_summary .authors .name,
.obj_article_summary .authors a,
.issues_iterator .authors a {
    color: var(--atu-secondary) !important;
    text-decoration: none !important;
    font-size: 1.05rem !important;
    font-weight: 600;
    transition: color 0.2s ease;
}

.obj_article_summary .authors .name:hover,
.obj_article_summary .authors a:hover,
.issues_iterator .authors a:hover {
    color: var(--atu-primary) !important;
    text-decoration: underline !important;
}

/* 5. اصلاح آیکون ORCID در بخش Summary و Details (نمایش گرافیکی بدون کدهای متنی) */
.obj_article_summary .authors a[href*="orcid.org"],
.obj_article_details .authors a[href*="orcid.org"],
a[href*="orcid.org"] {
    font-size: 0 !important;
    display: inline-block !important;
    width: 15px;
    height: 15px;
    background-image: url('https://orcid.org/sites/default/files/images/orcid_16x16.png');
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
    margin-inline-start: 4px;
    margin-inline-end: 8px;
}

.obj_article_summary .orcid-id, 
.author_orcid {
    display: inline-block !important;
    font-size: 0 !important;
    width: 15px;
    height: 15px;
    background-image: url('https://orcid.org/sites/default/files/images/orcid_16x16.png');
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
}

/* 6. Pure CSS Expandable Abstract (چکیده بازشو و بسته‌شو با هاور در بخش Summary) */
.obj_article_summary .abstract {
    max-height: 80px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: max-height 0.6s ease-in-out, background-color 0.3s ease;
    padding: 5px;
    border-radius: 4px;
}

.obj_article_summary .abstract::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.95));
    pointer-events: none;
}

.obj_article_summary .abstract:hover,
.obj_article_summary .abstract:focus {
    max-height: 600px !important;
    background-color: #fafbfc;
}

.obj_article_summary .abstract:hover::after,
.obj_article_summary .abstract:focus::after {
    display: none;
}

.obj_article_summary .abstract::before {
    content: "📌 (برای خواندن کل چکیده، ماوس را روی متن ببرید)";
    display: block;
    font-size: 0.75rem;
    color: var(--atu-secondary);
    font-weight: bold;
    margin-bottom: 4px;
}
html[lang="en"] .obj_article_summary .abstract::before {
    content: "📌 (Hover to expand abstract)";
}

/* 7. Header & Navigation Refinement */
.pkp_structure_head {
    border-bottom: 4px solid var(--atu-primary);
}

.pkp_navigation_primary {
    background-color: var(--atu-primary) !important;
    border-radius: 4px;
}

.pkp_navigation_primary > li > a {
    color: #ffffff !important;
    font-weight: 500;
}

/* 8. Article Details Page (صفحه جزئیات مقاله) */
.obj_article_details {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--atu-border);
}

.obj_article_details .title {
    color: var(--atu-primary);
    font-weight: 700;
}

/* دکمه دانلود PDF */
.obj_article_details .galley_link.pdf, 
.obj_galley_link {
    background-color: #c0392b !important;
    color: #ffffff !important;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
}