/* ==========================================================================
   SlashWeb - Single Article Page Styles (style-single.css)
   ========================================================================== */

.single-post-container {
    max-width: 860px;
    margin: 1.5rem auto 3rem;
    padding: 0 1rem;
}

.single-post-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-xl);
    border: 1px solid var(--card-border);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2.5rem;
    overflow: hidden;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

@media (max-width: 640px) {
    .single-post-container {
        margin: 0.75rem auto 2rem;
    }
    .single-post-card {
        padding: 1.15rem;
        border-radius: var(--radius-lg);
        margin-bottom: 1.5rem;
    }
}

.single-post-category-tag {
    display: inline-block;
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0.35rem 0.95rem;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
    transition: all var(--transition-fast);
}

.single-post-category-tag:hover {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
}

.single-post-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--color-dark);
    line-height: 1.35;
    margin-bottom: 1rem;
    word-break: break-word;
    overflow-wrap: break-word;
    contain: layout;
}

@media (max-width: 640px) {
    .single-post-title {
        font-size: 1.35rem;
        line-height: 1.4;
    }
}

@media (min-width: 768px) {
    .single-post-title {
        font-size: 2.25rem;
    }
}

.single-post-meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--card-meta);
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 1.75rem;
    min-height: 48px;
    contain: layout;
}

.single-post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.single-post-meta i {
    color: var(--color-primary);
}

.single-post-image-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background-color: var(--color-surface-alt);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    display: block;
}

.single-post-image {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}

/* محتوى المقال والخطوط */
.single-post-content {
    font-size: 1.125rem;
    color: var(--color-text-body);
    line-height: 1.9;
    word-break: break-word;
}

.single-post-content p {
    margin-bottom: 1.5rem;
}

.single-post-content h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-right: 0.75rem;
    border-right: 4px solid var(--color-primary);
}

.single-post-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding-right: 0.75rem;
    border-right: 4px solid var(--color-primary);
}

.single-post-content blockquote {
    margin: 1.75rem 0;
    padding: 1.25rem 1.75rem;
    background-color: var(--color-surface-hover);
    border-right: 4px solid var(--color-primary);
    border-radius: var(--radius-md);
    font-style: italic;
    color: var(--color-text-main);
    font-size: 1.15rem;
}

.single-post-content img {
    border-radius: var(--radius-lg);
    margin: 1.75rem auto;
    max-width: 100%;
}

/* قائمة الوسوم أسفل المقال */
.single-post-tags {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.single-post-tags strong {
    font-size: 0.9rem;
    color: var(--color-dark);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.5rem;
}

.single-post-tags strong i {
    color: var(--color-primary);
}

.single-post-tags a.tag {
    background-color: var(--color-surface-elevated);
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.single-post-tags a.tag:hover {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
    border-color: var(--color-primary);
}

/* الأخبار ذات الصلة */
.related-posts {
    margin-top: 3rem;
}

.related-posts-section {
    margin-top: 3rem;
    padding: 1.5rem 1.75rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.related-posts-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--color-border-light);
}

.related-posts-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--color-dark);
    margin: 0;
}

.related-links-vertical {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.related-link-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background-color: var(--color-surface-alt);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-normal);
}

.related-link-row:hover {
    background-color: var(--color-surface);
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-md);
    transform: translateX(-4px);
}

.related-bullet {
    margin-top: 0.35rem;
    width: 20px;
    height: 20px;
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.related-link-row:hover .related-bullet {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
}

.related-text-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.related-link-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-main);
    text-decoration: none;
    line-height: 1.5;
    transition: color var(--transition-fast);
}

.related-link-title:hover {
    color: var(--color-primary);
}

.related-link-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* ==========================================================================
   شريط المشاركة الاجتماعية والرابط المختصر الشامل
   ========================================================================== */
.single-post-share-bar {
    margin: 2.25rem 0;
    padding: 1.25rem 1.5rem;
    background-color: var(--color-surface-hover);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.share-section-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--color-dark);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.share-buttons-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.share-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    font-size: 0.9rem;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    text-decoration: none !important;
}

.share-btn:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: var(--shadow-md);
}

.share-btn.whatsapp { background-color: #25D366; }
.share-btn.twitter { background-color: #000000; }
.share-btn.facebook { background-color: #1877F2; }
.share-btn.telegram { background-color: #24A1DE; }
.share-btn.linkedin { background-color: #0A66C2; }
.share-btn.threads { background-color: #000000; }
.share-btn.pinterest { background-color: #E60023; }
.share-btn.reddit { background-color: #FF4500; }
.share-btn.email { background-color: #EA4335; }
.share-btn.print { background-color: #475569; }
.share-btn.native { background-color: var(--color-primary); }

.short-link-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background-color: var(--color-surface);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xs);
}

.short-link-text {
    font-family: monospace;
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--color-dark);
    direction: ltr;
    user-select: all;
}

.btn-copy-short {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-copy-short:hover {
    color: var(--color-primary);
    background-color: var(--color-surface-hover);
}

@media (max-width: 640px) {
    .single-post-share-bar {
        padding: 1rem;
        margin: 1.5rem 0;
        gap: 0.85rem;
    }
    .share-buttons-group {
        gap: 0.35rem;
    }
    .share-btn {
        width: 33px;
        height: 33px;
        font-size: 0.8rem;
    }
    .short-link-box {
        width: 100%;
        justify-content: space-between;
    }
    .short-link-text {
        max-width: 170px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .single-post-tags {
        gap: 0.4rem;
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
}

/* ==========================================================================
   Google News & Social Follow Hub
   ========================================================================== */

.btn-meta-gnews {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-main) !important;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.775rem;
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-fast);
    margin-right: auto;
}

.btn-meta-gnews:hover {
    background-color: var(--color-surface-hover);
    border-color: var(--color-border-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.single-post-follow-hub {
    margin: 2rem 0;
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-alt) 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.follow-hub-header {
    margin-bottom: 1.25rem;
}

.follow-hub-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 800;
    color: var(--color-dark);
    margin-bottom: 0.35rem;
}

.follow-hub-desc {
    font-size: 0.825rem;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.5;
}

.follow-hub-channels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.follow-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.follow-chip:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.follow-chip.gnews {
    background-color: var(--color-surface);
    color: var(--color-text-main) !important;
    border: 1px solid var(--color-border);
}
.follow-chip.gnews:hover { border-color: #4285F4; }

.follow-chip.whatsapp {
    background: #25D366;
    color: #ffffff !important;
}

.follow-chip.telegram {
    background: #24A1DE;
    color: #ffffff !important;
}

.follow-chip.twitter {
    background: #000000;
    color: #ffffff !important;
}

.follow-chip.facebook {
    background: #1877F2;
    color: #ffffff !important;
}

.follow-chip.youtube {
    background: #FF0000;
    color: #ffffff !important;
}

.follow-chip.instagram {
    background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
    color: #ffffff !important;
}

.follow-chip.threads {
    background: #000000;
    color: #ffffff !important;
}

.follow-chip.tiktok {
    background: #010101;
    color: #ffffff !important;
}

.follow-chip.linkedin {
    background: #0A66C2;
    color: #ffffff !important;
}

/* ==========================================================================
   WordPress SlashNews Style Channels Banners (.sw-channels-grid)
   ========================================================================== */

.sw-channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin: 24px 0 16px;
}

.sw-channel-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-radius: var(--radius-lg, 14px);
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 13.5px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.sw-channel-banner:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: #ffffff !important;
}

.sw-channel-gnews {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
}

.sw-channel-wapp {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
}

.sw-channel-telegram {
    background: linear-gradient(135deg, #229ed9 0%, #0088cc 100%);
}

.sw-channel-btn {
    background: rgba(255, 255, 255, 0.22);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

@media (max-width: 640px) {
    .btn-meta-gnews {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
    .sw-channels-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .sw-channel-banner {
        padding: 12px 14px;
        font-size: 12.5px;
    }
    .follow-hub-channels {
        gap: 0.5rem;
    }
    .follow-chip {
        flex: 1 1 calc(50% - 0.5rem);
        justify-content: center;
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}

/* ==========================================================================
   Dark Mode Overrides for Single Post Page
   ========================================================================== */
/* Note: Most elements use CSS variables which automatically switch in dark mode. 
   Only essential specific overrides are kept here. */

html[data-theme="dark"] .share-btn.twitter,
html[data-theme="dark"] .share-btn.threads {
    background-color: #222222;
}

html[data-theme="dark"] .follow-chip.twitter,
html[data-theme="dark"] .follow-chip.threads,
html[data-theme="dark"] .follow-chip.tiktok {
    background-color: #222222;
}

html[data-theme="dark"] .single-post-follow-hub {
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-hover) 100%);
}

/* ==========================================================================
   شريط تقدم القراءة في أعلى المقال (Reading Progress Bar)
   ========================================================================== */
.reading-progress-bar {
    position: fixed;
    top: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ef4444, #f97316);
    width: 0%;
    z-index: 99999;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* ==========================================================================
   شريط أدوات القارئ (Reader Toolbar: Reading Time, Resizer, Print)
   ========================================================================== */
.reader-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    margin-bottom: 2rem;
    background-color: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
}

.reading-time-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text-body);
}

.reader-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.font-resizer-box {
    display: inline-flex;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 2px;
    gap: 2px;
}

.btn-resizer {
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    font-size: 0.825rem;
    font-weight: 800;
    color: var(--color-text-main);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-resizer:hover {
    background-color: var(--color-primary);
    color: #ffffff;
}

.btn-print-article {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-body);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-print-article:hover {
    background-color: var(--color-surface-hover);
    color: var(--color-primary);
    border-color: var(--color-primary-border);
}

/* ==========================================================================
   صندوق الكاتب الصحفي (Author Bio Card)
   ========================================================================== */
.author-bio-card {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.75rem;
    margin-top: 2.5rem;
    background: linear-gradient(145deg, var(--color-surface), var(--color-surface-alt));
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
    .author-bio-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.25rem;
        gap: 1rem;
    }
}

.author-avatar-wrap {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid var(--color-primary-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.author-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-surface-hover);
}

.author-bio-details {
    flex: 1;
    min-width: 0;
}

.author-bio-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .author-bio-header {
        justify-content: center;
    }
}

.author-name {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--color-text-main);
    margin: 0;
    line-height: 1.3;
}

.author-role-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.25rem 0.75rem;
    background-color: #fee2e2;
    color: #991b1b; /* WCAG AAA Contrast Ratio > 8:1 */
    border: 1px solid #fca5a5;
    border-radius: var(--radius-full);
    line-height: 1.2;
}

.author-bio-text {
    font-size: 0.925rem;
    color: var(--color-text-body);
    line-height: 1.65;
    margin: 0;
}

/* الوضع الداكن لأدوات المقال وصندوق الكاتب */
html[data-theme="dark"] .reader-toolbar {
    background-color: #0f172a;
    border-color: #1e293b;
}

html[data-theme="dark"] .font-resizer-box,
html[data-theme="dark"] .btn-print-article {
    background-color: #162033;
    border-color: #1e293b;
    color: #cbd5e1;
}

html[data-theme="dark"] .btn-resizer {
    color: #cbd5e1;
}

html[data-theme="dark"] .author-bio-card {
    background: linear-gradient(145deg, #0f172a, #162033);
    border-color: #1e293b;
}

html[data-theme="dark"] .author-avatar-wrap {
    border-color: rgba(239, 68, 68, 0.25);
}

html[data-theme="dark"] .author-role-badge {
    background-color: #450a0a;
    color: #fecaca; /* WCAG AAA Contrast Ratio > 10:1 */
    border: 1px solid #7f1d1d;
}