:root {
    --bg-color: #1a1a1a;
    --text-color: #f0f0f0;
    --gap: 16px;
    --font-ui: 'Montserrat', sans-serif;
    --font-quote: 'Playfair Display', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-ui);
    min-height: 100vh;
    width: 100vw;
    padding: 2rem;
    overflow-x: hidden;
    overflow-y: auto;
    /* Allow scrolling */
}

/* Masonry Grid */
.gallery {
    column-count: 3;
    /* Default to 3 cols */
    column-gap: var(--gap);
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    break-inside: avoid;
    /* Prevent image breaking across columns */
    margin-bottom: var(--gap);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

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

/* Gallery Caption */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Dim other items on hover (if device supports hover) */
@media (hover: hover) {
    .gallery:hover .gallery-item:not(:hover) {
        opacity: 0.5;
        transition: opacity 0.3s ease;
    }

    .gallery-item:hover {
        opacity: 1;
        z-index: 2;
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Responsive Columns */
@media (max-width: 1024px) {
    .gallery {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .gallery {
        column-count: 1;
    }

    body {
        padding: 1rem;
    }
}

/* Lightbox */
.lightbox {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

/* Lightbox Wrapper */
.lightbox-wrapper {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-content {
    display: block;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-description {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    text-align: center;
    padding: 1.5rem 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    line-height: 1.5;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 1001;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Lightbox Navigation */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    padding: 0 1rem;
    z-index: 1002;
    transition: color 0.2s, transform 0.2s;
    user-select: none;
}

.nav-btn:hover {
    color: #bbb;
    transform: translateY(-50%) scale(1.1);
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

@media (max-width: 600px) {
    .nav-btn {
        font-size: 2rem;
        padding: 0 0.5rem;
    }

    .lightbox-description {
        font-size: 0.875rem;
        padding: 1rem 0.75rem;
    }
}

/* Header Styles */
.site-header {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-bottom: 2rem;
    animation: fadeIn 1s ease-out;
}

.header-content {
    text-align: center;
    max-width: 1200px;
    padding: 2rem 3rem;
    min-height: 140px;
    /* Prevent layout shift */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-content h1 {
    font-family: var(--font-quote);
    font-weight: 400;
    font-size: 1.8rem;
    line-height: 1.4;
    font-style: italic;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.95);
}

.header-content p {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@media (max-width: 600px) {
    .header-content {
        padding: 1.5rem;
    }

    .header-content h1 {
        font-size: 1.2rem;
    }
}

/* Search Styles */
.search-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 2rem;
    padding: 0 2rem;
}

#search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-ui);
    font-size: 1rem;
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#search-input:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.15);
}

.no-results {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 4rem 2rem;
    font-size: 1.1rem;
}

@media (max-width: 600px) {
    .search-container {
        padding: 0 1rem;
        margin-bottom: 1.5rem;
    }
}

/* Page Layout */
.page-layout {
    display: flex;
    gap: 2rem;
    max-width: 1800px;
    margin: 0 auto;
}

.sidebar {
    width: 200px;
    flex-shrink: 0;
}

.sidebar h2 {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1rem;
}

.album-list {
    list-style: none;
}

.album-item {
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: 6px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    transition: background-color 0.2s, color 0.2s;
}

.album-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.album-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-weight: 500;
}

.main-content {
    flex: 1;
    min-width: 0;
}

/* Adjust gallery max-width since it's now inside main-content */
.main-content .gallery {
    max-width: none;
}

.main-content .search-container {
    max-width: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

/* Mobile: Sidebar becomes horizontal pills */
@media (max-width: 900px) {
    .page-layout {
        flex-direction: column;
        gap: 1rem;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar h2 {
        display: none;
    }

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

    .album-item {
        padding: 0.5rem 1rem;
        margin-bottom: 0;
        background-color: rgba(255, 255, 255, 0.1);
        font-size: 0.85rem;
    }
}