/*
 * Home page sections: the module cards and the news band.
 *
 * Kept as a plain stylesheet rather than part of resources/sass/app.scss so the
 * site can be deployed without rebuilding assets. public/css is git-ignored
 * because Mix writes there, hence this path.
 */

.module-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.module-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
    margin-bottom: 40px;
}

.module-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 326px;
    padding: 34px 32px 28px;
    background: var(--module-bg);
    color: var(--module-fg);
    transition: background .28s, transform .28s;
}

.module-card:hover {
    transform: scale(1.02);
}

.module-card > * {
    position: relative;
    z-index: 1;
}

/* Three tones, rotated so no two neighbours match. */
.module-card--dark {
    --module-bg: #171F3D;
    --module-fg: #FFFFFF;
    --module-sub: rgba(182, 203, 247, .78);
    --module-mark: #93B4F4;
}

.module-card--mid {
    --module-bg: #33478F;
    --module-fg: #FFFFFF;
    --module-sub: rgba(220, 230, 248, .82);
    --module-mark: #B6CBF7;
}

.module-card--pale {
    --module-bg: #DCE6F8;
    --module-fg: #171F3D;
    --module-sub: #41507F;
    --module-mark: #33478F;
}

.module-card--dark:hover { --module-bg: #0F1530; }
.module-card--mid:hover  { --module-bg: #2B3C7A; }
.module-card--pale:hover { --module-bg: #CBDAF5; }

.module-card__watermark {
    position: absolute;
    z-index: 0;
    right: -18px;
    bottom: -14px;
    width: 172px;
    height: 172px;
    color: var(--module-mark);
    opacity: .17;
    pointer-events: none;
    transition: transform .4s, opacity .4s;
}

.module-card--pale .module-card__watermark { opacity: .22; }

.module-card:hover .module-card__watermark {
    transform: scale(1.07) translate(-6px, -4px);
    opacity: .26;
}

.module-card__title {
    margin: 0 0 14px;
    font-family: "Roboto", sans-serif;
    font-weight: 700;
    font-size: 25px;
    line-height: 1.24;
    letter-spacing: -.005em;
    color: var(--module-fg);
}

.module-card__guides {
    /* Stops short of the right edge so the watermark behind it stays clear. */
    max-width: 86%;
    margin: 0;
    font-size: 14px;
    line-height: 1.62;
    color: var(--module-sub);
}

.module-card__rest {
    white-space: nowrap;
    margin-left: 6px;
    font-weight: 700;
    color: var(--module-fg);
    opacity: .85;
}

.module-card__more {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-top: auto;
    padding-top: 30px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--module-fg);
}

.module-card__arrow {
    flex: none;
    width: 19px;
    height: 28px;
    color: var(--module-mark);
    transition: transform .28s;
}

.module-card:hover .module-card__arrow { transform: translateX(5px); }

@media only screen and (max-width: 991px) {
    .module-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}

@media only screen and (max-width: 767px) {
    .module-cards { grid-template-columns: 1fr; gap: 18px; }

    .module-card {
        min-height: 0;
        padding: 28px 24px 24px;
    }

    .module-card__title { font-size: 24px; }

    .module-card__watermark {
        width: 132px;
        height: 132px;
        right: -12px;
        bottom: -10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .module-card,
    .module-card__watermark,
    .module-card__arrow {
        transition: none;
    }

    .module-card:hover { transform: none; }

    .module-card:hover .module-card__watermark { transform: none; }
    .module-card:hover .module-card__arrow { transform: none; }
}


/* ---------- news band ---------- */

.news-band {
    background: #DCE6F8;
    padding: 44px 0 46px;
    margin-top: 20px;
}

.news-band__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.news-band__title {
    margin: 0;
    font-family: "Roboto", sans-serif;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -.01em;
    color: #171F3D;
}

.news-band__all {
    font-size: 14px;
    font-weight: 500;
    color: #33478F;
    border-bottom: 1px solid rgba(51, 71, 143, .4);
    padding-bottom: 2px;
}

.news-band__all:hover {
    color: #171F3D;
    border-color: #171F3D;
}

.news-band__carousel { position: relative; }

/*
 * Column widths repeat wide / narrow / narrow, so each set of three keeps the
 * lead card at double width while the row still scrolls.
 */
.news-band__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns:
        calc((100% - 48px) / 2)
        calc((100% - 48px) / 4)
        calc((100% - 48px) / 4);
    gap: 24px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.news-band__track::-webkit-scrollbar { display: none; }
.news-band__track > * { scroll-snap-align: start; }

.news-card {
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    color: #171F3D;
    transition: transform .25s;
}

.news-card:hover { transform: scale(1.015); }

/* A fixed ratio, because the uploaded images vary from square to panoramic. */
.news-card__img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.news-card--lead .news-card__img { aspect-ratio: 3.55 / 1; }

.news-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 22px 20px;
}

.news-card__title {
    margin: 0;
    font-family: "Roboto", sans-serif;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.28;
    color: #171F3D;
}

.news-card--lead .news-card__title { font-size: 23px; }

.news-card:hover .news-card__title { color: #33478F; }

.news-card__text {
    margin: 7px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: #5C6485;
}

.news-card__kind {
    margin-top: auto;
    padding-top: 18px;
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 500;
    color: #6B76A0;
}

.news-band__nav {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 26px;
}

.news-band__btn {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 3px;
    cursor: pointer;
    background: rgba(90, 120, 190, .16);
    color: #171F3D;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

.news-band__btn:hover { background: rgba(90, 120, 190, .28); }
.news-band__btn:focus-visible { outline: 2px solid #33478F; outline-offset: 2px; }

@media only screen and (max-width: 991px) {
    .news-band__track { grid-auto-columns: 76%; }
    .news-card--lead .news-card__img { aspect-ratio: 16 / 9; }
    .news-card--lead .news-card__title { font-size: 18px; }
}

@media only screen and (max-width: 767px) {
    .news-band { padding: 38px 0 40px; }
    .news-band__title { font-size: 23px; }
    .news-band__track { grid-auto-columns: 84%; }
}

@media (prefers-reduced-motion: reduce) {
    .news-card { transition: none; }
    .news-card:hover { transform: none; }
    .news-band__track { scroll-behavior: auto; }
}
