/**
 * Magazine-Style Article Layout
 * Inspired by Wired, NYTimes, Medium
 */

/* Article Container */
.article-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.7;
    color: var(--text-primary, #1a1a2e);
}

/* Hero Section */
.article-hero {
    position: relative;
    width: 100%;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

.hero-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
}

.hero-gradient {
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 40%),
        linear-gradient(45deg, transparent 45%, rgba(255,255,255,0.03) 50%, transparent 55%);
    background-size: 100% 100%, 100% 100%, 20px 20px;
}

.hero-overlay {
    position: relative;
    z-index: 2;
    padding: 4rem 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    color: #fff;
}

.hero-category {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: 'Georgia', serif;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    max-width: 900px;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero-excerpt {
    font-family: 'Georgia', serif;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 400;
    font-style: italic;
    max-width: 700px;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.5;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    opacity: 0.8;
}

.hero-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-author {
    font-weight: 600;
}

.hero-reading-time::before {
    content: '·';
    margin-right: 0.5rem;
}

/* Article Body */
.article-body {
    max-width: 740px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* Section Styling */
.article-section {
    margin-bottom: 3rem;
}

.section-title {
    font-family: 'Roboto', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-top: 2rem;
    border-top: 3px solid #667eea;
    color: var(--text-primary);
}

/* Intro Section */
.section-intro {
    font-size: 1.2rem;
}

.intro-paragraph {
    margin-bottom: 1.5rem;
}

.drop-cap {
    float: left;
    font-size: 4.5rem;
    line-height: 0.8;
    padding-right: 0.75rem;
    padding-top: 0.25rem;
    font-weight: 700;
    color: var(--blog-accent, #667eea);
    font-family: 'Georgia', serif;
}

/* Key Points Section */
.section-keypoints {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem -1rem;
}

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

.keypoint-card {
    background: rgba(255,255,255,0.9);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: relative;
    border-left: 4px solid #667eea;
}

.keypoint-number {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
}

.keypoint-card p {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Code Section */
.section-code {
    background: #1a1a2e;
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem -1rem;
}

.section-code .section-title {
    color: #fff;
    border-top-color: #25E1ED;
}

.section-code pre {
    background: rgba(0,0,0,0.4);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
}

.section-code code {
    font-family: 'Share Tech Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #e2e8f0;
}

/* Data Section */
.section-data {
    overflow-x: auto;
}

.section-data table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
}

.section-data th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
}

.section-data td {
    padding: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.section-data tr:hover td {
    background: rgba(102, 126, 234, 0.05);
}

/* Conclusion Section */
.section-conclusion {
    margin-top: 4rem;
}

.conclusion-wrapper {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 3rem;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.conclusion-wrapper::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 20px;
    font-size: 12rem;
    opacity: 0.1;
    font-family: Georgia, serif;
    line-height: 1;
}

.conclusion-wrapper .section-title {
    color: #fff;
    border-top: none;
    padding-top: 0;
}

.conclusion-content {
    position: relative;
    z-index: 1;
}

.conclusion-content p {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* Sources Section */
.section-sources {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 12px;
    margin-top: 3rem;
}

.section-sources .section-title {
    font-size: 1.25rem;
    border-top: none;
    padding-top: 0;
}

.sources-list a {
    color: var(--blog-accent, #667eea);
    text-decoration: none;
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
    transition: border-color 0.2s ease;
}

.sources-list a:hover {
    border-bottom-color: #667eea;
}

.sources-list ul {
    list-style: none;
    padding: 0;
}

.sources-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
}

/* Standard Text Styling */
.article-body p {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.article-body strong {
    font-weight: 700;
    color: #1a1a2e;
}

.article-body em {
    font-style: italic;
}

.article-body a {
    color: var(--blog-accent, #667eea);
    text-decoration: none;
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
}

.article-body a:hover {
    color: #764ba2;
    border-bottom-color: #764ba2;
}

.article-body blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    border-left: 4px solid #667eea;
    background: rgba(102, 126, 234, 0.05);
    font-style: italic;
    font-size: 1.1rem;
}

.article-body ul, .article-body ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.75rem;
}

/* Inline Code */
.article-body code:not(pre code) {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9em;
    padding: 0.2em 0.4em;
    background: rgba(102, 126, 234, 0.15);
    border-radius: 4px;
    color: var(--text-primary, #1a1a2e);
}

/* Reading Progress */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 1000;
    background: rgba(0,0,0,0.1);
}

.reading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.1s ease;
}

/* Dark Mode */
body.dark-mode .article-container {
    color: rgba(255,255,255,0.9);
}

body.dark-mode .section-title {
    color: #fff;
}

body.dark-mode .article-body p,
body.dark-mode .article-body strong {
    color: rgba(255,255,255,0.9);
}

body.dark-mode .section-keypoints {
    background: rgba(102, 126, 234, 0.1);
}

body.dark-mode .keypoint-card {
    background: rgba(255,255,255,0.05);
}

body.dark-mode .keypoint-card p {
    color: rgba(255,255,255,0.9);
}

body.dark-mode .section-sources {
    background: rgba(0,0,0,0.3);
}

body.dark-mode .sources-list li {
    border-bottom-color: rgba(255,255,255,0.1);
}

body.dark-mode .article-body blockquote {
    background: rgba(102, 126, 234, 0.15);
}

body.dark-mode .article-body code:not(pre code) {
    background: rgba(102, 126, 234, 0.3);
    color: #e0e7ff;
}

body.dark-mode .article-body a {
    color: #a5b4fc;
}

body.dark-mode .sources-list a {
    color: #a5b4fc;
}

/* Responsive */
@media (max-width: 768px) {
    .article-hero {
        min-height: 50vh;
    }

    .hero-overlay {
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-excerpt {
        font-size: 1rem;
    }

    .hero-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .article-body {
        padding: 2rem 1rem;
    }

    .section-keypoints,
    .section-code {
        margin: 1.5rem -0.5rem;
        padding: 1.5rem 1rem;
        border-radius: 0;
    }

    .keypoints-grid {
        grid-template-columns: 1fr;
    }

    .drop-cap {
        font-size: 3rem;
    }

    .conclusion-wrapper {
        padding: 2rem 1.5rem;
    }
}

/* Small Mobile (480px) */
@media (max-width: 480px) {
    .article-hero {
        min-height: 35vh;
    }

    .hero-overlay {
        padding: 1.5rem 0.75rem;
    }

    .hero-title {
        font-size: clamp(1.3rem, 4vw, 1.6rem);
    }

    .hero-excerpt {
        font-size: 0.95rem;
    }

    .hero-meta {
        font-size: 0.8rem;
        gap: 0.4rem;
    }

    .hero-category {
        font-size: 0.65rem;
        padding: 0.4rem 0.8rem;
    }

    .drop-cap {
        font-size: 2.5rem;
    }

    .section-keypoints,
    .section-code {
        margin: 1rem 0;
        padding: 1rem;
    }

    .conclusion-wrapper {
        padding: 1.5rem 1rem;
    }
}

/* Print Styles */
@media print {
    .reading-progress {
        display: none;
    }

    .article-hero {
        min-height: auto;
        page-break-after: always;
    }

    .hero-image-container {
        display: none;
    }

    .hero-overlay {
        background: none;
        color: #000;
    }

    .article-body {
        max-width: 100%;
    }
}
