/* Root block — defines CSS custom props and block-level spacing. */
.smbr-related-articles {
    --smbr-related-articles-navy: #102544;
    --smbr-related-articles-blue: #164e9c;
    --smbr-related-articles-orange: #f36c2f;
    --smbr-related-articles-text: #4f5663;
    --smbr-related-articles-border: #d6d9de;
    --smbr-related-articles-light-border: #e4e6e9;
    --smbr-related-articles-background: #ffffff;
    --smbr-related-articles-radius: 12px;
    --smbr-related-articles-grid-gap: 24px;

    padding: clamp(48px, 6vw, 88px) 0;
    color: var(--smbr-related-articles-navy);
    background: var(--smbr-related-articles-background);
}

/*
 * Scoped reset — box-sizing is applied only to descendants of the block root
 * so no outer element inherits an unexpected box model.
 */
.smbr-related-articles *,
.smbr-related-articles *::before,
.smbr-related-articles *::after {
    box-sizing: border-box;
}

/* ── Intro ─────────────────────────────────────────────────────────────── */

/* Added .smbr-related-articles ancestor to all child selectors below so they
   win over any same-specificity theme rules targeting the same generic classes
   (e.g. .container h2, .wysiwyg p) that the full-width-image block also uses. */

.smbr-related-articles .smbr-related-articles__intro {
    font-weight: 700;
    max-width: 820px;
    margin: 0 auto 48px;
    text-align: center;
}

.smbr-related-articles .smbr-related-articles__kicker {
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--smbr-related-articles-orange);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.smbr-related-articles .smbr-related-articles__heading {
    max-width: 760px;
    margin: 0 auto 18px;
    color: var(--smbr-related-articles-navy);
}

.smbr-related-articles .smbr-related-articles__description {
    font-weight: 400;
    max-width: 680px;
    margin: 0 auto;
    color: black;
}

/* ── Tabs ───────────────────────────────────────────────────────────────── */

.smbr-related-articles .smbr-related-articles__tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 34px;
}

/* ── Accordion (details/summary markup used for progressive enhancement) ─ */

.smbr-related-articles .smbr-related-articles__accordion {
    margin-bottom: 0;
}

.smbr-related-articles .smbr-related-articles__accordion-item {
    border: 0;
}

.smbr-related-articles .smbr-related-articles__accordion-item > summary {
    list-style: none;
}

.smbr-related-articles .smbr-related-articles__accordion-item > summary::-webkit-details-marker {
    display: none;
}

/*
 * The summary text is kept in the DOM for screen-reader announcement but
 * hidden visually; desktop tab buttons serve as the visual affordance.
 */
.smbr-related-articles .smbr-related-articles__summary-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    white-space: nowrap;
}

/* ── Tab buttons ────────────────────────────────────────────────────────── */

.smbr-related-articles .smbr-related-articles__tab {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 42px;
    padding: 8px 18px;
    border: 1px solid #aeb3ba;
    border-radius: 6px;
    color: #242a33;
    background: #ffffff;
    font: inherit;
    text-align: center;
    cursor: pointer;
    transition:
        color 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
}

.smbr-related-articles .smbr-related-articles__tab:hover,
.smbr-related-articles .smbr-related-articles__tab:focus-visible,
.smbr-related-articles .smbr-related-articles__tab.is-active {
    color: #ffffff;
    background: var(--smbr-related-articles-navy);
    border-color: var(--smbr-related-articles-navy);
}

.smbr-related-articles .smbr-related-articles__tab:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgb(16 37 68 / 16%);
}

.smbr-related-articles .smbr-related-articles__tab:focus-visible {
    outline: 3px solid rgb(243 108 47 / 35%);
    outline-offset: 3px;
}

/* ── Panel ──────────────────────────────────────────────────────────────── */

.smbr-related-articles .smbr-related-articles__panel {
    padding-top: 24px;
}

/* ── Divider ────────────────────────────────────────────────────────────── */

.smbr-related-articles .smbr-related-articles__divider {
    display: grid;
    grid-template-columns: minmax(30px, 1fr) auto minmax(30px, 1fr);
    align-items: center;
    gap: 28px;
    margin-bottom: 34px;
}

.smbr-related-articles .smbr-related-articles__divider-line {
    width: 100%;
    height: 1px;
    background: #c9cdd2;
}

.smbr-related-articles .smbr-related-articles__divider-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 0;
}

/* Targeting h3 via the parent class keeps the rule from touching h3 elements
   in any other block that appears on the same page (e.g. full-width-image). */
.smbr-related-articles .smbr-related-articles__divider-title h3 {
    margin: 0;
    color: var(--smbr-related-articles-navy);
    text-align: center;
}

.smbr-related-articles .smbr-related-articles__divider-pin {
    display: block;
    flex: 0 0 auto;
    width: 28px;
    height: auto;
}

/* ── Article grid ───────────────────────────────────────────────────────── */

.smbr-related-articles .smbr-related-articles__grid {
    display: grid;
    gap: var(--smbr-related-articles-grid-gap);
    align-items: stretch;
}

.smbr-related-articles .smbr-related-articles__grid > * {
    min-width: 0;
}

.smbr-related-articles .smbr-related-articles__grid--cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.smbr-related-articles .smbr-related-articles__grid--cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.smbr-related-articles .smbr-related-articles__grid--cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.smbr-related-articles .smbr-related-articles__grid--cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ── Article card ───────────────────────────────────────────────────────── */

.smbr-related-articles .smbr-related-articles__card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--smbr-related-articles-light-border);
    border-radius: var(--smbr-related-articles-radius);
    background: #ffffff;
    box-shadow: 0 2px 7px rgb(15 35 64 / 5%);
    transition:
        transform 220ms ease,
        box-shadow 220ms ease,
        border-color 220ms ease;
}

.smbr-related-articles .smbr-related-articles__card:hover,
.smbr-related-articles .smbr-related-articles__card:focus-within {
    transform: translateY(-5px);
    border-color: #c9cfd7;
    box-shadow: 0 14px 30px rgb(15 35 64 / 14%);
}

.smbr-related-articles .smbr-related-articles__image-link {
    display: block;
    overflow: hidden;
    background: #eef0f2;
}

.smbr-related-articles .smbr-related-articles__image {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 2;
    object-fit: contain;
    transition: transform 350ms ease;
}

.smbr-related-articles .smbr-related-articles__card:hover .smbr-related-articles__image,
.smbr-related-articles .smbr-related-articles__card:focus-within .smbr-related-articles__image {
    transform: scale(1.035);
}

.smbr-related-articles .smbr-related-articles__card-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 24px 22px 25px;
}

.smbr-related-articles .smbr-related-articles__category {
    margin: 0 0 12px;
    color: var(--smbr-related-articles-orange);
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.smbr-related-articles .smbr-related-articles__card-title {
    display: -webkit-box;
    position: relative;
    margin: 0 0 14px;
    overflow: hidden;
    color: var(--smbr-related-articles-navy);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/*
 * Faint fade at the lower-right edge hints that the heading may be truncated
 * while keeping the card design subtle and uncluttered.
 */
.smbr-related-articles .smbr-related-articles__card-title::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 36px;
    height: 1.3em;
    background: linear-gradient(to right, rgb(255 255 255 / 0%), #ffffff 70%);
    pointer-events: none;
}

.smbr-related-articles .smbr-related-articles__card-title a {
    color: inherit;
    text-decoration: none;
}

.smbr-related-articles .smbr-related-articles__card-title a:hover,
.smbr-related-articles .smbr-related-articles__card-title a:focus-visible {
    color: var(--smbr-related-articles-blue);
    text-decoration: none;
}

.smbr-related-articles .smbr-related-articles__excerpt {
    display: -webkit-box;
    margin: 0 0 22px;
    overflow: hidden;
    color: var(--smbr-related-articles-text);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

/* ── Read-more link & CTA ───────────────────────────────────────────────── */

.smbr-related-articles .smbr-related-articles__read-more,
.smbr-related-articles .smbr-related-articles__cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--smbr-related-articles-blue);
    text-decoration: none;
}

.smbr-related-articles .smbr-related-articles__read-more {
    align-self: flex-start;
    margin-top: auto;
}

.smbr-related-articles .smbr-related-articles__read-more:hover,
.smbr-related-articles .smbr-related-articles__read-more:focus-visible,
.smbr-related-articles .smbr-related-articles__cta:hover,
.smbr-related-articles .smbr-related-articles__cta:focus-visible {
    color: var(--smbr-related-articles-navy);
    text-decoration: none;
}

.smbr-related-articles .smbr-related-articles__arrow {
    display: inline-block;
    transition: transform 180ms ease;
}

.smbr-related-articles .smbr-related-articles__read-more:hover .smbr-related-articles__arrow,
.smbr-related-articles .smbr-related-articles__read-more:focus-visible .smbr-related-articles__arrow,
.smbr-related-articles .smbr-related-articles__cta:hover .smbr-related-articles__arrow,
.smbr-related-articles .smbr-related-articles__cta:focus-visible .smbr-related-articles__arrow {
    transform: translateX(5px);
}

/* ── Footer / CTA button ────────────────────────────────────────────────── */

.smbr-related-articles .smbr-related-articles__footer {
    display: flex;
    justify-content: center;
    padding-top: 40px;
}

.smbr-related-articles .smbr-related-articles__cta {
    justify-content: center;
    min-width: min(100%, 370px);
    min-height: 62px;
    padding: 13px 28px;
    border: 2px solid var(--smbr-related-articles-blue);
    border-radius: 6px;
    background: #ffffff;
    text-align: center;
    transition:
        color 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.smbr-related-articles .smbr-related-articles__cta:hover,
.smbr-related-articles .smbr-related-articles__cta:focus-visible {
    color: #ffffff;
    background: var(--smbr-related-articles-navy);
    border-color: var(--smbr-related-articles-navy);
    box-shadow: 0 9px 22px rgb(16 37 68 / 18%);
}

.smbr-related-articles .smbr-related-articles__cta:focus-visible {
    outline: 3px solid rgb(243 108 47 / 35%);
    outline-offset: 4px;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 991.98px) {
    .smbr-related-articles .smbr-related-articles__grid--cols-3,
    .smbr-related-articles .smbr-related-articles__grid--cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .smbr-related-articles {
        padding: 48px 0 56px;
    }

    .smbr-related-articles .smbr-related-articles__intro {
        margin-bottom: 34px;
    }

    .smbr-related-articles .smbr-related-articles__tabs {
        margin-bottom: 28px;
    }

    .smbr-related-articles .smbr-related-articles__divider {
        grid-template-columns: minmax(15px, 1fr) auto minmax(15px, 1fr);
        gap: 14px;
        margin-bottom: 27px;
    }

    .smbr-related-articles .smbr-related-articles__divider-title {
        gap: 8px;
    }

    .smbr-related-articles .smbr-related-articles__divider-pin {
        width: 22px;
    }

    .smbr-related-articles .smbr-related-articles__grid--cols-2,
    .smbr-related-articles .smbr-related-articles__grid--cols-3,
    .smbr-related-articles .smbr-related-articles__grid--cols-4 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .smbr-related-articles .smbr-related-articles__tabs {
        gap: 8px;
    }

    .smbr-related-articles .smbr-related-articles__tab {
        padding-right: 10px;
        padding-left: 10px;
    }

    .smbr-related-articles .smbr-related-articles__card-body {
        padding: 22px 20px 23px;
    }

    .smbr-related-articles .smbr-related-articles__cta {
        width: 100%;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .smbr-related-articles .smbr-related-articles__tab,
    .smbr-related-articles .smbr-related-articles__card,
    .smbr-related-articles .smbr-related-articles__image,
    .smbr-related-articles .smbr-related-articles__arrow,
    .smbr-related-articles .smbr-related-articles__cta {
        transition: none;
    }
}

