/* Article Listing */
.article-list {
    margin: 2rem 0;
    display: grid;
    gap: 2rem;
}
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}
.article-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}
.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.article-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.article-card-content {
    padding: 1.5rem;
}
.article-card-content h2 {
    margin: 0 0 0.5rem;
    font-size: 1.6rem;
    text-align: left;
}
.article-preview-link {
    position: relative;
    display: block;
}
.article-preview-link:hover {
    text-decoration: none;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 0;
    font-size: 1.3rem;
    color: #666;
}
.article-meta > * {
    display: flex;
    align-items: center;
    gap: 6px;
}
.article-meta > * + *:not(script)::before {
    width: 2px;
    height: 2px;
    content: "";
    border-radius: 50%;
}
.article-meta .sep {
    margin: 0 4px;
}
.article-preview {
    background-size: cover;
    display: flex;
    flex-direction: column;
    grid-column: span 2;
    position: relative;
}
.article-preview h1 {
    font-size: clamp(2.3rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 0;
}
.article-preview-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.article-preview-title {
    color: #333;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}
.article-excerpt {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-top: 12px;
    max-width: 720px;
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
    -moz-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    color: #666;
    margin-bottom: 0.75rem;
    font-family: 'Lora', serif;
}
.article-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.read-more {
    display: inline-block;
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    margin-top: 0.5rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* Article Content */
.article-container {
    margin: 2rem auto;
    padding: 0 1rem;
}


.article-content {
    line-height: 1.7;
    color: #333;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin: 1.5em 0 1rem;
    line-height: 1.05;
    color: #222;
}

.article-content h1 { font-size: 2rem; text-align: left;}
.article-content h2 { font-size: 1.75rem; text-align: left;}
.article-content h3 { font-size: 1.5rem; text-align: left;}
.article-content h4 { font-size: 1.25rem; text-align: left;}
.article-content h5 { font-size: 1.1rem; text-align: left;}
.article-content h6 { font-size: 1rem; text-align: left;}

.article-content p {
    margin: 1rem 0;
    letter-spacing: 0.025em !important;
    font-family: 'Lora', serif;
    font-weight: 400;
    line-height: 1.6em;
}

.article-content ul {
    margin-left: 1rem;
    line-height: 1.6em;
}
.article-content ol {
    margin-left: 1rem;
    line-height: 1.6em;
}
.article-content li {
    margin: 0.5rem 0;
    letter-spacing: 0.025em !important;
    font-family: 'Lora', serif;
    font-weight: 400;
    line-height: 1.6em;
}
.article-content a {
    color: #007bff;
    text-decoration: none;
}

.article-content a:hover {
    text-decoration: underline;
}

.article-content code {
    background: #f5f5f5;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
}

.article-content pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

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

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

.article-content blockquote {
    border-left: 4px solid #ddd;
    padding: 0.5rem 0 0.5rem 1rem;
    margin: 1.5rem 0;
    color: #666;
    font-style: italic;
}

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

.article-content li {
    margin: 0.5rem 0;
}

/* Back link */
.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: #666;
    text-decoration: none;
    font-size: 0.95rem;
}

.back-link:hover {
    color: #333;
    text-decoration: underline;
}

/* Error message */
.error {
    text-align: center;
    padding: 4rem 1rem;
}

.error h1 {
    color: #dc3545;
    margin-bottom: 1rem;
}

.error p {
    margin-bottom: 2rem;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .article-content {
        font-size: 1rem;
    }
    
    .article-content h1 { font-size: 1.75rem; }
    .article-content h2 { font-size: 1.5rem; }
    .article-content h3 { font-size: 1.3rem; }
    .article-content h4 { font-size: 1.15rem; }
    .article-content h5 { font-size: 1.05rem; }
    .article-content h6 { font-size: 1rem; }
}

/* Tracking */
.tracking-tighter { letter-spacing: -0.05em; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }

@media (min-width: 1001px) {
    .article-preview-large {
        grid-column: span 6;
        display: grid;
        grid-gap: 4vmin;
        grid-template-columns: repeat(3, 1fr);
        border-top: 0;
    }

    .article-preview-large:not(.no-image) .article-preview-header {
        margin-top: 0;
    }

    .article-preview-large .article-preview-image-link {
        position: relative;
        grid-column: span 2;
        margin-bottom: 0;
    }

    .article-preview-large .article-preview-content {
        grid-column: span 1;
    }

    .article-preview-large.no-image .article-preview-content {
        grid-column: span 2;
    }

    .article-preview-large .article-preview-image {
        position: absolute;
        width: 100%;
        height: 100%;
    }

    .article-preview-large .article-preview-tags {
        margin-bottom: 12px;
    }

    .article-preview-large .article-excerpt {
        margin-top: 16px;
    }

    .article-preview-full {
        grid-column: span 6;
    }

    .article-preview-full .article-preview-image-link {
        margin-bottom: 40px;
    }

    .article-preview-full .article-preview-tags {
        margin-bottom: 14px;
    }

    .article-preview-full .article-excerpt {
        margin-top: 20px;
        font-size: 1.8rem;
    }

    .article-preview-large + .article-preview-large:nth-child(even) {
        margin: 32px 0;
    }

    .article-preview-large + .article-preview-large:nth-child(even) .article-preview-content {
        order: -1;
    }

    .post-card.dynamic {
        grid-column: span 3;
    }
}