/* ============================================
   Single Article Page - Newspaper Style
   صفحة المقال الداخلي - تصميم محسّن
   ============================================ */

/* ============================================
   Reading Progress Bar
   ============================================ */
.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(49, 101, 149, 0.15);
    z-index: 9999;
}

.reading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
    transition: width 0.1s ease-out;
    box-shadow: 0 0 8px rgba(49, 101, 149, 0.5);
}

/* Main Layout */
.single-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 25px;
    padding: 25px 0;
}

/* ============================================
   Article Main Content
   ============================================ */
.article-main {
    background: var(--bg-secondary);
    border: 1px solid #d4c8b8;
    padding: 0;
    position: relative;
}

/* Folded corner */
.article-main::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 25px;
    height: 25px;
    background: linear-gradient(-135deg,
            transparent 50%,
            var(--border-color) 50%,
            var(--border-dark) 52%,
            var(--bg-secondary) 100%);
    z-index: 2;
}

/* ============================================
   Article Header
   ============================================ */
.article-header {
    padding: 20px 25px;
    border-bottom: 1px dashed #d4c8b8;
}

/* Categories */
.article-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.article-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.3px;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.article-category:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Title */
.article-title {
    font-family: var(--font-family);
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.6;
    margin: 0 0 15px;
}

/* Meta Info */
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    font-size: 0.7rem;
    color: #888;
    padding-top: 12px;
    border-top: 1px solid #e8e0d4;
}

.article-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-meta-item i {
    color: var(--primary-color);
    font-size: 0.75rem;
}

.article-author {
    font-weight: 600;
    color: #444;
}

/* ============================================
   Featured Image - Inside Padding
   ============================================ */
.article-featured-image {
    padding: 0 25px;
    margin: 20px 0;
}

.article-featured-image-wrapper {
    position: relative;
    overflow: hidden;
    border: 1px solid #e0d8cc;
}

.article-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(15%);
    transition: filter 0.4s ease;
}

.article-featured-image:hover img {
    filter: grayscale(0%);
}

.article-image-caption {
    padding: 8px 15px;
    background: #f5f3f0;
    border-top: 1px solid #e0d8cc;
    font-size: 0.7rem;
    color: #777;
    text-align: center;
}

.article-image-caption i {
    margin-left: 5px;
    color: var(--primary-color);
    font-size: 0.65rem;
}

/* ============================================
   Share Buttons
   ============================================ */
.article-share {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 25px;
    background: var(--bg-secondary);
    border-top: 1px solid #e8e0d4;
    border-bottom: 1px solid #e8e0d4;
}

.article-share-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #666;
}

.article-share-buttons {
    display: flex;
    gap: 6px;
}

.article-share-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background: #fff;
    color: #888;
    text-decoration: none;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.article-share-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.article-share-btn.facebook:hover {
    background: #3b5998;
    border-color: #3b5998;
}

.article-share-btn.twitter:hover {
    background: #1da1f2;
    border-color: #1da1f2;
}

.article-share-btn.whatsapp:hover {
    background: #25d366;
    border-color: #25d366;
}

.article-share-btn.telegram:hover {
    background: #0088cc;
    border-color: #0088cc;
}

.article-share-btn.linkedin:hover {
    background: #0077b5;
    border-color: #0077b5;
}

/* Font Size Controls */
.font-size-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
    padding-right: 15px;
    border-right: 1px solid #ddd;
}

.font-size-label {
    font-size: 0.7rem;
    color: #777;
    margin-left: 5px;
}

.font-size-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.font-size-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.font-size-btn.font-size-reset {
    font-weight: 700;
    font-size: 0.75rem;
}

/* ============================================
   Article Content Body
   ============================================ */
.article-body {
    padding: 25px;
}

.article-content {
    font-family: var(--font-family);
    font-size: 0.95rem;
    line-height: 1.9;
    color: #333;
}

.article-content p {
    margin: 0 0 18px;
    text-align: justify;
}

.article-content p:first-of-type::first-letter {
    font-size: 2.8rem;
    font-weight: 700;
    float: right;
    margin: 0 0 8px 12px;
    line-height: 1;
    color: var(--primary-dark);
    font-family: serif;
}

.article-content h2,
.article-content h3 {
    font-family: var(--font-family);
    color: #1a1a1a;
    margin: 25px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

.article-content h2 {
    font-size: 1.15rem;
}

.article-content h3 {
    font-size: 1rem;
}

.article-content ul,
.article-content ol {
    margin: 0 0 18px 25px;
    padding: 0;
}

.article-content li {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.article-content blockquote {
    margin: 20px 0;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-right: 3px solid var(--primary-color);
    font-size: 0.9rem;
    font-style: italic;
    color: #555;
}

.article-content blockquote cite {
    display: block;
    margin-top: 8px;
    font-size: 0.75rem;
    color: #888;
    font-style: normal;
}

/* ============================================
   Inline Images in Article
   ============================================ */
.article-inline-image {
    margin: 20px auto;
    border: 1px solid #e8e0d4;
    max-width: 80%;
}

.article-inline-image img {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: cover;
    display: block;
}

.article-inline-image figcaption {
    padding: 8px 12px;
    background: var(--bg-secondary);
    font-size: 0.7rem;
    color: #777;
    text-align: center;
}

/* ============================================
   Suggested Articles Inside Content
   ============================================ */
.article-suggested {
    margin: 25px 0;
    padding: 15px;
    background: var(--bg-secondary);
    border: 1px dashed #d4c8b8;
}

.article-suggested-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0d8cc;
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-suggested-title i {
    font-size: 0.7rem;
}

.article-suggested-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.article-suggested-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e8e0d4;
    padding: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.article-suggested-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background: #fcfaf8;
}

.article-suggested-item img {
    width: 60px;
    height: 50px;
    object-fit: cover;
    flex-shrink: 0;
    filter: grayscale(20%);
    transition: filter 0.3s ease;
}

.article-suggested-item:hover img {
    filter: grayscale(0%);
}

.article-suggested-item-title {
    flex: 1;
    font-size: 0.7rem;
    font-weight: 600;
    color: #333;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   Related News Inside Article
   ============================================ */
.article-related-inline {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--primary-color);
    border-right: 3px solid var(--primary-color);
}

.article-related-inline img {
    width: 85px;
    height: 60px;
    object-fit: cover;
    flex-shrink: 0;
}

.article-related-inline-content {
    flex: 1;
}

.article-related-inline-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.article-related-inline-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    line-height: 1.5;
    margin: 0;
}

.article-related-inline-title a {
    color: inherit;
    text-decoration: none;
}

.article-related-inline-title a:hover {
    color: var(--primary-color);
}

/* ============================================
   Tags / Keywords
   ============================================ */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 15px 25px;
    border-top: 1px dashed #d4c8b8;
    background: var(--bg-secondary);
}

.article-tags-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-tags-label i {
    color: var(--primary-color);
    font-size: 0.7rem;
}

.article-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #ddd;
    color: #666;
    font-size: 0.65rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.article-tag:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* ============================================
   Short Link
   ============================================ */
.article-short-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    border-top: 1px solid #e8e0d4;
}

.article-short-link-label {
    font-size: 0.7rem;
    color: #777;
}

.article-short-link-input {
    flex: 1;
    max-width: 250px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    background: var(--bg-secondary);
    font-size: 0.7rem;
    color: #555;
    direction: ltr;
    text-align: left;
}

.article-short-link-copy {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.article-short-link-copy i {
    font-size: 0.65rem;
}

.article-short-link-copy:hover {
    background: var(--primary-dark);
}

/* ============================================
   Sidebar & Ad Slots
   ============================================ */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Ad Slots - General */
.ad-slot {
    background: var(--bg-secondary);
    border: 1px dashed #d4c8b8;
    overflow: hidden;
}

.ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
    text-align: center;
    color: #aaa;
}

.ad-placeholder i {
    font-size: 1.5rem;
    color: #ccc;
}

.ad-placeholder span {
    font-size: 0.75rem;
    font-weight: 600;
}

.ad-placeholder small {
    font-size: 0.65rem;
    color: #bbb;
}

/* Sidebar Ads */
.ad-sidebar {
    min-height: 250px;
}

.ad-sidebar#ad-sidebar-3 {
    min-height: 400px;
}

/* Sticky Ad */
.ad-sticky {
    position: sticky;
    top: 100px;
}

/* Inline Article Ads */
.ad-inline {
    margin: 25px 0;
    min-height: 90px;
}

/* ============================================
   Bottom Section Placeholder
   ============================================ */
.article-bottom-sections {
    margin-top: 25px;
    /* مكان فارغ لإضافة أقسام */
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 992px) {
    .single-layout {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        order: 1;
    }

    .article-suggested-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .article-header {
        padding: 15px 20px;
    }

    .article-title {
        font-size: 1.2rem;
        line-height: 1.6;
    }

    .article-featured-image {
        padding: 0 15px;
        margin: 15px 0;
    }

    .article-featured-image img {
        border-radius: 4px;
    }

    .article-body {
        padding: 15px;
    }

    .article-content {
        font-size: 0.88rem;
        line-height: 1.9;
    }

    .article-content p:first-of-type::first-letter {
        font-size: 2.2rem;
        margin-left: 6px;
    }

    .article-meta {
        flex-wrap: wrap;
        gap: 8px;
    }

    .article-meta-item {
        font-size: 0.65rem;
    }

    .article-categories {
        gap: 6px;
    }

    .article-category {
        font-size: 0.6rem;
        padding: 3px 8px;
    }

    .article-suggested-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .article-related-inline {
        flex-direction: row;
        gap: 10px;
    }

    .article-related-inline img {
        width: 100px;
        height: 70px;
    }

    .article-related-inline-content h4 {
        font-size: 0.78rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .article-tags {
        padding: 12px 15px;
        flex-wrap: wrap;
    }

    .tag-link {
        font-size: 0.65rem;
        padding: 4px 10px;
    }

    .article-short-link {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .article-short-link-input {
        max-width: 100%;
    }

    .article-share {
        padding: 12px 15px;
    }

    .share-btn {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    /* Author Info */
    .article-author-info {
        padding: 10px 15px;
    }

    .author-avatar {
        width: 45px;
        height: 45px;
    }

    .author-name {
        font-size: 0.8rem;
    }

    .author-role {
        font-size: 0.65rem;
    }

    /* Blockquote */
    .article-content blockquote {
        padding: 12px 15px;
        font-size: 0.85rem;
    }

    /* Inline images */
    .article-inline-image figcaption {
        font-size: 0.65rem;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .article-header {
        padding: 12px 15px;
    }

    .article-title {
        font-size: 1.05rem;
        line-height: 1.7;
    }

    .article-featured-image {
        padding: 0 10px;
        margin: 12px 0;
    }

    .article-body {
        padding: 12px;
    }

    .article-content {
        font-size: 0.85rem;
    }

    .article-content p {
        margin-bottom: 12px;
    }

    .article-content p:first-of-type::first-letter {
        font-size: 2rem;
        line-height: 1;
    }

    .article-meta-item {
        font-size: 0.6rem;
    }

    .article-share {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .share-buttons {
        width: 100%;
        justify-content: flex-start;
    }

    .share-btn {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }

    .article-tags {
        padding: 10px 12px;
    }

    .article-tags-label {
        font-size: 0.7rem;
    }

    .tag-link {
        font-size: 0.6rem;
        padding: 3px 8px;
    }

    /* Author Info mobile */
    .article-author-info {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .author-avatar {
        width: 50px;
        height: 50px;
    }

    /* Suggested articles */
    .article-suggested {
        padding: 12px;
        margin: 20px 0;
    }

    .article-suggested-title {
        font-size: 0.85rem;
    }

    .suggested-item-title {
        font-size: 0.75rem;
    }

    /* Related inline */
    .article-related-inline {
        padding: 10px;
    }

    .article-related-inline img {
        width: 80px;
        height: 60px;
    }

    .article-related-inline-content h4 {
        font-size: 0.72rem;
    }

    /* Short link */
    .article-short-link {
        padding: 10px 12px;
    }

    .article-short-link-label {
        font-size: 0.7rem;
    }

    .article-short-link-input {
        font-size: 0.65rem;
        padding: 5px 8px;
    }

    .copy-link-btn {
        padding: 5px 10px;
        font-size: 0.65rem;
    }

    /* Folded corner - smaller on mobile */
    .article-main::before {
        width: 20px;
        height: 20px;
    }
}