/* ========================================
   Article View Styles
   ======================================== */

/* Article Overlay */
.article-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.article-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.article-overlay.hidden {
    display: flex;
    opacity: 0;
    visibility: hidden;
}

/* Article Container */
.article-container {
    position: relative;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transform: translateY(20px);
    transition: transform var(--transition-normal);
}

.article-overlay.visible .article-container {
    transform: translateY(0);
}

/* Close Button */
.btn-close-article {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.btn-close-article:hover {
    background: var(--bg-elevated);
}

/* Article Content */
.article-content {
    max-height: 90vh;
    overflow-y: auto;
    padding-bottom: var(--space-2xl);
}

/* Article Header */
.article-header {
    position: relative;
}

/* Header Image */
.article-header-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg-secondary);
    overflow: hidden;
}

.article-header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-header-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--news-gradient-start), var(--news-gradient-end));
}

.article-header-image.placeholder::after {
    content: '';
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

/* Article Meta */
.article-meta {
    padding: var(--space-lg);
    padding-bottom: 0;
}

.article-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--news-accent);
    margin-bottom: var(--space-sm);
}

.article-brand-icon {
    width: 20px;
    height: 20px;
    background: var(--news-accent);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

/* Article Title */
.article-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    letter-spacing: -0.5px;
}

/* Article Subtitle */
.article-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--space-md);
}

/* Author & Date */
.article-byline {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--bg-tertiary);
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.article-author {
    font-weight: 500;
    color: var(--text-secondary);
}

.article-date {
    color: var(--text-muted);
}

/* Article Body */
.article-body {
    padding: 0 var(--space-lg);
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.article-body p {
    margin-bottom: 1.5em;
    color: inherit;
}

.article-body p:last-child {
    margin-bottom: 0;
}

/* Article Images */
.article-body-image {
    margin: var(--space-xl) calc(-1 * var(--space-lg));
    background: var(--bg-secondary);
}

.article-body-image img {
    width: 100%;
    display: block;
}

.article-body-image figcaption {
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Article Footer */
.article-footer {
    padding: var(--space-lg);
    margin-top: var(--space-lg);
    border-top: 1px solid var(--bg-tertiary);
    text-align: center;
}

.article-footer-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Read in iPhone Mockup */
.article-in-iphone {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 30px;
    overflow-y: auto;
    background: var(--bg-primary);
    -webkit-overflow-scrolling: touch;
}

.article-in-iphone .article-content {
    max-height: none;
}

.article-in-iphone .article-header-image {
    aspect-ratio: 4 / 3;
}

.article-in-iphone .article-title {
    font-size: 1.25rem;
}

.article-in-iphone .article-subtitle {
    font-size: 0.9375rem;
}

.article-in-iphone .article-body {
    font-size: 0.9375rem;
    padding: 0 var(--space-md);
}

.article-in-iphone .article-meta {
    padding: var(--space-md);
    padding-bottom: 0;
}

.article-in-iphone .article-byline {
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-md);
}

/* Back Button in iPhone */
.article-back-btn {
    position: absolute;
    top: 54px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: var(--space-xs) var(--space-sm);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: var(--radius-full);
    color: var(--accent-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    z-index: 20;
}

.article-back-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Mobile: Full screen article */
@media (max-width: 768px) {
    .article-overlay {
        padding: 0;
    }
    
    .article-container {
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .btn-close-article {
        top: var(--space-sm);
        right: var(--space-sm);
    }
    
    .article-title {
        font-size: 1.5rem;
    }
    
    .article-body {
        font-size: 1rem;
    }
}

/* Print styles */
@media print {
    .article-overlay {
        position: static;
        background: white;
    }
    
    .btn-close-article {
        display: none;
    }
    
    .article-container {
        max-width: 100%;
        box-shadow: none;
    }
    
    .article-content {
        max-height: none;
    }
}

/* Animation for article appearance */
@keyframes articleSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-overlay.visible .article-container {
    animation: articleSlideUp 0.4s ease-out;
}

/* Reading progress indicator */
.reading-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--news-accent);
    width: 0%;
    transition: width 0.1s ease-out;
    z-index: 20;
}

