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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --text-color: #333;
    --light-gray: #ecf0f1;
    --border-color: #999;
    --bg-color: #DEE4E7;
    --photo-border: #000;
}

[data-theme="dark"] {
    --primary-color: #e0e0e0;
    --secondary-color: #b0b0b0;
    --accent-color: #5dade2;
    --text-color: #e0e0e0;
    --light-gray: #4a4a52;
    --border-color: #555;
    --bg-color: #37373F;
    --photo-border: #fff;
}

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

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header and Navigation */
header {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav {
    display: flex;
    gap: 2rem;
}

.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    border-color: var(--accent-color);
    transform: scale(1.1);
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--accent-color);
}

/* Hero Section */
.hero {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.hero-content {
    flex: 1;
}

.hero-photo {
    flex-shrink: 0;
}

.profile-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 3px solid var(--photo-border);
    transition: border-color 0.3s ease;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.intro {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

/* Sections */
section {
    margin-bottom: 3rem;
}

.hero-content .about,
.hero-content .recent-posts {
    margin-top: 2rem;
}

h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

/* Post List */
.post-list {
    list-style: none;
}

.post-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.post-list li:last-child {
    border-bottom: none;
}

.post-list a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.post-list a:hover {
    color: var(--accent-color);
}

.post-date {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-right: 1rem;
    display: inline-block;
    min-width: 100px;
}

/* Footer */
footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

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

.post-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.post-meta {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.post-content {
    line-height: 1.8;
}

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

.post-content h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.post-content iframe {
    margin: 1.5rem 0;
    max-width: 100%;
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem auto 0.5rem auto;
    display: block;
    cursor: zoom-in;
    transition: opacity 0.3s ease;
}

.post-content img:hover {
    opacity: 0.9;
}

.image-caption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-style: italic;
    margin: 0.5rem 0 1.5rem 0;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox img {
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    cursor: zoom-out;
}

.lightbox-caption {
    color: #fff;
    text-align: center;
    font-size: 1rem;
    font-style: italic;
    margin-top: 1rem;
    max-width: 90%;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    user-select: none;
}

.lightbox-close:hover {
    color: #ccc;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    gap: 1rem;
}

.post-navigation a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.post-navigation a:hover {
    text-decoration: underline;
}

.prev-post {
    text-align: left;
}

.next-post {
    text-align: right;
    margin-left: auto;
}

/* Blog List Styles */
.post-preview {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.post-preview:last-child {
    border-bottom: none;
}

.post-preview h2 {
    margin-bottom: 0.5rem;
}

.post-preview h2 a {
    color: var(--primary-color);
    text-decoration: none;
}

.post-preview h2 a:hover {
    color: var(--accent-color);
}

.post-excerpt {
    color: var(--secondary-color);
    margin-top: 0.5rem;
}

/* Photo Gallery Styles */
.photos-section h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.photos-intro {
    color: var(--secondary-color);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Album Cards Grid */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.album-card {
    background: var(--light-gray);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.album-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.album-cover {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.album-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    background: linear-gradient(110deg, var(--light-gray) 8%, #f0f0f0 18%, var(--light-gray) 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.album-cover-image[src] {
    animation: none;
    background: none;
}

.album-card:hover .album-cover-image {
    transform: scale(1.05);
}

.album-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.album-card:hover .album-overlay {
    opacity: 1;
}

.view-album {
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.album-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.album-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.album-description {
    color: var(--secondary-color);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.album-date {
    color: var(--secondary-color);
    font-size: 0.85rem;
    font-style: italic;
}

/* Individual Album Page */
.album .back-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.album .back-link:hover {
    text-decoration: underline;
}

.album-header {
    margin-bottom: 3rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.album-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 700;
    width: 100%;
}

.album-description-full {
    color: var(--text-color);
    font-size: 1.15rem;
    line-height: 1.8;
    max-width: 700px;
    width: 100%;
}

/* Photo Gallery within Albums */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: var(--light-gray);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    cursor: zoom-in;
    display: block;
    transition: opacity 0.3s ease;
    background: linear-gradient(110deg, var(--light-gray) 8%, #f0f0f0 18%, var(--light-gray) 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.gallery-image[src] {
    animation: none;
    background: none;
}

.gallery-image:hover {
    opacity: 0.9;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.gallery-caption {
    padding: 1rem;
    text-align: center;
    color: var(--text-color);
    font-size: 0.9rem;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        align-items: center;
    }

    .hero-content {
        text-align: center;
    }

    .hero-photo {
        order: -1;
        margin-bottom: 1.5rem;
    }

    .profile-photo {
        width: 150px;
        height: 150px;
    }

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

    .subtitle {
        font-size: 1rem;
    }

    .container {
        padding: 1rem;
    }

    .post-date {
        display: block;
        margin-bottom: 0.25rem;
    }
}
