/* --- DGMD E-27 --- ASSIGNMENT 2 --- */
/* --- Hamburger Menu based on code from

https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_topnav

---- */
/* SCSS Variables */
/* pale yellow */
/* light gray */
/* hint of yellow */
/* CSS Variables */
:root {
  --wrapper-width: 80%;
}

:root {
  --sidebar-padding: 1em;
}

:root {
  --index-page-width: 40%;
}

:root {
  --col5-flex-basis: 90%;
}

:root {
  --col1-flex-basis: 15%;
}

:root {
  --food-flex-basis: 15%;
}

:root {
  --line-height: 1.25em;
}

/* border box model */
html {
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}

/* nesting */
body {
  font-family: Palatino, serif;
  font-weight: normal;
  font-style: normal;
  color: dimgray;
  background-color: #fffff1;
  padding: 0;
  margin: 0;
  line-height: var(--line-height);
}

h1, header h1, h2, h3, h4, h5, h6 {
  font-family: "Merriweather Sans", sans-serif;
  font-weight: bold;
  color: darkblue;
  text-align: center;
}

h2 {
  line-height: 1.25;
}

/* Extend */
header h1 {
  font-family: "Gloria Hallelujah", cursive;
}

/* How to feed the hypoallergenic kid */
.index-page {
  width: var(--index-page-width);
  margin: 0 auto;
  overflow: auto;
}

.index-page h3 {
  text-align: left;
}

.wrapper {
  width: 80%;
  margin: 0 auto;
  overflow: auto;
}

/* skip navigation */
/* SCSS function */
.skip {
  font-family: "Merriweather Sans", sans-serif;
  padding-right: 1em;
  float: right;
  color: dimgray;
}

/* nav bar */
nav {
  display: inline-block;
  padding: 1em;
  background-color: darkgreen;
  width: 100%;
  text-align: center;
  overflow: hidden;
  font-family: "Merriweather Sans", sans-serif;
}

nav a {
  padding: 1em;
  text-decoration: none;
  color: white;
  clear: both;
}

nav a:hover {
  background-color: darkorange;
}

.navbar .hamburger {
  display: none;
}

.allergy-list {
  padding-left: 25%;
}

/* list styles for homepage */
ul:not(.allergy-list) {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

/* side bar - disclaimer */
/* SCSS function */
.sidebar {
  width: 10%;
  position: absolute;
  background: white;
  overflow-x: hidden;
  padding: var(--sidebar-padding);
  border-style: solid;
  margin: 1em;
  border-color: #ff6200;
}

.sidebar h3 {
  text-align: left;
}

/* flexbox for statistics */
.row {
  display: flex;
  justify-content: center;
  text-align: center;
  flex-wrap: wrap;
}

[class*="col-"] {
  margin-left: 4%;
  float: left;
}

article {
  border-style: solid;
  border-color: #efefef;
  background-color: #fffffe;
  margin: 1em;
}

.column-5 {
  flex: 0 0 var(--col5-flex-basis);
  border-style: solid;
  border-color: #efefef;
  background-color: #fffffe;
}

.column-1 {
  flex: 0 0 var(--col1-flex-basis);
  border-style: solid;
  border-color: #efefef;
  background-color: #fffffe;
  background-color: #fffffe;
}

article p {
  color: #AA2600;
}

/* flexbox for good food */
a {
  color: dimgrey;
}

a:hover {
  background-color: grey;
  color: white;
}

.goodfood {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  text-align: left;
}

.fruit,
.veggie,
.bean,
.grain,
.spice {
  flex: 0 0 var(--food-flex-basis);
  margin: 0.5em;
  padding: 0em 3em 1em 1em;
  border-style: solid;
  border-color: #efefef;
  background-color: #fffffe;
}

.goodfood h2 {
  text-align: left;
}

/* footer */
footer {
  background-color: darkblue;
  color: white;
  text-align: center;
  clear: both;
  margin-top: 2em;
}

/* image below footer on home page */
.plate {
  height: 10em;
  background: url(../images/plate-200.jpeg) no-repeat;
  background-position: center;
}

/* image below footer on good food page */
.green-checkmark {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.stats {
  margin-left: 1%;
  margin-right: 1%;
}

/* SCSS Variables */
/* media query for tablets */
@media only screen and (max-width: 1200px) {
  :root {
    --wrapper-width: 90%;
  }
  :root {
    --index-page-width: 50%;
  }
  :root {
    --sidebar-padding: 1em;
  }
  :root {
    --col5-flex-basis: 40%;
  }
  :root {
    --col1-flex-basis: 40%;
  }
  :root {
    --food-flex-basis: 100%;
  }
  :root {
    --line-height: 1.75em;
  }
  h1, header h1 {
    font-size: 1.5em;
  }
  .allergy-list {
    padding-left: 20%;
  }
  .sidebar {
    width: 80%;
    position: relative;
    border-width: thick;
    margin-left: 10%;
    margin-top: 5%;
  }
  ol li {
    list-style: none;
    display: inline;
  }
  ol li:after {
    content: ", ";
  }
  ol li:last-child:after {
    content: "";
  }
  .fruit,
  .veggie,
  .bean,
  .grain,
  .spice {
    border: 0.01em solid;
    padding: 0.5em;
    margin: 0.5em;
  }
  ul:not(.allergy-list) li {
    list-style: none;
    display: inline;
  }
  ul:not(.allergy-list) li:after {
    content: ", ";
  }
  ul:not(.allergy-list) li:last-child:after {
    content: "";
  }
  .column-5,
  .column-1 {
    flex: 0 0 40%;
    flex-wrap: nowrap;
  }
  .plate {
    background: url(../images/plate-100.jpeg) no-repeat;
    background-position: center;
  }
}

/* end of media query for tablets */
/* media query for iPhone 6 */
@media only screen and (max-width: 1000px) {
  :root {
    --wrapper-width: 100%;
  }
  :root {
    --index-page-width: 80%;
  }
  :root {
    --col5-flex-basis: 80%;
  }
  :root {
    --col1-flex-basis: 80%;
  }
  :root {
    --food-flex-basis: 95%;
  }
  :root {
    --line-height: 1.75em;
  }
  h1, header h1 {
    font-size: 1em;
  }
  h2,
  h3 {
    font-size: 1em;
  }
  .allergy-list {
    padding-left: 10%;
  }
  nav {
    display: flex;
    flex-wrap: wrap;
    padding: 1em;
  }
  nav a {
    flex: 0 0 100%;
    text-align: left;
    padding: 0.5em;
  }
  .navbar a:not(:first-child) {
    display: none;
  }
  .navbar a.hamburger {
    display: block;
  }
  .navbar.shortnav a {
    float: none;
    display: block;
    text-align: left;
    font-size: 1em;
  }
  /* Note: the font size is very large when tested on a computer screen, but on the iPhone 6, it's a great size so that the menu items are more easily selected with a finger or thumb */
  .active {
    background-color: darkorange;
  }
  article {
    border-width: thin;
    margin: 0.5em;
    padding: 0.5em;
  }
  .column-1,
  .column-5 {
    flex: 0 0 90%;
  }
  .stats {
    font-size: 2vw;
  }
  .fruit,
  .veggie,
  .bean,
  .grain,
  .spice {
    padding: 0.5em;
    margin: 0.25em;
  }
  .plate {
    background: url(../images/plate-50.jpg) no-repeat;
    background-position: center;
  }
}

/* end of media query for mobile phones */
