/* Gallery + Filters Container */
.gallery-filters-container {
    display: flex;
    gap: 20px;
    max-width: 95%;
    margin: 0 auto 40px auto;
}

/* Gallery Container - Masonry layout */
#gallery-container {
    flex: 1;
    column-count: 3;
    column-gap: 15px;
    width: 100%;
}

/* Filters Sidebar */
.filters-sidebar {
    flex: 0 0 250px;
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    height: fit-content;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    position: sticky;
    top: 20px;
}

/* Red scrollbar for general sidebar */
.filters-sidebar::-webkit-scrollbar {
    width: 10px;
}

.filters-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.filters-sidebar::-webkit-scrollbar-thumb {
    background: #f44336;
    border-radius: 5px;
}

.filters-sidebar::-webkit-scrollbar-thumb:hover {
    background: #d32f2f;
}

/* Firefox red scrollbar */
.filters-sidebar {
    scrollbar-width: thin;
    scrollbar-color: #f44336 #f1f1f1;
}

.filters-sidebar h3 {
    color: #333;
    font-weight: 400;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.filters-sidebar h4 {
    color: #4CAF50;
    font-weight: 400;
    margin-bottom: 10px;
    margin-top: 0;
    font-size: 1em;
    position: sticky;
    top: 0;
    background-color: #f9f9f9;
    z-index: 10;
    padding-top: 12px;
    padding-bottom: 5px;
}

.filter-section {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 12px;
    padding-top: 0;
    margin-bottom: 15px;
    max-height: 450px;
    overflow-y: auto;
}

/* Green scrollbar for filter boxes */
.filter-section::-webkit-scrollbar {
    width: 8px;
}

.filter-section::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.filter-section::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 4px;
}

.filter-section::-webkit-scrollbar-thumb:hover {
    background: #45a049;
}

/* Firefox green scrollbar */
.filter-section {
    scrollbar-width: thin;
    scrollbar-color: #4CAF50 #f1f1f1;
}

/* Filter buttons */
.filter-btn {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    background-color: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-align: left;
    font-family: 'Nunito Sans', Arial, sans-serif;
}

.filter-btn:hover {
    background-color: #e8e8e8;
    border-color: #4CAF50;
}

.filter-btn.active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* Reset filters button */
.reset-filters-btn {
    width: 100%;
    padding: 10px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    font-family: 'Nunito Sans', Arial, sans-serif;
    margin-top: 10px;
    margin-bottom: 15px;
}

/* First reset button (at top) has no margin-top */
.filters-sidebar > .reset-filters-btn:first-of-type {
    margin-top: 0;
}

.reset-filters-btn:hover {
    background-color: #d32f2f;
}

/* Gallery Item */
.gallery-item {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s;
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
    width: 100%;
    break-inside: avoid;
}

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

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

/* Image description under photo */
.image-description {
    padding: 10px;
    font-size: 14px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    min-height: 40px;
    text-align: center;
    color: #333;
}

/* Tooltip on hover */
.image-tooltip {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 10px;
    border-radius: 5px 5px 0 0;
    z-index: 10;
    font-size: 12px;
    line-height: 1.6;
    max-width: 100%;
    max-height: 80%;
    overflow-y: auto;
    box-sizing: border-box;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    opacity: 0.95;
    pointer-events: none;
    display: none;
    text-align: left;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    #gallery-container {
        column-count: 2;
    }
    
    .gallery-filters-container {
        flex-direction: column;
    }
    
    .filters-sidebar {
        flex: 1;
        position: relative;
        top: 0;
        max-height: none;
    }
    
    .filter-section {
        max-height: 500px;
    }
}

@media (max-width: 768px) {
    #gallery-container {
        column-count: 1;
    }
    
    .filters-sidebar {
        padding: 15px;
    }
    
    .gallery-filters-container {
        max-width: 98%;
    }
    
    .filter-section {
        max-height: 550px;
    }
}

@media (max-width: 480px) {
    .filter-btn {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .filters-sidebar h3 {
        font-size: 1.1em;
    }
    
    .filters-sidebar h4 {
        font-size: 0.95em;
    }
}

/* Content space adapted for Ethiopian portraits page */
main .content-space {
    min-height: auto;
}

/* Banner specific for Ethiopian portraits */
.banner {
    background-image: url('Images/20020409-banner-Shahura-2543x659-© Daniel Mège.jpg') !important;
}

/* Banner text position - 33% from top */
.banner-text {
    position: absolute;
    top: 10% !important;
    bottom: auto !important;
    left: 40px;
    max-width: 75%;
    background: transparent;
    color: white;
    padding: 25px 50px;
    font-size: 2em;
    text-align: left;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Align content-space with back button and gallery */
main .content-space {
    max-width: 95%;
    margin-left: auto;
    margin-right: auto;
    padding: 20px;
}

/* High resolution button */
.high-res-button {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Nunito Sans', Arial, sans-serif;
    transition: background-color 0.3s;
}

.high-res-button:hover {
    background-color: #45a049;
}

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

/* Lightbox image */
.lightbox-image {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    cursor: default;
}

/* Lightbox close button */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    font-family: Arial, sans-serif;
    line-height: 1;
    transition: opacity 0.3s;
}

.lightbox-close:hover {
    opacity: 0.7;
}

/* Prevent body scroll when lightbox is open */
body:has(.lightbox) {
    overflow: hidden;
}
