/* ==========================================================================
   Card Selector — structural shell
   Visual styling (colors, shadows, typography) to be added
   ========================================================================== */

.card-selector {
    padding: var(--section-pad-y) var(--section-pad-x);

    & .card-selector__inner {
        max-width: var(--container-max-width);
        margin: 0 auto;
    }

    /* Header
       ====================================================================== */

    & .card-selector__header {
        margin-bottom: 3rem;
    }

    & .card-selector__subhead {
        margin: 0 0 0.5rem;
        font-size: 18px;
        letter-spacing: 0.2em;
    }

    & .card-selector__heading {
        margin: 0;
        font-size: 42px;

        @media (max-width: 599px) {
            font-size: 32px;
        }
    }

    /* Slider
       ====================================================================== */

    & .card-selector__track {
        display: flex;
        gap: 1.5rem;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 2rem;

        &::-webkit-scrollbar {
            display: none;
        }
    }

    /* Cards — 1 col mobile, 2 tablet, 3 desktop
       ====================================================================== */

    & .card-selector__card {
        flex: 0 0 100%;
        scroll-snap-align: start;
        display: flex;
        flex-direction: column;
        text-decoration: none;
        color: inherit;

        @media (min-width: 600px) {
            flex: 0 0 calc((100% - 1.5rem) / 2);
        }

        @media (min-width: 1024px) {
            flex: 0 0 calc((100% - 3rem) / 3);
        }
    }

    & .card-selector__card-image {
        & img {
            width: 100%;
            height: auto;
            display: block;
            border-radius: var(--border-radius);
        }

        @media (max-width: 599px) {
            max-height: 150px;
            overflow: hidden;
        }
    }

    & .card-selector__card-body {
        display: flex;
        flex-direction: column;
        flex: 1;
        gap: 0.75rem;
        padding: 1.25rem 0 0;
    }

    & .card-selector__card-title {
        margin: 0;
    }

    & .card-selector__card-copy {
        flex: 1;

        & p:first-child { margin-top: 0; }
        & p:last-child  { margin-bottom: 0; }
    }

    & .card-selector__card-link {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
        color: var(--color-navy);
        font-weight: 600;
        align-self: flex-start;
        margin-top: auto;

        & svg {
            flex-shrink: 0;
            transition: transform 0.2s ease;
        }

        &:hover svg {
            transform: translateX(3px);
        }
    }

    /* Industry variant
       ====================================================================== */

    &.card-selector--industry {
        background-color: var(--color-white);

        & .card-selector__subhead {
            color: var(--color-gold);
            text-transform: uppercase;
            letter-spacing: 0.2em;
            font-weight: 600;
        }

        & .card-selector__heading {
            color: var(--color-navy);
        }

        /* Header row: text left, nav buttons right */

        & .card-selector__header {
            display: flex;
            justify-content: space-between;
            align-items: flex-end;
            gap: 1.5rem;

            @media (max-width: 599px) {
                flex-direction: column;
                align-items: center;
            }
        }

        & .card-selector__header-text {
            @media (max-width: 599px) {
                text-align: center;
            }
        }

        & .card-selector__nav {
            margin-top: 0;
            flex-shrink: 0;

            @media (max-width: 599px) {
                display: none;
            }
        }

        /* Cards */

        & .card-selector__card {
            overflow: visible;
            position: relative;

            @media (max-width: 599px) {
                flex: 0 0 105%;
            }
        }

        & .card-selector__card-image {
            position: relative;
            z-index: 2;

            & img {
                border-radius: 15px;
                aspect-ratio: 4 / 3;
                object-fit: cover;

                @media (max-width: 599px) {
                    border-bottom-left-radius: 0;
                    border-bottom-right-radius: 0;
                }
            }
        }

        & .card-selector__card-body {
            background: rgba(115, 140, 189, 0.20);
            border-radius: 0 0 25px 25px;
            padding: 45px 25px 25px;
            flex: 1;
            gap: 0.75rem;
            margin: -20px 20px 0;
            position: relative;
            z-index: 1;
            transition: transform 0.3s ease, background-color 0.3s ease;

            @media (max-width: 599px) {
                margin: 0;
                padding: 25px;
            }
        }

        & .card-selector__card-title {
            color: var(--color-navy);
            text-transform: none;
            letter-spacing: 0;
            font-size: 32px;
            font-weight: 700;
            margin: 0;
        }

        & .card-selector__card-copy {
            color: var(--color-navy);
            font-size: 16px;
            font-style: normal;
            font-weight: 400;
            line-height: 24px;

            & p { color: var(--color-navy); margin: 0; }
        }

        & .card-selector__card-link {
            color: var(--color-navy);
            align-self: flex-end;
            margin-top: auto;
            padding: 5px;
            border-radius: 6px;
            background-color: transparent;
            transition: background-color 0.2s ease, color 0.2s ease;
        }

        /* Hover state — desktop only */

        & .card-selector__card:hover {
            @media (min-width: 600px) {
                & .card-selector__card-body {
                    transform: translateY(20px);
                    background: rgba(115, 140, 189, 0.35);
                }

                & .card-selector__card-link {
                    background-color: var(--color-navy);
                    color: var(--color-white);
                }
            }
        }
    }

    /* Nav buttons
       ====================================================================== */

    & .card-selector__nav {
        display: flex;
        gap: 1rem;
        margin-top: 2rem;
    }

    & .card-selector__btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        border: 2px solid var(--color-navy);
        background: transparent;
        color: var(--color-navy);
        cursor: pointer;
        transition: background-color 0.2s ease, color 0.2s ease;

        &:hover {
            background-color: var(--color-navy);
            color: var(--color-white);
        }

        &:focus-visible {
            outline: 3px solid var(--color-gold);
            outline-offset: 3px;
        }
    }
}