@import url("https://fonts.googleapis.com/css2?family=Amatic+SC:wght@400;700&family=Happy+Monkey&display=swap");

:root {
    --primary-colour: #201302;
    --secondary-colour: #f9e0cc;
    --selected-colour: #613712;
    --selected-bg-colour: #f7dac1;
    --background-colour: #fcf2e8;
}

body {
    display: grid;
    /* Allocate all extra space to main */
    min-height: 100vh;
    grid-template-rows: auto 1fr auto;

    /* Change font family */
    font-family: "Happy Monkey";

    /* Improve spacing */
    line-height: 1.5rem;

    /* Remove all default edge margins */
    margin: 0;

    background-color: var(--background-colour);

    h1 {
        font-size: 2.75rem;
        line-height: 4rem;
        margin-bottom: 0;
        margin-top: 1rem;
    }
}

nav {
    background-color: var(--secondary-colour);
    width: fit-content;
    margin: 0 auto;
    position: sticky;
    top: 1rem;

    border-radius: 10rem;
    padding: 0rem 1rem;

    #menu-toggle {
        display: none;
    }

    .hamburger-icon {
        display: none;
        cursor: pointer;
        padding: 0.5rem;
    }

    .logo {
        font-family: 'Amatic SC';
        font-size: 2rem;
    }

    ul {
        margin: 0;
        padding: 0;
        list-style: none;
        text-align: left;

        display: flex;
    }

    li {
        display: inline-block;
    }
    
    a {
        color: var(--primary-colour);
        text-decoration: none;
        display: block;
        
        margin: 1rem;
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }
    
    li:hover {
        .menu-title {
            color: var(--selected-colour);
        }

        .menu-title.logo {
            color: var(--primary-colour);
        }

        @media (width >= 630px) {

            .sub-menu {
                display: flex;
                justify-content: center;
                gap: 2rem;
                margin: 0 auto;
    
                position: absolute;
                left: 50%;
                right: 50%;
                transform: translate(-50%);
    
    
                ul {
                    display: grid;
                }
    
                li {
                    display: block;
                    margin: 0;
                }
            }
    
            .sub-menu.one-col {
                width: 11rem;
            }
    
            .sub-menu.two-col {
                width: 22rem;
            }
    
            .sub-menu.three-col {
                width: 31rem;
            }
        }

    }

    @media (width < 630px) {
        margin: 0;
        padding: 0;
        border-radius: 0;

        width: 100vw;
        
        position: absolute;
        top: 0;

        
        ul {
            display: none;
        }
        
        .hamburger-icon {
            display: flex;
            height: 1.5rem;
            flex-direction: column;
            justify-content: space-between;

            padding-top: 1rem;
            padding-bottom: 1rem;
            padding-left: 0.8rem;

            /* background-color: var(--background-colour); */
            
            span {
                width: 2rem;
                height: 0.15rem;
                background-color: var(--primary-colour);

                transition: all 0.25s ease-in-out; /* Add smooth transition */
            }
        }

        #menu-toggle:checked ~ ul {
            display: flex;
            flex-direction: column;
        }

        #menu-toggle:checked ~ .hamburger-icon {
            span:nth-child(1) {
                transform: translateY(0.68rem) rotate(45deg);
            }

            span:nth-child(2) {
                opacity: 0;
            }
            
            span:nth-child(3) {
                transform: translateY(-0.68rem) rotate(-45deg);
            }
        }

        li:hover {
            .sub-menu.two-col {
                width: 100vw;
                position: absolute;
            }

            .sub-menu.three-col {
                width: 100vw;
                position: absolute;
            }
        }
    }
}

.sub-menu {
    position: absolute;
    background-color: var(--selected-bg-colour);
    display: none;
    padding: 1.75rem 1.5rem;
    width: 20rem;
    
    a {
        margin: 0.05rem 0;
    }
    
    a:hover {
        text-decoration: underline;
    }
}

.menu-category {
    margin-top: 0;

    a {
        margin: 0;
        padding: 0;
    }
}

main {
    max-width: 80ch;
    margin: 0 auto;

    padding: 0 1rem;

    h1 {
        /* Ensure content is visible beneath the nav bar */
        padding-top: 2rem;

        @media (width < 630px) {
            margin-top: 3rem;
        }
    }

    p {
        margin-bottom: 2rem;
    }
}

.homepage-cards {
    display: grid;
    gap: 1rem;

    img {
        max-width: 100%;
    }

    @media (width < 570px) {
        grid-template-columns: 1fr;
    }

    @media (width >= 540px) {
        grid-template-columns: 1fr 1fr;
    }

    @media (width >= 760px) {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .card {
        border: 1px solid var(--selected-colour);
        border-radius: 6px;
        padding: 1rem;
        align-items: center;

        p {
            margin-top: 0;
            margin-bottom: 1rem;
            text-align: center;
        }
    }
}

.section-title {
    color: var(--primary-colour);
}

.info-section {
    h2 {
        margin-top: 2.5rem;
    }

    h2, b {
        color: var(--primary-colour);
    }

    p {
        margin-top: 0.2rem;
        margin-bottom: 0.2rem;
    }

    b {
        display: block;
        margin-top: 1.2rem;
        font-weight: 900;
    }

    img {
        display: block;
        margin: 1rem auto 0 auto;
        width: 450px;

        @media (width <= 482px) {
            width: 100%;
        }
    }

    ul {
        margin-top: 0.25rem;
    }
}

.paw-separator {
    white-space: nowrap;
    overflow: hidden;
    
    color: var(--primary-colour);

    padding-top: 2.5rem;
 
    .alternate-paw {
        color: var(--selected-bg-colour);
    }

    /* Reducing separator at different screen sizes for responsiveness */
    @media (width <= 780px) {
        width: 74ch;
    }

    @media (width <= 720px) {
        width: 68ch;
    }

    @media (width <= 670px) {
        width: 62ch;
    }

    @media (width <= 610px) {
        width: 56ch;
    }

    @media (width <= 550px) {
        width: 50ch;
    }

    @media (width <= 490px) {
        width: 44ch;
    }

    @media (width <= 440px) {
        width: 38ch;
    }

    @media (width <= 390px) {
        width: 35ch;
    }
}

footer {
    display: flex;
    justify-content: center;
    
    background-color: var(--secondary-colour);
    margin-top: 3rem;
    padding: 1rem;
}


