﻿/* ===== Article Typography ===== */
.article-content {
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #2d3436;
    line-height: 1.9;
    font-size: 1.12rem;
    text-align: justify;
    hyphens: auto;
    transition: font-size 0.3s ease;
}

    /* Drop Cap for first letter */
    .article-content::first-letter {
        float: left;
        font-family: 'Georgia', serif;
        font-size: 4.2rem;
        line-height: 0.8;
        padding-right: 0.15em;
        padding-top: 0.1em;
        font-weight: 700;
        color: #667eea;
        margin-right: 0.08em;
    }

/* RTL Drop Cap override */
[dir="rtl"] .article-content::first-letter {
    float: right;
    padding-right: 0;
    padding-left: 0.15em;
    margin-right: 0;
    margin-left: 0.08em;
}

/* ===== Hero Image ===== */
.article-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
    filter: brightness(0.45) contrast(1.08) saturate(1.05);
}

/* ===== LEFT SIDE PANEL — Vertical Actions ===== */
.hero-side-panel {
    animation: sidePanelIn 0.8s ease both;
    animation-delay: 0.4s;
}

@keyframes sidePanelIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-side-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50px;
    padding: 0.6rem;
}

.hero-side-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.25s ease;
}

    .hero-side-btn:hover {
        background: rgba(255,255,255,0.15);
        color: #fff;
        transform: scale(1.1);
    }

.hero-side-divider {
    width: 24px;
    height: 1px;
    background: rgba(255,255,255,0.15);
    margin: 0.2rem auto;
}

.hero-side-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    margin-top: 0.5rem;
}

/* ===== RIGHT SIDE PANEL — Author Card ===== */
.hero-author-card {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.hero-author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.4rem;
    box-shadow: 0 4px 20px rgba(102,126,234,0.35);
    border: 2px solid rgba(255,255,255,0.2);
}

.hero-author-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.hero-author-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,1);
    font-weight: 500;
}

.hero-author-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.hero-author-divider {
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,1.2);
}

.hero-author-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.hero-author-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,7);
    justify-content: center;
}

    .hero-author-meta-item i {
        font-size: 0.75rem;
        color: rgba(255,255,255,1);
    }

/* Decorative floating pen badge */
.hero-floating-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,1);
    font-size: 0.85rem;
    margin-top: 0.75rem;
    align-self: center;
    animation: floatBadge 3s ease-in-out infinite;
}

@keyframes floatBadge {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 10px;
}

/* ===== Selection ===== */
::selection {
    background: rgba(102, 126, 234, 0.25);
    color: #2d3436;
}

/* ===== Share Button Hover Glow ===== */
.share-btn:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* ===== Comment Card ===== */
.comment-card {
    animation: fadeSlideUp 0.4s ease both;
}

    .comment-card:nth-child(1) {
        animation-delay: 0s;
    }

    .comment-card:nth-child(2) {
        animation-delay: 0.05s;
    }

    .comment-card:nth-child(3) {
        animation-delay: 0.1s;
    }

    .comment-card:nth-child(4) {
        animation-delay: 0.15s;
    }

    .comment-card:nth-child(5) {
        animation-delay: 0.2s;
    }

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
    .hero-side-panel {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .article-hero {
        min-height: 55vh;
    }

    .article-content {
        font-size: 1.02rem;
        line-height: 1.8;
    }

        .article-content::first-letter {
            font-size: 3.2rem;
        }
}

/* ===== Print Styles ===== */
@media print {
    .article-hero {
        min-height: auto;
        background: #fff !important;
    }

        .article-hero img,
        .article-hero div[style*="position:absolute"],
        .hero-side-panel {
            display: none !important;
        }

    #action-bar, .share-btn, form, #comment-list, section {
        display: none !important;
    }

    .article-content {
        color: #000;
    }
}

/* ===== BODY LEFT RAIL — Vertical Progress ===== */
.body-progress-rail {
    width: 3px;
    height: 180px;
    background: #e8e8ee;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.body-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: height 80ms linear;
}

.body-progress-label {
    margin-top: 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #aaa;
    font-variant-numeric: tabular-nums;
}

/* RTL rail */
[dir="rtl"] .body-progress-rail,
[dir="rtl"] .body-progress-fill {
    /* Rail is symmetric, no direction change needed */
}

/* ===== BODY RIGHT SIDEBAR — Cards ===== */
.body-sidebar-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 8px rgba(0,0,0,0.03);
    transition: box-shadow 0.3s ease;
}

    .body-sidebar-card:hover {
        box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    }

.body-sidebar-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    background: #f8f9fc;
    border-bottom: 1px solid #eee;
}

    .body-sidebar-card-header i {
        color: #667eea;
        font-size: 0.85rem;
    }

.body-sidebar-card-body {
    padding: 0.5rem 1.1rem 0.25rem;
}

.body-sidebar-info-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid #f5f5f5;
}

    .body-sidebar-info-row:last-child {
        border-bottom: none;
    }

    .body-sidebar-info-row > i {
        color: #bbb;
        font-size: 0.85rem;
        margin-top: 0.15rem;
        flex-shrink: 0;
        width: 18px;
        text-align: center;
    }

    .body-sidebar-info-row > div {
        display: flex;
        flex-direction: column;
        gap: 0.1rem;
        min-width: 0;
    }

.body-sidebar-info-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #aaa;
    font-weight: 500;
}

.body-sidebar-info-value {
    font-size: 0.88rem;
    color: #333;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sidebar Share Buttons */
.sidebar-share-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .sidebar-share-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }

/* Sidebar Action Buttons */
.sidebar-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.7rem 0.5rem;
    border: none;
    border-radius: 12px;
    background: #f8f9fc;
    color: #666;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.2s;
}

    .sidebar-action-btn i {
        font-size: 1rem;
    }

    .sidebar-action-btn:hover {
        background: #eef0ff;
        color: #667eea;
    }

    .sidebar-action-btn.active {
        background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.1));
        color: #667eea;
    }

/* ===== Responsive: hide sidebars below lg ===== */
@media (max-width: 991.98px) {
    .body-progress-rail,
    .body-progress-fill,
    .body-progress-label {
        display: none !important;
    }
}
