/*
Theme Name: Pivotal Custom
Theme URI: https://example.com/
Description: Custom theme for Pivotalsl website.
Author: Samii Noden-Poli
Template: twentytwentyfive
Version: 1.0
*/

/*** GLOBAL STYLES ***/
body {
    padding: 0;
    padding-top: 75px; /*FIXED HEADER*/
    margin: 0;
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
    color: var(--wp--preset--color--black);
    overflow-x: hidden;
    transition: all .25s ease;
    text-box-trim: trim-both;

    @media screen and (min-width: 1024px) {
        padding-top: 90px; /*FIXED HEADER*/
        font-size: 1.25rem;
    }
}

/*** HEADINGS ***/
.display, h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 600;
    margin: 0 0 1rem 0;
    @media screen and (min-width: 768px) {
        margin: 0 0 1.5rem 0;
    }
}

.display {
    font-size: var(--wp--preset--font-size--72);
    font-weight: 400;
}

h1, .h1 {
    font-size: var(--wp--preset--font-size--64);
    font-weight: 400;
}

h2, .h2 {
    font-size: var(--wp--preset--font-size--48);
}

h3, .h3 {
    font-size: var(--wp--preset--font-size--32);
}

h4, .h4 {
    font-size: var(--wp--preset--font-size--24);
}

h5, .h5 {
    font-size: var(--wp--preset--font-size--20);
}

h6, .h6 {
    font-size: var(--wp--preset--font-size--18);
}

.section-heading {
    text-align: center;
    margin: 0 auto 1rem;
    font-size: var(--wp--preset--font-size--32);
    @media screen and (min-width: 1024px) {
        max-width: 60%;
        font-size: var(--wp--preset--font-size--48);
    }
}

section {
    margin: 0;
}

/*** CONTAINER ***/
.container {
    max-width: 90%;
    margin: 0 auto;
    padding: 1.875rem 1.25rem;

    @media screen and (min-width: 768px) {
        padding: 3.75rem 2.5rem;
    }

    @media screen and (min-width: 1024px) {
        padding: 3.75rem 0;
    }

    @media screen and (min-width: 1600px) {
        max-width: 1400px;
    }

    &.full-width {
        max-width: 100%;
        width: 100%;
        margin: 0;
        padding: 0;
        .section-heading {
            padding: 0 1.25rem;
            @media screen and (min-width: 1024px) {
                padding: 0;
            }
        }
    }
}

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

/*** BUTTONS ***/
.btn {
    width: max-content;
    text-align: center;
    padding: .5rem 1.625rem;
    transition: all .25s ease;
    /*transform: skewX(-5deg); - removed skew, don't like it in practice*/
    font-weight: 600;
    &:hover {
        text-decoration: none;
    }

    &.btn-primary {
        background: var(--wp--preset--color--primary);
        color: var(--wp--preset--color--white);
        border: 2px solid var(--wp--preset--color--primary);
        &:hover {
            color: var(--wp--preset--color--primary);
            background: var(--wp--preset--color--white);
        }
    }

    &.btn-secondary {
        background: var(--wp--preset--color--white);
        color: var(--wp--preset--color--primary);
        border: 2px solid var(--wp--preset--color--primary);
        &:hover {
            color: var(--wp--preset--color--white);
            background: var(--wp--preset--color--purple-1);
        }
    }

    /*span {
        transform: skewX(5deg);
    } - skew removed, so no need to unskew the text*/
}


/*** COLOUR SCHEMES ***/
.white {
    background: var(--wp--preset--color--white);
    color: var(--wp--preset--color--black);
}

.dark {
    background: var(--wp--preset--color--black);
    color: var(--wp--preset--color--white);
}

.purple {
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
    .btn-primary {
        background: var(--wp--preset--color--white);
        color: var(--wp--preset--color--primary);
        border: 2px solid var(--wp--preset--color--white);
        &:hover {
            color: var(--wp--preset--color--white);
            background: var(--wp--preset--color--primary);
        }
    }
}

/*** IMAGES ***/
img {
    width: 100%;
    height: auto;
    display: block;
}

.icon {
    height: 1rem;
    width: 1rem;
    display: inline-block;
    vertical-align: bottom;
    margin-right: 1rem;
}

.skew {
    @media screen and (min-width: 1024px) {
        transform: skew(-5deg);
        overflow: hidden;
        max-width: 95%;

        img {
            transform: skew(5deg) translateX(-5%); /* Skew in the other direction to straighten out the image and move to the left with half of the extra width */
            object-fit: cover;
            object-position: center;
            width: 115%; /* Slightly larger to cover edges */
            height: 100%;
        }
    }
}

/*** SWIPER ***/
.swiper-navigation {
    width: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    @media screen and (max-width: 1199px) {
        display: none;
    }

    .swiper-button-next, .swiper-button-prev {
        color: var(--wp--preset--color--white);
    }
}

.swiper-pagination-bullet {
    height: .875rem;
    width: .875rem;
    opacity: 1;
}

.purple {
    .swiper-pagination-bullet {
        background: var(--wp--preset--color--white);
        opacity: 1;
    }

    .swiper-pagination-bullet-active {
        border: 1px solid var(--wp--preset--color--black);
    }
}

.white {
    .swiper-pagination-bullet {
        background: var(--wp--preset--color--primary);
        opacity: 1;
    }

    .swiper-pagination-bullet-active {
        background: var(--wp--preset--color--primary);
        border: 1px solid var(--wp--preset--color--black);
    }

    .swiper-button-prev, .swiper-button-next {
        color: var(--wp--preset--color--primary);
    }
}

.dark {
    .swiper-pagination-bullet {
        background: var(--wp--preset--color--white);
        opacity: 1;
    }

    .swiper-pagination-bullet-active {
        background: var(--wp--preset--color--primary);
        border: 1px solid var(--wp--preset--color--white);
    }
}

.swiper-mobile {
    @media screen and (min-width: 768px) {
        .swiper-pagination {
            display: none;
        }
    }
}


/*** ANIMATIONS ***/
[class*="fade-in"] {
    opacity: 0;
    transition: all 0.5s ease;
    &.faded-in {
        opacity: 1;
        transform: none;
        &.skew {
            @media screen and (min-width: 1024px) {
                transform: skew(-5deg);
            }
        }
    }
}

.fade-in-left {
    transform: translateY(50px);
    @media screen and (min-width: 1024px) {
        transform: translateX(-50px);
    }
    &.skew {
        @media screen and (min-width: 1024px) {
            transform: translateX(-50px) skew(-5deg);
        }
    }
}

.fade-in-right {
    transform: translateY(50px);
    @media screen and (min-width: 1024px) {
        transform: translateX(50px);
    }
    &.skew {
        @media screen and (min-width: 1024px) {
            transform: translateX(50px) skew(-5deg);
        }
    }
}

.fade-in-down {
    transform: translateY(50px);
    @media screen and (min-width: 1024px) {
        transform: translateY(-50px);
    }
    &.skew {
        @media screen and (min-width: 1024px) {
            transform: translateY(-50px) skew(-5deg);
        }
    }
}

.fade-in-up {
    transform: translateY(50px);
    &.skew {
        @media screen and (min-width: 1024px) {
            transform: translateY(50px) skew(-5deg);
        }
    }
}

/*** HEADER ***/
.header {
    height: 75px;
    top: 0;
    left: 0;
    width: 100%;
    position: fixed;
    z-index: 999;
    margin: 0;
    font-size: var(--wp--preset--font-size--16);

    @media screen and (min-width: 1024px) {
        height: 90px;
    }

    &.error {
        justify-content: space-between;
    }

    .container {
        display: flex;
        align-items: center;
        max-width: initial;
        width: initial;
        padding: 0;
        justify-content: space-between;
        height: 100%;
        margin: 0 20px;

        @media screen and (min-width: 1024px) {
            margin: 0 40px;
        }
    }

    /* -------------------------
       MOBILE MENU
    -------------------------- */
    .mobile-menu {
        background: var(--wp--preset--color--primary);
        height: 100dvh;
        position: fixed;
        left: 0;
        top: 75px;
        width: 100%;

        @media screen and (min-width: 1024px) {
            display: none;
        }

        .menu-wrapper {
            display: flex;
            flex-direction: column;
            width: 100dvw;
            list-style-type: none;

            .menu-item {
                position: relative;
                padding: .25rem 2.5rem;
                width: 100%;
                font-size: var(--wp--preset--font-size--20);

                &.active,
                &:focus,
                &.open {
                    background: var(--wp--preset--color--purple-1);
                }

                .icon {
                    margin-left: 1.75rem;
                    height: 1rem;
                    width: 1rem;
                }
            }

            /* MOBILE DROPDOWN LIST */
            .dropdown-list {
                list-style-type: none;
                padding: .5rem 0;
                background: var(--wp--preset--color--purple-1);
                display: none;

                .dropdown-item {
                    padding: 0 23px;
                    position: relative;

                    &.active,
                    &:hover,
                    &:focus {
                        background: var(--wp--preset--color--primary);
                    }

                    @media screen and (max-width: 1023px) {
                        margin-left: -2.5rem;
                        padding-left: 4rem;
                    }
                }
            }
        }
    }

    /* -------------------------
       LOGO
    -------------------------- */
    .logo {
        width: 150px;
        height: 53px;
    }

    /* -------------------------
       HAMBURGER
    -------------------------- */
    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;

        @media screen and (min-width: 1024px) {
            display: none;
        }

        span {
            width: 1.5rem;
            height: .1875rem;
            border-radius: .125rem;
            background: var(--wp--preset--color--white);
            transition: .25s ease;
        }

        &.close {
            span:first-child {
                transform: rotate(45deg) translate(30%, 70%);
            }

            span:nth-child(2) {
                transform: translateX(-100%);
                opacity: 0;
            }

            span:last-child {
                transform: rotate(-45deg) translate(40%, -150%);
            }
        }
    }

    /* -------------------------
       DESKTOP MENU
    -------------------------- */
    .desktop-menu {
        @media screen and (max-width: 1023px) {
            display: none;
        }

        .menu-wrapper {
            display: flex;
            margin: 0;
            padding: 0;
            list-style-type: none;
            gap: 1.5rem;
            font-weight: 600;

            .menu-item {
                position: relative;

                &.active, &:hover, &:focus {
                    &::before {
                        content: "";
                        width: calc(100% + 1rem);
                        height: 90px;
                        position: absolute;
                        left: 50%;
                        top: 50%;
                        transform: translate(-50%, -50%) skewX(-5deg);
                        background: var(--wp--preset--color--purple-1);
                        z-index: -1;
                    }
                }
            }
            
            .menu-item-wrapper {
                position: relative;
                &.open {
                    .menu-item::before {
                        content: "";
                        width: calc(100% + 1rem);
                        height: 90px;
                        position: absolute;
                        left: 50%;
                        top: 50%;
                        transform: translate(-50%, -50%) skewX(-5deg);
                        background: var(--wp--preset--color--purple-1);
                        z-index: -1;
                    }

                    &::after {
                        content: "";
                        width: 150%;
                        height: 100dvh;
                        position: absolute;
                        left: -25%;
                        top: 0;
                        background: transparent;
                        z-index: -1;
                    }
                }

                .dropdown {
                    display: flex;
                    align-items: center;
                    gap: .5rem;

                    .dropdown-button {
                        appearance: none;
                        background: none;
                        border: none;
                        color: inherit;
                        font-size: inherit;
                        font-weight: inherit;
                        font-family: var(--wp--preset--font-family--arial);
                        cursor: pointer;
                    }

                    .icon {
                        height: 1.25rem;
                        width: 1.25rem;
                        transition: .25s ease;
                    }
                }

                /* Desktop dropdown wrapper */
                .dropdown-wrapper {
                    display: none;
                    position: absolute;
                    left: -12px;
                    top: 90%;
                    padding-top: 2rem;
                    z-index: 10;

                    .dropdown-list {
                        list-style-type: none;
                        padding: .5rem 0;
                        background: var(--wp--preset--color--purple-1);
                        width: max-content;

                        .dropdown-item {
                            padding: 0 23px;
                            position: relative;
                            font-size: var(--wp--preset--font-size--16);

                            &.active,
                            &:hover,
                            &:focus {
                                background: var(--wp--preset--color--primary);
                            }
                        }
                    }
                }

                /* Icon rotation */
                &.open .icon {
                    transform: rotate(-180deg);
                }
            }
        }
    }
}

/*** ERROR 404 PAGE ***/
.error-404 {
    text-align: center;
}

/*** FOOTER ***/
.footer {
    margin: 0;
    font-size: var(--wp--preset--font-size--16);
    p, li {
        margin: 0;
    }
    a {
        margin-bottom: 1rem;
    }
    .container {
        display: grid;
        grid-template-rows: repeat(7, auto);
        grid-row-gap: 1.5rem;

        @media screen and (min-width: 1024px) {
            grid-template-rows: repeat(3, auto);
            grid-template-columns: auto, 1fr auto;
        }

        .logo-wrapper {
            .logo {
                max-width: 100px;
                max-height: 35px;
                @media screen and (min-width: 1024px) {
                    max-height: 52px;
                    max-width: 150px;
                }
            }
            .logo-text {
                font-family: var(--wp--preset--font-family--georgia);
            }
        }

        .menu-wrapper {
            padding: 0;
            list-style: none;
            margin: 0;
            @media screen and (min-width: 1024px) {
                column-count: 2;
            }
        }

        .legal-wrapper, .copy-wrapper, .info-wrapper {
            display: flex;
            @media screen and (min-width: 1024px) {
                align-items: end;
            }
        }

        .legal-wrapper {
            @media screen and (max-width: 1023px) {
                grid-row: 5 / 6;
            }
            @media screen and (min-width: 1024px) {
                grid-column: 2 / 3;
            }
            a {
                margin-right: 1rem;
                margin-bottom: 0;
            }
        }

        .social-wrapper {
            @media screen and (min-width: 1024px) {
                grid-column: 3 / 4;
                margin-bottom: 2rem;
            }
        }

        .contact-wrapper {
            display: flex;
        }

        .info-wrapper, .contact-wrapper {
            flex-direction: column;
        }

        .address {
            @media screen and (min-width) {
                margin: 1.5rem 0;
            }
        }

        .icon {
            height: 1.25rem;
            width: 1.25rem;
        }
    }
}

/*** UNDO WORDPRESS DEFAULTS ***/
.wp-site-blocks, .wp-block-group {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
    display: block !important;
}

.wp-site-blocks {
    @media screen and (min-width: 768px) {
        display: grid;
        grid-template-rows: auto 1fr auto;
    }
}

:root :where(.is-layout-constrained) > * {
    margin-block-start: 0;
    margin-block-end: 0;
}

:where(.wp-site-blocks) > * {
    margin-block-start: 0;
}

/*** COOKIE BANNER OVERRIDE ***/
.cky-preference-center {
    background: var(--wp--preset--color--black) !important;
}

.cky-btn-revisit-wrapper, .cky-switch input[type="checkbox"]:checked {
    background: var(--wp--preset--color--primary) !important;
}

.cky-btn {
    background: var(--wp--preset--color--primary) !important;
    border-color: var(--wp--preset--color--primary) !important;
}

.cky-always-active {
    color: var(--wp--preset--color--primary) !important;
}

.cky-policy, .cky-show-desc-btn {
    color: var(--wp--preset--color--white) !important;
}