
/* =========================================
   GALLERY SECTION
========================================= */

.gallery-section {
    padding: 80px 0;
    background: #ffffff;
    font-family: "Montserrat", sans-serif;
}

.gallery-section .container-fluid {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 35px;
}

/* Section heading */

.gallery-heading {
    margin-bottom: 45px;
    text-align: center;
}

.gallery-eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    color: #6b9f2b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.gallery-heading h2 {
    margin: 0 0 12px;
    color: #17231b;
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 700;
    font-family: "Montserrat", sans-serif;
    line-height: 1.2;
}

.gallery-heading p {
    max-width: 620px;
    margin: 0 auto;
    color: #68736b;
    font-size: 15px;
    line-height: 1.8;
}

/* Main layout */

.gallery-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
    gap: 32px;
}

/* =========================================
   SIDEBAR
========================================= */

.gallery-sidebar {
    position: sticky;
    top: 25px;
    padding: 22px 16px;
    background: #f8fbf5;
    border: 1px solid #e5eedc;
    border-radius: 14px;
}

.sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 0 5px 15px;
    border-bottom: 1px solid #e3ebdc;
}

.sidebar-heading h3 {
    margin: 0;
    color: #17231b;
    font-size: 17px;
    font-weight: 700;
    font-family: "Montserrat", sans-serif;
}

.category-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #315d1b;
    background: #e8f4dc;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.gallery-filters {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.gallery-filter {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 11px 12px;
    color: #465247;
    background: transparent;
    border: 0;
    border-radius: 7px;
    text-align: left;
    font-family: "Montserrat", sans-serif;;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease,
                transform 0.25s ease;
}

.gallery-filter:hover {
    color: #315d1b;
    background: #edf5e6;
}

.gallery-filter.active {
    color: #ffffff;
    background: #a5dc4c;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(111, 157, 45, 0.16);
}

.gallery-filter:focus-visible {
    outline: 3px solid rgba(165, 220, 76, 0.45);
    outline-offset: 2px;
}

/* =========================================
   GALLERY TOOLBAR
========================================= */

.gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.gallery-toolbar h3 {
    margin: 0 0 5px;
    color: #17231b;
    font-size: 20px;
    font-weight: 700;
    font-family: "Montserrat", sans-serif;
}

.gallery-toolbar p {
    margin: 0;
    color: #89928a;
    font-size: 12px;
}

/* =========================================
   GALLERY GRID
========================================= */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.gallery-card {
    min-width: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #edf0e9;
    border-radius: 13px;
    box-shadow: 0 5px 20px rgba(25, 45, 20, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease,
                border-color 0.3s ease;
    animation: galleryFadeIn 0.35s ease both;
}

.gallery-card:hover {
    transform: translateY(-5px);
    border-color: #d5e8bf;
    box-shadow: 0 12px 28px rgba(25, 45, 20, 0.11);
}

/* Image */

.gallery-image {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f1f4ee;
}

.gallery-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-image img {
    transform: scale(1.06);
}

.gallery-image-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 35, 20, 0.35);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Hover arrow overlay disabled
.gallery-card:hover .gallery-image-overlay,
.gallery-image:focus-visible .gallery-image-overlay {
    opacity: 1;
}
*/

.gallery-view-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #1d2a18;
    background: #a5dc4c;
    border-radius: 50%;
    font-size: 22px;
    font-weight: 600;
}

/* Card content */

.gallery-card-content {
    padding: 18px 18px 20px;
}

.gallery-card-category {
    display: block;
    margin-bottom: 7px;
    color: #6c9d32;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.gallery-card-content h4 {
    margin: 0;
    color: #202a22;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
    font-family: "Montserrat", sans-serif;
}

/* Hidden items */

.gallery-card[hidden] {
    display: none !important;
}

/* Empty state */

.gallery-empty {
    padding: 65px 20px;
    text-align: center;
    background: #f8fbf5;
    border: 1px dashed #d7e6c9;
    border-radius: 14px;
}

.gallery-empty[hidden] {
    display: none !important;
}

.empty-icon {
    display: block;
    margin-bottom: 12px;
    color: #80b83c;
    font-size: 42px;
}

.gallery-empty h4 {
    margin: 0 0 8px;
    color: #202a22;
    font-size: 18px;
}

.gallery-empty p {
    margin: 0 0 18px;
    color: #768074;
    font-size: 13px;
}

.reset-gallery {
    padding: 10px 18px;
    color: #203018;
    background: #a5dc4c;
    border: 0;
    border-radius: 6px;
    font-family: "Montserrat", sans-serif;;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.25s ease;
}

.reset-gallery:hover {
    background: #91c83a;
}

/* Animation */

@keyframes galleryFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1199px) {
    .gallery-layout {
        grid-template-columns: 230px minmax(0, 1fr);
        gap: 24px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .gallery-section {
        padding: 55px 0;
    }

    .gallery-section .container-fluid {
        padding: 0 18px;
    }

    .gallery-heading {
        margin-bottom: 30px;
    }

    .gallery-layout {
        /* minmax(0, 1fr): plain 1fr can't shrink below the nowrap
           filter row's width, which stretched the page to ~2000px */
        grid-template-columns: minmax(0, 1fr);
        gap: 25px;
    }

    .gallery-sidebar,
    .gallery-main {
        min-width: 0;
    }

    .gallery-sidebar {
        position: static;
        padding: 16px;
    }

    .sidebar-heading {
        margin-bottom: 12px;
    }

    .gallery-filters {
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        padding: 2px 2px 8px;
        scrollbar-width: thin;
    }

    .gallery-filter {
        flex: 0 0 auto;
        width: auto;
        min-height: 38px;
        padding: 9px 14px;
        white-space: nowrap;
        font-size: 12px;
    }

    .gallery-toolbar {
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .gallery-image {
        aspect-ratio: 16 / 10;
    }

    .gallery-card-content {
        padding: 15px 16px 17px;
    }

    .gallery-heading p {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-card,
    .gallery-card *,
    .gallery-filter {
        animation: none !important;
        transition: none !important;
    }
}
