/* === Article & Category Page Styles === */

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: var(--accent);
    z-index: 10000;
    transition: width 0.1s linear;
}

/* Article Hero */
.article-hero {
    padding: 120px 0 40px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--rule);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.article-cat {
    display: inline-block;
    padding: 4px 14px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    font-family: var(--sans);
}
.article-cat:hover { opacity: .85; }

.article-date,
.article-read {
    font-family: var(--sans);
    font-size: 13px;
    color: var(--muted);
}

.article-read::before {
    content: "·";
    margin-right: 16px;
}

.article-title {
    font-family: var(--serif);
    font-size: 44px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--fg);
    margin-bottom: 16px;
    max-width: 800px;
}

.article-subtitle {
    font-family: var(--serif);
    font-style: italic;
    font-size: 20px;
    color: var(--muted);
    line-height: 1.6;
    max-width: 700px;
}

/* Article Cover */
.article-cover {
    width: 100%;
    max-width: 960px;
    margin: 40px auto;
    aspect-ratio: 21/9;
    background: #E8E5DF;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--rule);
}
.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Article Container (Body + Sidebar) */
.article-container {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 60px;
    padding-top: 40px;
    padding-bottom: 80px;
    align-items: start;
}

/* Article Body */
.article-body {
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.9;
    color: var(--fg);
}

.article-body h2 {
    font-family: var(--serif);
    font-size: 26px;
    font-weight: 700;
    margin: 48px 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--rule);
    color: var(--fg);
}

.article-body h3 {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 16px;
    color: var(--fg);
}

.article-body p {
    margin-bottom: 24px;
    text-align: justify;
}

.article-body blockquote {
    border-left: 4px solid var(--accent);
    margin: 32px 0;
    padding: 24px 30px;
    background: var(--bg);
    font-style: italic;
    color: var(--muted);
    font-size: 19px;
}

.article-body blockquote p:last-child {
    margin-bottom: 0;
}

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

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

.article-body figure {
    margin: 40px 0;
    text-align: center;
}

.article-body figure img {
    max-width: 100%;
    border: 1px solid var(--rule);
    box-shadow: 0 4px 20px rgba(0,0,0,.04);
}

.article-body figcaption {
    font-family: var(--sans);
    font-size: 13px;
    color: var(--muted);
    margin-top: 12px;
    font-style: italic;
}

.article-body .key-point {
    background: rgba(68,140,134,.05);
    border-top: 3px solid var(--accent);
    padding: 24px 30px;
    margin: 32px 0;
}

.article-body .key-point strong {
    color: var(--accent-dark);
}

.article-body .data-highlight {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-family: var(--sans);
    font-weight: 700;
    color: var(--accent);
    font-size: 1.3em;
}

.article-body .article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--rule);
}

.article-body .article-tags a {
    padding: 6px 14px;
    background: var(--bg);
    border: 1px solid var(--rule);
    font-family: var(--sans);
    font-size: 12px;
    color: var(--muted);
    text-decoration: none;
    transition: all .2s;
}
.article-body .article-tags a:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(68,140,134,.05);
}

/* Article Sidebar */
.article-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-section {
    margin-bottom: 40px;
    padding: 24px;
    background: var(--bg);
    border: 1px solid var(--rule);
    border-top: 3px solid var(--accent);
}

.sidebar-section h4 {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--rule);
}

.related-link {
    display: block;
    padding: 16px 0;
    border-bottom: 1px dashed var(--rule);
    text-decoration: none;
    transition: all .2s;
}
.related-link:last-child { border-bottom: none; }
.related-link:hover { transform: translateX(4px); }

.related-link .related-cat {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
}

.related-link .related-title {
    font-family: var(--serif);
    font-size: 16px;
    color: var(--fg);
    font-weight: 600;
    line-height: 1.4;
    margin-top: 6px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag-cloud a {
    padding: 4px 12px;
    background: var(--card-bg);
    border: 1px solid var(--rule);
    font-family: var(--sans);
    font-size: 12px;
    color: var(--muted);
    text-decoration: none;
    transition: all .2s;
}
.tag-cloud a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Loading State */
.article-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--muted);
    font-family: var(--sans);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--rule);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Category Page === */
.cat-hero {
    padding: 120px 0 60px;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
}

.cat-title {
    font-family: var(--serif);
    font-size: 48px;
    font-weight: 800;
    color: var(--fg);
    margin: 12px 0 16px;
}

.cat-desc {
    font-family: var(--serif);
    font-style: italic;
    font-size: 18px;
    color: var(--muted);
    line-height: 1.6;
    max-width: 600px;
}

.cat-stats {
    display: flex;
    gap: 32px;
    margin-top: 24px;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--muted);
}
.cat-stats strong {
    color: var(--accent);
    font-weight: 600;
}

/* Category Grid */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
}

.cat-article-card {
    background: var(--card-bg);
    border: 1px solid var(--rule);
    overflow: hidden;
    transition: all .2s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}
.cat-article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,.06);
    border-color: var(--accent);
}

.cat-card-img {
    width: 100%;
    aspect-ratio: 16/9;
    background: #E8E5DF;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--rule);
}
.cat-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.cat-article-card:hover .cat-card-img img {
    transform: scale(1.05);
}

.cat-card-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 4px 10px;
    background: var(--accent);
    color: #fff;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.cat-card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cat-card-date {
    font-family: var(--sans);
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

.cat-card-title {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--fg);
    line-height: 1.4;
    margin-bottom: 12px;
}

.cat-card-excerpt {
    font-family: var(--serif);
    font-size: 15px;
    color: var(--muted);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cat-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed var(--rule);
}

.cat-card-read {
    font-family: var(--sans);
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
}

.cat-card-time {
    font-family: var(--sans);
    font-size: 12px;
    color: var(--muted);
}

/* Responsive */
@media (max-width: 900px) {
    .article-container {
        grid-template-columns: 1fr;
    }
    .article-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

@media (max-width: 600px) {
    .article-hero { padding: 100px 0 32px; }
    .article-title { font-size: 28px; }
    .article-body { font-size: 16px; }
    .article-sidebar {
        grid-template-columns: 1fr;
    }
    .cat-grid {
        grid-template-columns: 1fr;
    }
    .cat-hero { padding: 100px 0 40px; }
}
