.webinar-matrix-wrap {
    background: var(--wm-page-bg, transparent);
    padding: clamp(16px, 3vw, 32px);
    box-sizing: border-box;
}

.webinar-matrix-wrap *,
.webinar-matrix-wrap *::before,
.webinar-matrix-wrap *::after {
    box-sizing: border-box;
}

.webinar-sort {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.webinar-sort-top {
    margin: 0 0 18px 0;
}

.webinar-sort-bottom {
    margin: 22px 0 0 0;
}

.webinar-sort-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 7px 13px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--wm-sort-button-radius, 999px);
    background: var(--wm-sort-button-bg, #33412f);
    color: var(--wm-sort-button-text, #fff) !important;
    font-size: var(--wm-sort-button-font-size, 13px);
    line-height: 1.1;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.webinar-sort-button:hover,
.webinar-sort-button:focus {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

.webinar-sort-button.is-active {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45), 0 8px 18px rgba(0, 0, 0, 0.14);
}

.webinar-matrix-grid {
    display: grid;
    grid-template-columns: repeat(var(--wm-columns, 4), minmax(0, 1fr));
    gap: clamp(18px, 2.4vw, 32px);
    align-items: stretch;
}

.webinar-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--wm-card-bg, #fff);
    border-radius: var(--wm-card-radius, 18px);
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.10);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.webinar-matrix-wrap.no-shadow .webinar-card {
    box-shadow: none;
}

.webinar-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.14);
    border-color: rgba(0, 0, 0, 0.12);
}

.webinar-image-link {
    display: block;
    position: relative;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.04);
    aspect-ratio: 16 / 10;
}

.webinar-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transform: scale(1.001);
    transition: transform 260ms ease;
}

.webinar-card:hover .webinar-image {
    transform: scale(1.045);
}

.webinar-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: clamp(16px, 2vw, 22px);
}

.webinar-header {
    margin-bottom: 12px;
}

.webinar-title {
    margin: 0;
    color: var(--wm-title-color, #33412f);
    font-size: clamp(19px, 1.45vw, 25px);
    line-height: 1.18;
    font-weight: 700;
    letter-spacing: -0.02em;
	text-align: center;
}

.webinar-date {
    margin-top: 8px;
    color: var(--wm-date-color, #6f7a62);
    font-size: 13px;
    line-height: 1.35;
    font-weight: 600;
}

.webinar-description {
    margin: 0 0 20px 0;
    padding-left: 1.15em;
    color: var(--wm-text-color, #4f5f43);
    font-size: 15px;
    line-height: 1.45;
}

.webinar-description li {
    margin: 0 0 7px 0;
}

.webinar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.webinar-button,
.webinar-button:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 16px;
    border-radius: var(--wm-button-radius, 999px);
    background: var(--wm-button-bg, #7b1e1e);
    color: var(--wm-button-text, #fff) !important;
    font-size: var(--wm-button-font-size, 14px);
    line-height: 1.1;
    font-weight: 700;
    text-decoration: none !important;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.webinar-button:hover,
.webinar-button:focus {
    color: var(--wm-button-text, #fff) !important;
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.webinar-matrix-empty {
    padding: 16px;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 10px;
    background: #fff8e5;
}

@media (max-width: 1024px) {
    .webinar-matrix-grid {
        grid-template-columns: repeat(var(--wm-tablet-columns, 2), minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .webinar-matrix-wrap {
        padding: 12px;
    }

    .webinar-sort {
        justify-content: stretch;
    }

    .webinar-sort-button {
        flex: 1 1 auto;
    }

    .webinar-matrix-grid {
        grid-template-columns: repeat(var(--wm-mobile-columns, 1), minmax(0, 1fr));
        gap: 18px;
    }

    .webinar-actions {
        flex-direction: column;
    }

    .webinar-button {
        width: 100%;
    }
}
