.rcm-home-featured,
.rcm-home-featured * {
    box-sizing: border-box;
}

.rcm-home-featured {
    --rcm-home-featured-title: #183354;
    --rcm-home-featured-body: #545e69;
    --rcm-home-featured-border: #dfdfdf;
    --rcm-home-featured-accent: #7153b0;
    width: min(1263px, calc(100% - 32px));
    margin: 0 auto;
    font-family: "Inter", sans-serif;
}

.rcm-home-featured__header {
    display: grid;
    grid-auto-flow: dense;
    grid-template-columns: minmax(0, 562px) 1fr;
    align-items: center;
    column-gap: 34px;
    row-gap: var(--rcm-home-rail-gap-title-rule, 15px);
    margin-bottom: var(--rcm-home-rail-gap-rule-content, 34px);
}

.rcm-home-featured__title {
    grid-column: 1 / span 2;
    margin: 0;
    color: var(--rcm-home-featured-title);
    font-family: "Roboto", sans-serif;
    font-size: 25px;
    font-weight: 700;
    line-height: 1.344;
}

.rcm-home-featured__tabs {
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 38px;
}

.rcm-home-featured__tab {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    color: #d7d7d7 !important;
    font-family: "Roboto", sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    cursor: pointer;
    box-shadow: none !important;
    outline: none !important;
    min-height: 0 !important;
    min-width: 0 !important;
}

.rcm-home-featured__tab:hover,
.rcm-home-featured__tab:focus,
.rcm-home-featured__tab:active {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--rcm-home-featured-accent) !important;
    box-shadow: none !important;
    border: 0 !important;
    outline: none !important;
}

.rcm-home-featured__tab.is-active {
    color: var(--rcm-home-featured-accent) !important;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
}

.rcm-home-featured__rule {
    grid-column: 1;
    position: relative;
    width: 100%;
    height: 5px;
    border-top: 1px solid var(--rcm-home-featured-border);
    border-bottom: 1px solid var(--rcm-home-featured-border);
}

.rcm-home-featured__rule-accent {
    position: absolute;
    top: -1px;
    left: 0;
    width: 40px;
    height: 5px;
    background: var(--rcm-home-featured-accent);
}

.rcm-home-featured__rule-notch {
    position: absolute;
    top: -1.5px;
    left: 36px;
    width: 10px;
    height: 6px;
    background: #fff;
    -webkit-mask-image: url('../../assets/images/notch-mask.svg');
    mask-image: url('../../assets/images/notch-mask.svg');
    -webkit-mask-size: 10px 6px;
    mask-size: 10px 6px;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
}

.rcm-home-featured__panel {
    display: none;
}

.rcm-home-featured__panel.is-active {
    display: block;
}

.rcm-home-featured__panel--empty .rcm-home-featured__empty {
    margin: 0;
    padding: 32px 16px;
    color: var(--rcm-home-featured-body);
    font-family: "Inter", sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
}

.rcm-home-featured__layout {
    display: grid;
    grid-template-columns: 278px minmax(0, 582px) 278px;
    gap: 30px;
    align-items: start;
}

/* Fewer than 5 items: same visual rhythm as full layout so tabs stay aligned. */
.rcm-home-featured__layout--compact {
    display: grid;
    gap: 30px;
    width: 100%;
    align-items: start;
}

.rcm-home-featured__layout--compact.rcm-home-featured__layout--n1 {
    grid-template-columns: minmax(0, 582px);
    justify-content: center;
    max-width: 100%;
}

.rcm-home-featured__layout--compact.rcm-home-featured__layout--n2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rcm-home-featured__layout--compact.rcm-home-featured__layout--n3 {
    grid-template-columns: minmax(0, 278px) minmax(0, 582px) minmax(0, 278px);
}

.rcm-home-featured__layout--compact.rcm-home-featured__layout--n4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rcm-home-featured__column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rcm-home-featured__card-link {
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.rcm-home-featured__card-link .wpb_column,
.rcm-home-featured__card-link .vc_column_container,
.rcm-home-featured__card-link .vc_row,
.rcm-home-featured__card-link .wpb_row {
    display: none !important;
}

.rcm-home-featured__card-image {
    width: 100%;
    height: 200px;
    border-radius: 6px;
    background: #dbe3ef center / cover no-repeat;
}

.rcm-home-featured__card-image--main {
    height: 390px;
}

.rcm-home-featured__badge {
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    margin: -13px 0 10px 0;
    padding: 4px 14px;
    border-radius: 3px;
    background: var(--rcm-home-featured-badge-color, #7153b0);
    color: #fff;
    font-family: "Manrope", sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.rcm-home-featured__card--main .rcm-home-featured__badge {
    align-self: center;
    width: auto;
    max-width: calc(100% - 74px);
    margin-bottom: 14px;
}

.rcm-home-featured__card-title {
    margin: 0;
    padding: 0;
    color: var(--rcm-home-featured-title);
    font-family: "Manrope", sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
}

/* Side column small cards only (not center hero). */
.rcm-home-featured__card-title:not(.rcm-home-featured__card-title--main) {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    min-width: 0;
    min-height: calc(1.4em * 2);
    overflow-wrap: anywhere;
}

.rcm-home-featured__card-title--main {
    padding: 0 37px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
}

.rcm-home-featured__event-date {
    display: block;
    margin: 6px 0 0;
    color: var(--rcm-home-featured-body);
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
}

.rcm-home-featured__event-date--main {
    margin: 10px 37px 0;
    font-size: 16px;
    font-weight: 600;
}

@media (max-width: 1180px) {
    .rcm-home-featured {
        width: 100%;
        max-width: min(1263px, calc(100% - 32px));
        margin-left: auto;
        margin-right: auto;
    }

    /* Stack like mobile: title, full-width rule, then tabs (avoids rule/tabs sharing one row). */
    .rcm-home-featured__header {
        display: grid;
        grid-template-columns: 1fr;
        grid-auto-flow: row;
        column-gap: 0;
        align-items: stretch;
    }

    .rcm-home-featured__title {
        grid-column: 1;
        order: 1;
    }

    .rcm-home-featured__rule {
        grid-column: 1;
        order: 2;
        width: 100%;
    }

    .rcm-home-featured__tabs {
        grid-column: 1;
        order: 3;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: clamp(18px, 4vw, 32px);
        width: 100%;
    }

    .rcm-home-featured__layout {
        grid-template-columns: 1fr;
    }

    .rcm-home-featured__column {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
        align-items: stretch;
    }

    /* Equal-height pairs: grid stretches each article; link fills and stacks image → badge → title. */
    .rcm-home-featured__column > .rcm-home-featured__card {
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: 100%;
        overflow: hidden;
    }

    .rcm-home-featured__column > .rcm-home-featured__card .rcm-home-featured__card-link {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: 100%;
        overflow: hidden;
    }

    .rcm-home-featured__column > .rcm-home-featured__card--small .rcm-home-featured__card-image {
        flex: 0 0 auto;
        height: 200px;
        min-height: 200px;
        max-height: 200px;
    }

    .rcm-home-featured__layout--compact {
        gap: clamp(16px, 2.5vw, 24px);
    }

    .rcm-home-featured__layout--compact.rcm-home-featured__layout--n2,
    .rcm-home-featured__layout--compact.rcm-home-featured__layout--n4 {
        align-items: stretch;
    }

    .rcm-home-featured__layout--compact.rcm-home-featured__layout--n2 > .rcm-home-featured__card,
    .rcm-home-featured__layout--compact.rcm-home-featured__layout--n4 > .rcm-home-featured__card {
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: 100%;
        overflow: hidden;
    }

    .rcm-home-featured__layout--compact.rcm-home-featured__layout--n2 > .rcm-home-featured__card .rcm-home-featured__card-link,
    .rcm-home-featured__layout--compact.rcm-home-featured__layout--n4 > .rcm-home-featured__card .rcm-home-featured__card-link {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: 100%;
        overflow: hidden;
    }

    .rcm-home-featured__layout--compact.rcm-home-featured__layout--n2 > .rcm-home-featured__card--small .rcm-home-featured__card-image,
    .rcm-home-featured__layout--compact.rcm-home-featured__layout--n4 > .rcm-home-featured__card--small .rcm-home-featured__card-image {
        flex: 0 0 auto;
        height: 200px;
        min-height: 200px;
        max-height: 200px;
    }

    .rcm-home-featured__layout--compact.rcm-home-featured__layout--n3 {
        grid-template-columns: 1fr;
    }

    .rcm-home-featured__layout--compact.rcm-home-featured__layout--n1 {
        grid-template-columns: 1fr;
    }

    .rcm-home-featured__card-link {
        height: 100%;
    }
}

@media (max-width: 600px) {
    .rcm-home-featured__layout--compact.rcm-home-featured__layout--n2,
    .rcm-home-featured__layout--compact.rcm-home-featured__layout--n4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .rcm-home-featured {
        width: 100%;
        max-width: min(1263px, calc(100% - 24px));
        margin-left: auto;
        margin-right: auto;
    }

    .rcm-home-featured__header {
        display: grid !important;
        grid-template-columns: 1fr;
        grid-auto-flow: row;
        column-gap: 0 !important;
        row-gap: var(--rcm-home-rail-gap-title-rule, 16px);
        margin-bottom: var(--rcm-home-rail-gap-rule-content, 24px);
        align-items: stretch !important;
    }

    .rcm-home-featured__title {
        grid-column: 1;
        order: 1;
        font-size: 25px;
        /* Keeps same as desktop but let's be explicit */
    }

    .rcm-home-featured__rule {
        grid-column: 1;
        order: 2;
        width: 100%;
        margin-bottom: 0;
    }

    .rcm-home-featured__tabs {
        grid-column: 1;
        order: 3;
        justify-content: flex-start;
        gap: 37px;
        overflow-x: auto;
        padding-top: 10px;
        padding-bottom: 4px;
        /* affordance for scrollbar */
    }

    .rcm-home-featured__column {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        align-items: stretch;
    }

    /* Keep paired small cards + hero row from painting outside their boxes (Elementor / h3 line-height). */
    .rcm-home-featured__column > .rcm-home-featured__card {
        overflow: hidden;
    }

    .rcm-home-featured__column > .rcm-home-featured__card .rcm-home-featured__card-link {
        overflow: hidden;
    }

    .rcm-home-featured__card--main {
        overflow: hidden;
        border-radius: 6px;
    }

    .rcm-home-featured__card--main .rcm-home-featured__card-link {
        overflow: hidden;
    }

    .rcm-home-featured__layout--compact > .rcm-home-featured__card--small,
    .rcm-home-featured__layout--compact > .rcm-home-featured__card--main {
        overflow: hidden;
    }

    .rcm-home-featured__layout--compact > .rcm-home-featured__card .rcm-home-featured__card-link {
        overflow: hidden;
    }

    .rcm-home-featured__card-image {
        height: 188px;
        /* Mobile image height */
    }

    .rcm-home-featured__card-image--main {
        height: 280px;
    }

    /* Beat 1180px column rule: small-card image band is fixed on narrow screens. */
    .rcm-home-featured__column > .rcm-home-featured__card--small .rcm-home-featured__card-image,
    .rcm-home-featured__layout--compact.rcm-home-featured__layout--n2 > .rcm-home-featured__card--small .rcm-home-featured__card-image,
    .rcm-home-featured__layout--compact.rcm-home-featured__layout--n4 > .rcm-home-featured__card--small .rcm-home-featured__card-image {
        height: 188px;
        min-height: 188px;
        max-height: 188px;
    }

    .rcm-home-featured__badge {
        margin: -13px 0 16px 0;
        /* Keep consistent overlap */
    }

    /*
     * Small-card badges: fixed-height band, flex-centered (webkit-box line-clamp top-aligns single lines).
     * Two-line cap via max-height + overflow; text block stays vertically centered.
     */
    .rcm-home-featured__column--left .rcm-home-featured__card--small .rcm-home-featured__badge,
    .rcm-home-featured__column--right .rcm-home-featured__card--small .rcm-home-featured__badge,
    .rcm-home-featured__panel--compact .rcm-home-featured__card--small .rcm-home-featured__badge {
        align-self: stretch;
        width: 100%;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
        flex-shrink: 0;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        overflow: hidden;
        word-break: break-word;
        overflow-wrap: anywhere;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.2;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        padding: 4px 12px;
        /* 2 lines at 13px × 1.2 + vertical padding 8px — same outer rhythm as before */
        min-height: calc(13px * 1.2 * 2 + 8px);
        max-height: calc(13px * 1.2 * 2 + 8px);
    }

    .rcm-home-featured__card-title,
    .rcm-home-featured__card-title--main {
        padding: 0;
        text-align: center;
    }

    .rcm-home-featured__card-title {
        font-size: 15px;
        line-height: 1.2;
    }

    /* All small-card titles: 2 lines, !important beats Elementor/global h3. */
    .rcm-home-featured__card--small .rcm-home-featured__card-title {
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden !important;
        overflow-wrap: anywhere;
        word-break: break-word;
        flex-shrink: 0;
        min-width: 0;
        min-height: 0 !important;
        max-height: 36px !important;
        line-height: 1.2 !important;
        font-size: 15px !important;
        align-self: stretch;
        margin: 0 !important;
    }

    /* Center hero: cap lines so long titles don’t overlap the next rail. */
    .rcm-home-featured__card-title--main {
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        overflow: hidden !important;
        font-size: 20px !important;
        line-height: 1.2 !important;
        margin-top: 10px;
        max-height: 72px !important;
        min-height: 0 !important;
        word-break: break-word;
        overflow-wrap: anywhere;
        padding-left: 12px !important;
        padding-right: 12px !important;
        box-sizing: border-box;
    }

    .rcm-home-featured__event-date,
    .rcm-home-featured__event-date--main {
        margin-left: 0;
        margin-right: 0;
        padding: 0;
        text-align: center;
        font-size: 14px;
    }
}