/**
 * Text and Image Columns Module
 *
 * @package mohawk-consumer-2027
 */

/* ------- Section Base ------- */

#content .homeFeaturesNew {
    box-shadow: none;
    padding-left: 20px;
    padding-right: 20px;
    background-image: none;
    z-index: 0;
    padding-bottom: 40px;

    &.has-sidebar {
        padding-left: 0px;
        padding-right: 0px;
    }

    &.bottom-shrink {
        padding-bottom: 0px;
    }

    @media (min-width: 768px) {
        padding-bottom: 50px;
    }

    @media (min-width: 960px) {
        padding-bottom: 60px;
    }

    @media (min-width: 1360px) {
        padding-bottom: 80px;
    }
}

/* ------- Intro Content Wrapper ------- */

#content .homeFeaturesNew .inside-content-wrapper {
    margin: 0 auto;
    padding: 0 0 20px 0;
    max-width: none;
    width: 100%;

    &.no-sidebar {
        max-width: 800px;
        width: 90%;
    }

    &.text-left,
    &.text-left h1,
    &.text-left h2,
    &.text-left h3,
    &.text-left p {
        text-align: left;
    }

    &.text-center,
    &.text-center h1,
    &.text-center h2,
    &.text-center h3,
    &.text-center p {
        text-align: center;
    }

    & h2 {
        line-height: 1em;
        color: #304677;
        font-size: 24px;
        font-weight: 600;
        text-align: center;
        clear: none;
        padding: 0px 0 0 0;
        letter-spacing: -0.015em;
        text-transform: uppercase;

        @media (min-width: 768px) {
            font-size: 32px;
        }

        @media (min-width: 960px) {
            font-size: 40px;
        }
    }

    & h1 {
        font-weight: 300;
        color: #e70000;
        font-family: var(--font-condensed);
        font-size: clamp(2.25rem, 4vw, 3rem);
        line-height: 1em;
        margin-top: 12px;
        margin-bottom: 30px;
        letter-spacing: -0.02em;
        text-wrap: wrap;
    }

    & p {
        text-align: center;
    }

    @media (min-width: 768px) {
        padding: 0px 0 20px 0;
    }

    @media (min-width: 960px) {
        padding: 0px 0 30px 0;
    }

    @media (min-width: 1360px) {
        padding: 0px 0 30px 0;
    }
}

/* ------- Feature Cards Grid ------- */

#content .homeFeaturesNew .homeFeatures-wrapper {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    margin: 0 auto;
    max-width: 1400px;
    gap: 20px;

    @media (min-width: 768px) {
        flex-direction: row;
    }
    & h3 {
        font-family: var(--font-heading);
    }
    & .item {
        flex: 0 0 100%;
        width: 100%;
        cursor: default;
        overflow: hidden;
        position: relative;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
        border-radius: 7px;

        @media (min-width: 768px) {
            flex: 0 0 calc(50% - 10px);
            width: calc(50% - 10px);
        }

        @media (min-width: 1101px) {
            flex: 0 0 calc(33.33% - 14px);
            width: calc(33.33% - 14px);
        }

        & .homeFeature-inside-wrap {
            position: relative;
            overflow: hidden;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
            border-radius: 7px;

            & .featureImage {
                aspect-ratio: 8/5;
                cursor: default;
                margin-bottom: -4px;

                &::before {
                    background-image: linear-gradient(
                        180deg,
                        rgba(0, 0, 0, 0) 70%,
                        rgba(0, 0, 0, 0.75) 100%
                    );
                    content: '';
                    background-repeat: no-repeat;
                    background-size: cover;
                    position: absolute;
                    top: 0;
                    bottom: 0;
                    left: 0;
                    right: 0;
                    display: block;
                    z-index: 0;
                    width: 100%;
                    border-radius: 0 0 7px 7px;
                }

                & img {
                    height: 100%;
                    border-radius: 7px;
                    object-fit: cover;
                    max-height: none;
                    max-width: none;
                    width: 100%;
                }
            }

            & .featureImage--icon {
                aspect-ratio: auto;
                display: flex;
                justify-content: center;
                padding: 15px;

                & img {
                    max-height: 100px;
                    width: auto;
                    height: auto;
                    object-fit: contain;
                }
            }

            /* ------- Hover-Reveal Card Content ------- */

            & .featureContent {
                padding: 0 15px;
                position: absolute;
                top: calc(100% - 20px);
                right: 0;
                left: 0;
                transition: top 0.25s;

                @media (min-width: 1360px) {
                    padding: 0 20px;
                }

                & h3 {
                    transform: translate(0, -90%);
                    transition: transform 0.17s linear 0.05s;
                    text-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
                    margin: 0;
                    color: #fff;
                    font-weight: 400;
                    line-height: 1.2em;

                    @media (min-width: 768px) {
                        font-size: 22px;
                    }

                    @media (min-width: 1101px) {
                        font-size: 18px;
                    }

                    @media (min-width: 1360px) {
                        font-size: 22px;
                    }
                }

                & p {
                    color: #fff;
                    font-size: 14px;
                    line-height: 1.4em;

                    @media (min-width: 768px) {
                        font-size: 14px;
                    }
                }
            }

            & .featureContent-overlay {
                background-color: #000;
                border-radius: 7px;
                position: absolute;
                aspect-ratio: 8/5;
                top: 0;
                right: 0;
                bottom: 0;
                left: 0;
                opacity: 0;
                z-index: -1;
                transition: opacity 0.2s ease;
            }

            &:hover {
                & .featureContent-overlay {
                    opacity: 0.8;
                    z-index: 1;
                }

                & .featureContent {
                    top: 15px;
                    z-index: 2;

                    @media (min-width: 1360px) {
                        top: 20px;
                    }

                    & h3 {
                        transform: none;
                        text-shadow: none;
                    }
                }
            }
        }
    }
}

/* ------- Grid Column Overrides ------- */

#content .homeFeaturesNew .homeFeatures-wrapper {
    &.grid-cols-1 .item {
        flex: 0 0 100%;
        width: 100%;
    }

    &.grid-cols-2 .item {
        flex: 0 0 100%;
        width: 100%;

        @media (min-width: 768px) {
            flex: 0 0 calc(50% - 10px);
            width: calc(50% - 10px);
        }
    }

    &.grid-cols-4 .item {
        flex: 0 0 100%;
        width: 100%;

        @media (min-width: 768px) {
            flex: 0 0 calc(50% - 10px);
            width: calc(50% - 10px);
        }

        @media (min-width: 960px) {
            flex: 0 0 calc(33.33% - 14px);
            width: calc(33.33% - 14px);
        }

        @media (min-width: 1101px) {
            flex: 0 0 calc(25% - 15px);
            width: calc(25% - 15px);
        }
    }

    &.grid-cols-5 {
        justify-content: flex-start;
    }

    &.grid-cols-5 .item {
        flex: 0 0 100%;
        width: 100%;

        @media (min-width: 768px) {
            flex: 0 0 calc(50% - 10px);
            width: calc(50% - 10px);
        }

        @media (min-width: 960px) {
            flex: 0 0 calc(33.33% - 14px);
            width: calc(33.33% - 14px);
        }

        @media (min-width: 1101px) {
            flex: 0 0 calc(20% - 16px);
            width: calc(20% - 16px);
        }
    }
}

/* ------- Feature Text Alignment ------- */

#content .homeFeaturesNew .homeFeatures-wrapper {
    &.text-center .item .featureContent {
        text-align: center;
    }

    &.text-left .item .featureContent {
        text-align: left;
    }
}

/* ------- Content Under Image Layout ------- */

#content .homeFeaturesNew.layout-content-under .homeFeatures-wrapper .item {
    box-shadow: none;

    & .featureImage a {
        & img {
            transition: opacity 0.25s ease;
        }

        &:hover img {
            opacity: 0.8;
        }
    }

    & .homeFeature-inside-wrap {
        box-shadow: none;

        & .featureImage {
            border-radius: 7px;
            overflow: hidden;

            &::before {
                display: none;
            }
        }

        & .featureContent {
            position: static;
            top: auto;
            padding: 15px 0 0 0;

            & h3 {
                transform: none;
                text-shadow: none;
                color: #e70000;
                font-weight: 700;
                font-size: clamp(1.5rem, 2vw, 2rem);
                margin-top: 10px;
                margin-bottom: 8px;
            }

            & p {
                color: var(--color-foreground-muted);
                font-size: 15px;
                line-height: 1.5em;
            }
        }

        & .featureContent-overlay {
            display: none;
        }
    }
}

#content
    .homeFeaturesNew.layout-content-under
    .homeFeatures-wrapper.grid-cols-3
    .item
    .homeFeature-inside-wrap
    .featureContent
    h3,
#content
    .homeFeaturesNew.layout-content-under
    .homeFeatures-wrapper.grid-cols-4
    .item
    .homeFeature-inside-wrap
    .featureContent
    h3,
#content
    .homeFeaturesNew.layout-content-under
    .homeFeatures-wrapper.grid-cols-5
    .item
    .homeFeature-inside-wrap
    .featureContent
    h3 {
    font-size: clamp(1.45rem, 1.25vw, 1.5rem);
}

#content
    .homeFeaturesNew.contain-images
    .homeFeatures-wrapper
    .item
    .homeFeature-inside-wrap
    .featureImage
    img {
    object-fit: contain;
}

#content .homeFeaturesNew.has-drop-shadow .homeFeatures-wrapper .item {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

/* ------- Card Accordion ------- */

#content .tig-accordion {
    border: 2px solid #ccc;
    background-color: #ffffff;
    padding: 5px 10px;
    margin: 0 15px 15px;
    border-radius: 5px;
}

#content .tig-accordion__toggle {
    display: block;
    width: 100%;
    padding: 8px 10px;
    margin-top: 0;
    border: none;
    border-radius: 0;
    background: none;
    background-image: none;
    color: #000;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    text-shadow: none;
    text-transform: uppercase;
    cursor: pointer;

    &:hover {
        background: none;
        background-color: transparent;
        color: #000;
    }
}

#content .tig-accordion__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;

    &.is-open {
        max-height: 2000px;
        transition: max-height 0.5s ease-in;
    }
}

#content .tig-accordion__content {
    padding: 10px 0 5px;
    border-top: 1px solid #ccc;

    & p {
        color: var(--color-foreground-muted);
        font-size: 15px;
        line-height: 1.5em;
    }
    & h4 {
        font-size: 16px;
        margin-bottom: 8px;
        line-height: 1.2em;
        border-top: 1px solid #ccc;
        padding-top: 12px;
        &.noLine {
            border: none;
            padding-top: 0;
        }
    }
}

#content .homeFeatures-wrapper {
    &.grid-cols-4 .tig-accordion__content p,
    &.grid-cols-5 .tig-accordion__content p {
        font-size: 13px;
        line-height: 1.2em;
    }
}
