/* ========================================
   Modern Article Page Design - World Class
   ======================================== */

/* Article Header - Premium Design */
.article-header {
    position: relative;
    min-height: 65vh;
    display: flex;
    align-items: flex-end;
    padding-bottom: 4rem;
    overflow: hidden;
}

.article-header-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.article-header-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.05);
    transition: transform 8s ease-out;
}

.article-header:hover .article-header-bg img {
    transform: scale(1);
}

.header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.9) 100%
    );
    z-index: 2;
}

.header-content {
    position: relative;
    z-index: 3;
    color: white;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Breadcrumb - Modern Style */
.article-breadcrumb .breadcrumb {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 50px;
    display: inline-flex;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.article-breadcrumb .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.article-breadcrumb .breadcrumb-item a:hover {
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Category Badge - Glassmorphism */
.article-category-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FFB84D 0%, #F05A24 50%, #E03D3F 100%);
    backdrop-filter: blur(10px);
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(240, 90, 36, 0.3);
    transition: all 0.3s ease;
}

.article-category-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(240, 90, 36, 0.4);
}

/* Article Title - Premium Typography */
.article-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    margin-bottom: 2rem;
    line-height: 1.2;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
}

.article-header .article-title {
    color: #ffffff;
}

/* Meta Bar - Enhanced Design */
.article-meta-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.author-avatar:hover {
    transform: scale(1.1);
    border-color: white;
}

.author-details .author-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.author-details .author-role {
    font-size: 0.9rem;
    opacity: 0.8;
}

.meta-items {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.meta-item i {
    font-size: 1.1rem;
}

/* Content Wrapper - Premium Card */
.article-body {
    padding-top: 2.5rem;
    padding-bottom: 4rem;
    background-color: #f8fafc;
}

.article-content-wrapper {
    position: relative;
    background: white;
    border-radius: 28px;
    padding: 3.5rem 3rem;
    margin-top: 0;
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(0, 0, 0, 0.03);
    margin-bottom: 3rem;
    transition: box-shadow 0.3s ease;
}

.article-content-wrapper:hover {
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.03);
}

/* Share Sidebar - Desktop Only (Absolute Position) */
@media (min-width: 1201px) {
    .share-sidebar {
        position: absolute;
        right: -80px;
        top: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        z-index: 10;
    }
    
    .share-label {
        font-size: 0.75rem;
        font-weight: 700;
        color: #9ca3af;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        writing-mode: vertical-rl;
        text-orientation: mixed;
        transform: rotate(180deg);
        margin-bottom: 0.5rem;
    }
    
    .share-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .share-btn {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }
}

/* Share Button Base Styles */
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.share-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.share-btn:hover::before {
    opacity: 1;
}

.share-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.share-btn.facebook { background: linear-gradient(135deg, #1877f2, #0c5ec7); }
.share-btn.twitter { background: linear-gradient(135deg, #1da1f2, #0d8bd9); }
.share-btn.whatsapp { background: linear-gradient(135deg, #25d366, #1da851); }
.share-btn.linkedin { background: linear-gradient(135deg, #0a66c2, #004182); }
.share-btn.copy-link { background: linear-gradient(135deg, #6b7280, #4b5563); }

/* Article Content - Editorial Typography & Balanced Paragraph Rhythm */
.article-content {
    --article-font-scale: 1;
    font-size: calc(1.0625rem * var(--article-font-scale));
    line-height: 1.82;
    color: #1f2937;
    font-weight: 400;
}

.article-content h2 {
    font-size: 1.65rem;
    font-weight: 800;
    color: #092E40;
    margin-top: 2.1rem !important;
    margin-bottom: 0.75rem !important;
    padding-inline-start: 1.1rem;
    padding-right: 0;
    border-right: none;
    border-inline-start: 4px solid #EA502E;
    line-height: 1.38;
    position: relative;
    scroll-margin-top: 90px;
}

.article-content h2::before {
    display: none;
}

.article-content h3 {
    font-size: 1.28rem;
    font-weight: 700;
    color: #092E40;
    margin-top: 1.55rem !important;
    margin-bottom: 0.55rem !important;
    line-height: 1.42;
    scroll-margin-top: 90px;
}

.article-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 1.25rem !important;
    margin-bottom: 0.45rem !important;
}

.article-content p {
    margin-top: 0 !important;
    margin-bottom: 0.95rem !important;
}

.article-content p + p {
    margin-block-start: 0 !important;
}

.article-content p:last-child {
    margin-bottom: 0 !important;
}

.article-content p:empty {
    display: none;
}

/* No drop cap for Arabic cursive typography */
.article-content p:first-of-type::first-letter {
    all: unset;
    font-size: inherit;
    font-weight: inherit;
    float: none;
    margin: 0;
    color: inherit;
    line-height: inherit;
    display: inline;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 1.4rem 0;
    box-shadow: 0 12px 32px rgba(9, 46, 64, 0.1);
    transition: transform 0.3s ease;
}

.article-content img:hover {
    transform: scale(1.01);
}

.article-content blockquote {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-inline-start: 4px solid #EA502E;
    border-right: none;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 14px;
    font-style: normal;
    color: #334155;
    font-size: 1.05rem;
    line-height: 1.75;
    position: relative;
    box-shadow: 0 6px 20px rgba(9, 46, 64, 0.05);
}

.article-content blockquote::before {
    display: none;
}

.article-content ul,
.article-content ol {
    margin-top: 0.2rem;
    margin-bottom: 1.15rem;
    padding-inline-start: 1.65rem;
    padding-right: 0;
}

.article-content ul {
    list-style: none;
}

.article-content li {
    margin-bottom: 0.45rem;
    padding-inline-start: 0.25rem;
    position: relative;
    line-height: 1.75;
}

.article-content li:last-child {
    margin-bottom: 0;
}

.article-content ul li::before {
    content: '';
    position: absolute;
    inset-inline-start: -1.05rem;
    top: 0.72em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #EA502E;
}

.article-content a:not(.btn) {
    color: #F05A24;
    text-decoration: none;
    border-bottom: 2px solid #ffd4c4;
    transition: all 0.3s ease;
    font-weight: 600;
}

.article-content a:not(.btn):hover {
    color: #E03D3F;
    border-bottom-color: #F05A24;
    background: linear-gradient(to bottom, transparent 50%, rgba(240, 90, 36, 0.1) 50%);
}

.article-content a.btn {
    border-radius: 14px;
    font-weight: 700;
    padding: 0.75rem 1.75rem;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(9, 46, 64, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-content a.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(9, 46, 64, 0.22);
}

.article-content figure.article-figure {
    margin: 2.25rem 0;
}

.article-content figure.article-figure img {
    margin: 0 auto;
    display: block;
}

.article-content figure.article-figure figcaption {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.article-content .table-responsive {
    margin: 2rem 0;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    font-size: 0.98rem;
}

.article-content table th {
    background: #092E40;
    color: #ffffff;
    font-weight: 700;
    padding: 0.85rem 1rem;
    border-color: #0e3d54;
}

.article-content table td {
    padding: 0.8rem 1rem;
    border-color: #e2e8f0;
    vertical-align: middle;
}

.article-content .ratio iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 16px;
}

/* Video Section - Premium */
.article-video {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 2.5rem;
    border-radius: 24px;
    margin: 3rem 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.video-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.video-title i {
    color: #F05A24;
    font-size: 1.5rem;
}

.video-container {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* CTA Buttons - Premium */
.article-cta {
    margin: 4rem 0;
    padding: 3rem;
    background: linear-gradient(135deg, #FFB84D 0%, #F05A24 50%, #E03D3F 100%);
    border-radius: 24px;
    text-align: center;
}

.article-cta .btn {
    background: white;
    color: #F05A24;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.article-cta .btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* Tags - Modern Pills */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 2.5rem 0;
    border-top: 2px solid #f3f4f6;
    margin-top: 3rem;
}

.tags-label {
    font-weight: 700;
    color: #111827;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 20px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 30px;
    color: #475569;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tag-badge:hover {
    background: #F05A24;
    border-color: #F05A24;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(240, 90, 36, 0.3);
}

/* Author Box - Premium Card */
.author-box {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 28px;
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.author-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.12);
}

.author-box-content {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.author-box-avatar {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    object-fit: cover;
    border: 4px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, #FFB84D 0%, #F05A24 50%, #E03D3F 100%) border-box;
    box-shadow: 0 10px 30px rgba(240, 90, 36, 0.3);
    transition: all 0.3s ease;
}

.author-box-avatar:hover {
    transform: scale(1.05) rotate(2deg);
}

.author-label {
    font-size: 0.85rem;
    color: #F05A24;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.author-box-name {
    font-size: 1.75rem;
    font-weight: 900;
    color: #111827;
    margin-bottom: 0.75rem;
}

.author-box-bio {
    color: #475569;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.author-social {
    display: flex;
    gap: 1rem;
}

.author-social a {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
}

.author-social a:hover {
    background: #F05A24;
    border-color: #F05A24;
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(240, 90, 36, 0.3);
}

/* Comments Section - Modern Design */
.comments-section {
    background: white;
    border-radius: 28px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.comments-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f3f4f6;
}

.comments-header h2,
.comments-header h3 {
    font-size: 1.75rem;
    font-weight: 900;
    color: #111827;
}

.comment-item {
    padding: 2rem 0;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.3s ease;
}

.comment-item:hover {
    background: #f8fafc;
    margin: 0 -1rem;
    padding: 2rem 1rem;
    border-radius: 16px;
}

.comment-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    border: 3px solid #e2e8f0;
}

.comment-form .form-control {
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    padding: 1rem 1.5rem;
    font-size: 1.05rem;
}

.comment-form .form-control:focus {
    border-color: #F05A24;
    box-shadow: 0 0 0 4px rgba(240, 90, 36, 0.1);
}

.submit-comment-btn {
    background: linear-gradient(135deg, #FFB84D 0%, #F05A24 50%, #E03D3F 100%);
    padding: 1rem 2.5rem;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1.05rem;
    box-shadow: 0 10px 30px rgba(240, 90, 36, 0.3);
}

.submit-comment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(240, 90, 36, 0.4);
}

/* Sidebar - Premium Widgets */
.sidebar-widget {
    background: white;
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.sidebar-widget:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #f3f4f6;
}

.widget-title i {
    color: #F05A24;
    font-size: 1.4rem;
}

/* Related Articles - Premium Cards */
.related-widget {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.related-articles-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.related-article-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid #f3f4f6;
}

.related-article-card:hover {
    transform: translateX(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border-color: #F05A24;
}

.related-link {
    display: flex;
    gap: 1.25rem;
    padding: 1rem;
}

.related-image {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.related-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.related-article-card:hover .related-image::after {
    opacity: 1;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-article-card:hover .related-image img {
    transform: scale(1.1);
}

.related-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.related-article-card:hover .related-title {
    color: #F05A24;
}

.related-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #9ca3af;
}

/* Newsletter Widget - Premium */
.newsletter-widget {
    background: linear-gradient(135deg, #FFB84D 0%, #F05A24 50%, #E03D3F 100%);
    color: white;
}

.newsletter-widget .widget-title {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.newsletter-widget .widget-title i {
    color: white;
}

.newsletter-content h2,
.newsletter-content h4 {
    color: white;
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.newsletter-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
}

.newsletter-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.newsletter-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

.newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.newsletter-input:focus {
    outline: none;
    border-color: white;
    background: rgba(255, 255, 255, 0.2);
}

.newsletter-btn {
    width: 100%;
    padding: 1rem;
    background: white;
    color: #F05A24;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* TOC Widget - Modern */
.toc-widget {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.toc-link {
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    font-weight: 600;
}

.toc-link:hover {
    background: #F05A24;
    border-color: #F05A24;
    color: white;
    transform: translateX(-4px);
}

/* Back Widget */
.back-to-blog {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1.25rem;
    border-radius: 16px;
    font-weight: 700;
    border: 2px solid #e2e8f0;
}

.back-to-blog:hover {
    background: #F05A24;
    border-color: #F05A24;
    color: white;
    transform: translateX(-4px);
}

/* Responsive Design - Tablet */
@media (max-width: 1200px) {
    .share-sidebar {
        position: static;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        margin-bottom: 2rem;
        padding-bottom: 2rem;
        border-bottom: 1px solid #e2e8f0;
        right: auto;
        max-width: 100%;
        box-sizing: border-box;
    }

    .share-label {
        writing-mode: horizontal-tb;
        transform: none;
        margin-bottom: 0;
        margin-left: 1rem;
    }

    .share-buttons {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .share-btn {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 1.05rem;
    }
}

/* Mobile Breakpoint - Fix UI Rendering Issues */
@media (max-width: 767px) {
    .share-sidebar {
        /* FIX: Remove absolute positioning conflicts */
        position: static !important;
        top: auto;
        right: auto;
        
        /* FIX: Proper flexbox configuration */
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
        
        /* FIX: Prevent overflow */
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
        
        /* FIX: Optimized spacing with borders for visual separation */
        margin: 2rem 0 1.5rem 0;
        padding: 1.5rem 0;
        border-top: 2px solid #e2e8f0;
        border-bottom: 2px solid #e2e8f0;
    }
    
    .share-buttons {
        /* FIX: Proper flexbox for buttons */
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 0.3rem;
        flex-wrap: wrap;
        
        /* FIX: Prevent overflow */
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .share-btn {
        /* FIX: Reduced size to prevent overflow */
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        border-radius: 8px;
        
        /* FIX: Box model */
        box-sizing: border-box;
        
        /* FIX: Remove positioning */
        position: static;
        
        /* FIX: Remove margins (use gap instead) */
        margin: 0;
        
        /* Maintain padding for icon centering */
        padding: 0.5rem;
    }
    
    .share-label {
        /* FIX: Proper alignment */
        display: flex;
        align-items: center;
        
        /* FIX: Horizontal text */
        writing-mode: horizontal-tb;
        transform: none;
        
        /* FIX: Remove margin (spacing handled by gap) */
        margin: 0;
        
        /* FIX: Reduced size */
        font-size: 0.65rem;
        
        /* RTL: Position after buttons */
        order: 1;
    }
    
    .share-btn:active {
        /* Touch feedback */
        transform: scale(0.95);
        transition: transform 0.15s ease;
    }
}

/* Extra Small Mobile - 320px screens */
@media (max-width: 374px) {
    .share-buttons {
        /* Even tighter spacing */
        gap: 0.25rem;
    }
    
    .share-btn {
        /* Minimum viable size */
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
        border-radius: 7px;
    }
    
    .share-label {
        font-size: 0.6rem;
    }
}

@media (max-width: 991px) {
    .article-title {
        font-size: 2.5rem;
    }

    .article-content-wrapper {
        padding: 3rem 2rem;
    }
}

/* Global Mobile Overflow Fix */
@media (max-width: 767px) {
    /* Prevent horizontal scroll on mobile */
    html, body {
        overflow-x: hidden;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    body * {
        box-sizing: border-box;
    }
    
    .container,
    .container-fluid {
        max-width: 100%;
        overflow-x: hidden;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .row {
        margin-left: -15px;
        margin-right: -15px;
    }
}

@media (max-width: 767px) {
    .article-header {
        min-height: 50vh;
    }

    .article-title {
        font-size: 1.75rem;
    }

    .article-content-wrapper {
        padding: 2rem 1.25rem;
        margin-top: 0;
        border-radius: 20px;
        /* FIX: Prevent horizontal overflow */
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .article-content {
        font-size: 1.05rem;
        /* FIX: Prevent content overflow */
        max-width: 100%;
        overflow-x: hidden;
        word-wrap: break-word;
    }
    
    .article-content p:first-of-type::first-letter {
        all: unset;
        font-size: inherit;
        display: inline;
    }
    
    /* FIX: Ensure all content elements don't overflow */
    .article-content * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* FIX: Images and iframes */
    .article-content img,
    .article-content iframe,
    .article-content video {
        max-width: 100% !important;
        height: auto !important;
        box-sizing: border-box;
    }
    
    /* FIX: Tables */
    .article-content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* FIX: Code blocks */
    .article-content pre,
    .article-content code {
        max-width: 100%;
        overflow-x: auto;
        word-wrap: break-word;
        white-space: pre-wrap;
    }

    /* FIX: Meta bar on mobile */
    .article-meta-bar {
        padding: 1.5rem 1rem;
        gap: 1rem;
    }
    
    .meta-items {
        gap: 0.75rem;
    }
    
    .meta-item {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .author-box-content {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .author-social {
        justify-content: center;
    }

    .related-link {
        flex-direction: column;
    }

    .related-image {
        width: 100%;
        height: 200px;
    }
    
    /* FIX: Ensure sidebar widgets don't overflow */
    .sidebar-widget {
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    /* FIX: Ad containers */
    .article-ad-top,
    .article-ad-mobile,
    .article-ad-middle,
    .article-ad-bottom {
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    
    .article-ad-top *,
    .article-ad-mobile *,
    .article-ad-middle *,
    .article-ad-bottom * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* Natural Scroll */
html {
    scroll-behavior: auto;
}

/* Selection Color */
::selection {
    background: #c7d2fe;
    color: #1e1b4b;
}


/* ========================================
   "قد يعجبك أيضاً" Section - Simple & Clean Design
   ======================================== */

.you-may-like-section {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 32px;
    padding: 4rem 3rem;
    margin: 4rem 0;
    border: 2px solid #e2e8f0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: #111827;
    margin-bottom: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

.section-title i {
    color: #F05A24;
    font-size: 2.25rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    font-weight: 500;
}

/* بطاقة بسيطة - صورة + عنوان فقط */
.you-may-like-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #f3f4f6;
    height: 100%;
}

.you-may-like-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border-color: #F05A24;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* الصورة مع التصنيف فوقها */
.card-image-wrapper {
    position: relative;
    padding-bottom: 65%;
    overflow: hidden;
    background: #f3f4f6;
}

.card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.you-may-like-card:hover .card-image {
    transform: scale(1.08);
}

/* التصنيف - مستطيل صغير فوق الصورة من اليمين */
.card-category {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #FFB84D 0%, #F05A24 50%, #E03D3F 100%);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(240, 90, 36, 0.4);
    transition: all 0.3s ease;
}

.you-may-like-card:hover .card-category {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(240, 90, 36, 0.5);
}

/* Overlay خفيف للصورة */
.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.4) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.you-may-like-card:hover .card-overlay {
    opacity: 1;
}

/* العنوان - بسيط ونظيف */
.card-body-content {
    padding: 1.25rem 1.5rem;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.6;
    margin: 0;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.you-may-like-card:hover .card-title {
    color: #F05A24;
}

/* إخفاء العناصر غير المطلوبة */
.card-excerpt,
.card-meta,
.read-more-badge {
    display: none;
}

/* Responsive Design for "قد يعجبك أيضاً" */
@media (max-width: 991px) {
    .you-may-like-section {
        padding: 3rem 2rem;
    }

    .section-title {
        font-size: 2rem;
    }
    
    .card-title {
        font-size: 0.9rem;
    }
}

@media (max-width: 767px) {
    .you-may-like-section {
        padding: 2.5rem 1.5rem;
        margin: 3rem 0;
        border-radius: 24px;
    }

    .section-title {
        font-size: 1.75rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .card-body-content {
        padding: 1rem 1.25rem;
    }

    .card-title {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

/* Animation for cards on scroll */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.you-may-like-card {
    animation: fadeInUp 0.6s ease-out;
}

.you-may-like-card:nth-child(1) {
    animation-delay: 0.1s;
}

.you-may-like-card:nth-child(2) {
    animation-delay: 0.2s;
}

.you-may-like-card:nth-child(3) {
    animation-delay: 0.3s;
}


/* Replies Section Styling */
.replies-section {
    margin-top: 1.5rem;
    margin-right: 3rem;
    padding-right: 2rem;
    border-right: 3px solid #e2e8f0;
}

.reply-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    background: #f8fafc;
    margin: 0 -1rem;
    padding: 1.5rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.reply-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.reply-item .comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid #cbd5e1;
}

.reply-item .comment-author {
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reply-item .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

.reply-item .comment-text {
    font-size: 0.95rem;
    color: #475569;
}

.reply-item:hover {
    background: #f1f5f9;
    transform: translateX(-5px);
}

/* RTL Support for Replies */
[dir="rtl"] .replies-section {
    margin-right: 0;
    margin-left: 3rem;
    padding-right: 0;
    padding-left: 2rem;
    border-right: none;
    border-left: 3px solid #e2e8f0;
}

[dir="rtl"] .reply-item:hover {
    transform: translateX(5px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .replies-section {
        margin-right: 1rem;
        padding-right: 1rem;
    }
    
    [dir="rtl"] .replies-section {
        margin-left: 1rem;
        padding-left: 1rem;
    }
    
    .reply-item {
        margin: 0 -0.5rem;
        padding: 1rem 0.5rem;
    }
}


/* ============================================================
   Community-Inspired Mobile Reading UX, Progress Bar & Dark Mode
   ============================================================ */

/* Top Reading Progress Bar */
.article-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    background: rgba(9, 46, 64, 0.08);
    z-index: 1080;
    pointer-events: none;
}

.article-reading-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #092E40 0%, #EA502E 65%, #FFB84D 100%);
    transition: width 0.08s linear;
    border-radius: 0 3px 3px 0;
}

/* Collapsible Mobile TOC Drawer */
.mobile-toc-drawer {
    background: #ffffff;
    border: 1px solid rgba(9, 46, 64, 0.12);
    border-radius: 16px;
    margin-bottom: 1.1rem;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(9, 46, 64, 0.05);
}

.mobile-toc-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.05rem;
    font-weight: 700;
    font-size: 0.92rem;
    color: #092E40;
    user-select: none;
}

.mobile-toc-summary::-webkit-details-marker {
    display: none;
}

.mobile-toc-chevron {
    transition: transform 0.25s ease;
    color: #64748b;
}

.mobile-toc-drawer[open] .mobile-toc-chevron {
    transform: rotate(180deg);
}

.mobile-toc-body {
    padding: 0 0.9rem 0.9rem;
    border-top: 1px solid rgba(9, 46, 64, 0.08);
}

.mobile-toc-body .toc-list {
    list-style: none;
    padding: 0.6rem 0 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.mobile-toc-body .toc-item.sub {
    padding-inline-start: 0.85rem;
}

.mobile-toc-body .toc-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(9, 46, 64, 0.08);
    background: #f8fafc;
    color: #1e293b;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.45;
}

/* Floating Mobile Reading Bar (Medium / Thmanyah inspired) */
.mobile-reading-bar {
    position: fixed;
    left: 50%;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    transform: translate(-50%, 110px);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.55rem;
    border-radius: 999px;
    background: rgba(9, 46, 64, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 12px 32px rgba(9, 46, 64, 0.32);
    z-index: 1040;
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
}

.mobile-reading-bar.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

.mobile-reading-bar.is-visible.is-hidden-scroll {
    transform: translate(-50%, 110px);
    opacity: 0;
}

.mrb-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.15s ease;
}

.mrb-btn:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.16);
}

.mrb-btn.mrb-whatsapp {
    color: #4ade80;
}

.mrb-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.18);
    margin: 0 0.15rem;
}

/* Copy Toast Notification */
.article-copy-toast {
    position: fixed;
    left: 50%;
    bottom: 76px;
    transform: translate(-50%, 16px);
    background: #092E40;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.55rem 1.15rem;
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(9, 46, 64, 0.28);
    opacity: 0;
    pointer-events: none;
    z-index: 1090;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.article-copy-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Desktop Tighter Card Padding */
@media (min-width: 992px) {
    .article-content-wrapper {
        padding: 2.5rem 2.75rem;
    }
}

/* ============================================================
   Elevated Mobile Article Experience (<= 767px)
   ============================================================ */
@media (max-width: 767px) {
    .article-header {
        min-height: auto !important;
        padding: 1.25rem 0 1.65rem !important;
        align-items: flex-end;
    }

    .article-breadcrumb .breadcrumb {
        padding: 6px 12px;
        margin-bottom: 0.85rem;
        font-size: 0.78rem;
        border-radius: 999px;
        flex-wrap: nowrap;
        overflow: hidden;
        max-width: 100%;
    }

    .article-breadcrumb .breadcrumb-item.active {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 145px;
    }

    .article-category-badge {
        padding: 5px 14px;
        font-size: 0.8rem;
        margin-bottom: 0.65rem;
    }

    .article-title {
        font-size: 1.48rem !important;
        line-height: 1.38 !important;
        margin-bottom: 1rem !important;
    }

    .article-meta-bar {
        padding: 0.85rem 0.95rem !important;
        gap: 0.75rem !important;
        border-radius: 16px;
        background: rgba(9, 46, 64, 0.45);
    }

    .author-info {
        gap: 0.75rem;
    }

    .author-avatar {
        width: 42px;
        height: 42px;
        border-width: 2px;
    }

    .author-details .author-name {
        font-size: 0.92rem;
        margin-bottom: 2px;
    }

    .author-details .author-role {
        font-size: 0.76rem;
    }

    .meta-items {
        width: 100%;
        gap: 0.45rem !important;
        padding-top: 0.6rem;
        border-top: 1px solid rgba(255, 255, 255, 0.14);
    }

    .meta-item {
        padding: 4px 9px !important;
        font-size: 0.76rem !important;
        border-radius: 999px;
        gap: 0.35rem;
    }

    .meta-item i {
        font-size: 0.85rem;
    }

    /* Clean, spacious edge-to-edge editorial reading canvas on mobile */
    .article-body {
        padding-top: 1.15rem !important;
        padding-bottom: 5.5rem !important;
        background-color: #ffffff;
    }

    .article-body > .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .article-content-wrapper {
        padding: 0.35rem 0 1.25rem !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        margin-bottom: 1.25rem !important;
    }

    .article-content {
        font-size: calc(1.01rem * var(--article-font-scale)) !important;
        line-height: 1.78 !important;
        color: #1e293b;
    }

    .article-content p {
        margin-bottom: 0.82rem !important;
    }

    .article-content h2 {
        font-size: 1.32rem !important;
        margin-top: 1.65rem !important;
        margin-bottom: 0.6rem !important;
        padding-inline-start: 0.85rem !important;
        border-inline-start-width: 3.5px;
    }

    .article-content h3 {
        font-size: 1.14rem !important;
        margin-top: 1.3rem !important;
        margin-bottom: 0.45rem !important;
    }

    .article-content ul,
    .article-content ol {
        margin-bottom: 0.95rem !important;
        padding-inline-start: 1.35rem !important;
    }

    .article-content li {
        margin-bottom: 0.4rem !important;
        line-height: 1.72 !important;
    }

    .article-content blockquote {
        margin: 1.1rem 0 !important;
        padding: 0.95rem 1.05rem !important;
        font-size: 0.96rem !important;
        border-radius: 12px;
    }

    .article-content img,
    .article-content figure.article-figure {
        margin: 1rem 0 !important;
        border-radius: 14px !important;
    }

    .article-tags {
        padding: 1.25rem 0;
        margin-top: 1.5rem;
        gap: 0.55rem;
    }

    .tag-badge {
        padding: 6px 13px;
        font-size: 0.82rem;
    }

    .author-box {
        padding: 1.4rem 1.15rem;
        border-radius: 18px;
        margin-bottom: 1.5rem;
    }

    .author-box-avatar {
        width: 76px;
        height: 76px;
        border-radius: 18px;
    }

    .author-box-name {
        font-size: 1.25rem;
    }

    .author-box-bio {
        font-size: 0.92rem;
        line-height: 1.65;
        margin-bottom: 1rem;
    }

    .you-may-like-section {
        padding: 1.6rem 1.1rem !important;
        margin: 1.5rem 0 !important;
        border-radius: 18px !important;
    }

    .section-header {
        margin-bottom: 1.35rem !important;
    }

    .section-title {
        font-size: 1.35rem !important;
    }

    .comments-section {
        padding: 1.5rem 1.1rem;
        border-radius: 18px;
    }

    .sidebar-widget {
        padding: 1.35rem 1.15rem;
        border-radius: 18px;
        margin-bottom: 1.25rem;
    }
}

/* Dark Mode Editorial Comfort */
[data-theme="dark"] .article-body {
    background-color: #0b1622;
}

[data-theme="dark"] .article-content-wrapper,
[data-theme="dark"] .author-box,
[data-theme="dark"] .comments-section,
[data-theme="dark"] .sidebar-widget,
[data-theme="dark"] .you-may-like-section,
[data-theme="dark"] .you-may-like-card,
[data-theme="dark"] .related-article-card,
[data-theme="dark"] .mobile-toc-drawer {
    background: #102132;
    border-color: rgba(255, 255, 255, 0.09);
    color: #e2e8f0;
}

[data-theme="dark"] .article-content {
    color: #e2e8f0;
}

[data-theme="dark"] .article-content h2,
[data-theme="dark"] .article-content h3,
[data-theme="dark"] .article-content h4,
[data-theme="dark"] .author-box-name,
[data-theme="dark"] .widget-title,
[data-theme="dark"] .section-title,
[data-theme="dark"] .card-title,
[data-theme="dark"] .related-title,
[data-theme="dark"] .mobile-toc-summary {
    color: #f8fafc;
}

[data-theme="dark"] .article-content blockquote {
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
}

[data-theme="dark"] .mobile-toc-body .toc-link,
[data-theme="dark"] .tag-badge {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

@media (max-width: 767px) {
    [data-theme="dark"] .article-body {
        background-color: #0b1622;
    }
    [data-theme="dark"] .article-content-wrapper {
        background: transparent !important;
    }
}
