/**
 * Single Published Article Styles
 * MATCHING Graduate Research Premium Design
 */

:root {
    --art-primary: #1e407a;
    --art-accent: #ffc53a;
    --art-soft: #cdd4fb;
    --art-chip-bg: #b7d8ef;
    --art-text-main: #292929;
    --art-text-muted: #545454;
    --art-border-soft: #cdd4fb;
    --art-page-bg: #ffffff;
    --art-radius-lg: 24px;
    --art-radius-md: 16px;
    --art-shadow-soft: 0 22px 55px rgba(15, 23, 42, 0.14);
}

/* Hide default theme title on Published Article single */
.single-published_article .page-header,
.single-published_article .page-title,
.single-published_article .entry-title,
.single-published_article #sub-header,
.single-published_article .elementor-page-title {
    display: none !important;
}

/* Heading overrides inside our layout */
.single-published_article .art-single-page h1,
.single-published_article .art-single-page h2,
.single-published_article .art-single-page h3,
.single-published_article .art-single-page h4 {
    font-family: inherit;
    line-height: 1.4;
}

.single-published_article .art-title-main {
    font-size: 1.7rem !important;
    line-height: 1.35 !important;
    font-weight: 800;
    color: var(--art-primary);
}

.single-published_article .art-section-title {
    font-size: 1rem !important;
    font-weight: 700;
    color: var(--art-primary);
}

/* Base wrapper */
.art-single-page {
    width: 100%;
    min-height: 100vh;
    padding: 32px 0 60px;
    background: var(--art-page-bg);
    color: var(--art-text-main);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.art-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Back link */
.art-back-link {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--art-text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
}

.art-back-link span:first-child {
    font-size: 1rem;
    line-height: 1;
}

.art-back-link:hover {
    color: var(--art-primary);
}

/* RTL: Flip the back arrow */
html[dir="rtl"] .art-back-link,
html[lang="ar"] .art-back-link,
body.rtl .art-back-link {
    flex-direction: row-reverse;
}

html[dir="rtl"] .art-back-link span:first-child,
html[lang="ar"] .art-back-link span:first-child,
body.rtl .art-back-link span:first-child {
    transform: scaleX(-1);
}

/* MAIN CARD */
.art-single-main {
    display: grid;
    grid-template-columns: minmax(0, 2.3fr) minmax(0, 1.4fr);
    background: #f7f7fc;
    border-radius: 30px;
    box-shadow: var(--art-shadow-soft);
    overflow: hidden;
}

@media (max-width: 960px) {
    .art-single-main {
        grid-template-columns: minmax(0, 1fr);
    }
}

.art-left {
    padding: 24px 24px 26px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.art-right {
    padding: 26px 24px 26px;
    background: linear-gradient(135deg, var(--art-primary), #16345f);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
}

/* Left top */
.art-article-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--art-text-muted);
}

.art-title-main {
    margin: 4px 0 4px;
    line-height: 1.35;
}

.art-title-ar {
    font-size: 1rem;
    font-weight: 500;
    color: var(--art-text-muted);
    margin: 0 0 6px;
}

.art-authors-line {
    margin: 0 0 4px;
    font-size: 0.9rem;
    color: var(--art-text-muted);
}

.art-journal-line {
    margin: 0;
    font-size: 0.86rem;
    color: var(--art-text-main);
    font-weight: 500;
    font-style: italic;
}

.art-index-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.art-index-badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--art-chip-bg);
    border: 1px solid var(--art-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--art-text-main);
    font-size: 0.72rem;
}

/* Abstract / keywords */
.art-section-title {
    margin: 10px 0 4px;
}

.art-abstract-text {
    font-size: 0.92rem;
    line-height: 1.9;
    color: var(--art-text-muted);
    margin: 0 0 10px;
}

.art-keywords-block {
    margin-top: 5px;
}

.art-keywords-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.art-keyword-pill {
    font-size: 0.78rem;
    padding: 4px 9px;
    border-radius: 999px;
    background: #fff7e5;
    border: 1px solid #ffe0a3;
    color: #92400e;
    white-space: nowrap;
}

/* RIGHT DETAILS */
.art-right-heading {
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    opacity: 0.9;
}

.art-details-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px 20px;
    font-size: 0.86rem;
    margin-top: 8px;
}

.art-detail-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    opacity: 0.75;
    margin-bottom: 2px;
}

.art-detail-value {
    font-weight: 600;
    word-break: break-word;
}

/* BUTTONS COLUMN */
.art-buttons-column {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

body.single-published_article .art-right .art-buttons-column .art-btn-primary,
body.single-published_article .art-right .art-buttons-column .art-btn-secondary {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
    align-items: center;
    border-radius: 999px;
    border: none;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease,
        color 0.15s ease;
}

body.single-published_article .art-right .art-buttons-column .art-btn-primary span,
body.single-published_article .art-right .art-buttons-column .art-btn-secondary span {
    color: inherit;
    text-decoration: none;
}

/* PRIMARY – View PDF */
body.single-published_article .art-right .art-buttons-column .art-btn-primary {
    background: linear-gradient(120deg, var(--art-accent), #ffb200);
    color: #1b1b1b;
}

body.single-published_article .art-right .art-buttons-column .art-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
    background: linear-gradient(120deg, #ffd45f, var(--art-accent));
}

/* SECONDARY – View external page */
body.single-published_article .art-right .art-buttons-column .art-btn-secondary {
    background: rgba(255, 255, 255, 0.96);
    color: var(--art-primary);
    border: 1px solid #ffffff;
}

body.single-published_article .art-right .art-buttons-column .art-btn-secondary:hover {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
}

/* Right footnote + ID */
.art-right-footnote {
    font-size: 0.78rem;
    opacity: 0.85;
}

.art-article-id {
    margin-top: 6px;
    font-size: 0.8rem;
    opacity: 0.9;
}

/* RELATED ARTICLES - Premium Design */
.art-related {
    max-width: 1140px;
    margin: 40px auto 0;
    padding: 0 16px 40px;
}

.art-related-title {
    margin: 0 0 20px;
    font-size: 1.4rem !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--art-primary);
    position: relative;
    padding-bottom: 12px;
}

.art-related-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--art-accent), var(--art-primary));
    border-radius: 2px;
}

html[dir="rtl"] .art-related-title::after,
body.rtl .art-related-title::after {
    left: auto;
    right: 0;
}

.art-related-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 1100px) {
    .art-related-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .art-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 500px) {
    .art-related-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.art-related-card {
    border-radius: 16px;
    border: 1px solid rgba(205, 212, 251, 0.8);
    background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
    overflow: hidden;
}

.art-related-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--art-primary), var(--art-accent));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.art-related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    border-color: var(--art-primary);
}

.art-related-card:hover::before {
    opacity: 1;
}

.art-related-name {
    margin: 0;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    font-family: inherit !important;
    line-height: 1.35 !important;
    color: var(--art-text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.art-related-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.art-related-name a:hover {
    color: var(--art-primary);
    text-decoration: none;
}

.art-related-meta {
    margin: 0;
    color: var(--art-text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.art-related-meta::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--art-accent);
    border-radius: 50%;
    flex-shrink: 0;
}

/* PDF MODAL */
.art-pdf-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.art-pdf-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.art-pdf-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
}

.art-pdf-dialog {
    position: relative;
    max-width: 900px;
    width: 90%;
    height: 75vh;
    margin: 12vh auto 0;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(24px) scale(0.97);
    transition: transform 0.25s ease;
}

.art-pdf-modal.is-open .art-pdf-dialog {
    transform: translateY(0) scale(1);
}

.art-pdf-header {
    padding: 10px 18px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, #e5e7ff, #ffffff);
}

.art-pdf-title {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #111827;
}

.art-pdf-close {
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
}

.art-pdf-body {
    flex: 1;
    background: #f3f4f6;
}

.art-pdf-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* RTL Keyword Support */
html[dir="rtl"] .art-keyword-pill,
html[lang="ar"] .art-keyword-pill,
body.rtl .art-keyword-pill {
    direction: rtl;
    unicode-bidi: isolate;
}

/* RTL Single Layout */
html[dir="rtl"] .art-single-page,
html[lang="ar"] .art-single-page,
body.rtl .art-single-page {
    direction: rtl;
    text-align: right;
}