.sm-gallery {
    --sm-gallery-gap: 16px;
    --sm-gallery-radius: 22px;
    --sm-gallery-border: rgba(103, 122, 48, .10);
    --sm-gallery-shadow: 0 14px 34px rgba(73, 61, 36, .08);
    --sm-gallery-bg: #fff;
    --sm-gallery-accent: #6b8d1f;
    --sm-gallery-accent-2: #cf5b1e;
    --sm-gallery-text: #2d2a23;
    --sm-gallery-muted: #6e6758;
    position: relative;
}

.sm-gallery__head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.sm-gallery__head--empty {
    display: none;
}

.sm-gallery__title {
    margin: 0;
}

.sm-gallery__subtitle {
    max-width: 860px;
    color: var(--sm-gallery-muted);
    font-size: 14px;
    line-height: 1.6;
}

.sm-gallery__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--sm-gallery-gap);
}

.sm-gallery__item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--sm-gallery-radius);
    background: var(--sm-gallery-bg);
    box-shadow: var(--sm-gallery-shadow);
    border: 1px solid var(--sm-gallery-border);
    text-decoration: none;
    transform: translateZ(0);
}

.sm-gallery__item::before {
    content: "";
    display: block;
    padding-top: 74%;
}

.sm-gallery__media {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.sm-gallery__media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .45s ease, filter .35s ease;
}

.sm-gallery__item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(26,26,26,0) 45%, rgba(26,26,26,.18) 100%);
    opacity: 0;
    transition: opacity .35s ease;
    pointer-events: none;
}

.sm-gallery__zoom {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.92);
    color: var(--sm-gallery-accent-2);
    box-shadow: 0 8px 18px rgba(0,0,0,.12);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .35s ease, transform .35s ease, background .35s ease;
}

.sm-gallery__zoom svg {
    width: 20px;
    height: 20px;
    display: block;
}

.sm-gallery__item:hover .sm-gallery__media img,
.sm-gallery__item:focus-visible .sm-gallery__media img {
    transform: scale(1.06);
    filter: saturate(1.04);
}

.sm-gallery__item:hover::after,
.sm-gallery__item:focus-visible::after,
.sm-gallery__item:hover .sm-gallery__zoom,
.sm-gallery__item:focus-visible .sm-gallery__zoom {
    opacity: 1;
}

.sm-gallery__item:hover .sm-gallery__zoom,
.sm-gallery__item:focus-visible .sm-gallery__zoom {
    transform: translateY(0);
}

.sm-gallery__item:focus-visible {
    outline: 2px solid rgba(107, 141, 31, .45);
    outline-offset: 3px;
}

.sm-gallery__actions {
    display: flex;
    justify-content: center;
    margin-top: 22px;
}

.sm-gallery__more {
    min-width: 190px;
    padding: 14px 28px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--sm-gallery-accent-2) 0%, #e16c2a 100%);
    color: #fff;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(207, 91, 30, .24);
    transition: transform .25s ease, box-shadow .25s ease, opacity .25s ease;
}

.sm-gallery__more:hover,
.sm-gallery__more:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(207, 91, 30, .28);
}

.sm-gallery__empty {
    padding: 22px 24px;
    border-radius: var(--sm-gallery-radius);
    background: #f5f2e8;
    color: var(--sm-gallery-text);
    border: 1px solid rgba(107, 141, 31, .08);
}

@media (max-width: 1199.98px) {
    .sm-gallery__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .sm-gallery {
        --sm-gallery-gap: 12px;
    }

    .sm-gallery__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sm-gallery__zoom {
        width: 36px;
        height: 36px;
        right: 10px;
        bottom: 10px;
        opacity: 1;
        transform: none;
    }

    .sm-gallery__item::after {
        opacity: 1;
    }

    .sm-gallery__subtitle {
        font-size: 13px;
    }
}
