/* 
    Table of content
    1. ICON & TEXT
    2. FEATURED
        1.1 Front-wrapper
        1.2 Back-wrapper
    3. CLIENTS
    4. RESULTS
    5. GALLERY
*/

/* 1. ICON & TEXT */
.grid-icon-text .container {
    position: relative;
    z-index: 1;
}

.grid-icon-text .container > .content-wrapper {
    max-width: 78rem;
    margin-bottom: 8rem;
}

.grid-icon-text .grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 8rem 10rem;
}

.grid-icon-text .grid.col-three {
    grid-template-columns: repeat( 3, 1fr );
    grid-gap: 5rem;
}

.grid-icon-text .icon {
    display: flex;
    margin-bottom: 2rem;
    font-size: 4rem;
}

/* 2. FEATURED */
.grid-featured {
    overflow: hidden;
}

.grid-featured.lines-black::before {
    display: none;
}

.grid-featured:not(.bgfull)::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(50% + 4rem);
    background-color: white;
}

.grid-featured.lines-black:not(.bgfull)::after {
    background-image: url(../images/pattern-lines-black-005.svg);
    background-repeat: repeat-y;
    background-position: center top;
}

.grid-featured .container {
    position: relative;
    z-index: 1;
}

.grid-featured .grid {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 10rem;
}

.grid-featured .grid::before {
    content: '';
    position: absolute;
    top: -10rem;
    right: -10rem;
    width: 20rem;
    height: 20rem;
    background-image: url(../images/circle-featured-darkgrey.svg);
    background-size: contain;
    background-position: center;
    animation: rotateSlowly 40s infinite linear;
}

.grid-featured.bgfull .grid::before {
    background-image: url(../images/circle-featured-white.svg);
}

.grid-featured .item {
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 100%;
    perspective: 100rem;
}

.grid-featured .item:nth-child(odd) {
    margin-top: 8rem;
}

.grid-featured .item-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.5s;
    transform-style: preserve-3d;
}

.grid-featured .item.active .item-container {
    transform: rotateY(180deg);
}

.grid-featured .front-wrapper,
.grid-featured .back-wrapper {
    position: absolute;
    z-index: 1;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    overflow: hidden;
}

.grid-featured .icon {
    position: absolute;
    top: 3rem;
    right: 3rem;
    font-size: 3rem;
}

.grid-featured h3 {
    margin: 0;
    font-weight: 700;
    line-height: 1.1;
}

.grid-featured .type {
    margin-top: .5rem;
    font-size: 1.4rem;
    line-height: 1.5;
}

.grid-featured .container > .link-wrapper {
    position: absolute;
    bottom: -1rem;
    right: 0;
    text-align: right;
}

.grid-featured .container > .link-wrapper .link {
    color: white;
}

/* 1.1 Front-wrapper */
.grid-featured .front-wrapper {
    background-size: cover;
    background-position: center;
}

.grid-featured .item.active .front-wrapper {
    z-index: 0;
}

.grid-featured .front-wrapper::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: rgb(0,0,0);
    background: linear-gradient(0deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
    opacity: .5;
}

.grid-featured .title-wrapper {
    position: absolute;
    z-index: 1;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: var(--inner-padding);
}

/* 1.2 Back-wrapper */
.grid-featured .back-wrapper {
    z-index: 2;
    background-color: var(--color-yellow);
    transform: rotateY(180deg);
    color: var(--color-darkgrey);
}

.grid-featured .content-wrapper {
    position: absolute;
    z-index: 1;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: var(--inner-padding);
}

.grid-featured .text-wrapper {
    margin-top: 1.5rem;
    font-size: 1.4rem;
    line-height: 1.7;
}

.grid-featured .item .link-wrapper {
    margin-top: 2.5rem;
    text-align: right;
}

.grid-featured .item .link {
    color: var(--color-darkgrey);
}

/* 3. CLIENTS */
.grid-clients .container {
    position: relative;
    z-index: 1;
}

.grid-clients h2 {
    max-width: var(--grid-size-sm);
    margin: 0 auto 8rem;
    text-align: center;
}

.grid-clients .grid {
    display: grid;
    grid-template-columns: repeat( 5, 1fr );
    justify-content: space-between;
    grid-gap: 7rem 10rem;
}

.grid-clients .image {
    display: flex;
    max-width: 18rem;
    height: 6rem;
}

.grid-clients .image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

/* 4. RESULTS */
.grid-results .container {
    position: relative;
    z-index: 1;
}

.grid-results .grid {
    display: grid;
    grid-template-columns: repeat( 4, 1fr );
    grid-gap: 5rem;
}

.grid-results .item {
    text-align: center;
}

.grid-results .number {
    position: relative;
    font-size: 10rem;
    font-weight: 500;
    line-height: 1;
}

.grid-results sup {
    position: absolute;
    top: -2rem;
    font-size: 4rem;
}

.grid-results .text {
    max-width: 24rem;
    margin: 1rem auto 0;
    font-size: 1.8rem;
    line-height: 1.5;
}

/* 5. GALLERY */
.grid-gallery .container {
    border-radius: var(--border-radius);
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-gap: 1rem;
    overflow: hidden;
}

.grid-gallery .image-wrapper:first-child {
    grid-row: span 2;
}

.grid-gallery .image-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-top: calc(100% - 1rem);
}

.grid-gallery .image-wrapper img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* RESIZE */
@media (max-width: 1140px) {
    /* 1. ICON & TEXT */
    .grid-icon-text .grid {
        grid-gap: 6rem;
    }

    /* 2. FEATURED */
    .grid-featured .grid {
        grid-gap: 6rem;
    }

    /* 4. RESULTS */
    .grid-results .grid {
        grid-template-columns: repeat( 2, 1fr );
        grid-gap: 6rem;
    }
}

@media (max-width: 1024px) {
    /* 1. ICON & TEXT */
    .grid-icon-text .grid.col-three {
        grid-template-columns: 1fr 1fr;
        grid-gap: 6rem;
    }

    .grid-icon-text .item h2,
    .grid-icon-text .item h3 {
        margin-bottom: 1.5rem;
        font-size: 2.6rem;
        line-height: 1.3;
    }

    /* 3. CLIENTS */
    .grid-clients .grid {
        grid-template-columns: repeat( 4, 1fr );
    }

    /* 4. RESULTS */
    .grid-results .number {
        font-size: 8rem;
    }
}

@media (max-width: 899px) {
    /* 1. ICON & TEXT */
    .grid-icon-text .container > .content-wrapper {
        margin-bottom: 5rem;
    }

    .grid-icon-text .grid {
        grid-gap: 5rem 6rem;
    }

    .grid-icon-text .grid.col-three {
        grid-gap: 5rem 6rem;
    }

    /* 2. FEATURED */
    .grid-featured .grid::before {
        top: -8rem;
        right: -8rem;
        width: 16rem;
        height: 16rem;
    }

    /* 1.2 Back-wrapper */
    .grid-featured .text-wrapper {
        display: none;
    }

    /* 3. CLIENTS */
    .grid-clients h2 {
        margin: 0 auto 5rem;
    }
}

@media (max-width: 767px) {
    /* 1. ICON & TEXT */
    .grid-icon-text .grid {
        grid-template-columns: 1fr;
        grid-gap: 3rem;
    }
    
    .grid-icon-text .grid.col-three {
        grid-template-columns: 1fr;
        grid-gap: 3rem;
    }

    .grid-icon-text .icon {
        margin-bottom: 1rem;
        font-size: 3.4rem;
    }

    .grid-icon-text .item h2,
    .grid-icon-text .item h3 {
        margin-bottom: 1rem;
        font-size: 2.2rem;
    }

    /* 2. FEATURED */
    .grid-featured .grid {
        grid-template-columns: 1fr;
        grid-gap: 0;
    }

    .grid-featured .grid::before {
        top: -6rem;
        right: -6rem;
        width: 12rem;
        height: 12rem;
    }

    .grid-featured .item:not(:first-child) {
        display: none;
    }

    body.page-id-973 .grid-featured .item:nth-child(2) {
        display: block;
        margin-top: 3rem;
    }

    .grid-featured .item:nth-child(odd) {
        margin-top: inherit;
    }

    .grid-featured .container > .link-wrapper {
        position: relative;
        bottom: inherit;
        right: inherit;
        margin-top: 3rem;
        text-align: right;
    }

    /* 3. CLIENTS */
    .grid-clients .grid {
        grid-template-columns: repeat( 3, 1fr );
        grid-gap: 5rem 10rem;
    }

    /* 4. RESULTS */
    .grid-results .number {
        font-size: 7rem;
    }

    .grid-results sup {
        top: -1.8rem;
    }

    .grid-results .text {
        margin: .5rem auto 0;
        font-size: 1.6rem;
    }
}

@media (max-width: 599px) {
    /* 2. FEATURED */
    body.page-id-973 .grid-featured .item:nth-child(2) {
        margin-top: 1.5rem;
    }

    /* 3. CLIENTS */
    .grid-clients .grid {
        grid-gap: 4rem 6rem;
    }

    /* 4. RESULTS */
    .grid-results .grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 499px) {
    /* 3. CLIENTS */
    .grid-clients .grid {
        grid-template-columns: repeat( 2, 1fr );
        grid-gap: 5rem;
    }

    .grid-clients .image {
        max-width: inherit;
        height: 4rem;
    }
}