/*
Theme Name: Sport and Life
Author: Maple Rock Design
Description: A custom WordPress theme for Sport and Life.
Version: 1.0.0
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 8.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sport-and-life
*/

@import url("https://use.typekit.net/yii2ruu.css");
/* <link rel="stylesheet" href="https://use.typekit.net/yii2ruu.css"> */

html,body {
    height: 100%;
    line-height: 1.4;
}

.wp-site-blocks {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}



/*Hover Effects for terms and block cards*/
.wp-block-query {
    .wp-block-post .wp-block-post-featured-image {
        overflow: hidden;
    }

    .wp-block-post:hover .wp-block-post-featured-image img {
        scale: 1.3;
    }

    .wp-block-post:hover .wp-block-post-featured-image img {
        transition: all 0.3s;
    }
}

.wp-block-terms-query .wp-block-term {

    &:hover img {
        scale: 1.3;
    }

    .wp-block-image {
        overflow: hidden;

        img {
            transition: all 0.3s;
        }
    }
}


/* Main and Category Navigation Menu Styles */
.wp-block-navigation-item__label {
    font-weight: 300;
}

.wp-block-navigation-item__label:hover,
.current-menu-item .wp-block-navigation-item__label,
.current-menu-ancestor .wp-block-navigation-item__label {
    font-weight: 500;
}

li.sport-life-main-menu + li.sport-life-main-menu:before,
li.sport-life-cat-menu + li.sport-life-cat-menu:before {
  content: '|';
  margin-left: 1rem;
  margin-right: 1rem;
  position: relative;
  top: -2px;
}

.sport-life-cat-menu-wrapper {
    justify-content: center;
    margin-top: 1rem;
}

.mrd-search {

    .wp-block-search__button {
        max-width: 30px !important;
    }

}

.wp-block-group.is-linked {

    .wp-block-group:first-of-type:has(img) {
        overflow: hidden;
    }
    .wp-block-group:first-of-type img {
        transition: 0.2s;
    }
    &:hover .wp-block-group:first-of-type img {
        scale: 1.3
    }
}

.is-advert {

    text-align: center;
    position: relative;

    &:before {
        display: block;
        content: 'Advertisement';
        padding: 1rem 0;
        text-align: center;
        text-transform: uppercase;
        font-size: 80%;
        background-color: white;
        display: inline-block;
        margin: 0 auto;
        z-index: 1;
        position: relative;
        padding: 8px 10px;
    }

    &:after {
        display: block;
        content: '';
        height: 1px;
        width: 100%;
        background-color: var(--wp--preset--color--mid);
        position: absolute;
        top: 16px;
    }
}

@keyframes sweepBorder {
    to {
        background-position: 0 200%;
    }
}

.wp-block-query .wp-block-post > .wp-block-group {
    position: relative;

    --transition: 0.25s;

    &:before {
        content: "";
        position: absolute;
        inset: -1px;
        border-radius: inherit;
        padding: 1px;
        visibility: hidden;

        background: linear-gradient(
                120deg,
                transparent 20%,
                var(--wp--preset--color--accent) 50%,
                transparent 80%
        );

        background-size: 200% 100%;
        background-position: -200% 0;

        -webkit-mask:
                linear-gradient(#000 0 0) content-box,
                linear-gradient(#000 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;

        pointer-events: none;
    }

    &:hover:before {
        visibility: visible;
        animation: sweepBorder 0.8s ease forwards;
    }
}

.wp-block-query .is-layout-grid .wp-block-post:has(> .mrd-stack-pattern.has-light-background-color) {
    display: flex;
    flex-direction: column;

    > div {
        flex: 1 0 auto;
    }

    background-color: var(--wp--preset--color--light);
}


.mrd-stack-pattern {
    flex: 1 0 auto;

    &:hover  h3 a, &:hover  h3{
        color: var(--wp--preset--color--accent);
    }
}

body.is-featured {
    main > .wp-block-group:nth-child(2) > .wp-block-group {
        border-top: 5px solid var(--wp--preset--color--mid);
    }
}



/*MOBILE STYLES CUSTOM BLOCK BITS*/
.wp-site-blocks .wp-block-template-part:has(header) {

    header {
        gap: 20px;
        justify-content: center;
        align-items: center;
        padding: 0 !important;


        @media (max-width: 600px) {
            > .wp-block-group {
                justify-content: center;
                align-items: center;
            }
        }

    }

    .site-logo {
        width: 300px;
        height: auto;

        @media (min-width: 600px) {
            width: revert;
        }
    }
}


.wp-block-terms-query .is-layout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));

    @media (min-width: 600px) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}


:root :where(.is-layout-grid) {
    gap: calc(var(--wp--style--block-gap)/2);

    @media (min-width: 600px) {
        gap: var(--wp--style--block-gap)
    }
}

main {

    @media (max-width: 600px) {
        margin-top: 0 !important;
        margin-block-start: 0 !important;
    }

}

@media (max-width: 600px) {

    .mrd-featured.mrd-collapse-mobile {
        gap: 0;
    }

    .mrd-featured.mrd-collapse-mobile > *:not(figure, a) {
        padding: 1rem;
    }
    .mrd-featured.mrd-collapse-mobile .wp-block-post-title {
        margin-block-start: 1rem;
    }


    footer {

        .alignright {
            float: none  !important;
            margin-inline-start: 0  !important;
        }

        figure {
            margin: 0 auto  !important;
        }

        .subscribe-card {
            gap: 10px !important;
            padding-bottom: 1rem;

            img {
                width: 100% !important;
            }

            > *:not(:first-child) {
                padding: 0 1rem;
            }
        }
    }
}
