/* Article pages (insights/*.html) and the CMS Insight preview.
   Moved from the <style> block in templates/article.html so both share it. */
/* Article Page Specific Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}

/* Featured Image - Full width at top */
.article-featured-image {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.article-featured-image img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 16px;
}

.article-source-note {
    max-width: 900px;
    margin: 16px auto 0;
    padding: 0 20px;
    box-sizing: border-box;
}

.article-source-note__text {
    margin: 0;
    padding: 12px 16px;
    background: #F3F4F6;
    border-radius: 8px;
    color: #4B5563;
    font-size: 0.875rem;
    line-height: 1.5;
}

.article-source-note__link {
    color: #491998;
    text-decoration: underline;
}

.article-source-note__link:hover {
    filter: brightness(0.85);
}

@media (max-width: 768px) {
    .article-source-note {
        padding: 0 16px;
        margin-top: 12px;
    }

    .article-source-note__text {
        font-size: 0.8125rem;
    }
}

/* Article Header - Below image */
.article-header {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 20px 0;
}

.article-header h1 {
    color: #1a1a1a;
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    margin: 0 0 24px;
    line-height: 1.15;
    word-wrap: normal;
    overflow-wrap: normal;
}

.article-lead {
    color: #6B7280;
    font-size: clamp(16px, 2.5vw, 18px);
    line-height: 1.7;
    margin: 0;
    word-wrap: normal;
    overflow-wrap: normal;
}

/* Back Link */
.back-to-insights-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 100px 20px 16px;
}

/* Article Body */
.article-body {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 20px 60px;
    font-size: 18px;
    line-height: 1.8;
    color: #374151;
    word-wrap: normal;
    overflow-wrap: normal;
    overflow-x: hidden;
}

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

.article-body img,
.article-body video,
.article-body iframe,
.article-body table,
.article-body pre {
    overflow-x: auto;
}

.article-body h2 {
    font-size: 26px;
    font-weight: 700;
    margin: 40px 0 16px;
    color: #1a1a1a;
}

.article-body h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 12px;
    color: #1a1a1a;
}

/* Subheads moved up a level for a correct heading outline keep their original look */
.article-body .heading--h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 12px;
    color: #1a1a1a;
}

.article-body .heading--h4 {
    font-size: inherit;
    font-weight: 700;
    margin: 0;
    color: inherit;
}

.article-body p {
    margin: 0 0 20px;
}

.article-body ul, .article-body ol {
    margin: 0 0 20px;
    padding-left: 24px;
}

.article-body li {
    margin-bottom: 10px;
}

.article-body blockquote {
    border-left: 3px solid #491998;
    padding: 16px 20px;
    margin: 28px 0;
    background: #f8f7fc;
    font-style: italic;
    font-size: 18px;
    color: #491998;
    border-radius: 0 8px 8px 0;
    word-wrap: normal;
    overflow-wrap: normal;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 28px 0;
}

/* Back Link */
.back-to-insights {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #491998;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 20px;
    transition: opacity 0.2s;
}

.back-to-insights:hover {
    opacity: 0.7;
}

/* Divider */
.article-divider {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px;
}

.article-divider hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 0;
}

/* More Insights Section */
.more-insights-section {
    background: #f9fafb;
    padding: 60px 20px 80px;
    overflow: hidden;
}

.more-insights-inner {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.more-insights-header {
    text-align: center;
    margin-bottom: 40px;
}

.more-insights-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.more-insights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.more-insights-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.more-insights-card:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.more-insights-card-image {
    aspect-ratio: 16/10;
    overflow: hidden;
}

.more-insights-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.more-insights-card:hover .more-insights-card-image img {
    transform: scale(1.03);
}

.more-insights-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.more-insights-card-headline {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.more-insights-card-headline a {
    color: inherit;
    text-decoration: none;
}

.more-insights-card-headline a:hover {
    color: #491998;
}

.more-insights-card-excerpt {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* View More Button */
.more-insights-actions {
    text-align: center;
    margin-top: 40px;
}

.btn-view-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: 2px solid #491998;
    border-radius: 50px;
    background: transparent;
    color: #491998;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.btn-view-more:hover {
    background: #491998;
    color: white;
}

/* CTA Section */
.article-cta {
    background: white;
    padding: 60px 20px;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

.article-cta h2 {
    font-size: 26px;
    margin-bottom: 12px;
    color: #1a1a1a;
}

.article-cta p {
    color: #6B7280;
    margin-bottom: 24px;
    font-size: 16px;
}

.btn-primary {
    display: inline-block;
    background: #491998;
    color: white;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: filter 0.2s;
}

.btn-primary:hover {
    filter: brightness(0.85);
}

/* Author Byline */
.article-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    font-size: 14px;
    color: #6B7280;
}

.byline-author {
    font-weight: 600;
    color: #374151;
}

.byline-credentials {
    color: #6B7280;
}

.byline-credentials::before {
    content: "•";
    margin-right: 8px;
    color: #D1D5DB;
}

/* Article Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.article-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #F3F4F6;
    color: #491998;
    font-size: 12px;
    font-weight: 500;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Key Insight Summary Box (LLM-friendly) */
.summary-box {
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8f7fc 0%, #f0f4ff 100%);
    border-left: 4px solid #491998;
    border-radius: 0 12px 12px 0;
    margin-top: 32px;
}

.summary-box-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #491998;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-box-header svg {
    stroke: #491998;
    flex-shrink: 0;
}

.summary-box p {
    margin: 0;
    color: #374151;
    font-size: 16px;
    line-height: 1.7;
    font-style: italic;
}

@media (max-width: 768px) {
    .summary-box {
        margin: 24px 16px 0;
        padding: 16px 20px;
    }
    
    .article-byline {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .byline-credentials::before {
        display: none;
    }
}

/* Loading & Error States */
.article-loading {
    text-align: center;
    padding: 120px 20px;
    color: #6B7280;
}

.article-error {
    text-align: center;
    padding: 120px 20px;
}

.article-error h2 {
    color: #1a1a1a;
    margin-bottom: 12px;
}

.article-error p {
    color: #6B7280;
}

.article-error a {
    color: #491998;
}

/* Responsive */
@media (max-width: 1024px) {
    .more-insights-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .back-to-insights-wrapper {
        padding: 90px 16px 12px;
    }
    
    .article-featured-image {
        margin-top: 0;
        padding: 0 16px;
    }
    
    .article-featured-image img {
        border-radius: 12px;
    }
    
    .article-header {
        padding: 32px 16px 0;
    }
    
    .article-body {
        padding: 32px 16px 50px;
        font-size: 16px;
    }
    
    .article-body h2 {
        font-size: 22px;
    }
    
    .article-body h3 {
        font-size: 18px;
    }

    .article-body .heading--h3 {
        font-size: 18px;
    }
    
    .article-body blockquote {
        padding: 14px 16px;
        font-size: 16px;
        margin: 20px 0;
    }
    
    .article-featured-image {
        padding: 0 16px;
        margin-top: 30px;
    }
    
    .article-featured-image img {
        max-height: 240px;
    }
    
    .article-divider {
        padding: 0 16px;
    }
    
    .more-insights-section {
        padding: 50px 16px 60px;
    }
    
    .more-insights-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .more-insights-header h2 {
        font-size: 24px;
    }
    
    .article-cta {
        padding: 50px 16px;
    }
    
    .article-cta h2 {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .back-to-insights-wrapper {
        padding: 80px 16px 10px;
    }
    
    .back-to-insights {
        font-size: 13px;
    }
    
    .article-featured-image img {
        border-radius: 10px;
    }
    
    .article-header {
        padding: 24px 16px 0;
    }
    
    .article-body {
        padding: 28px 16px 40px;
        font-size: 15px;
        line-height: 1.7;
    }
    
    .more-insights-card-content {
        padding: 16px;
    }
    
    .more-insights-card-headline {
        font-size: 16px;
    }
}
