/* ========================================
   ARTICLE PAGE STYLES - WITH SIDEBAR (V1)
   This is the ORIGINAL version with TOC sidebar
   ======================================== */

/* Article Header */
.article-page {
    background: white;
}

.article-hero {
    width: 100%;
    overflow: hidden;
    margin-bottom: 40px;
}

.article-hero .hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.article-header-content {
    max-width: 1200px;
    margin: 0 auto 60px;
    text-align: center;
    padding: 0 20px;
}

/* Category Badges */
.article-category-badges {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.category-badge.primary {
    background: #0077B6;
    color: white;
}

.category-badge.secondary {
    background: #F8F8F8;
    color: #666666;
    border: 1px solid #E9ECEF;
}

.category-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 48px;
    line-height: 1.12;
    margin-bottom: 20px;
    color: #333333;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.article-meta {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    color: #AAAAAA;
    flex-wrap: wrap;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-meta .meta-separator {
    color: #DDDDDD;
}

/* Article Content Layout - SINGLE COLUMN */
.article-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px 80px;
}

.article-body {
    width: 100%;
}

/* Article Sidebar - HIDDEN */
.article-sidebar {
    display: none;
}

.toc-widget,
.share-widget {
    background: var(--color-base-light);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.toc-widget h3,
.share-widget h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--color-contrast);
}

#article-toc {
    list-style: none;
    padding: 0;
}

#article-toc li {
    margin-bottom: 12px;
}

#article-toc a {
    color: var(--color-contrast-light);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.6;
    transition: color var(--transition-fast);
}

#article-toc a:hover {
    color: var(--color-accent-blue);
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.share-btn {
    padding: 10px;
    background: white;
    color: var(--color-contrast);
    text-align: center;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all var(--transition-normal);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ========================================
   SPEC-COMPLIANT BLOCK STYLES
   ======================================== */

/* Heading Block */
.article-heading {
    margin: 60px 0 20px;
    color: var(--color-contrast);
}

h2.article-heading {
    font-size: 32px;
}

h3.article-heading {
    font-size: 24px;
    margin: 40px 0 16px;
}

h4.article-heading {
    font-size: 20px;
    margin: 30px 0 12px;
}

/* Paragraph Block */
.article-paragraph {
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 24px;
    color: var(--color-contrast-light);
}

/* Image Block */
.article-image {
    margin: 40px 0;
    border-radius: 12px;
    overflow: hidden;
}

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

.article-image figcaption {
    padding: 12px 16px;
    background: var(--color-base-light);
    font-size: 14px;
    color: var(--color-contrast-light);
    text-align: center;
}

/* Table Block */
.article-table {
    width: 100%;
    margin: 40px 0;
    border-collapse: collapse;
    border: 1px solid #E9ECEF;
}

.article-table th,
.article-table td {
    padding: 12px 16px;
    border: 1px solid #E9ECEF;
    text-align: left;
}

.article-table th {
    background: var(--color-base-light);
    font-weight: 600;
    color: var(--color-contrast);
}

.article-table td {
    color: var(--color-contrast-light);
    font-size: 16px;
}

/* List Block */
.article-list {
    margin: 24px 0;
    padding-left: 30px;
}

.article-list li {
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 12px;
    color: var(--color-contrast-light);
}

/* FAQ Block - Using Native Details/Summary */
.article-faq {
    margin-bottom: 20px;
    padding: 20px 24px;
    background: #F8F8F8;
    border-radius: 8px;
    border: 1px solid #E9ECEF;
}

.article-faq summary {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0;
    transition: color 0.2s ease;
    gap: 16px;
}

.article-faq summary::-webkit-details-marker {
    display: none;
}

.article-faq summary::after {
    content: '+';
    font-size: 24px;
    font-weight: 400;
    color: #0077B6;
    flex-shrink: 0;
    line-height: 1;
    transition: all 0.2s ease;
}

.article-faq[open] summary::after {
    content: '−';
}

.article-faq summary:hover {
    color: #0077B6;
}

.article-faq div {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #E9ECEF;
    font-size: 16px;
    line-height: 1.7;
    color: #666666;
}

/* ========================================
   LIGHTBOX
   ======================================== */

.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    font-weight: 300;
    line-height: 1;
}

.lightbox-close:hover {
    color: #ccc;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .article-content {
        grid-template-columns: 1fr 250px;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .article-hero .hero-image {
        height: 300px;
    }
    
    .article-title {
        font-size: 32px;
    }
    
    .article-header-content {
        margin-bottom: 40px;
    }
    
    .article-content {
        grid-template-columns: 1fr;
        padding: 0 20px 60px;
    }
    
    .article-sidebar {
        position: static;
        order: -1;
    }
    
    h2.article-heading {
        font-size: 26px;
    }
    
    h3.article-heading {
        font-size: 20px;
    }
    
    h4.article-heading {
        font-size: 18px;
    }
    
    .article-paragraph,
    .article-list li {
        font-size: 16px;
    }
    
    .article-table {
        font-size: 14px;
    }
    
    .article-table th,
    .article-table td {
        padding: 8px 12px;
    }
    
    .article-faq summary {
        font-size: 16px;
    }
    
    .article-faq div {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .article-hero .hero-image {
        height: 250px;
    }
    
    .article-title {
        font-size: 28px;
    }
    
    .article-content {
        padding: 0 16px 40px;
    }
    
    h2.article-heading {
        font-size: 24px;
        margin: 40px 0 16px;
    }
    
    h3.article-heading {
        font-size: 18px;
        margin: 30px 0 12px;
    }
    
    .share-buttons {
        flex-direction: row;
    }
}


/* ========================================
   Related Articles Section
   ======================================== */

.related-articles {
    background: #F8F8F8;
    padding: 80px 0;
    margin-top: 80px;
}

.related-articles-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.related-articles-title {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    font-weight: 700;
    color: #1A1A1A;
    margin: 0 0 40px 0;
    text-align: center;
}

/* Article Cards Grid */

.article-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    max-width: 1200px;
}

@media (max-width: 768px) {
    .article-cards-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Article Card */

.article-card {
    background: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.article-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Card Image */

.article-card-image {
    width: 100%;
    overflow: hidden;
    background: #E5E5E5;
}

.article-card-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px 12px 0 0;
    transition: transform 0.3s ease;
}

.article-card:hover .article-card-image img {
    transform: scale(1.05);
}

/* Card Content */

.article-card-content {
    padding: 24px;
}

.article-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.card-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 16px;
    text-transform: capitalize;
}

.card-badge.primary {
    background: #0077B6;
    color: #FFFFFF;
}

.card-badge.secondary {
    background: #F8F8F8;
    color: #666666;
}

.article-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 700;
    color: #1A1A1A;
    margin: 0 0 12px 0;
    line-height: 1.3;
    transition: color 0.2s ease;
}

.article-card:hover .article-card-title {
    color: #0077B6;
}

.article-card-excerpt {
    font-size: 15px;
    line-height: 1.6;
    color: #666666;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Meta */

.article-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #999999;
    padding-top: 16px;
    border-top: 1px solid #EEEEEE;
}

.card-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-meta-item svg {
    width: 16px;
    height: 16px;
    color: #999999;
}


/* ========================================
   SIMPLE ARTICLE HEADER (for article pages)
   ======================================== */
.article-header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.article-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-contrast);
    text-decoration: none;
    font-family: var(--font-heading);
}

.site-logo:hover {
    color: var(--color-accent-blue);
}

.main-nav {
    display: flex;
    gap: 30px;
}

.main-nav a {
    color: var(--color-contrast-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color var(--transition-fast);
}

.main-nav a:hover {
    color: var(--color-accent-blue);
}

/* Hero spacing from header */
.article-hero {
    margin-top: 8px;
}

/* ========================================
   BREADCRUMB
   ======================================== */
.breadcrumb {
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 20px 20px 0;
    font-size: 13px;
    color: #7a7a7a;
}

.breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #7a7a7a;
}

/* ========================================
   ARTICLE HEADER CONTENT
   ======================================== */
.article-header-content {
    margin-bottom: 50px;
}

.article-meta {
    margin-bottom: 40px;
}

/* ========================================
   RELATED ARTICLES SECTION
   ======================================== */
.related-articles {
    max-width: 1200px;
    margin: 80px auto;
    padding: 0 20px;
}

.related-articles h2 {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--color-contrast);
}

.related-articles .section-subtitle {
    font-size: 15px;
    color: #7a7a7a;
    margin-bottom: 30px;
}

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

.related-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-decoration: none;
    display: block;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.related-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px 12px 0 0;
}

.related-card-content {
    padding: 20px;
}

.related-card-title {
    font-size: 18px;
    margin: 0 0 10px;
    color: var(--color-contrast);
    line-height: 1.4;
}

.related-card-meta {
    font-size: 13px;
    color: var(--color-contrast-lighter);
}

/* ========================================
   SIMPLE ARTICLE FOOTER (Wirecutter style)
   ======================================== */
.article-footer {
    margin-top: 80px;
    padding: 40px 0;
    border-top: 1px solid #e5e5e5;
    background: #fafafa;
    text-align: center;
}

.footer-nav {
    margin-bottom: 18px;
}

.footer-nav a {
    color: #555;
    font-size: 15px;
    text-decoration: none;
    margin: 0 20px;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: #111;
}

.copyright {
    color: #999;
    font-size: 14px;
    margin: 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .article-header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-nav {
        gap: 20px;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .footer-nav {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}
