.itsmf-event-gallery-grid {
    display: grid;
    gap: 24px;
}

.itsmf-event-gallery-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.itsmf-event-gallery-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.itsmf-event-gallery-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.itsmf-event-gallery-card {
    position: relative;
    overflow: hidden;
    min-height: var(--itsmf-event-gallery-card-height, 260px);
    background: #111;
    /*border-radius: 8px;*/
    isolation: isolate;
}

.itsmf-event-gallery-card-link {
    display: block;
    position: relative;
    min-height: var(--itsmf-event-gallery-card-height, 260px);
    color: var(--itsmf-event-gallery-title-color, #fff);
    text-decoration: none;
    outline-offset: 4px;
}

.itsmf-event-gallery-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: #202020;
    transform: scale(1);
    transition: transform 0.45s ease, filter 0.45s ease;
    will-change: transform;
}

.itsmf-event-gallery-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.15) 0%,
            rgba(0, 0, 0, 0.38) 42%,
            rgba(0, 0, 0, 0.86) 100%
    );
    transition: opacity 0.3s ease;
}

.itsmf-event-gallery-card-content {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 2;
}

.itsmf-event-gallery-title {
    margin: 0 0 8px;
    padding:0;
    color: var(--itsmf-event-gallery-title-color, #fff);
    font-size: 20px;
    line-height: 1.15;
    font-weight: 700;
    overflow-wrap: break-word;
}

.itsmf-event-gallery-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    color: var(--itsmf-event-gallery-meta-color, rgba(255, 255, 255, 0.88));
    font-size: 14px;
    line-height: 1.35;
}

.itsmf-event-gallery-button {
    display: inline-block;
    padding: 9px 16px;
    border: 1px solid var(--itsmf-event-gallery-button-border-color, #fff);
    background: var(--itsmf-event-gallery-button-background-color, transparent);
    color: var(--itsmf-event-gallery-button-text-color, #fff);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: all 0.3s ease;
}

.itsmf-event-gallery-card-link:hover .itsmf-event-gallery-card-bg,
.itsmf-event-gallery-card-link:focus-visible .itsmf-event-gallery-card-bg {
    transform: scale(1.06);
    filter: saturate(1.08);
}

.itsmf-event-gallery-card-link:hover .itsmf-event-gallery-button,
.itsmf-event-gallery-card-link:focus-visible .itsmf-event-gallery-button {
    background: var(--itsmf-event-gallery-button-hover-background-color, #fff);
    color: var(--itsmf-event-gallery-button-hover-text-color, #111);
}

@media (max-width: 1200px) {
    .itsmf-event-gallery-columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 980px) {
    .itsmf-event-gallery-columns-4,
    .itsmf-event-gallery-columns-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .itsmf-event-gallery-columns-4,
    .itsmf-event-gallery-columns-3,
    .itsmf-event-gallery-columns-2 {
        grid-template-columns: 1fr;
    }
}
