/**
 * Styles for the "Related Carousel" component (Components/related_carousel).
 * Scoped under .related-carousel-* throughout.
 */

.related-carousel-section {
    padding: 50px 0;
}

.related-carousel-section.background-fade {
    background: linear-gradient(180deg, var(--color-light-grey) 0%, var(--color-white) 100%);
}

/* !important throughout: same [id^=ModularPageBuilder] h2 specificity trap
   as every other heading in this build (~40px at weight 400 site-wide,
   beats a plain class) when this sits inside that wrapper. */
.related-carousel-heading {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.5em !important;
    padding-bottom: 0 !important;
    margin-bottom: 56px !important;
    /* Matches .related-carousel-tile's own 10px side padding (the gap
       between tiles) — without this the heading sits flush with the
       container edge while the first tile's card starts 10px further in. */
    padding-left: 10px;
}

.related-carousel-empty {
    color: var(--color-grey);
}

/* ---------- Tiles (Owl Carousel items) ---------- */

/*
 * Equal card heights: Owl wraps each item in its own .owl-item, which
 * doesn't stretch to match its row-mates by default — .owl-stage is flexed
 * here and every level below it (.owl-item/.related-carousel-tile/the link)
 * is told to fill that height, so a short title's card matches a
 * three-line title's card instead of shrink-wrapping its own content.
 */
.related-carousel-track .owl-stage {
    display: flex !important;
    align-items: stretch !important;
}

.related-carousel-track .owl-item {
    display: flex !important;
    height: auto !important;
    align-items: stretch;
}

.related-carousel-tile {
    display: flex !important;
    width: 100%;
    padding: 0 10px;
    height: auto;
}

.related-carousel-tile-link {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--color-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.related-carousel-tile-link:hover,
.related-carousel-tile-link:focus {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    transform: translateY(-2px);
    text-decoration: none;
}

.related-carousel-tile-img {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--color-lightest-teal);
    overflow: hidden;
}

.related-carousel-tile-img-el {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-carousel-tile-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 20px 20px;
}

.related-carousel-tile-title {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 1.0625em !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    padding-bottom: 0 !important;
    color: var(--color-off-black);
    margin: 0 0 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-carousel-tile-cta {
    margin-top: auto;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.9375em;
    color: var(--color-dark-teal);
    text-decoration: none !important;
}

/* ---------- Owl Carousel chrome ---------- */

/*
 * Owl's .owl-stage-outer carries overflow:hidden (needed for the sliding
 * mechanism) which was clipping the hover lift/shadow above — tiles at the
 * very top/bottom of the row had nowhere for that effect to spill into.
 * Padding here gives it room; the matching negative margin cancels the
 * padding back out so it doesn't add visible extra space around the track.
 */
.related-carousel-track .owl-stage-outer {
    padding: 10px 0 20px;
    margin: -10px 0 -20px;
}

.related-carousel-track .owl-nav {
    position: absolute;
    top: -60px;
    right: 0;
    display: flex;
    gap: 10px;
}

.related-carousel-track .owl-nav button.owl-prev,
.related-carousel-track .owl-nav button.owl-next {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-white) !important;
    border: 1px solid var(--color-grey);
    color: var(--color-off-black) !important;
    font-size: 1em;
}

.related-carousel-track .owl-nav button.owl-prev:hover,
.related-carousel-track .owl-nav button.owl-next:hover {
    background: var(--color-dark-teal) !important;
    color: var(--color-white) !important;
    border-color: var(--color-dark-teal);
}

.related-carousel-track .owl-dots {
    text-align: center;
    margin-top: 20px;
}

.related-carousel-track .owl-dot span {
    background: var(--color-light-grey) !important;
}

.related-carousel-track .owl-dot.active span {
    background: var(--color-dark-teal) !important;
}

/* ==========================================================================
 * "Resources Hub row" design (Design = hub) — Articles / News rows on the
 * Resources hub. Every rule below is scoped under --hub, so the original
 * Related Resources look above is untouched.
 * ========================================================================== */

/* Centred heading with the "See all …" link directly beneath it; the gap
   under that title block is 40px large / 30px small / 20px mobile (spec). */
.related-carousel-section--hub .related-carousel-header {
    text-align: center;
    margin-bottom: 40px;
}

.related-carousel-section--hub .related-carousel-heading {
    padding-left: 0;
    margin-bottom: 8px !important;
    /* Same size as the site H2 the Webinars/Guides headings use (base rule is
       2.5em, 2.4em on smaller screens) — beats the 1.5em set on the original
       .related-carousel-heading above. */
    font-size: 2.5em !important;
    line-height: 1.5 !important;
}

.related-carousel-see-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.9375em;
    color: var(--color-dark-teal);
    text-decoration: none;
}

.related-carousel-see-all:hover {
    text-decoration: underline;
    color: var(--color-dark-teal);
}

@media (max-width: 1280px) {
    .related-carousel-section--hub .related-carousel-header { margin-bottom: 30px; }
}

/* Base site H2 steps down to 2.4em at ≤1600px (ModularPageBuilderBaseStyles.css). */
@media (max-width: 1600px) {
    .related-carousel-section--hub .related-carousel-heading { font-size: 2.4em !important; }
}

@media (max-width: 767px) {
    .related-carousel-section--hub .related-carousel-header { margin-bottom: 20px; }
}

/* Tile: H3 bold title, then "ARTICLE | 5 MIN READ" — no CTA line. */
.related-carousel-section--hub .related-carousel-tile-title {
    margin-bottom: 14px;
}

.related-carousel-tile-meta {
    margin-top: auto;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.6875em;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b6b6b;
}

/* Row width is the container the arrow offset above is measured against;
   --rc-items mirrors the Owl "items" breakpoints in scripts.js. */
.related-carousel-section--hub .related-carousel-track {
    container-type: inline-size;
    --rc-items: 1.2;
}

@media (min-width: 576px)  { .related-carousel-section--hub .related-carousel-track { --rc-items: 2.5; } }
@media (min-width: 992px)  { .related-carousel-section--hub .related-carousel-track { --rc-items: 4.5; } }
@media (min-width: 1400px) { .related-carousel-section--hub .related-carousel-track { --rc-items: 6.5; } }

/* Arrows sit on the card edges, vertically centred, instead of top-right. */
.related-carousel-section--hub .related-carousel-track .owl-nav {
    position: static;
    display: block;
}

.related-carousel-section--hub .related-carousel-track .owl-nav button.owl-prev,
.related-carousel-section--hub .related-carousel-track .owl-nav button.owl-next {
    position: absolute;
    /* Centred on the card IMAGE (16:9, inside the tile's 10px side padding; the
       row's 10px top padding is cancelled by its negative margin), not the whole card - otherwise the arrow
       lands at the image/title boundary. Card width = row width / items shown
       (same counts as scripts.js), so the row's own width drives it. */
    top: calc(((100cqw / var(--rc-items, 4.5)) - 20px) * 9 / 32);
    transform: translateY(-50%);
    z-index: 2;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--color-medium-teal) !important;
    color: var(--color-white) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.related-carousel-section--hub .related-carousel-track .owl-nav button.owl-prev { left: 12px; }
.related-carousel-section--hub .related-carousel-track .owl-nav button.owl-next { right: 12px; }

.related-carousel-section--hub .related-carousel-track .owl-nav button.owl-prev:hover,
.related-carousel-section--hub .related-carousel-track .owl-nav button.owl-next:hover {
    background: var(--color-dark-teal) !important;
}

.related-carousel-section--hub .related-carousel-track .owl-nav button.disabled {
    /* Same colour as the active arrow (was dimmed to 35%, which made the
       start-of-row Previous arrow look grey next to the teal Next arrow). */
    opacity: 1 !important;
    cursor: default;
}
