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

:root {
    --bg: #ffffff;
    --text: #1a1a1a;
    --text-secondary: #666;
    --border: #e0e0e0;
    --accent: #0066cc;
    --code-bg: #f5f5f5;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1a1a;
        --text: #e0e0e0;
        --text-secondary: #999;
        --border: #333;
        --accent: #4a9eff;
        --code-bg: #2a2a2a;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 750px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header & Navigation */
header {
    margin-bottom: 4rem;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.home-link {
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    color: var(--text);
}

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

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

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

/* Typography */
h1 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.75rem;
    margin: 2.5rem 0 1rem;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.3rem;
    margin: 2rem 0 0.75rem;
    line-height: 1.4;
    font-weight: 600;
}

p {
    margin-bottom: 1.25rem;
}

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

a:hover {
    text-decoration: underline;
}

/* Intro Section */
.intro {
    font-size: 1.15rem;
    line-height: 1.75;
}

.intro img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 3px solid var(--border);
}

@media (prefers-color-scheme: dark) {
    .intro img {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

.intro p:first-of-type {
    margin-top: 0;
}

.intro p:last-child {
    margin-top: 2rem;
}

/* Blog List */
.post-list {
    list-style: none;
    margin-top: 2rem;
}

.post-list li {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: baseline;
}

.post-date {
    color: var(--text-secondary);
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    min-width: 6rem;
}

.post-list a {
    color: var(--text);
    font-weight: 500;
}

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

/* Photo Gallery & Albums */
.subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-style: italic;
}

/* Albums Grid (Gallery Page) - Moved below to consolidate with photo-grid styles */

/* Album info - base styles moved to .album-card .album-info below */

/* Individual Album Page */
.album-header {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.album-header h1 {
    margin-bottom: 0.75rem;
}

.album-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.album-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.album-description {
    margin-top: 1.25rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 65ch;
}

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

.album-nav a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.album-nav a:hover {
    color: var(--text);
}

/* Photo Grid (Inside Album) */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.photo-item {
    position: relative;
    overflow: hidden;
}

.photo-item a {
    display: block;
    position: relative;
}

.photo-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 3/2;
    object-fit: cover;
    display: block;
    transition: filter 0.4s ease;
    cursor: pointer;
}

.photo-item a:hover img {
    filter: brightness(0.75);
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem 1rem 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

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

.photo-meta {
    display: none;
}

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

.album-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.album-card a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.album-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.85);
    transition: filter 0.4s ease;
}

.album-card:hover img {
    filter: brightness(0.6);
}

.album-card .album-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem 1.25rem 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    color: white;
}

.album-card .album-info h3 {
    font-size: 1.3rem;
    font-weight: 500;
    margin: 0 0 0.2rem;
    color: white;
    line-height: 1.2;
}

.album-card .album-location,
.album-card .album-date {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

.album-card .photo-count {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    margin-top: 0.3rem;
    line-height: 1.3;
    margin-bottom: 0.3rem;
}

/* Article Content */
article {
    margin-bottom: 4rem;
}

.meta {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.content {
    line-height: 1.75;
    font-size: 1.05rem;
}

.content ul, .content ol {
    margin-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.content li {
    margin-bottom: 0.5rem;
}

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

/* Code Blocks */
pre {
    background: var(--code-bg);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
}

p code {
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

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

/* Lightbox Gallery */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.lightbox.active {
    display: block;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(10, 10, 10);
}

.lightbox-layout {
    position: relative;
    z-index: 10;
    display: flex;
    height: 100vh;
    width: 100%;
}

.lightbox-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-width: 0;
}

.lightbox-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    overflow: hidden;
}

.lightbox-image {
    max-width: 100%;
    max-height: calc(100vh - 6rem);
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
}

.lightbox-image:active {
    cursor: grabbing;
}

.lightbox-sidebar {
    width: 380px;
    background: rgb(18, 18, 18);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 11;
}

.lightbox-sidebar-content {
    padding: 2.5rem 2rem;
}

.lightbox-close {
    position: fixed;
    top: 1.5rem;
    right: 400px;
    z-index: 12;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: rgba(255, 255, 255, 0.9);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 11;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 2.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    padding-bottom: 0.2rem;
    transition: color 0.2s;
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    color: rgba(255, 255, 255, 0.9);
}

.lightbox-caption {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: white;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.lightbox-description {
    font-size: 0.9rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

.lightbox-exif {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.exif-item {
    margin: 0.6rem 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

.exif-item:first-child {
    margin-top: 0;
}

.exif-item:last-child {
    margin-bottom: 0;
}

.exif-item strong {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.15rem;
}

.lightbox-map {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1.5rem;
}

.map-header {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.map-coords {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    margin-top: 0.3rem;
}

.map-links {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.map-links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.2s;
}

.map-links a:hover {
    color: rgba(255, 255, 255, 0.9);
}

.map-links span {
    color: rgba(255, 255, 255, 0.25);
    margin: 0 0.4rem;
}

.lightbox-counter {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.lightbox-hint {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 12;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1.5rem 1rem;
    }
    
    nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .post-list li {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .post-date {
        min-width: auto;
    }
    
    .photo-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .photo-caption {
        opacity: 1;
        padding: 2rem 0.75rem 0.75rem;
        font-size: 0.9rem;
    }

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

    .album-card .album-info {
        padding: 2.5rem 1rem 0.75rem;
    }

    .album-card .album-info h3 {
        font-size: 1.1rem;
    }

    /* Lightbox responsive */
    .lightbox-layout {
        flex-direction: column;
    }

    .lightbox-main {
        height: 50vh;
    }

    .lightbox-sidebar {
        width: 100%;
        height: 50vh;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .lightbox-sidebar-content {
        padding: 1.5rem;
    }

    .lightbox-image-container {
        padding: 1rem;
    }

    .lightbox-image {
        max-height: calc(50vh - 2rem);
    }

    .lightbox-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 40px;
        height: 40px;
        font-size: 1.75rem;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 2rem;
        top: 25vh;
    }

    .lightbox-prev {
        left: 0.5rem;
    }

    .lightbox-next {
        right: 0.5rem;
    }

    .lightbox-hint {
        display: none;
    }

    .lightbox-counter {
        bottom: auto;
        top: calc(50vh - 2rem);
        font-size: 0.75rem;
    }

    .lightbox-caption {
        font-size: 1rem;
    }

    .lightbox-description {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }

    .lightbox-exif,
    .lightbox-map {
        padding-top: 1.25rem;
    }
}

/* Tablet responsive */
@media (max-width: 1024px) and (min-width: 601px) {
    .lightbox-sidebar {
        width: 320px;
    }

    .lightbox-close {
        right: 340px;
    }
}