body {
    background: var(--bg-body) !important;
}

.gallery-layout {
    display: flex;
    gap: 30px;
    /* padding: 20px 5%; */
    margin-right: 80px;
}

/* Sidebar Styling */
.year-sidebar {
    width: 240px;
    min-width: 240px;
    background: #4F5F3A33;
    padding: 20px;
    border-radius: 8px;
    flex-shrink: 0;
}

.year-btn {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: none;
    background: #F6F3EC57;
    border-radius: 10px;
    transition: 0.3s;
    color: #4F5F3A;
}

.year-btn-browser {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: none;
    background: #F6F3ECCC;
    border-radius: 10px;
    transition: 0.3s;
    color: #4F5F3A;
}

.year-btn.active {
    background: #8B9474;
    /* Olive green from reference */
    color: white;
}

/* Filter Buttons */
.filter-btn {
    padding: 8px 20px;
    border-radius: 10px;
    border: 1px solid #00000080;
    margin-right: 10px;
}

.filter-btn.active {
    border: 1px solid #4F5F3A;
    background-color: #4F5F3A33;
}

/* Masonry Grid (Web) */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 200px;
    gap: 15px;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    border: 3px solid #F6F3EC;
    box-shadow:
        -2px 3px 9px 0px #0000001A,
        -7px 14px 15px 0px #00000017,
        -15px 31px 21px 0px #0000000D,
        -27px 56px 25px 0px #00000003,
        -42px 87px 27px 0px #00000000;
}

/* Custom Image Sizes */
.grid-item.tall {
    grid-row: span 2;
}

.grid-item.wide {
    grid-column: span 1;
}

.section-divider {
    padding: 20px 0;
    margin-bottom: 20px;
}

.category-name {
    font-family: var(--font-body);
    /* Or your heading font */
    font-size: 1.2rem;
    font-weight: 500;
    color: #2B2B2B;
    white-space: nowrap;
    /* Prevents text from breaking into two lines */
}

.section-divider hr {
    border: none;
    height: 1px;
    background-color: #8B9474;
    /* The olive green from your reference */
    opacity: 0.6;
    margin: 0;
    /* Reset default margins */
    margin-bottom: -10px;
}

.year-label {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: #8B9474;
    font-weight: 500;
}

/* -----------Divider----------- */
.title-wrapper {
    text-align: center;
}

.title-inner {
    display: inline-block;
}

.section-title {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 3rem;
    font-weight: 700;
}

.divider {
    margin-bottom: 50px;
    height: 1px;
    width: 100%;
    background: linear-gradient(90deg,
            rgba(192, 132, 61, 0) 0%,
            #C0843D 48.56%,
            rgba(192, 132, 61, 0) 100%);
}


#gallery-grid {
    transition: opacity 0.3s ease-in-out;
}

.grid-item {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure the content area takes up all remaining space */
.gallery-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Prevents flex items from overflowing */
}

/* Updated Divider to ensure it stretches fully */
.section-divider {
    display: flex;
    align-items: center;
    width: 100%;
    /* Forces the divider to span the full gallery-content width */
    padding: 20px 0;
    margin-bottom: 20px;
}

.section-divider hr {
    flex-grow: 1;
    /* This makes the line stretch to fill space */
    border: none;
    height: 1px;
    background-color: #8B9474;
    opacity: 0.6;
    margin: 0 15px;
    /* Adds consistent spacing between text and line */
    align-self: center;
}

/* Prevent the category name from shrinking */
.category-name {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 500;
    color: #2B2B2B;
    white-space: nowrap;
}

/* Ensure empty state message doesn't break layout */
.no-photos-message {
    width: 100%;
    padding: 40px 0;
    color: #575757;
    font-size: 1.1rem;
}

/* --- Mobile Responsiveness Adjustments --- */
@media (max-width: 992px) {
    body, html {
        overflow-x: hidden;
        max-width: 100%;
    }

    .section-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 1024px) {
    .gallery-layout {
        flex-direction: column;
        margin-right: 0;
        /* Reset desktop margin */
        padding: 0 15px;
    }

    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 180px;
        gap: 10px;
    }

    /* Target the container of filters to look cleaner on mobile */
    .filter-container {
        display: flex;
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
    }

    /* Year Select Styling */
    .year-select-mobile select {
        width: 100%;
        border-radius: 10px;
        border: 1px solid #ced4da;
        padding: 10px;
    }

    /* Event buttons on mobile: allow them to wrap or scroll */
    .event-filters {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        gap: 10px;
    }

    .event-filters label {
        display: none !important;
        /* Hide label to save space on mobile */
    }

    .filter-btn {
        white-space: nowrap;
        margin-right: 0;
    }

    /* --- FIXING THE DIVIDER FOR MOBILE (IMAGE 1 LOOK) --- */
    .section-divider {
        display: flex !important;
        /* Force flex even on mobile */
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin-top: 10px;
    }

    .section-divider hr {
        display: block !important;
        /* RE-ENABLE THE LINE */
        flex-grow: 1;
        margin: 0 10px;
        border: none;
        height: 1px;
        background-color: #8B9474;
        opacity: 0.4;
        margin-bottom: 0 !important;
        /* Remove the offset you have on desktop */
    }

    .category-name {
        font-size: 1rem;
        font-weight: 600;
    }

    .year-label {
        font-size: 0.9rem;
    }
}

/* --- Mobile View Adjustments (Screens smaller than 1024px) --- */
@media (max-width: 1024px) {

    /* 1. Fix the Divider Line to stretch like Image 1 */
    .section-divider {
        display: flex !important;
        /* Force flexbox on mobile */
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin: 25px 0;
    }

    .section-divider hr {
        display: block !important;
        /* Show the line */
        flex-grow: 1;
        height: 1px;
        border: none;
        background-color: #8B9474;
        /* Olive green line */
        opacity: 0.4;
        margin: 0 15px;
        /* Spacing between text and line */
        margin-bottom: 0 !important;
        /* Fix desktop offset */
    }

    /* 2. Style the Dropdown and Selected Option */
    .year-select-mobile select {
        width: 100%;
        border-radius: 10px;
        border: 1px solid #4F5F3A80;
        padding: 12px;
        color: #4F5F3A;
        /* Text color */
        background-color: #fff;
        font-weight: 500;
        outline: none;
    }

    /* Sets the color of the text inside the dropdown list */
    .year-select-mobile select option {
        color: #333;
        background-color: #fff;
    }

    /* Style for the select when focused */
    .year-select-mobile select:focus {
        border-color: #4F5F3A;
        box-shadow: 0 0 0 2px rgba(79, 95, 58, 0.2);
    }

    /* 3. Event Filter Buttons on Mobile */
    .event-filters {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        /* Allow side-scrolling if buttons are long */
        padding-bottom: 5px;
        margin-top: 10px;
    }

    .filter-btn {
        flex: 0 0 auto;
        /* Prevent buttons from shrinking */
        font-size: 0.9rem;
        padding: 8px 16px;
    }
}

/* --------------------Drop Down------------------------------ */
.custom-select-wrapper {
    position: relative;
}
.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #4F5F3A80;
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
    font-size: 0.95rem;
    color: #4F5F3A;
    font-weight: 500;
    user-select: none;
}
.custom-select-trigger i {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}
.custom-select-wrapper.open .custom-select-trigger i {
    transform: rotate(180deg);
}
.custom-select-options {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    list-style: none;
    padding: 6px 0;
    margin: 0;
    z-index: 999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.custom-select-wrapper.open .custom-select-options {
    display: block;
}
.custom-select-options li {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    transition: background 0.15s;
}
.custom-select-options li:hover {
    background-color: #f0f4ea;
    color: #4F5F3A;
}
.custom-select-options li.selected {
    background-color: #95a77d;
    font-weight: 600;
}