/* Article Page Styles */

.article-container {
    background: var(--dark-bg);
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Article Hero Section */
.article-hero {
    position: relative;
    height: 500px;
    overflow: hidden;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    margin-top: 2rem;
}

.article-featured-image {
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    background-size: cover;
    background-position: center;
    position: relative;
}

.article-featured-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.85) 100%
    );
}

.article-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem;
    color: white;
    z-index: 2;
}

.article-hero-info {
    max-width: 1200px;
    margin: 0 auto;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.breadcrumb a:hover {
    opacity: 0.8;
}

#article-title-hero {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.article-meta-hero {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    opacity: 0.95;
}

.meta-item svg {
    flex-shrink: 0;
}

/* Article Layout */
.article-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    max-width: 1400px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 2rem 3rem;
    box-sizing: border-box;
}

/* Main Article */
.article-main {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

/* Left Sidebar */
.article-sidebar-left {
    position: sticky;
    top: 120px;
    height: fit-content;
}

/* Old Sidebar - Hidden */
.article-sidebar {
    display: none;
}

.sidebar-sticky > * {
    margin-bottom: 2rem;
}

.author-card,
.article-stats-card,
.toc-card,
.share-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.author-card,
.article-stats-card,
.toc-card {
    border: 1px solid var(--border-color);
}

/* Author Card */
.author-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 50px;
    height: 50px;
    background: var(--gradient-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.author-info h4 {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.author-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Stats Card */
.article-stats-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.stat-value {
    color: var(--text-primary);
    font-weight: bold;
}

/* Table of Contents */
.toc-card h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.toc-card ul {
    list-style: none;
}

.toc-card li {
    margin-bottom: 0.5rem;
}

.toc-card a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    display: block;
    border-right: 3px solid transparent;
    padding-right: 1rem;
    transition: all 0.3s ease;
}

.toc-card a:hover,
.toc-card a.active {
    color: var(--primary-color);
    border-right-color: var(--primary-color);
    background: rgba(224, 47, 58, 0.1);
    border-radius: var(--radius-sm);
}

/* Share Card */
.share-card h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.share-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.share-btn svg {
    width: 22px;
    height: 22px;
}

.share-btn.telegram {
    background: #0088cc;
    color: white;
}

.share-btn.telegram:hover {
    background: #006ba3;
}

.share-btn.twitter {
    background: #000000;
    color: white;
}

.share-btn.twitter:hover {
    background: #1a1a1a;
}

.share-btn.whatsapp {
    background: #25D366;
    color: white;
}

.share-btn.whatsapp:hover {
    background: #1da851;
}

.share-btn.linkedin {
    background: #0077b5;
    color: white;
}

.share-btn.linkedin:hover {
    background: #005885;
}

.share-btn.copy {
    background: #6c757d;
    color: white;
}

.share-btn.copy:hover {
    background: #555;
}

/* Related Articles Card */
.related-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
}

.related-card h4 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.related-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-secondary);
    position: relative;
}

.related-item:last-child {
    border-bottom: none;
}

.related-item:hover {
    padding-right: 0.5rem;
}

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

.related-item-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: font-size 0.3s ease, font-weight 0.3s ease;
}

.related-item:hover .related-item-number {
    font-size: 1.15rem;
    font-weight: 700;
}

.related-item-content {
    flex: 1;
    min-width: 0;
}

.related-item-title {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

/* Main Article Content */
.article-main {
    max-width: none;
}

.article-body {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

/* Article Header */
.article-header {
    padding: 3rem 3rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.article-meta-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.article-category-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: bold;
}

.article-read-time {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.article-title {
    font-size: 2.5rem;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: bold;
}

.article-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Article Content */
.article-content {
    padding: 2rem 3rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.article-content h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.article-content h3 {
    color: var(--text-primary);
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem;
}

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

.article-content ul,
.article-content ol {
    margin: 1rem 0 1.5rem 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    background: var(--dark-bg);
    border-right: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: var(--radius-md);
    font-style: italic;
}

.article-content code {
    background: var(--dark-bg);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.article-content pre {
    background: var(--dark-bg);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
    max-width: 100%;
}

.article-content img {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 2rem 0;
    object-fit: cover;
}

.article-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    display: block;
    overflow-x: auto;
}

/* Twitter Embed */
.article-content .twitter-embed-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 100%;
    overflow: hidden;
}

.article-content .twitter-tweet {
    margin: 0 auto !important;
}

/* Loading State */
.content-loading {
    padding: 2rem 0;
}

.loading-skeleton .skeleton-line {
    height: 1rem;
    background: var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    animation: loading-pulse 1.5s infinite ease-in-out;
}

.skeleton-line.short {
    width: 60%;
}

@keyframes loading-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Article Footer */
.article-footer {
    padding: 2rem 3rem 3rem;
    border-top: 1px solid var(--border-color);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tag {
    background: none;
    color: var(--text-secondary);
    padding: 0;
    border-radius: 0;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
}

.tag::before {
    content: '#';
    margin-left: 0.25rem;
}

.tag:hover {
    color: var(--primary-color);
}

/* Article Actions */
.article-actions {
    display: flex;
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(224, 47, 58, 0.1);
}

.action-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Related Articles */
.related-articles {
    margin-top: 3rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
}

.related-articles h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.related-article {
    background: var(--dark-bg);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.related-article:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
}

.related-article h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.related-article p {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.related-article .meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Comments Section */
.comments-section {
    margin-top: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
}

.comments-section h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.comment-form {
    margin-bottom: 2rem;
}

.comment-form textarea {
    width: 100%;
    min-height: 100px;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    color: var(--text-primary);
    font-family: var(--font-persian);
    resize: vertical;
    margin-bottom: 1rem;
}

.comment-form button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-persian);
}

.comment {
    background: var(--dark-bg);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.comment-author {
    color: var(--text-primary);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.comment-text {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.comment-date {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .article-content-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem 2rem;
    }
    
    .article-sidebar-left {
        order: 2;
        position: relative;
        top: auto;
    }
    
    .article-main {
        order: 1;
    }

    .article-hero {
        height: 400px;
    }

    #article-title-hero {
        font-size: 2rem;
    }

    .article-meta-hero {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .article-container {
        overflow-x: hidden;
    }

    .article-hero {
        height: 350px;
        margin-top: 1rem;
        width: 100%;
        max-width: 100%;
    }

    .article-hero-overlay {
        padding: 2rem 1.5rem;
        width: 100%;
        box-sizing: border-box;
    }

    #article-title-hero {
        font-size: 1.75rem;
        margin-bottom: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .breadcrumb {
        font-size: 0.8rem;
        margin-bottom: 1.5rem;
        flex-wrap: wrap;
    }

    .article-meta-hero {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .meta-item {
        font-size: 0.85rem;
    }

    .meta-item svg {
        width: 18px;
        height: 18px;
    }
    
    .article-title {
        font-size: 2rem;
        word-wrap: break-word;
    }
    
    .article-header,
    .article-content,
    .article-footer {
        padding-left: 1rem;
        padding-right: 1rem;
        width: 100%;
        box-sizing: border-box;
    }

    .article-content-wrapper {
        padding: 0 0.5rem 1.5rem;
        width: 100%;
        box-sizing: border-box;
    }

    .article-content {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .article-content * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }

    .author-card,
    .article-stats-card,
    .toc-card,
    .share-card {
        padding: 1.25rem;
    }

    .toc-list {
        font-size: 0.9rem;
    }

    .comment-form textarea {
        min-height: 100px;
    }
}

@media (max-width: 480px) {
    .article-container {
        padding: 0;
        width: 100%;
    }

    .article-hero {
        height: 280px;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        width: 100%;
        margin: 0;
    }

    .article-hero-overlay {
        padding: 1.5rem 0.75rem;
        width: 100%;
    }

    #article-title-hero {
        font-size: 1.4rem;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .breadcrumb {
        font-size: 0.75rem;
        margin-bottom: 1rem;
        flex-wrap: wrap;
    }

    .article-meta-hero {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
        width: 100%;
    }

    .meta-item {
        font-size: 0.8rem;
    }

    .article-content-wrapper {
        padding: 0 0.25rem 1rem;
        gap: 1.5rem;
        width: 100%;
        margin: 0;
    }

    .article-header,
    .article-content,
    .article-footer {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        width: 100%;
        max-width: 100%;
    }

    .article-title {
        font-size: 1.5rem;
        word-wrap: break-word;
    }

    .article-content h1,
    .article-content h2,
    .article-content h3,
    .article-content h4,
    .article-content h5,
    .article-content h6 {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .article-content p {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .article-content pre {
        padding: 1rem;
        font-size: 0.8rem;
        overflow-x: auto;
    }

    .article-content code {
        word-break: break-all;
    }

    .author-card,
    .article-stats-card,
    .toc-card,
    .share-card {
        padding: 1rem;
    }

    .share-buttons {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .share-btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
        font-size: 0.85rem;
        padding: 0.625rem;
    }

    .comment-form input,
    .comment-form textarea {
        font-size: 0.9rem;
    }

    .comment-form button {
        width: 100%;
        padding: 0.875rem;
    }

    .comment {
        padding: 1rem;
    }
}
