:root {
    --article-max-width: 820px;
    --article-line-height: 1.8;
    --article-font-size: 17px;
    --sidebar-width: 320px;
    --accent-color: #e53935;
    --text-primary: #1a1a2e;
    --text-secondary: #64748b;
    --bg-subtle: #f8fafc;
    --border-color: #e2e8f0;
}

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), #ff6f61);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .reading-progress { transition: none; }
}

.article-breadcrumb {
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    font-size: 0.875rem;
}

.article-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.article-breadcrumb a:hover {
    color: var(--accent-color);
}

.article-hero {
    padding: 2.5rem 0 2rem;
}

.article-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.article-featured-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    max-height: 420px;
    margin-bottom: 2rem;
}

.article-featured-image img {
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

.article-featured-image.placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-featured-image.placeholder i {
    font-size: 3rem;
    color: rgba(255,255,255,0.5);
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 3rem;
    align-items: start;
}

@media (max-width: 991px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.article-content {
    max-width: var(--article-max-width);
}

.article-body {
    font-size: var(--article-font-size);
    line-height: var(--article-line-height);
    color: var(--text-primary);
}

.article-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    scroll-margin-top: 100px;
}

.article-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    color: var(--text-primary);
    scroll-margin-top: 100px;
}

.article-body p {
    margin-bottom: 1.25rem;
}

.article-body ul, .article-body ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body blockquote {
    border-left: 4px solid var(--accent-color);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--bg-subtle);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.article-body a {
    color: var(--accent-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}

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

.article-body pre, .article-body code {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 6px;
}

.article-body code {
    padding: 0.2rem 0.4rem;
    font-size: 0.9em;
}

.article-body pre {
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-body pre code {
    padding: 0;
    background: none;
}

.article-body table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
}

.article-body th, .article-body td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.article-body th {
    background: var(--bg-subtle);
    font-weight: 600;
}

.article-sidebar {
    position: sticky;
    top: 100px;
}

@media (max-width: 991px) {
    .article-sidebar {
        position: static;
        order: -1;
    }
}

.toc-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.toc-card h4,
.toc-card .toc-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-cta-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-list a {
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    padding: 0.35rem 0.75rem;
    border-left: 2px solid transparent;
    transition: all 0.2s;
    border-radius: 0 4px 4px 0;
}

.toc-list a:hover {
    color: var(--accent-color);
    background: var(--bg-subtle);
}

.toc-list a.active {
    color: var(--accent-color);
    border-left-color: var(--accent-color);
    background: rgba(229, 57, 53, 0.05);
    font-weight: 500;
}

.toc-list .toc-h3 {
    padding-left: 1.5rem;
    font-size: 0.85rem;
}

.toc-mobile {
    display: none;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

@media (max-width: 991px) {
    .toc-mobile { display: block; }
    .toc-card { display: none; }
}

.toc-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

.toc-mobile-header i {
    transition: transform 0.2s;
}

.toc-mobile.open .toc-mobile-header i {
    transform: rotate(180deg);
}

.toc-mobile-content {
    display: none;
    padding: 0 1.25rem 1rem;
}

.toc-mobile.open .toc-mobile-content {
    display: block;
}

.article-cta {
    background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin: 2.5rem 0;
    text-align: center;
}

.article-cta.inline {
    background: linear-gradient(135deg, #fef7f7 0%, #fff 100%);
    border-color: rgba(229, 57, 53, 0.2);
}

.article-cta h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.article-cta p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.article-cta .cta-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.article-cta .btn-cta-primary {
    background: var(--accent-color);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.article-cta .btn-cta-primary:hover {
    background: #c62828;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
}

.article-cta .btn-cta-secondary {
    background: #fff;
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.article-cta .btn-cta-secondary:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.share-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

.share-bar span {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.share-bar a, .share-bar button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.share-bar a:hover, .share-bar button:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.share-bar .copied {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

.related-posts {
    padding: 3rem 0;
    background: var(--bg-subtle);
    margin-top: 3rem;
}

.related-posts h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
}

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

@media (max-width: 991px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
}

.related-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.related-card-image {
    height: 160px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.related-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-card-body {
    padding: 1.25rem;
}

.related-card-body h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.related-card-body h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.related-card-body h3 a:hover {
    color: var(--accent-color);
}

.related-card-body p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.related-card-footer .date {
    color: var(--text-secondary);
}

.related-card-footer .read-more {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .fade-in {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
