
.gallery-filter-section {
    padding-top: 38px;
    padding-bottom: 10px;
}

.gallery-filter-heading,
.gallery-results-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 17px;
}

.gallery-filter-heading h2,
.gallery-results-heading h2 {
    margin: 0;
    font-size: clamp(25px, 3vw, 33px);
    line-height: 1.15;
}

.gallery-clear-filter {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #c9ddd3;
    border-radius: 999px;
    background: #f4f9f6;
    color: #0b7049;
    font-size: 13px;
    font-weight: 800;
}

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

.gallery-category-card {
    position: relative;
    display: grid;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dce6e1;
    border-radius: 13px;
    background: #fff;
    color: #14251e;
    box-shadow: 0 7px 24px rgba(24,57,42,.045);
    transition:
        transform .18s ease,
        border-color .18s ease,
        box-shadow .18s ease,
        opacity .18s ease;
}

.gallery-category-card:hover {
    transform: translateY(-3px);
    border-color: #afd2c0;
    box-shadow: 0 15px 30px rgba(24,57,42,.09);
}

.gallery-category-card.is-active {
    border: 2px solid #087448;
    box-shadow: 0 16px 34px rgba(8,116,72,.14);
}

.gallery-category-card.is-empty:not(.is-active) {
    opacity: .58;
}

.gallery-category-card__media {
    display: block;
    aspect-ratio: 16 / 8.5;
    overflow: hidden;
    background: #edf3f0;
}

.gallery-category-card__media > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.gallery-category-card:hover .gallery-category-card__media > img {
    transform: scale(1.035);
}

.gallery-category-card__placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
}

.gallery-category-card__placeholder img {
    width: 72px;
    opacity: .4;
}

.gallery-category-card__body {
    display: grid;
    gap: 2px;
    padding: 14px 15px 15px;
}

.gallery-category-card__body strong {
    overflow: hidden;
    font-size: 15px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-category-card__body small {
    color: #748078;
    font-size: 12px;
}

.gallery-category-card__active {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 8px;
    border-radius: 999px;
    background: #087448;
    color: #fff;
    font-size: 10px;
    font-weight: 850;
}

.gallery-filter-mobile {
    display: none;
}

.gallery-year-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding: 15px 17px;
    border: 1px solid #dce6e1;
    border-radius: 12px;
    background: #f7faf8;
}

.gallery-year-form {
    display: flex;
    align-items: end;
    gap: 10px;
}

.gallery-year-form label {
    display: grid;
    gap: 5px;
}

.gallery-year-form label > span {
    color: #53665d;
    font-size: 12px;
    font-weight: 800;
}

.gallery-year-form select {
    min-width: 245px;
    height: 41px;
    padding: 0 38px 0 12px;
    border: 1px solid #c8d8d0;
    border-radius: 8px;
    background: #fff;
    color: #172820;
    font: inherit;
}

.gallery-year-form button {
    height: 41px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: #087448;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.gallery-active-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.gallery-active-filters a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid #bdd8ca;
    border-radius: 999px;
    background: #fff;
    color: #176b4b;
    font-size: 12px;
    font-weight: 750;
}

.gallery-active-filters a span {
    font-size: 16px;
    line-height: 1;
}

.gallery-results-section {
    padding-top: 34px;
}

.gallery-results-count {
    color: #738078;
    font-size: 13px;
    font-weight: 750;
}

@media (max-width: 950px) {
    .gallery-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-year-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .gallery-active-filters {
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .gallery-filter-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .gallery-category-grid {
        display: none;
    }

    .gallery-filter-mobile {
        display: flex;
        max-width: 100%;
        gap: 8px;
        padding-bottom: 7px;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .gallery-filter-mobile a {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 7px;
        padding: 9px 11px;
        border: 1px solid #d2dfd8;
        border-radius: 999px;
        background: #fff;
        color: #3d584d;
        font-size: 13px;
        font-weight: 750;
    }

    .gallery-filter-mobile a span {
        display: inline-grid;
        min-width: 22px;
        height: 22px;
        place-items: center;
        border-radius: 999px;
        background: #edf3f0;
        font-size: 11px;
    }

    .gallery-filter-mobile a.is-active {
        border-color: #087448;
        background: #087448;
        color: #fff;
    }

    .gallery-filter-mobile a.is-active span {
        background: rgba(255,255,255,.18);
    }

    .gallery-year-panel,
    .gallery-year-form {
        align-items: stretch;
    }

    .gallery-year-form {
        width: 100%;
        flex-direction: column;
    }

    .gallery-year-form select {
        width: 100%;
        min-width: 0;
    }

    .gallery-results-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
}
