/*--------------------------------------------------------------
# KKSB homepage sections
# Save as assets/css/kksb-home.css
# Loads after chaves.css. Only touches the two rebuilt sections
# plus a small nav colour fix.
--------------------------------------------------------------*/

/*--------------------------------------------------------------
# Nav fix - Home, News and Contact were inheriting black
--------------------------------------------------------------*/
.main-menu-three .main-menu__list > li > a {
    color: #ffffff;
}

.main-menu-three .main-menu__list li ul li a {
    color: var(--thm-black);
}

/*--------------------------------------------------------------
# Our Communities
--------------------------------------------------------------*/
.home-stats {
    position: relative;
    display: block;
    padding: 110px 0 110px;
}

.home-stats__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    align-items: center;
    gap: 70px;
}

.home-stats__media img {
    display: block;
    width: 100%;
    height: auto;
}

.home-stats__eyebrow {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    line-height: 22px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--thm-primary);
    margin-bottom: 12px;
}

.home-stats__heading {
    font-size: 46px;
    line-height: 54px;
    font-weight: 500;
    text-transform: uppercase;
    color: #000068;
    margin: 0 0 20px;
}

.home-stats__intro {
    font-size: 17px;
    line-height: 30px;
    color: #4d4d6b;
    margin: 0;
    max-width: 460px;
}

/* Hairline grid - the rules do the separating, no boxes needed */
.home-stats__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 45px 0 0;
    padding: 0;
    border-top: 1px solid #e2e2ea;
    border-left: 1px solid #e2e2ea;
}

.home-stats__item {
    padding: 32px 30px;
    border-right: 1px solid #e2e2ea;
    border-bottom: 1px solid #e2e2ea;
}

.home-stats__figure {
    display: flex;
    align-items: flex-start;
    font-size: 52px;
    line-height: 58px;
    font-weight: 400;
    color: #000068;
}

.home-stats__suffix {
    font-size: 26px;
    line-height: 34px;
    margin-left: 4px;
    color: var(--thm-primary);
}

.home-stats__label {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 22px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6a6a7d;
}

/* Odometer inherits the figure type rather than the theme default */
.home-stats__figure .odometer.odometer-auto-theme,
.home-stats__figure .odometer.odometer-theme-default {
    font-family: var(--thm-font);
    line-height: inherit;
}

@media (max-width: 1199px) {
    .home-stats__inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 50px;
    }

    .home-stats__media {
        max-width: 460px;
    }

    .home-stats__intro {
        max-width: none;
    }
}

@media (max-width: 767px) {
    .home-stats {
        padding: 70px 0;
    }

    .home-stats__heading {
        font-size: 34px;
        line-height: 42px;
    }

    .home-stats__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-stats__item {
        padding: 24px 20px;
    }

    .home-stats__figure {
        font-size: 42px;
        line-height: 48px;
    }
}

/*--------------------------------------------------------------
# Services
--------------------------------------------------------------*/
.home-services {
    position: relative;
    display: block;
    background-color: #f4f4f4;
    padding: 110px 0 110px;
}

.home-services__head {
    max-width: 640px;
    margin-bottom: 55px;
}

.home-services__eyebrow {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    line-height: 22px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--thm-primary);
    margin-bottom: 12px;
}

.home-services__heading {
    font-size: 46px;
    line-height: 54px;
    font-weight: 500;
    text-transform: uppercase;
    color: #000068;
    margin: 0 0 18px;
}

.home-services__intro {
    font-size: 17px;
    line-height: 30px;
    color: #4d4d6b;
    margin: 0;
}

.home-services__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

.home-services__card {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background-color: #000068;
    background-size: cover;
    background-position: center;
}

/* The zoom runs on a pseudo-element transform, not background-size.
   Transforms are composited, so this stays smooth at 60fps. */
.home-services__card::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: 0;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    transform: scale(1);
    transform-origin: center;
    will-change: transform;
    transition: transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.home-services__card:hover::before,
.home-services__card:focus-visible::before {
    transform: scale(1.08);
}

/* Navy scrim, deepening from the bottom so the type stays legible */
.home-services__card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top,
                rgba(0, 0, 104, 0.92) 0%,
                rgba(0, 0, 104, 0.72) 38%,
                rgba(0, 0, 104, 0.25) 72%,
                rgba(0, 0, 104, 0.12) 100%);
    transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.home-services__body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 34px 32px 32px;
}

/* The tan rule is the same device used on the footer headings */
.home-services__rule {
    display: block;
    width: 28px;
    height: 2px;
    background-color: var(--thm-primary);
    margin-bottom: 16px;
    transition: width 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.home-services__card:hover .home-services__rule {
    width: 56px;
}

.home-services__title {
    font-size: 22px;
    line-height: 30px;
    font-weight: 700;
    text-transform: uppercase;
    color: #ffffff;
    margin: 0;
}

.home-services__text {
    font-size: 15px;
    line-height: 26px;
    color: #d2d7da;
    margin: 12px 0 0;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1) 60ms,
                transform 600ms cubic-bezier(0.22, 1, 0.36, 1) 60ms;
}

.home-services__card:hover .home-services__text,
.home-services__card:focus-visible .home-services__text {
    opacity: 1;
    transform: translateY(0);
}

.home-services__card:focus-visible {
    outline: 3px solid var(--thm-primary);
    outline-offset: 3px;
}

/* Touch devices have no hover, so never hide the description there */
@media (hover: none) {
    .home-services__text {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 991px) {
    .home-services__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .home-services__body {
        padding: 26px 24px 24px;
    }
}

@media (max-width: 767px) {
    .home-services {
        padding: 70px 0;
    }

    .home-services__heading {
        font-size: 34px;
        line-height: 42px;
    }

    .home-services__head {
        margin-bottom: 38px;
    }

    .home-services__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-services__card {
        aspect-ratio: 16 / 10;
    }
}

/*--------------------------------------------------------------
# Motion preferences
--------------------------------------------------------------*/
@media (prefers-reduced-motion: reduce) {
    .home-services__card::before,
    .home-services__card::after,
    .home-services__rule,
    .home-services__text {
        transition: none;
    }

    .home-services__card:hover::before {
        transform: scale(1);
    }
}

/*--------------------------------------------------------------
# Vision & Mission - text left, image right
# The theme built this column pair the other way round, so its
# negative offsets need neutralising after the swap.
--------------------------------------------------------------*/
.welcome-three .row {
    align-items: center;
}

.welcome-three__right {
    margin-left: 0;
    padding-top: 0;
    padding-right: 40px;
}

.welcome-three__left::before {
    display: none;
}

.welcome-three__img {
    margin-top: 0;
}

.welcome-three__text {
    max-width: 520px;
}

@media (max-width: 1199px) {
    .welcome-three__right {
        padding-right: 0;
        margin-bottom: 45px;
    }

    .welcome-three__text {
        max-width: none;
    }
}