*{
    
    margin: 0;
    padding: 0;
}
/*This css file is linked to the page1_grid_index.html and should only be used for that.*/
/*The main_nav_menu.css file is used for the header and navigation bar styles, and should always be in top of every page*/
/* ----------------- GENERAL STYLES ----------------- */
body {
    margin: 0;
    font-family:Verdana, Geneva, Tahoma, sans-serif
}


/* ----------------- GRID LAYOUT ----------------- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas:
        "item1 item1 item1"
        "item2 item3 item4"
        "item5 item6 item7";
    gap: 15px;
    padding: 15px;
    
}

/*Introduction to the topic section*/
.item1 {
    grid-area: item1;
    background-color: #f2f2f2;        
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    line-height: 1.6;
    border: 2px solid orange;
}

.item2 {
    grid-area: item2;
    background-color: #f2f2f2;    
    /* width: 300px; */
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}
.item3{
    grid-area: item3;
    background-color: #f2f2f2;
    justify-content: center;
    align-items: center;
    /* width:300px; */
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}



.item4 {
    grid-area: item4;
    background-color: #f2f2f2;
    /* width:300px; */
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.item5 {
    grid-area: item5;
    background-color: #f2f2f2;    
    /* width:300px; */
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}
.item6 {
    grid-area: item6;
    background-color: #f2f2f2;   
    /* width:300px; */
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}
 .item7 {
    grid-area: item7;
    background-color: #f2f2f2;    
    /* width:300px; */
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center; 
}    

/*I have added this to center the image i hope*/

.grid-link {
    display: flex;
    flex-direction: column;
    align-items: center;     /* centres image + text */
    gap: 10px;               /* space between image and text */
    text-decoration: none;
    color: inherit;
}

.grid-link img {
    width: 100px;
    height: auto;
    display: block;
}


/* ----------------- NAVIGATION ----------------- */
nav {
    position: relative;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    /* border-right: 1px solid orange; */
    gap: 20px;
}

nav ul li {
    position: relative;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    padding: 10px;
    display: block;
    border-right: 1px solid orange;
}

nav ul li:hover > a {
    background: #333;
}

/* dropdown menu */
nav ul li .submenu {
    display: none;
    position: absolute;
    background: #003366;
    top: 100%;
    right: 0;
    min-width: 180px;
    border-radius: 0 0 6px 6px;
    border-bottom: orange 2px solid;    
}

nav ul li .submenu li a {
    padding: 10px;
}

nav ul li:hover .submenu {
    display: block;
}

/* ----------------- MOBILE HAMBURGER ----------------- */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle span {
    width: 22px;
    height: 2px;
    background: white;
    margin: 5px 0;
    transition: 0.3s;
}

/* checkbox transforms hamburger */
#menu-checkbox {
    display: none;
}

#menu-checkbox:checked + label .bar1 {
    transform: rotate(-45deg) translate(-8px, 9px);
}
#menu-checkbox:checked + label .bar2 {
    opacity: 0;
}
#menu-checkbox:checked + label .bar3 {
    transform: rotate(45deg) translate(-8px, -9px);
}

/* MOBILE MENU */
@media (max-width: 768px) {
    nav ul {
        position: absolute;
        top: 40px;
        right: 0;
        background: #003366;
        width: 300px;
        flex-direction: column;
        display: none;
        padding: 10px 0;
    }

    /* show menu when checkbox is checked */
    #menu-checkbox:checked ~ nav ul {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    nav ul li .submenu {
        position: static;
        background: #333;
        border-radius: 5px 0 0 5px;

    }

    nav ul li:hover .submenu {
        display: none; /* disable hover dropdown on mobile */
    }

    /* tap to open submenu */
    nav ul li:focus-within .submenu {
        display: block;
    }

    .grid-container {
        /* display: grid; */
        grid-template-columns: 1fr;
        grid-template-areas: "item1"
                            "item2"
                            "item3"
                            "item4"
                            "item5"
                            "item6"
                            "item7";
        height: 100vh;
        /* width:100vh;
        gap: 10px;

        padding: 10px; */
    }
}
