/* CSS Reset and Base */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-alt: #f9fafb;
    --border: #e5e7eb;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.1);
    --max-width: 1200px;
    --content-width: 800px;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* Site Header */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.nav-brand:hover {
    text-decoration: none;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-light);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary);
    text-decoration: none;
}

/* Main Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Page Styles */
.page {
    max-width: var(--content-width);
    margin: 0 auto;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    margin: 0;
}

/* Featured/Hero Image */
.hero-image,
.featured-image {
    margin: 2rem 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.hero-image img,
.featured-image img {
    width: 100%;
    display: block;
}

/* Page Content */
.page-content {
    font-size: 1.125rem;
}

.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.page-content h1 { font-size: 2rem; }
.page-content h2 { font-size: 1.5rem; }
.page-content h3 { font-size: 1.25rem; }

.page-content p {
    margin: 1rem 0;
}

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

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

.page-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--bg-alt);
    border-left: 4px solid var(--primary);
    font-style: italic;
}

.page-content pre {
    background: var(--bg-alt);
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
}

.page-content code {
    background: var(--bg-alt);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

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

.page-content img {
    border-radius: var(--radius);
    margin: 1rem 0;
}

/* Blog Post Specific */
.blog-post .post-header {
    margin-bottom: 2rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--text-light);
    font-size: 0.9rem;
}

.tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: var(--bg-alt);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.post-summary {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--text-light);
}

.post-nav {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* Blog Listing */
.blog-listing .page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-item {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 1.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.post-thumbnail {
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/10;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-item-content h2 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
}

.post-item-content p {
    color: var(--text-light);
    margin: 0.5rem 0;
}

.post-item-content time {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.read-more {
    font-weight: 500;
}

/* Recent Posts Section (reusable) */
.section-recent-posts {
    margin: 3rem calc(-1 * (var(--max-width) - var(--content-width)) / 2);
    padding: 2rem 0;
    width: calc(var(--max-width));
    max-width: calc(100vw - 3rem);
}

.section-recent-posts__title {
    text-align: center;
    margin: 0 0 2rem;
    font-size: 1.75rem;
}

.section-recent-posts__more {
    text-align: center;
    margin-top: 2rem;
}

/* Cards style */
.section-recent-posts--cards .section-recent-posts__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.section-recent-posts--cards .section-recent-posts__item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.section-recent-posts--cards .section-recent-posts__item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.section-recent-posts--cards .section-recent-posts__image-link {
    display: block;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.section-recent-posts--cards .section-recent-posts__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.section-recent-posts--cards .section-recent-posts__item:hover .section-recent-posts__image {
    transform: scale(1.05);
}

.section-recent-posts--cards .section-recent-posts__content {
    padding: 1.25rem;
}

.section-recent-posts--cards .section-recent-posts__content h3 {
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
}

.section-recent-posts--cards .section-recent-posts__content p {
    color: var(--text-light);
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.section-recent-posts--cards .section-recent-posts__content time {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* List style */
.section-recent-posts--list .section-recent-posts__grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.section-recent-posts--list .section-recent-posts__item {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 1.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.section-recent-posts--list .section-recent-posts__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.section-recent-posts--list .section-recent-posts__image-link {
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/10;
}

.section-recent-posts--list .section-recent-posts__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.section-recent-posts--list .section-recent-posts__content h3 {
    font-size: 1.35rem;
    margin: 0 0 0.5rem;
}

.section-recent-posts--list .section-recent-posts__content p {
    color: var(--text-light);
    margin: 0.5rem 0;
}

.section-recent-posts--list .section-recent-posts__content time {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

/* Compact style */
.section-recent-posts--compact .section-recent-posts__grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.section-recent-posts--compact .section-recent-posts__item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.section-recent-posts--compact .section-recent-posts__item:first-child {
    border-top: 1px solid var(--border);
}

.section-recent-posts--compact .section-recent-posts__content {
    flex: 1;
}

.section-recent-posts--compact .section-recent-posts__content h3 {
    font-size: 1.1rem;
    margin: 0;
    display: inline;
}

.section-recent-posts--compact .section-recent-posts__content p {
    display: none;
}

.section-recent-posts--compact .section-recent-posts__content time {
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .section-recent-posts--cards .section-recent-posts__grid {
        grid-template-columns: 1fr;
    }

    .section-recent-posts--list .section-recent-posts__item {
        grid-template-columns: 1fr;
    }
}

.no-posts,
.no-items {
    text-align: center;
    color: var(--text-light);
    padding: 3rem;
}

/* Collection Listing */
.collection-listing .page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.collection-description {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: var(--content-width);
    margin: 1rem auto 0;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.collection-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.collection-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.collection-thumbnail {
    display: block;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--bg-alt);
}

.collection-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.collection-item:hover .collection-thumbnail img {
    transform: scale(1.05);
}

.collection-item-content {
    padding: 1.25rem;
}

.collection-item-content h2 {
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
}

.collection-item-content p {
    color: var(--text-light);
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

/* Active nav link */
.nav-links a.active {
    color: var(--primary);
}

/* Site Footer */
.site-footer {
    margin-top: 4rem;
    padding: 2rem 1.5rem;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

.footer-content p {
    margin: 0.5rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        gap: 1rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .post-item {
        grid-template-columns: 1fr;
    }

    .post-thumbnail {
        aspect-ratio: 16/9;
    }
}
