/*
================================================================================
Scroller Module Styles
--------------------------------------------------------------------------------
File: scroller.css
Role: Layout + visual styling for the split scroller section.
Notes:
- Keep selectors in sync with scroller-init.js.
- Tile scroller class names remain stable by design.
- Typography is scoped to the module to keep markup lean.
================================================================================
*/

/* === 1) Module Tokens ===================================================== */
.split-scroller {
    --surface-soft: #f7f7f7;
    --split-surface: var(--surface-soft);
    --frame-color: #fff;
    --tile-border-width: 2px;
    --frame-width: var(--tile-border-width);
    --layout-max-width: 1920px;
    --layout-columns: 12;
    --spacing-y-m: 32px;
    --spacing-y-l: 40px;
    --page-header-height: 72px;
}

@media screen and (min-width: 992px) {
    .split-scroller {
        --layout-columns: 24;
        --spacing-y-m: 40px;
        --spacing-y-l: 64px;
        --page-header-height: 96px;
    }
}

@media screen and (min-width: 1200px) {
    .split-scroller {
        --spacing-y-m: 64px;
        --spacing-y-l: 80px;
        --page-header-height: 128px;
    }
}

/* === 2) Scoped Base ======================================================== */
.split-scroller,
.split-scroller *,
.split-scroller *::before,
.split-scroller *::after {
    box-sizing: border-box;
}

.split-scroller img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* === 3) Split Scroller Layout ============================================= */
.split-scroller {
    min-height: 100vh;
    background-color: var(--split-surface);
    border-top: var(--frame-width) solid var(--frame-color);
    border-bottom: var(--frame-width) solid var(--frame-color);
    font-family: "Google Sans", Helvetica, Arial, sans-serif;
    font-weight: 300;
    line-height: 1.6;
    color: #998da0;
}

.split-scroller--surface {
    --split-surface: var(--surface-soft);
}

.split-scroller--spaced {
    margin-bottom: var(--spacing-y-l);
}

.split-scroller__inner {
    margin-inline: 16px;
    max-width: var(--layout-max-width, 100%);
    display: grid;
    grid-template-columns: repeat(var(--layout-columns), minmax(0, 1fr));
}

.split-scroller__inner > div {
    grid-column: 1 / span var(--layout-columns);
}

.split-scroller__headline {
    padding-top: var(--page-header-height);
    padding-bottom: var(--spacing-y-m);
}

.split-scroller__title {
    margin: 0;
    font-size: clamp(2.2rem, 4vw, 3.375rem);
    line-height: 1.2;
}

.split-scroller__title--content {
    display: none;
}

.split-scroller__content {
    display: flex;
    align-items: center;
}

.split-scroller__content-inner {
    width: 100%;
}

.split-scroller__body {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: flex-start;
}

.split-scroller__lede {
    margin: 0;
    max-width: 32rem;
    color: #463853;
}

.split-scroller__lede--desktop {
    display: none;
}


@media screen and (max-width: 991.98px) {
    .split-scroller__media {
        height: max(344px, 50vh);
        width: calc(100% + 32px);
        margin-inline: -16px;
    }

    .split-scroller__content {
        padding-top: var(--spacing-y-m);
        padding-bottom: var(--spacing-y-l);
    }
}

@media screen and (min-width: 992px) {
    .split-scroller {
        height: 100vh;
    }

    .split-scroller__inner {
        margin-inline: auto;
    }

    .split-scroller__inner > div {
        grid-column: 2 / span calc(var(--layout-columns) - 2);
    }

    .split-scroller__inner,
    .split-scroller__content,
    .split-scroller__media {
        height: 100%;
    }

    .split-scroller__headline {
        display: none;
    }

    .split-scroller__title--content {
        display: block;
    }

    .split-scroller__content {
        grid-row: 1;
    }

    .split-scroller__inner > .split-scroller__content--left {
        grid-column: 3 / span 10;
    }

    .split-scroller__inner > .split-scroller__content--right {
        grid-column: 13 / span 10;
    }

    .split-scroller__media {
        grid-row: 1;
    }

    .split-scroller__inner > .split-scroller__media--left {
        grid-column: 1 / span 10;
    }

    .split-scroller__inner > .split-scroller__media--right {
        grid-column: 15 / span 10;
    }

    .split-scroller__lede--desktop {
        display: block;
    }
}

/* === 4) Tile Scroller ====================================================== */
.tile-scroller {
    overflow: hidden;
}

.tile-scroller__wrapper {
    will-change: transform;
}

.tile-scroller__grid {
    display: grid;
    width: fit-content;
}

.tile-scroller__item {
    overflow: hidden;
    line-height: 0;
    background-color: var(--split-surface);
}

.tile-scroller__item:where(:nth-child(odd)),
.tile-scroller__item:where(:nth-child(even)) {
    aspect-ratio: 1 / 1;
}

.tile-scroller__item--start,
.tile-scroller__item--end {
    aspect-ratio: 1 / 2;
}

.tile-scroller__item--svg {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    row-gap: 4%;
    padding: 6%;
}

.tile-scroller__item--svg > .ratio-wrapper {
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
    max-width: 64%;
    width: 100%;
}

.tile-scroller__item--svg > .ratio-wrapper > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tile-scroller__item .item__description {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
    color: #463853;
}

.tile-scroller__item--text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12%;
    text-align: center;
    line-height: 1.4;
}

.tile-scroller__item--text svg {
    width: 28px;
    height: 28px;
    color: #757575;
    flex-shrink: 0;
}

.tile-scroller__item--text h5 {
    margin: 0;
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
    font-weight: 500;
    line-height: 1.2;
}

.tile-scroller__item--text p {
    margin: 0;
    font-size: clamp(0.75rem, 2.1vw, 1.15625rem);
    line-height: 1.6;
    color: #000;
}

.tile-scroller--outlined {
    --outline-color: var(--frame-color, #fff);
    border-left: 2px solid #fff;
}

.tile-scroller--outlined .tile-scroller__wrapper {
    position: relative;
}

.tile-scroller--outlined .tile-scroller__wrapper::before {
    content: none;
}

.tile-scroller--outlined .tile-scroller__item {
    position: relative;
}

.tile-scroller--outlined .tile-scroller__item::before {
    content: "";
    inset: 0;
    position: absolute;
    pointer-events: none;
    border: var(--tile-border-width) solid var(--outline-color);
}

@media screen and (max-width: 991.98px) {
    .split-scroller {
        border-top: 0;
        border-bottom: 0;
    }

    .tile-scroller--outlined {
        border-left: 0;
    }

    .tile-scroller--outlined .tile-scroller__item::before {
        border: var(--tile-border-width) solid var(--outline-color);
    }

    .tile-scroller__wrapper {
        height: 100%;
        width: fit-content;
        min-width: 100vw;
    }

    .tile-scroller__grid {
        height: 100%;
    }

    .tile-scroller__grid[data-items="10"] {
        grid-template-rows: repeat(2, max(172px, 25vh));
        grid-template-columns: repeat(11, max(86px, 12.5vh));
    }

    .tile-scroller__item:where(:nth-child(odd)) {
        grid-row: 2;
        grid-column: auto / span 2;
    }

    .tile-scroller__item:where(:nth-child(even)) {
        grid-row: 1;
        grid-column: auto / span 2;
    }

    .tile-scroller__item--start,
    .tile-scroller__item--end {
        grid-column: auto / span 1;
    }

    .tile-scroller__item--text p {
        font-size: 1rem;
        line-height: 1.5;
        color: #5b4a62;
    }
}

@media screen and (max-width: 575.98px) {
    .tile-scroller__grid[data-items="10"] {
        grid-template-columns: repeat(11, max(110px, 16vh));
    }

    .tile-scroller__item:where(:nth-child(odd)),
    .tile-scroller__item:where(:nth-child(even)),
    .tile-scroller__item--start,
    .tile-scroller__item--end {
        aspect-ratio: auto;
    }

    .tile-scroller__item--text {
        justify-content: flex-start;
    }
}

@media screen and (min-width: 992px) {
    .tile-scroller--outlined {
        border-left: var(--tile-border-width) solid var(--frame-color);
    }

    .tile-scroller--outlined .tile-scroller__item:nth-child(-n+2)::before {
        border-top-width: 0;
    }

    .tile-scroller--outlined .tile-scroller__item:nth-last-child(-n+2)::before {
        border-bottom-width: 0;
    }

    .tile-scroller__wrapper {
        width: 100%;
        min-height: 100vh;
    }

    .tile-scroller__grid {
        width: 100%;
        height: auto;
        grid-auto-flow: column;
    }

    .tile-scroller__grid[data-items="10"] {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(11, 0.5fr);
    }

    .tile-scroller__item:where(:nth-child(odd)) {
        grid-row: auto / span 2;
        grid-column: 2;
    }

    .tile-scroller__item:where(:nth-child(even)) {
        grid-row: auto / span 2;
        grid-column: 1;
    }

    .tile-scroller__item--start,
    .tile-scroller__item--end {
        aspect-ratio: 2 / 1;
    }

    .tile-scroller__item--start {
        grid-column: 2;
        grid-row: auto / span 1;
    }

    .tile-scroller__item--end {
        grid-column: auto;
        grid-row: auto / span 1;
    }

    .tile-scroller__item--text svg {
        width: 50px;
        height: 50px;
    }
}

/* === 5) Utilities ========================================================== */
.pin-spacer {
    box-sizing: content-box;
}
