/* Gallery Layout - Sidebar + Content */

.gallery-layout {
    display: flex;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    gap: 2rem;
    min-height: 100vh;
}

/* Sidebar */
.gallery-sidebar {
    position: fixed;
    left: max(2rem, calc((100% - 1200px) / 2 + 2rem));
    width: 180px;
    padding-top: calc(2.5vh + 2.75rem);
    padding-left: 2rem;
    top: 0;
    height: fit-content;
    z-index: 10;
}

.gallery-sidebar h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    font-weight: 400;
}

.gallery-sidebar h1 a {
    color: inherit;
    text-decoration: none;
}

.gallery-sidebar h1 a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.sidebar-posts {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.sidebar-posts li {
    margin: 0.4rem 0;
}

.sidebar-posts a {
    font-size: 1rem;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.5);
    text-decoration: none;
    transition: color 0.15s ease;
}

.sidebar-posts a:hover {
    color: rgba(0, 0, 0, 0.8);
}

.sidebar-nav ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 0.4rem 0;
}

.sidebar-nav a {
    font-size: 1rem;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.5);
    text-decoration: none;
    display: inline-block;
    padding: 0.125rem 0;
    transition: color 0.15s ease;
    width: 150px;
}

.sidebar-nav a:hover {
    color: rgba(0, 0, 0, 0.8);
}

.sidebar-nav a.active {
    color: inherit;
}

/* Main Content Area */
.gallery-content {
    flex: 1;
    margin-left: 220px;
    padding-top: 0px;
    padding-bottom: 0px;
    max-width: 700px;
}

/* Header with navigation */
.gallery-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.gallery-nav {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.nav-link {
    font-size: 1rem;
    font-weight: 400;
    color: #3498db;
    text-decoration: none;
    padding: 0;
    line-height: 1.5;
    transition: color 0.15s ease;
}

.nav-link:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.nav-link.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.nav-separator {
    font-size: 1rem;
    color: inherit;
    opacity: 0.5;
    line-height: 1.5;
}

.gallery-counter {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.5);
}

/* Quote text above image */
.gallery-quote {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: inherit;
    margin-bottom: 1.5rem;
    max-width: 600px;
}

/* Figure and image */
.gallery-figure {
    margin: 0;
}

.gallery-image-wrapper {
    margin-bottom: 1rem;
}

.gallery-image {
    max-width: 100%;
    max-height: 65vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.gallery-caption {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: inherit;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .sidebar-posts a {
        color: rgba(255, 255, 255, 0.5);
    }
    
    .sidebar-posts a:hover {
        color: rgba(255, 255, 255, 0.8);
    }
    
    .sidebar-nav a {
        color: rgba(255, 255, 255, 0.5);
    }
    
    .sidebar-nav a:hover {
        color: rgba(255, 255, 255, 0.8);
    }
    
    .sidebar-nav a.active {
        color: inherit;
    }
    
    .gallery-counter {
        color: rgba(255, 255, 255, 0.5);
    }
    
    .nav-link {
        color: #5dade2;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .gallery-layout {
        flex-direction: column;
        padding: 1.5rem 1rem;
        gap: 1.5rem;
    }
    
    .gallery-sidebar {
        position: relative;
        left: auto;
        width: 100%;
        padding-top: 2.5vh;
        padding-left: 0;
    }
    
    .gallery-sidebar h1 {
        margin-bottom: 1rem;
    }
    
    .sidebar-nav ul {
        display: flex;
        gap: 1.5rem;
    }
    
    .sidebar-nav li {
        margin: 0;
    }
    
    .gallery-content {
        margin-left: 0;
        padding-top: 0;
        max-width: 100%;
    }
    
    .gallery-image {
        max-height: 50vh;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .gallery-layout {
        padding: 1rem 0.75rem;
    }
    
    .gallery-sidebar {
        padding-top: 1.5vh;
    }
    
    .gallery-image {
        max-height: 45vh;
    }
    
    .gallery-quote {
        font-size: 0.95rem;
    }
    
    .gallery-caption {
        font-size: 0.95rem;
    }
}
