/* the styles for the elements */
* {
    margin: 0; 
    padding: 0;
    box-sizing: border-box; 
}
html {
    background-color: steelblue;
}
body {
    background-color: white;
	font-family: Arial, Helvetica, sans-serif;
    font-size: calc(90% + 0.3vw); 
    width: 100%;
}
a {
    font-weight: bold;
}
h1, h2, h3 { padding-top: .75em; } 
p, ul, blockquote { padding-top: .5em; } 
h1 { font-size: 160%; }
blockquote { padding-left: 2em; }

.icon {
    vertical-align: middle;
}
@font-face {
    font-family: AmericanCaptain;
    src: url("../fonts/American Captain.ttf");
}

/* the styles for the header */
header {
    background-image: linear-gradient(to bottom, white 0%, lightsteelblue 100%);
    padding: 1em 1.5em; 
    & img {        
        float: left; 
        margin-right: 1em;
        width: clamp(100px, 20%, 120px);        
    }
    & h2 {
        font-family: AmericanCaptain;
        font-size: 250%;
        font-style: italic;
        color: steelblue;
        padding-top: 0;
    }
    & h3 {
        font-size: 150%;
        padding-top: .25em;
    }
} 


/*** menu styles ***/ 
.navbar {
    background-color: steelblue; 
    & ul {
        list-style-type: none; 
    } 
    & a {
        display: block; 
        padding: .25em 1em; 
        margin: .25em .5em .5em;
        text-decoration: none; 
        color: white;
    } 
    & a:hover, a:focus { 
        text-decoration: underline; 
    } 
    & a.current {
        border: 2px solid; 
        border-radius: 10px; 
        text-decoration: none;
    } 
} 
#checkbox-toggle { display: none; } /* checkbox always hidden */
.menu-btn {
    display: block; /* show menu button */
    padding: 0.25em 1em;
    color: white;
    font-size: 24px;
}
.menu-btn::after { content: "\2630"; } /* hamburger symbol */
#checkbox-toggle:checked ~ .menu {
    display: block;
}
#checkbox-toggle:checked ~ .menu-btn::after {
    content: "\2716"; /* close (X) symbol */
}
.menu {
    position: absolute; /* in relation to .navbar */
    left: 0;
    display: none; /* menu initially hidden */
    background-color: steelblue;
    & li:has(.submenu) {
        position: relative;
        & small::after {
            content: "\25b6"; /* right triangle */
        }
        & small {
            margin-left: .25em; /* add space */
        }
        &:hover > .submenu {
            display: block;
        }
    }
 }
.submenu {
    position: absolute; /* with respect to .submenu */
    top: 0;
    left: 100%;
    background-color: steelblue;
    color: white;
    width: 150%;
    display: none;
}

/* the styles for the main element  */
main {
    display: flex;
    flex-direction: column;    
    padding: 0 1.5em 1em;
}

/* the styles for the section */
section {
    & h3 {
        color: maroon;
    }
    & ul { 
        padding-left: 2em;
        list-style-type: square;
    }
    & li {
        padding-left: .25em;     /* space between bullet and text */ 
        padding-bottom: .25em;   /* space after list item */
    } 
    & a:link, a:visited { 
        color: maroon;
    }
    & a:hover, a:focus {
        color: steelblue;
    }
}

figure {
    float: left;
    margin: .75em 1em .25em 0;
    width: 60%;
    & img {
        width: 100%
    }
    & figcaption {
        display: block;
        font-weight: bold;
        border-bottom: 2px solid steelblue;
        padding-bottom: .25em;
    }
}

/* the styles for the sidebar */
aside {
    height: fit-content;
    padding: 1em 1.5em; 
    margin: 1em 0;
    border: 2px solid steelblue;
    border-radius: 25px;
    & h2 {
        padding: 0;
        color: maroon;
    }
    & ul {
        line-height: 1.5;
        list-style-type: none;
    }
    & li img {
        margin-right: .75em;
    }
    & a:link, a:visited { 
        color: steelblue
    }
    & a:hover, a:focus {
        color: maroon;
    }
}

/* the styles for the footer */
footer { 
	padding: 1em 1.5em;
    background-color: steelblue;
    & p {
        text-align: center;
        font-size: 85%;
        color: white;    
    }    
}

/* media query - for line length breakpoint */
@media only screen and (min-width: 630px) {
    main {
        flex-direction: row;
    }
	section {
        flex-basis: 65%;
	}
    aside {
        flex-basis: 35%;
        padding: 1em 1.5em; 
        margin: 1em 0 1em 1.5em;    
    }
}

/* media query - for menu breakpoint */
@media only screen and (min-width: 860px) {
	.menu {
        position: relative;             /* change position */
        display: flex;                  /* show horizontal menu */
        justify-content: space-around;  /* adjust menu spacing */
    }
    .menu-btn { display: none; }
    .menu li:has(.submenu) {
        position: relative;
        & small::after {
            content: "\25bc"; /* down triangle */
        }
    }
    .submenu {
        top: auto;
        left: 0;
        width: 140%;
    }
}