/* ============================================
   Tallybase - Article Page Styles
   ============================================ */

/* --------------------------------------------
   Reading Progress Bar
   -------------------------------------------- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: left;
    z-index: 1000;
    transition: transform 0.1s linear;
}

/* --------------------------------------------
   Article Header
   -------------------------------------------- */
.article-header {
    padding: clamp(10rem, 18vh, 14rem) 0 clamp(4rem, 8vh, 6rem);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.article-header-content {
    max-width: 800px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-decoration: none;
    margin-bottom: 2rem;
    transition: color 0.3s var(--ease-out);
}

.back-link svg {
    width: 18px;
    height: 18px;
    min-width: 18px;
    max-width: 18px;
    transition: transform 0.3s var(--ease-out);
}

.back-link:hover {
    color: var(--color-accent);
}

.back-link:hover svg {
    transform: translateX(-4px);
}

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

.article-header .article-category {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    padding: 0.375rem 0.75rem;
    background: rgba(45, 90, 74, 0.1);
}

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

.article-header h1 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 400;
    line-height: 1.2;
    margin: 0 0 1.5rem 0;
    max-width: 100%;
}

.article-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    font-style: italic;
    margin: 0;
}

/* --------------------------------------------
   Article Body Layout
   -------------------------------------------- */
.article-body {
    padding: clamp(4rem, 8vh, 6rem) 0;
    background: var(--color-bg);
}

.article-body > .container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 4rem;
    align-items: start;
}

/* --------------------------------------------
   Article Content
   -------------------------------------------- */
.article-content {
    max-width: 720px;
}

.article-content p {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    font-weight: 300;
    line-height: 1.8;
    margin: 0 0 1.5rem 0;
    color: var(--color-text);
}

.article-content p.lead {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--color-text);
    margin: 0 0 2rem 0;
}

.article-content p.conclusion {
    font-size: 1.125rem;
    font-weight: 500;
    font-style: italic;
    color: var(--color-text);
    margin: 2rem 0 1.5rem 0;
}

.article-content h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 400;
    line-height: 1.3;
    margin: 3rem 0 1.25rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.article-content h2:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 2rem;
}

.article-content h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.4;
    margin: 2rem 0 1rem 0;
}

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

.article-content li {
    font-size: 1.0625rem;
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

/* Callout Boxes */
.article-content .callout {
    margin: 2.5rem 0;
    padding: 1.5rem 2rem;
    background: var(--color-bg-alt);
    border-left: 3px solid var(--color-border);
}

.article-content .callout p {
    font-size: 1rem;
    margin: 0;
    color: var(--color-text);
}

.article-content .callout-accent {
    border-left-color: var(--color-accent);
    background: rgba(45, 90, 74, 0.05);
}

.article-content .callout-accent p {
    font-weight: 400;
}

/* --------------------------------------------
   Article Sidebar
   -------------------------------------------- */
.article-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-block {
    padding: 1.5rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
}

.sidebar-block h4 {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin: 0 0 1rem 0;
}

/* Takeaways List */
.takeaways-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.takeaways-list li {
    font-size: 0.9375rem;
    line-height: 1.5;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    margin: 0;
}

.takeaways-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Share Links */
.share-links {
    display: flex;
    gap: 0.75rem;
}

.share-link {
    width: 40px;
    height: 40px;
    min-width: 40px;
    max-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    transition: all 0.3s var(--ease-out);
}

.share-link svg {
    width: 18px;
    height: 18px;
    min-width: 18px;
    max-width: 18px;
    min-height: 18px;
    max-height: 18px;
}

.share-link:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-text-light);
}

/* Sidebar CTA */
.sidebar-cta {
    background: var(--color-text);
    border-color: var(--color-text);
}

.sidebar-cta h4 {
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-cta p {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 1.25rem 0;
}

.sidebar-cta-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    background: var(--color-bg);
    text-decoration: none;
    transition: all 0.3s var(--ease-out);
}

.sidebar-cta-btn:hover {
    background: var(--color-accent);
    color: var(--color-text-light);
}

/* --------------------------------------------
   Related Articles
   -------------------------------------------- */
.related-articles {
    padding: clamp(4rem, 8vh, 6rem) 0;
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
}

.related-articles h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0 0 2rem 0;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.related-card {
    padding: 1.5rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    text-decoration: none;
    transition: all 0.4s var(--ease-out);
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.related-category {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin: 0 0 0.75rem 0;
}

.related-card h4 {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--color-text);
    margin: 0 0 0.75rem 0;
    transition: color 0.3s var(--ease-out);
}

.related-card:hover h4 {
    color: var(--color-accent);
}

.related-meta {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin: 0;
}

/* --------------------------------------------
   Responsive Styles
   -------------------------------------------- */
@media (max-width: 1024px) {
    .article-body > .container {
        grid-template-columns: 1fr;
    }
    
    .article-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        margin-top: 3rem;
        padding-top: 3rem;
        border-top: 1px solid var(--color-border);
    }
    
    .sidebar-cta {
        grid-column: span 2;
    }
    
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .article-header h1 {
        font-size: 1.75rem;
    }
    
    .article-subtitle {
        font-size: 1.0625rem;
    }
    
    .article-content p {
        font-size: 1rem;
    }
    
    .article-content p.lead {
        font-size: 1.0625rem;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-content h3 {
        font-size: 1.125rem;
    }
    
    .article-sidebar {
        grid-template-columns: 1fr;
    }
    
    .sidebar-cta {
        grid-column: span 1;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .article-content .callout {
        padding: 1.25rem 1.5rem;
        margin: 2rem -1rem;
    }
}