/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #fffbf5;
    --text-color: #2c2c2c;
    --accent-color: #1a1a1a;
    --border-color: #e0e0e0;
    --hover-color: #f5f5f5;
    --max-width: 1200px;
    --spacing: 2rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* Navigation */
.nav {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.nav-logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

.nav-link:hover {
    opacity: 0.7;
}

/* Main Content */
.main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero-title {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #666;
}

/* Sections */
.section {
    padding: 3rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 2rem;
    color: var(--accent-color);
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.post-card {
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.post-date {
    font-size: 0.875rem;
    color: #999;
    margin-bottom: 0.5rem;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--accent-color);
}

.post-excerpt {
    font-size: 1rem;
    color: #666;
    line-height: 1.5;
}

.post-tags {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: var(--hover-color);
    border-radius: 3px;
    color: var(--text-color);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

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

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

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
}

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

.lightbox.active {
    display: flex;
}

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

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
}

/* About Section */
.about-content {
    max-width: 700px;
    font-size: 1.125rem;
    line-height: 1.8;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    color: #666;
}

.footer a {
    color: var(--accent-color);
    text-decoration: none;
}

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

/* Post Page */
.post-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 var(--spacing);
}

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

.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.post-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.post-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.post-content p {
    margin-bottom: 1rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 2rem 0;
}

.post-content code {
    background: var(--hover-color);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

.post-content pre {
    background: var(--hover-color);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

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

/* Responsive */
@media (max-width: 768px) {
    :root {
        --spacing: 1rem;
    }

    .nav-menu {
        gap: 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.5rem;
    }
}
