@import 'agogo.css';

/* -------------------------------- 

File#: _1_banner
Title: Banner
Descr: A CTA banner containing text + media
Usage: codyhouse.co/license

-------------------------------- */


/* -------------------------------- 
  
  Component 
  
  -------------------------------- */

.banner {
    display: block;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    background-color: hsl(0, 0%, 95%);
    box-shadow: 0 0 0 1px hsla(230, 13%, 9%, 0.05),
        0 0.3px 0.4px hsla(230, 13%, 9%, 0.02),
        0 0.9px 1.5px hsla(230, 13%, 9%, 0.045),
        0 3.5px 6px hsla(230, 13%, 9%, 0.09);
    border-style: solid;
    border-radius: 0.375em;
    border-color: rgb(206, 96, 96);
    border-width: 0.2em;
    transition: 0.3s;
}

.banner__text > h2 {
    text-decoration: none;
    color: rgb(206, 96, 96);
    border-bottom: 0px;
    font-size: 1.7em;
}

.banner__grid {
    display: flex;
    flex-direction: column;
}

.banner__grid>* {
    min-width: 0;
}

.banner__link {
    position: relative;
    text-decoration: none;
    color: hsl(250, 84%, 54%);
    display: inline-block;
    transition: 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
    transform-origin: left bottom;
}

.banner__link i {
    /* label */
    position: relative;
    z-index: 2;
    display: inline-block;
    transition: 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.banner__link::after {
    /* animated border */
    content: "";
    background-color: currentColor;
    height: 2px;
    width: 100%;
    position: absolute;
    z-index: 1;
    bottom: 0;
    left: 0;
    -webkit-clip-path: inset(0% round 0.1875em);
    clip-path: inset(0% round 0.1875em);
    opacity: 0.15;
    transition: 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.banner__figure {
    height: 0;
    width: 100%;
    padding-bottom: 50%;
    transition: 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

.banner__text {
    padding: 1.5rem;
}

.banner__link-wrapper {
    margin-top: 1rem;
}

.banner:hover {
    box-shadow: 0 0 0 1px hsla(230, 13%, 9%, 0.05),
        0 0.9px 1.25px hsla(230, 13%, 9%, 0.025),
        0 3px 5px hsla(230, 13%, 9%, 0.05),
        0 12px 20px hsla(230, 13%, 9%, 0.09);
}

.banner:hover .banner__link {
    transform: scale(1.3);
}

.banner:hover .banner__link i {
    /* reverse parent transformation */
    transform: scale(0.7);
}

.banner:hover .banner__link::after {
    height: 100%;
}

.banner:hover .banner__figure {
    transform: scale(1.05);
}

@media (min-width: 64rem) {
    .banner__grid {
        flex-direction: row-reverse;
    }

    .banner__grid>* {
        width: 50%;
    }

    .banner__figure {
        height: 100%;
        padding-bottom: 0;
        -webkit-clip-path: polygon(100px 0%, 100% 0%, 100% 100%, 50px 100%);
        clip-path: polygon(100px 0%, 100% 0%, 100% 100%, 50px 100%);
    }

    .banner__text {
        padding: 3rem;
    }

    .banner__link-wrapper {
        margin-top: 2rem;
    }

    .banner--invert .banner__grid {
        flex-direction: row;
    }

    .banner--invert .banner__figure {
        -webkit-clip-path: polygon(0% 0%, calc(100% - 100px) 0%, calc(100% - 50px) 100%, 0% 100%);
        clip-path: polygon(0% 0%, calc(100% - 100px) 0%, calc(100% - 50px) 100%, 0% 100%);
    }

    .banner--invert .banner__text {
        text-align: right;
    }

    .banner--invert .banner__link {
        transform-origin: right bottom;
    }

    .banner:hover .banner__figure {
        -webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    }
}
