/*
Theme Name: AIS
Author: Silomedia
Author URI: https://silomedia.co.uk
Description: Bespoke one-page theme for AIS
Version: 2025
Text Domain: ais
*/

/*******************************************************************/
/* Imports                                                         */
/*******************************************************************/

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap');
@import url('https://unpkg.com/aos@2.3.1/dist/aos.css');

/*******************************************************************/
/* Reset                                                           */
/*******************************************************************/

*, *::before, *::after { box-sizing: border-box; scroll-margin-top: 6rem; }
html, body { margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
       overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}


/*******************************************************************/
/* Settings                                                        */
/*******************************************************************/

:root {
    --primary: #21c59a;
    --primary-dark: #37976e;

    --secondary: #21c59a;
    --secondary-dark: #37976e;
    --secondary-gradient: linear-gradient(90deg, #a4f79d 0%, #1bf4c3 100%);

    --black: #000000;
    --white: #ffffff;

    --bg: #ffffff;
    --bg-alt: #f8f8f8;

    --heading-font: 'Noto Sans', sans-serif;
    --body-font: 'Noto Sans', sans-serif;

    font-size: 19px;
    @media(max-width: 1100px) { font-size: 17px; }
    @media(max-width: 900px) { font-size: 16px; }
}

/*******************************************************************/
/* Global, Type & Layout                                           */
/*******************************************************************/

body {
    font-family: var(--body-font);
    background-color: var(--bg);
    color: var(--primary-alt);
    line-height: 1.6;
    font-feature-settings: normal;
    font-variation-settings: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    color: var(--black);
    margin: 0 0 1rem;
    font-weight: 750;
    line-height: 1.2;
    text-wrap: balance;

    strong {
        color: var(--primary);
        font-weight: 750;
    }
}

img {
    max-width: 100%;
}

h1 {
    font-size: clamp(2.5rem, 7vw, 4rem);
}

h2 {
    font-size: clamp(2rem, 5.5vw, 3.5rem);
    margin-bottom: 1.5rem;
    max-width: 26ch;
}

h3 {
    font-size: 1.5rem;
}

strong {
    color: var(--primary);
    font-weight: 600;
}

hr {
    border: 0;
    border-top: 3px solid var(--primary);
    margin: 1rem 0;
}

p, ul, ol {
    font-size: 1.1rem;
    text-wrap: pretty;

    &:first-child {
        margin-top: 0;
    }

    &:last-child {
        margin-bottom: 0;
    }
}

.lead {
    font-size: 1.4rem;
    font-weight: 700;
    text-wrap: balance;
}

em {
    opacity: 0.6;
}

.container {
    max-width: 70rem;
    margin: 0 auto;
    width: 100%;
    padding: 0 2rem;

    @media(max-width: 700px) {
        padding: 0 1rem;
    }
}

a.button, form input[type="submit"] {
    border-radius: 100vh;
    color: var(--white);
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 2rem;
    text-decoration: none;
    min-width: 9rem;
    text-align: center;
    transition: background-color 0.3s, color 0.3s;
    background: linear-gradient(135deg, var(--black) 0%, var(--black) 100%);
    transition: 300ms;

    @media(max-width: 700px) {
        min-width: 0;
    }

    &:hover {
        background: var(--secondary-gradient);
        color: var(--black);
    }
}

.bg-alternate {
    background-color: var(--bg-alt);
}

/*******************************************************************/
/* Header                                                          */
/*******************************************************************/

header#masthead {
    position: sticky;
    top: 0;
    padding: 1.5rem 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;

    @media(max-width: 700px) {
        padding: 1rem 0;
    }

    .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .header-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .site-title {
        display: block;
        
        img {
            height: 3.5rem;
            transition: 300ms ease;

            @media(max-width: 700px) {
                height: 3rem !important;
            }
        }
    }

    .header-navigation {
        display: flex;
        align-items: center;
        gap: 2rem;

        @media(max-width: 700px) {
            gap: 1.5rem;
        }
    }

    .header-buttons {
        display: flex;
        align-items: center;
        gap: 1.5rem;

        .button {
            background: var(--primary);
            padding: 0.5rem 2rem;
            min-width: auto;
        }
        
        @media(max-width: 700px) {
            gap: 1rem;
        }
    }

    #top-menu {
        display: flex;
        gap: 3rem; /* Increased from 2rem for more space between nav items */
        list-style: none;
        margin: 0;
        padding: 0;

        @media(max-width: 900px) {
            display: none;
        }

        a {
            color: var(--black);
            text-decoration: none;
            font-weight: 500;
            transition: color 0.3s ease;

            &:hover {
                color: var(--primary);
            }
        }
    }

    &.is-sticky {
        padding: 1rem 0;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);

        .site-title img {
            height: 3.5rem;
        }
    }
}

/* Hamburger Menu */
.hamburger-toggle {
    display: none; /* Hide by default */
    padding: 0;
    cursor: pointer;
    background-color: transparent;
    border: 0;
    margin: 0;
    outline: none;
    z-index: 1001;

    @media(max-width: 900px) {
        display: flex; /* Show only on mobile when nav collapses */
    }
}

.hamburger-box {
    width: 30px;
    height: 24px;
    display: inline-block;
    position: relative;
}

.hamburger-inner {
    display: block;
    top: 50%;
    margin-top: -2px;

    &, &::before, &::after {
        width: 30px;
        height: 3px;
        background-color: var(--black);
        border-radius: 4px;
        position: absolute;
        transition: transform 0.15s ease, background-color 0.15s ease;
    }

    &::before, &::after {
        content: "";
        display: block;
    }

    &::before {
        top: -10px;
    }

    &::after {
        bottom: -10px;
    }
}

.hamburger-toggle.is-active .hamburger-inner {
    transform: rotate(45deg);

    &::before {
        transform: translate3d(0, 10px, 0) rotate(-90deg);
    }

    &::after {
        transform: translate3d(0, -10px, 0) rotate(90deg);
    }
}

/* Off-Canvas Menu */
.off-canvas-menu {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: linear-gradient(135deg, var(--white) 0%, var(--bg-alt) 100%);
    z-index: 1000000;
    transition: right 0.4s ease-in-out;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    padding: 5rem 3rem 3rem;
    border-left: 5px solid;
    border-image: linear-gradient(180deg, #a4f79d 0%, #1bf4c3 100%);
    border-image-slice: 1;

    .off-canvas-menu-inner {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    @media(max-width: 700px) {
        width: 320px;
        right: -320px;
        padding: 3rem 2rem 2rem;
    }

    @media(max-width: 500px) {
        width: 300px;
        right: -300px;
    }

    &.is-active {
        right: 0;
    }

    /* Logo in off-canvas menu */
    .offcanvas-logo {
        margin-bottom: 2.5rem;
        display: block;
        
        img {
            max-width: 160px;
            height: auto;
        }
    }

    /* Navigation in off-canvas menu */
    ul {
        list-style: none;
        margin: 0 0 2.5rem 0;
        padding: 0;
        flex-grow: 1;

        li {
            margin-bottom: 1rem;
            position: relative;
            overflow: hidden;
            padding: 0;
        }

        a {
            color: var(--black);
            font-size: 1.2rem;
            text-decoration: none;
            font-weight: 600;
            display: block;
            padding: 0.3rem 0;
            transition: all 0.3s ease;
            position: relative;

            &:hover, &:focus {
                color: var(--secondary);
                border-bottom-color: var(--secondary);
            }

            &::after {
                content: '';
                position: absolute;
                bottom: 0;
                left: 0;
                width: 0;
                height: 2px;
                background: var(--secondary-gradient);
                transition: width 0.3s ease;
            }

            &:hover::after {
                width: 100%;
            }
        }
    }

    /* Contact information section */
    .offcanvas-contact {
        padding-top: 2rem;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        
        h3 {
            font-size: 1.2rem;
            margin-bottom: 1rem;
            color: var(--secondary);
        }
        
        p {
            font-size: 1rem;
            margin-bottom: 0.8rem;
        }
        
        a {
            color: var(--secondary);
            text-decoration: none;
            transition: color 0.3s ease;
            
            &:hover {
                color: var(--secondary);
            }
        }
    }
    
    /* Social icons in off-canvas */
    .offcanvas-socials {
        display: flex;
        gap: 1.2rem;
        margin-top: 2rem;
        
        a {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            transition: all 0.3s ease;
            
            svg {
                width: 1.5rem;
                height: 1.5rem;
                fill: var(--secondary);
            }
        }
    }
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    z-index: 100000;
    transition: opacity 0.3s ease, visibility 0.3s ease;

    &.is-active {
        opacity: 1;
        visibility: visible;
    }
}

/* Additional styles for menu-open state */
body.menu-open {
    overflow: hidden;
}

/* Screen reader text */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;

    &:focus {
        background-color: var(--primary);
        border-radius: 3px;
        box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
        clip: auto !important;
        clip-path: none;
        color: var(--white);
        display: block;
        font-size: 0.875rem;
        font-weight: 700;
        height: auto;
        left: 5px;
        line-height: normal;
        padding: 15px 23px 14px;
        text-decoration: none;
        top: 5px;
        width: auto;
        z-index: 100000;
    }
}

/*******************************************************************/
/* Footer                                                          */
/*******************************************************************/

footer#footer {
    background: var(--black);
    color: #ffffff;
    padding: 5.5rem 0;

    .container {
        display: grid;
        grid-template-columns: 3fr 2fr 2fr;
        gap: 2rem;
    }

    strong {
        color: #ffffff;
    }
	
	a {
		color: inherit;
        text-decoration: none;
        transition: 300ms;

        &:hover {
            color: var(--primary);
            font-weight: 600;
        }
	}

    .footer-contact {
        p {
            margin-bottom: 1.6rem;
        }
    }

    .footer-brand {
        .footer-logo {
            max-width: 9rem;
            height: auto;
            margin-bottom: 0.5rem;
        }    
    }

    .footer-nav {
        list-style: none;
        margin: 0;
        padding: 0;
        
        a {
            color: #ffffff;
            text-decoration: none;
            display: block;
            padding: 0;
            transition: 300ms ease;
            font-weight: 500;

            &:hover {
                color: var(--bg);
                font-weight: 600;
            }
        }

        li {
            border-bottom: rgba(0,0,0,0.1) solid 1px;
        }
    }

    .wpcf7 {
        .wpcf7-response-output {
            margin: 1rem 0 0 0;
            width: fit-content;
            font-size: 0.7rem;
        }

        input {
            width: 100%;
            max-width: 350px;
            padding: 0.8rem 1.2rem;
            margin: 0;
            border-radius: 100vh;
            appearance: none;
            border: 0;
            background: #ffffff;
            font-size: 1rem;
            caret-color: var(--primary);
        }
        
        .wpcf7-submit {
            color: var(--black);
            background: #ffffff;
            margin-top: 0.75rem;
            font-weight: 600;
            transition: all 0.3s ease;
            
            &:hover {
                background: var(--primary);
                color: white;
            }
        }
    }

    .socials {
        display: flex;
        gap: 1rem;
        margin-top: 1.5rem;
    }
    
    .social-icon {
        display: flex;
        align-items: center;
        justify-content: center;
    
        svg {
            width: 1.5rem;
            height: 1.5rem;
        }
    }

    @media(max-width: 1100px) {
        .container {
            grid-template-columns: 1fr 1fr;

            .column:first-child {
                grid-column: span 2;
            }
        }
    }

    @media(max-width: 600px) {
        .container {
            grid-template-columns: 1fr;
            gap: 2rem;

            .column:first-child {
                grid-column: span 1;
            }
        }
    }
}

.footer-highlight {
    height: 2.5rem;
    width: 100%;
    background: var(--secondary-gradient);
}

/*******************************************************************/
/* Misc                                                            */
/*******************************************************************/

