/*
Theme Name: Grounds Management
Author: James Davey
Description: A custom theme for a grounds management style
*/

/* ---------------------------------------- Blocks  */

header {
    position: fixed;
    width: 100%;
    z-index: 50;
    top: 0;
    left: 0;
    right: 0;
}

a {
    text-decoration-line: none;
    &:hover {
        text-decoration-line: underline;
    }
}

ul {
    height: 100%;
}

button > svg {
    width: 3rem !important;
    height: 3rem !important;
    margin: 1.5rem;
}

/* ---------------------------------------- Header Elements */

body.home header .wp-block-image > a {
    pointer-events: none !important;
}

header {
    & .mega-toggle-block {
        width: 80px;
        justify-content: center;
    }

    & .mega-menu-link {
        width: 9rem !important;
        text-align: center !important;
    }

    & .mega-current-menu-item > a {
        color: var(--wp--custom--color--grey) !important;
        text-decoration-line: underline !important;
        pointer-events: none !important;
    }

    & .wp-block-image > a {
        height: 96px;
        align-items: center;
        display: flex !important;
        padding: 0 1rem;

        &:hover {
            background-color: var(--wp--custom--color--darkgreen);
            transition-duration: 300ms;
            > img {
                filter: var(--wp--preset--duotone--duotone-2) !important;
            }
        }
    }

    @media screen and (max-width: 1020px) {
        > .wp-block-group {
            padding: 0 !important;
        }
        & .mega-menu-link {
            width: 6.5rem !important;
        }
    }

    @media screen and (max-width: 782px) {
        & .mega-menu-link {
            width: 100% !important;
        }
    }
}

/* ---------------------------------------- Footer Elements */

footer {
    & a {
        display: flex;
        align-items: center;
        gap: 1rem;

        > svg {
            width: 2rem !important;
            height: 2rem !important;
        }
    }

    @media screen and (max-width: 1020px) {
        > .wp-block-group {
            padding: 5rem var(--wp--preset--spacing--32) !important;
        }
    }

    @media screen and (max-width: 782px) {
        > .wp-block-group {
            gap: var(--wp--preset--spacing--32) !important;
            justify-content: space-between;
        }

        & a > svg {
            width: 3rem !important;
            height: 3rem !important;
        }
        
        & ul {
            gap: 1rem !important;
        }
    }
}

/* ---------------------------------------- Page Elements */

.entry-content {
    background-color: white;
    width: 100%;
}

.wp-block-cover {
    width: 100%;
}

.wp-block-button > a:hover {
    background-color: var(--wp--custom--color--darkgreen) !important;
    color: white !important;
    transition-duration: 300ms;
}

.wp-site-blocks {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    > * {
        margin-block-start: 0px !important;
        overflow: hidden;
    }
}

.wp-post-image {
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: fixed !important;
    z-index: -10;
    overflow: hidden;
}

.wp-block-post-title, body.home .wp-block-cover .wp-block-heading {
    text-shadow: 0 4px 4px #00000040;
}

.wp-block-social-link-anchor {
    font-weight: bold;

    &:hover {
        color: var(--wp--custom--color--green) !important;
        transition-duration: 300ms;
    }
}

body.home h2 > a {
    padding: var(--wp--preset--spacing--16);
}

.wp-block-columns {
    justify-content: center !important;
}

.wp-block-column {
    min-width: 120px;
}

.wp-block-gallery a:hover {
    filter: brightness(150%);
    transition-duration: 300ms;
}

a.fancybox-inline {
    height: 12rem;
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--wp--preset--spacing--24);
    padding-right: var(--wp--preset--spacing--16);
    padding-left: var(--wp--preset--spacing--16);

    &:hover {
        outline: 1rem solid var(--wp--custom--color--green);
        box-shadow: none;
        transition: ease-out;
        transition-duration: 300ms;
        > * {
            text-decoration-line: underline;
        }
        &.a-winter {
            outline: 1rem solid white;
        }
    }
    &:not(:hover) {
        outline: 0 solid var(--wp--custom--color--green);
        transition: ease-out;
        transition-duration: 300ms;
        &.a-winter {
            outline: 0rem solid white;
        }
    }

    > * {
        color: var(--wp--custom--color--dark);
    }
}

.fancybox-hidden {
    padding: var(--wp--preset--spacing--40);
}

.service-gallery {
    overflow: scroll;
    overflow-y: hidden;
    
    > div {
        gap: 0.5rem;
        width: max-content;
    }

    img {
        width: 300px !important;
        max-height: 15rem !important;
    }

    /* Width */
    &::-webkit-scrollbar {
        height: 2rem;
        background: var(--wp--custom--color--lightgreen); 
    }
   
    /* Handle */
    &::-webkit-scrollbar-thumb {
        background: var(--wp--custom--color--green); 
    }
    
    /* Handle on hover */
    &::-webkit-scrollbar-thumb:hover {
        background: var(--wp--custom--color--darkgreen); 
    }
}


.wpcf7-form {
    font-family: var(--wp--preset--font-size--medium);

    > .input-row {
        display: flex;
        flex-direction: row;
        gap: 1rem;
    }
    & label > span {
        padding-bottom: var(--wp--preset--spacing--16);
        display: flex !important;
        flex-direction: column;
        width: 100%;
    }
    & input,textarea {
        padding: 0.5rem;
        border: 1px solid var(--wp--custom--color--green);
        width: inherit;
        min-width: 100px;
        min-height: 48px;
        max-height: 248px;
        &:focus {
            outline-color: var(--wp--custom--color--green) !important;
        }
    }
    & textarea {
        height: 120px;
    }
    & .wpcf7-submit {
        width: 15rem;
        background-color: var(--wp--custom--color--green);
        &:hover {
            background-color: var(--wp--custom--color--darkgreen);
            color: white;
            transition-duration: 300ms;
        }
    }
    & .wpcf7-response-output {
        margin: 1rem 0 0 !important;
    }
}

.wp-block-social-links {
    min-width: 120px;
}

@media screen and (max-width: 1020px) {
    h2 > a {
        font-size: var(--wp--preset--font-size--md-large) !important;
    }

    .index-paragraph {
        padding: 3rem !important;
    }

    .wp-block-gallery {
        columns: 3 !important;
        gap: var(--wp--preset--spacing--24) !important;
    }

    .service-card {
        max-width: 350px;
        & h6 {
            font-size: var(--wp--preset--font-size--medium) !important;
        }
        & p {
            font-size: var(--wp--preset--font-size--small) !important;
        }
    }

    .service-gallery img {
        width: 240px !important;
        max-height: 12rem !important;
    }
}

@media screen and (max-width: 782px) {

    /* Affects only home/index page */
    body.home {
        .wp-block-cover__inner-container {
            & .wp-block-column {
                display: flex;
                flex-direction: column;
                align-items: center;
            }
        }
    
        .wp-block-columns {
            margin: 0 !important;
        }

        .wp-block-group > .wp-block-columns:nth-of-type(2n+3) {
            display: flex;
            flex-direction: column-reverse;
        }

        .index-paragraph {
            padding: 2rem !important;
        }
    }

    .wp-block-column {
        > .wp-block-social-links {
            justify-content: center;
            flex-direction: row;
        }
        > figure {
            display: flex !important;
            width: 100% !important;
            justify-content: center;
            > img {
                height: 400px !important;
            }
        } 
    }

    .service-cards {
        > .service-card {
            max-width: 280px;
            & h6 {
                font-size: var(--wp--preset--font-size--medium) !important;
            }
            & p {
                font-size: var(--wp--preset--font-size--small) !important;
            }
        }
    } 

    .service-gallery img {
        width: 160px !important;
        max-height: 8rem !important;
    }

    .fancybox-hidden {
        padding: 2rem !important;
        font-size: var(--wp--preset--font-size--small) !important;
    }

    .wp-block-button {
        font-size: var(--wp--preset--font-size--md-large) !important;
        > a {
            padding: var(--wp--preset--spacing--24) var(--wp--preset--spacing--40) !important;
        }
    }
    
    .wpforms-submit-container {
        display: flex;
        justify-content: center;
    }

    figure {
        margin: 0 !important;
    }

    .error404 h2,.error404 p{
        padding: 7.5vw 7.5vw 0 !important;
    }
}

@media screen and (max-width: 599px) {
    .wp-block-gallery {
        gap: var(--wp--preset--spacing--16) !important;
    }
}