* {
    margin: 0; padding: 0; box-sizing: border-box;
}

:root {
     --color-background: #fffbdb;
    --color-text: #30362f;
    --color-primary: #a59132;
    --color-secondary: #625834;
    --color-accent: #da7422;
}

body {
    background-color: aquamarine;
}

header nav {
    text-align: center; 
    padding: 5px; 
    text-shadow: 2px 4px 4px #2fb371;
}

nav a {
    color: var(--color-text); 
    text-decoration: none;
    text-shadow: 2px 4px 4px #2f94b3; 
    font-size: 10pt; font-weight: 300;
}

nav a:hover {
    color: var(--color-accent); 
    text-decoration: underline;
}

h1 {
    text-align: center;
    margin: 8px 0;
    border: 2px darkblue solid;
    padding-bottom: 8px;
}

h2 {
    margin: 8px;
    font-weight: normal;
    background-color: #234;
    color: #cec;
    padding: 4px;
}

.flex-parent {
    border: 4px solid transparent;
    min-height: 100px;
    display: flex; /*reallign's child containers to be side by side rather than on top of each other, also collapses to their content.*/
    margin: 8px 8px 40px 8px;
}

.flex-child {
    border: 4px solid green;
    min-height: 80px;
    margin: 8px;
    flex-grow: 1;
    text-align: center; 
    font-weight: bold;
}

.demo1 .flex-child {
    background-color: #9c111d;
    color: #fff;
}

.demo2 .flex-parent {
    border: 4px solid transparent;
    justify-content: space-around;
}

.demo2 .flex-child {
    border: 4px solid black;
    flex-grow: 0;
    min-width: 16px;
    background-color: #0b128c;
    color: #eded1c;
}

.demo3 .flex-parent {
    justify-content: space-between;
    border: 4px solid transparent;
}

.demo3 .flex-child {
    flex-grow: 0;
    min-width: 75px;
    border: 4px solid black;
    background-color: #046e20;
    color: #fa5e1b;
}

.demo4 .flex-parent {
    justify-content: space-evenly;
    border: 4px solid transparent;
}

.demo4 .flex-child {
    flex-grow: 0;
    min-width: 16px;
    border: 4px solid black;
    background-color: fuchsia;
    color: #eee;
}

.demo5 .flex-parent,
.demo6 .flex-parent {
    border: 4px solid transparent;
}

.demo5 .flex-parent {
    flex-direction: row-reverse; /*stacks the flex items on top of each other in a column*/
    margin: 8px 8px 10px 8px;
}

.demo5 .flex-child:last-child {
    background-color: yellow;
}

.demo5 p {
    text-align: center;
    background-color: turquoise;
    font-weight: bold;
    margin-bottom: 10px;
}

.demo6 .flex-parent {
    display: flex;
    flex-flow: row wrap; /* combination of flex-direction and flex-wrap*/
    justify-content: space-evenly;
    margin: 8px 8px 10px 8px;
}

.demo6 .flex-child {
    background-color: pink;
    min-width: 200px;
    flex-grow: 1; /*2 possible values, 0 or 1. 0 sets to the min paramaters otherwise specified. 1 will expand the children as much as parameters permit*/
}

.demo6 p {
    text-align: center;
    background-color: turquoise;
    font-weight: bold;
    margin-bottom: 10px;
}

.demo7 .flex-parent {
    border: 4px solid transparent;
    min-height: 200px;
    justify-content: center; /* horizontal center */
    margin: 8px;
}

.demo7 .flex-child {
    flex-grow: 0;
}

.demo7 .flex-child:last-child {
    background-color: yellow;
    max-height: 150px; aspect-ratio: 1;
    min-width: 150px;
    align-self: center; /*vertical center */
}

.demo8 .flex-parent {
    border: 4px solid transparent;
    flex-flow: row wrap;
    justify-content: center;
    gap: 10px;
    margin: 8px 8px 10px 8px;
}

.demo8 .flex-child {
    flex-basis: 30%; /*each child is going to be 50% of the width in regards to parent parameters*/
    margin: 0;
    flex-grow: 1;
    background-color: orangered;
    color: darkblue;
}

.demo8 p {
    text-align: center;
    background-color: turquoise;
    font-weight: bold;
    margin-bottom: 10px;
}