/* =================================================================
   ARTICLE PAGE STYLES
   ================================================================= */

   /* Background Elements */
.c-bg-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: 15vw;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.02);
    pointer-events: none;
    z-index: 0;
    user-select: none;
    white-space: nowrap;
}

/* Reading Progress */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    z-index: 10001;
    transition: width 0.1s linear;
}

.article-page {
    background: var(--color-bg);
    color: var(--color-text);
    padding-top: 180px;
    position: relative;
}

/* Hero Section */
.a-hero {
    text-align: center;
    padding-bottom: 80px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.a-hero__meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.category-badge {
    background: rgba(138, 66, 255, 0.1);
    color: var(--color-primary-light);
    padding: 6px 16px;
    border-radius: 100px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.a-hero .title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 30px;
}

.a-hero .subtitle {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 50px;
}

.a-hero__author {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--color-primary);
}

.author-avatar img { width: 100%; height: 100%; object-fit: cover; }

.author-info {
    text-align: left;
    display: flex;
    flex-direction: column;
}

.author-info .name { font-weight: 600; color: var(--color-text); font-size: 1.1rem; }
.author-info .read-time { font-size: 0.85rem; color: var(--color-text-muted); }

/* Featured Image */
.a-featured-image {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 40px;
    overflow: hidden;
    margin-bottom: 100px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 40px 80px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
}

.a-featured-image img { width: 100%; height: 100%; object-fit: cover; }

/* Layout */
.a-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 60px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

/* Sidebar Share */
.a-sidebar {
    position: sticky;
    top: 150px;
    height: fit-content;
}

.a-share-sticky {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.a-share-sticky span {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

.share-btn { 
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; 
    color: var(--color-text-muted);
    transition: all 0.3s ease; 
}
.share-btn:hover { 
    color: #fff; 
    background: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-3px);
}

/* Clap Button */
.clap-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

.clap-btn {
    position: relative; /* For particle positioning */
}

.clap-btn.active {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: rgba(138, 66, 255, 0.1);
}

.clap-count {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

/* Table of Contents */
.a-toc {
    margin-top: 40px;
    position: relative;
    opacity: 0;
    animation: fadeIn 1s ease forwards 1s;
}

.a-toc h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    font-weight: 700;
}

.a-toc ul {
    list-style: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 0;
}

.a-toc li {
    margin-bottom: 0;
    position: relative;
}

.a-toc a {
    display: block;
    padding: 8px 0 8px 20px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    transition: all 0.3s ease;
    border-left: 2px solid transparent;
    margin-left: -1px;
    line-height: 1.4;
}

.a-toc a:hover, .a-toc a.active {
    color: var(--color-primary-light);
    border-left-color: var(--color-primary);
    background: linear-gradient(90deg, rgba(138, 66, 255, 0.05), transparent);
}

.a-toc .toc-h3 a {
    padding-left: 35px;
    font-size: 0.85rem;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Prev/Next Navigation */
.a-nav {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.nav-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 24px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.nav-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--color-primary);
    transform: translateY(-5px);
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
}

.nav-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
}

.nav-card.next {
    text-align: right;
    align-items: flex-end;
}

/* Content Typography */
.typography {
    font-size: 1.25rem;
    line-height: 1.8;
    color: #e0e0e0;
}

.typography p { margin-bottom: 32px; }
.typography .lead { font-size: 1.5rem; color: var(--color-text); margin-bottom: 50px; line-height: 1.6; font-weight: 400; }
.typography h2 { font-family: var(--font-heading); font-size: 2.2rem; color: var(--color-text); margin: 60px 0 24px; font-weight: 700; }
.typography h3 { font-family: var(--font-heading); font-size: 1.75rem; color: var(--color-text); margin: 40px 0 20px; font-weight: 600; }
.typography ul, .typography ol { margin-bottom: 32px; padding-left: 20px; }
.typography li { margin-bottom: 12px; position: relative; padding-left: 15px; }
.typography li::before { content: '•'; color: var(--color-primary); position: absolute; left: -10px; font-weight: bold; }
.typography strong { color: #fff; font-weight: 600; }
.typography a { color: var(--color-primary-light); text-decoration: underline; text-underline-offset: 4px; transition: color 0.3s ease; }
.typography a:hover { color: #fff; }

/* Service Promotion Box */
.typography .promotion-box {
    background: linear-gradient(145deg, rgba(138, 66, 255, 0.05), rgba(5, 8, 22, 0.4));
    border: 1px solid rgba(138, 66, 255, 0.2);
    border-left: 4px solid var(--color-primary);
    border-radius: 16px;
    padding: 32px;
    margin: 50px 0;
}
.typography .promotion-box h3 { margin-top: 0; font-size: 1.4rem; color: #fff; margin-bottom: 16px; }
.typography .promotion-box p { margin-bottom: 20px; font-size: 1rem; color: var(--color-text-muted); }
.typography .promotion-box .cta-link { 
    color: var(--color-primary-light); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: 0.9rem; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; 
}
.typography .promotion-box .cta-link i { transition: transform 0.3s ease; }
.typography .promotion-box .cta-link:hover i { transform: translateX(5px); }

/* Tags & Share */
.a-tags {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 10px;
}

.a-tags span {
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Related Articles */
.a-next {
    padding: 100px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 100px;
}

.section-title { font-family: var(--font-heading); font-size: 2rem; margin-bottom: 40px; color: var(--color-text); }

.a-next__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }

.related-card { display: block; background: rgba(255,255,255,0.02); border-radius: 24px; overflow: hidden; border: 1px solid rgba(255,255,255,0.05); transition: all 0.3s ease; }
.related-card:hover { transform: translateY(-5px); border-color: var(--color-primary); }

.related-image { aspect-ratio: 16/9; overflow: hidden; }
.related-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.related-card:hover img { transform: scale(1.05); }

.related-content { padding: 30px; }
.related-category { font-size: 0.75rem; color: var(--color-primary-light); text-transform: uppercase; font-weight: 700; letter-spacing: 1px; display: block; margin-bottom: 10px; }
.related-content h4 { font-size: 1.4rem; color: var(--color-text); line-height: 1.3; font-weight: 600; }

@media (max-width: 1024px) {
    .article-page {
        padding-top: 120px;
    }
    
    /* Switch to vertical stack layout */
    .a-layout {
        display: flex;
        flex-direction: column;
        gap: 40px;
    }

    .a-sidebar {
        position: relative;
        top: 0;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 30px;
        display: flex;
        flex-direction: column;
        gap: 30px;
    }

    .a-share-sticky {
        position: static;
        flex-direction: row;
        align-items: center;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        padding: 0;
        border: none;
        box-shadow: none;
        gap: 15px;
        flex-wrap: wrap;
    }

    .a-share-sticky span {
        display: inline-block;
        writing-mode: horizontal-tb;
        margin-bottom: 0;
        margin-right: 10px;
        font-size: 0.8rem;
    }

    .a-toc {
        display: block;
        opacity: 1;
        animation: none;
        margin-top: 0;
        background: rgba(255, 255, 255, 0.02);
        padding: 24px;
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .a-toc h4 {
        margin-top: 0;
    }

    .clap-container {
        flex-direction: row;
        margin-top: 0;
        margin-left: auto;
    }

    .share-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
        background: rgba(255, 255, 255, 0.05);
    }

    .a-hero .title { font-size: 2.5rem; }
    .typography { font-size: 1.1rem; }
}

@media (max-width: 768px) { 
    .article-page { padding-top: 100px; }
    
    .a-hero { padding-bottom: 40px; }
    .a-hero .title { font-size: 2.2rem; line-height: 1.2; }
    .a-hero .subtitle { font-size: 1rem; margin-bottom: 30px; }
    .a-hero__meta { flex-wrap: wrap; gap: 10px; justify-content: center; }
    
    .a-featured-image { aspect-ratio: 16/10; border-radius: 16px; margin-bottom: 40px; }
    
    .typography { font-size: 1rem; line-height: 1.7; }
    .typography h2 { font-size: 1.8rem; margin-top: 40px; }
    .typography h3 { font-size: 1.4rem; margin-top: 30px; }
    .typography .lead { font-size: 1.2rem; margin-bottom: 30px; }
    
    .typography .promotion-box {
        padding: 24px;
        margin: 40px 0;
    }
    .typography .promotion-box h3 { font-size: 1.2rem; }
    
    .a-tags { flex-wrap: wrap; }

    .a-next__grid { grid-template-columns: 1fr; gap: 30px; } 
    
    .a-nav {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .nav-card.next {
        text-align: left;
        align-items: flex-start;
    }
}