:root {
  --header: #7aa228;
  --nav: #475e18;
  --main: #1e2a07;
  --font_light: #f1fbdc;
  --passpartout: #F8F8F8;
  --frame: #000000;
}

* {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-size: 20px;
  background-color: var(--main);
  color: var(--font_light);
}

h1 {
  font-size: 3rem;
  margin: 1rem;
}

header p, h1 {
  text-align: center;
  color: var(--main);
  font-weight: 900;
}

h2 {
  text-align: center;
  font-size: 1.5rem;
  margin: 0.4rem 0;
  font-weight: 800;
}

.grid-container {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "header"
                        "nav"
                        "main"
                        "footer";
}

header {
  grid-area: header;
  background-color: var(--header);
  padding: 2rem;
}

nav {
  grid-area: nav;
  background-color: var(--nav);
  position: sticky; /*sticky funktioniert nur mit Angabe top, bottom, right oder left*/
  top: 0;
  display: flex;
  flex-flow: row wrap;
  justify-content: space-around;
  width: 100%;
  padding: 0.5rem;
}

a {
  margin: 0.5rem;
}

a {
  color: var(--font_light);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(241, 251, 220, 0.4);
  text-align: center;
}

a:focus {
  outline-offset: 3px;
  outline-color: var(--main);
  outline-width: 4px;
}

a:hover {
  color: #fff;
  font-weight: 900;
}

main {
  background-color: var(--main);
  grid-area: main;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
}

article {
  margin: 1rem;
}

figure {
  margin: 5rem 0;
  font-size: 0.8rem;
}

img {
  padding: 20px;
  border: 25px solid var(--frame);
  background-color: var(--passpartout);
  margin: 1rem auto;
  height: auto;
  width: 100%;
  max-width: 400px;
  object-fit: cover;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 0 19px var(--passpartout);
}

figure img:hover {opacity: 0.7;}

figcaption {
  text-align: center;
}

footer {
  padding: 1.5rem;
  background-color: var(--header);
  grid-area: footer;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

footer a {
  color: var(--main);
}

footer a:hover {
  color: #000;
  font-weight: 900;
}

@media screen and (min-width:600px) {
  .grid-container {
    display: grid;
    grid-template-columns: 1fr 4fr;
    grid-template-areas: "header header"
                          "nav main"
                          "nav main"
                          "footer footer";
  }
  nav {
    display: sticky;
    left: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
    height: 100vh;
    justify-content: flex-start;
    }

  header {
    position: sticky;
    top: 0;
  }

  footer {
    position: fixed;
    bottom: 0;
  }
}
