.tmsp-wrap,
.tmsp-wrap * {
    box-sizing: border-box;
}

.tmsp-wrap {
    --tmsp-rose: #c99191;
    --tmsp-rose-dark: #a76f76;
    --tmsp-blush: #fde3da;
    --tmsp-cream: #fbf5f1;
    --tmsp-ink: #3d3334;
    --tmsp-muted: #7d6f70;
    --tmsp-border: rgba(201, 145, 145, 0.26);
    width: 100%;
    color: var(--tmsp-ink);
    font-family: inherit;
}

.tmsp-heading {
    max-width: 760px;
    margin: 0 auto 30px;
    text-align: center;
}

.tmsp-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin-bottom: 12px;
    padding: 6px 15px;
    border: 1px solid var(--tmsp-border);
    border-radius: 999px;
    background: var(--tmsp-cream);
    color: var(--tmsp-rose-dark);
    font-size: 13px;
    font-weight: 700;
}

.tmsp-heading h2 {
    margin: 0 0 12px;
    color: var(--tmsp-ink);
    font-size: clamp(25px, 3vw, 38px);
    line-height: 1.5;
    font-weight: 800;
}

.tmsp-heading p {
    margin: 0;
    color: var(--tmsp-muted);
    font-size: 15px;
    line-height: 2;
}

.tmsp-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0 0 26px;
}

.tmsp-filter {
    min-height: 44px;
    padding: 9px 20px;
    border: 1px solid var(--tmsp-border);
    border-radius: 999px;
    background: #fff;
    color: var(--tmsp-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.tmsp-filter:hover {
    transform: translateY(-1px);
    border-color: var(--tmsp-rose);
}

.tmsp-filter.is-active {
    border-color: var(--tmsp-rose);
    background: var(--tmsp-rose);
    color: #fff;
    box-shadow: 0 9px 24px rgba(169, 111, 118, .2);
}

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

.tmsp-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(169, 111, 118, .13);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 12px 38px rgba(74, 54, 57, .08);
    transition: transform .25s ease, box-shadow .25s ease, opacity .2s ease;
}

.tmsp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 46px rgba(74, 54, 57, .13);
}

.tmsp-card.is-hidden {
    display: none;
}

.tmsp-image-button {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.tmsp-image-frame {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--tmsp-cream);
}

.tmsp-image-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .45s ease;
}

.tmsp-card:hover .tmsp-image-frame img {
    transform: scale(1.035);
}

.tmsp-zoom {
    position: absolute;
    left: 14px;
    bottom: 14px;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 50%;
    background: rgba(61, 51, 52, .64);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    opacity: 0;
    transform: translateY(5px);
    backdrop-filter: blur(8px);
    transition: opacity .2s ease, transform .2s ease;
}

.tmsp-card:hover .tmsp-zoom,
.tmsp-image-button:focus-visible .tmsp-zoom {
    opacity: 1;
    transform: translateY(0);
}

.tmsp-card-body {
    padding: 17px 18px 19px;
    text-align: right;
}

.tmsp-course-badge {
    display: inline-flex;
    margin-bottom: 9px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--tmsp-blush);
    color: var(--tmsp-rose-dark);
    font-size: 11px;
    font-weight: 800;
}

.tmsp-card-body h3 {
    margin: 0;
    color: var(--tmsp-ink);
    font-size: 15px;
    line-height: 1.8;
    font-weight: 800;
}

.tmsp-card-body p {
    margin: 6px 0 0;
    color: var(--tmsp-muted);
    font-size: 13px;
    line-height: 1.8;
}

.tmsp-empty {
    margin-top: 20px;
    padding: 25px;
    border: 1px dashed var(--tmsp-border);
    border-radius: 18px;
    background: var(--tmsp-cream);
    color: var(--tmsp-muted);
    text-align: center;
}

.tmsp-lightbox[hidden] {
    display: none;
}

.tmsp-lightbox {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(33, 26, 27, .86);
    backdrop-filter: blur(7px);
}

.tmsp-lightbox-inner {
    display: flex;
    width: min(94vw, 980px);
    max-height: 88vh;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.tmsp-lightbox img {
    display: block;
    max-width: 100%;
    max-height: calc(88vh - 58px);
    border-radius: 18px;
    object-fit: contain;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

.tmsp-lightbox p {
    margin: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.tmsp-lightbox-close {
    position: fixed;
    top: 18px;
    left: 18px;
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 50%;
    background: rgba(255,255,255,.13);
    color: #fff;
    font: inherit;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}

body.tmsp-lightbox-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .tmsp-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (max-width: 560px) {
    .tmsp-heading {
        margin-bottom: 22px;
    }

    .tmsp-heading h2 {
        font-size: 25px;
    }

    .tmsp-heading p {
        font-size: 13px;
        line-height: 1.9;
    }

    .tmsp-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 18px;
    }

    .tmsp-filter {
        min-height: 42px;
        padding: 8px 9px;
        font-size: 12px;
    }

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

    .tmsp-card {
        border-radius: 15px;
    }

    .tmsp-card-body {
        padding: 11px 11px 13px;
    }

    .tmsp-course-badge {
        margin-bottom: 7px;
        padding: 4px 7px;
        font-size: 9px;
    }

    .tmsp-card-body h3 {
        font-size: 11px;
        line-height: 1.75;
    }

    .tmsp-card-body p {
        font-size: 10px;
    }

    .tmsp-zoom {
        display: none;
    }

    .tmsp-lightbox {
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tmsp-card,
    .tmsp-filter,
    .tmsp-image-frame img,
    .tmsp-zoom {
        transition: none;
    }
}
