/**************/
/* CSS REMEDY  */
/**************/

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


/* ROOT */

:root {
  --gold: rgb(255, 203, 9);
  --text-primary: black;
  --text-secondary: white;
  --text-tertiary-link: rgb(139, 147, 155);
  --background-primary: whitesmoke;
  --background-secundary: black;
  --background-tertiary: white;
}


/*********************/
/* HERO SECTION */
/*********************/

/* Positionering van tekst over afbeelding met absolute positioning. Heb geprobeerd met div grid en z-index, maar snap nog niet helemaal */

section:first-of-type {
  color: var(--text-secondary);
  background-color: var(--background-primary);
  text-align: center;
}

section:first-of-type figure {
  margin: 0;
}

section:first-of-type img {
  width: 100vw;
  height: 100vh;
  object-fit: cover; 
}

/* Bron: ChatGPT voor object:cover, ik stuurde een screenshot met de uitgerekte afbeelding met vraag: Hoe zorg ik ervoor dat de image niet zo uitrekt over de breedte van het scherm met CSS. */

section:first-of-type h1 {
  position: absolute;
  top: 37%;
  left: 50%;
  width: 85%;
  font-size: 1.8em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.3;
  transform: translate(-50%, -50%);
}

section:first-of-type a {
  position: absolute;
  top: 30%;
  padding: 0.2em 1.5em;
  background: none;
  border-left-style: solid;
  border-right-style: solid;
  border-width: 0.5em;
  color: var(--text-secondary);
  text-decoration: underline;
  transform: translate(-50%, -50%);
}

section:first-of-type a:hover {
  font-weight: 700;
  letter-spacing: 0.5em;
  transition: 0.1s;
}

section:first-of-type p {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 85%;
  color: var(--text-secondary);
  font-size: 0.9em;
  text-align: center;
  line-height: 1.4;
  transform: translate(-50%, -50%);
}


section:first-of-type figcaption {
  padding: 1em 0 0.7em 2em;
  background-color: var(--background-tertiary);
  color: rgb(139, 147, 155);
  font-size: 0.7em;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.3em;
}


/*********************/
/* DIERENCATEGORIEN SECTION */
/*********************/

/* Visueel verbergen van h2 voor toegankelijkheid , zodat de heading wel word voorgelezen*/

section:nth-of-type(2) h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

/* Bron: https://www.a11yproject.com/posts/how-to-hide-content/ , niet naar omgekeken verder alleen Copy paste*/

/* Centreren van gehele sectie */

section:nth-of-type(2) {
  display: flex;
  justify-content: center;
  width: 100vw;
  padding-top: 2.5em;
  padding-bottom: 2.5em;
  background-color: var(--background-primary);
}

/* Grid-design voor categorieën blokjes */

section:nth-of-type(2) ul {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2em;
  padding: 0;
  list-style: none;
}

/* Artikel relatief voor absolute elementen */

section:nth-of-type(2) article {
  position: relative;
  width: 20em;
  height: 25em;
}

/* Zodat je alles binnen het figure mooi ziet */

section:nth-of-type(2) figure {
  margin: 0;
  width: 100%;
  height: 100%;
  /* De figure moet de hele article opvullen */
}

section:nth-of-type(2) img {
  width: 100%;
  height: 100%;
  object-fit: cover; 
}


section:nth-of-type(2) figcaption {
  position: absolute;
  inset: 0;
  /* Hulp van Frank, zie bronnenlijst */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--text-secondary);
  text-align: center;
}

section:nth-of-type(2) h3 {
  margin-bottom: 2em;
  font-size: 1.8em;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

section:nth-of-type(2) a::before {
  content: "☰";
  padding-right: 0.35em;
}

/* Bron: voor de see-more decoratie https://developer.mozilla.org/en-US/docs/Web/CSS/::before */


/*********************/
/* VIDEO SECTION */
/*********************/

section:nth-of-type(3) {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-secondary);
  background-color: var(--background-secundary);
}

section:nth-of-type(3) h2 {
  padding: 1.5em 0 1em;
  font-weight: 500;
  text-align: center;
  text-transform: uppercase;
}

section:nth-of-type(3) ul {
  display: flex;
  width: 95vw;
  max-width: 55em;
  margin: 0;
  padding-left: 0.5em;
  overflow: hidden;
}

/* Scrollbare carousel maken */

section:nth-of-type(3) nav ul {
  flex-direction: row;
  overflow-x: scroll;
}

/* Voorkomt samendrukken van items in flexbox */

section:nth-of-type(3) nav li {
  flex-shrink: 0;
  width: 12em;
  max-width: 10em;
  height: 10em;
}

section:nth-of-type(3) li {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  list-style: none;
}

/* Afbeeldingen in navigatie */

section:nth-of-type(3) nav ul:first-of-type img {
  width: 12em;
  height: auto;
  padding-bottom: 0.4em;
}

/* Styling weghalen die op algemene a's staat */

section:nth-of-type(3) a {
  flex-shrink: 0;
  padding: 0;
  max-width: 12em;
  background: none;
  color: var(--text-secondary);
  font-size: 0.8em;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

/* Geel balkje bij hover */

section:nth-of-type(3) a:hover img {
  background-color: var(--gold);
  opacity: 75%;
  transition: 0.3s;
}

/* Grote uitgelichte videoafbeelding onder navigatie */

section:nth-of-type(3) video {
  width: 95vw;
  max-width: 55em;
}

section:nth-of-type(3) > ul li {
  width: 55em;
}

section:nth-of-type(3) > ul li img {
  width: 55em;
  max-width: 100vw;
  height: auto;
}

section:nth-of-type(3) h3 {
  margin-bottom: 0.2em;
  max-width: 90vw;
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

section:nth-of-type(3) p {
  margin-top: 0.2em;
  padding-bottom: 1em;
  max-width: 90vw;
}

section:nth-of-type(3) p + p {
  margin-bottom: 0.3em;
  padding-bottom: 0.3em;
  font-size: 0.9em;
}

section:nth-of-type(3) button {
  width: 12em;
  margin-bottom: 2em;
  padding: 0.5em;
  background-color: var(--gold);
  border: none;
  color: black;
  font-family: "geo";
  font-size: 0.8em;
  text-align: center;
}

section:nth-of-type(3) button:hover {
  background-color: rgb(255, 255, 255);
}

section:nth-of-type(3) button:active {
  background-color: rgb(0, 189, 28);
}

/* PAS OP! GEEN FRAUDE, dit is een Copy paste van internet , extra feature voor accessability. Heb zelf de code beetje aangepast */
/* Bron: CSS en html voor de slider is hiervan: https://www.w3schools.com/howto/howto_css_switch.asp. Is puur voor usability en ik vond het een leuke toevoeging, niet zelf geschreven */

/* The switch - the box around the slider */

section:nth-of-type(3) label {
  position: relative;
  display: inline-block;
  width: 3em;
  height: 1.75em;
  margin-bottom: 3em;
}

/* Hide default HTML checkbox */

section:nth-of-type(3) label input {
  width: 0;
  height: 0;
  opacity: 0;
}

/* The slider */

section:nth-of-type(3) label span {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--text-tertiary-link);
  cursor: pointer;
  -webkit-transition: .2s;
  transition: .2s;
}

section:nth-of-type(3) label span:before {
  position: absolute;
  bottom: 0.25em;
  left: 0.25em;
  width: 1.3em;
  height: 1.3em;
  background-color: white;
  content: "";
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--gold);
}

input:checked + .slider:before {
  -webkit-transform: translateX(1.2em);
  -ms-transform: translateX(1.2em);
  transform: translateX(1.2em);
}

/* Rounded sliders */

section:nth-of-type(3) label span {
  border-radius: 2em;
}

section:nth-of-type(3) label span:before {
  border-radius: 50%;
}


/********************/
/* ARTIKELEN SECTION */
/********************/

section:nth-of-type(4) {
  background-color: var(--background-primary);
  color: var(--text-primary);
}

section:nth-of-type(4) h2 {
  margin-top: 0;
  padding-top: 2em;
  text-align: center;
  text-transform: uppercase;
}

section:nth-of-type(4) nav {
  display: flex;
  justify-content: left;
  align-items: center;
  max-width: 55em;
  margin-inline: auto;
}

/* Gridstructuur voor artikelen layout */

section:nth-of-type(4) ul {
  padding: 0;
}

section:nth-of-type(4) li {
  display: grid;
  grid-template-columns: 1fr 4fr;
  grid-template-rows: 1fr 1fr 1fr;
  column-gap: 1.5em;
  margin: 2em;
  max-height: 13em;
  background-color: var(--background-tertiary);
}

section:nth-of-type(4) img {
  grid-row: 1 / 4;
  grid-column: 1 / 2;
  height: 13em;
  object-fit: cover;
}

section:nth-of-type(4) h3 {
  grid-row-start: 2;
  grid-column-start: 2;
  margin: 0;
  padding-right: 2.5em;
  max-width: 20em;
  font-weight: 500;
}

section:nth-of-type(4) a {
  flex-shrink: 0;
  padding: 0;
  padding-top: 1em;
  background: none;
  color: var(--text-primary);
}

/* Animals link */

section:nth-of-type(4) a:nth-of-type(2) {
  grid-row-start: 1;
  grid-column-start: 2;
  padding-top: 2em;
  color: var(--text-tertiary-link);
  font-size: 0.7em;
  text-transform: uppercase;
  text-decoration: underline;
  letter-spacing: 0.2em;
}

/* Read link */

section:nth-of-type(4) a:first-of-type {
  grid-row-start: 3;
  grid-column-start: 2;
  padding-top: 2em;
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

section:nth-of-type(4) a:hover {
  font-weight: 700;
  transition: 0.1s;
  letter-spacing: 0.5em;
}

section:nth-of-type(4) a:first-of-type::before {
  content: "☰";
  padding-right: 0.35em;
}



/****************/
/* MEDIAQUERIES */
/****************/

/* dark mode */

@media (prefers-color-scheme: dark) {
  :root {
    --gold: rgb(255, 203, 9);
    --text-primary: whitesmoke;
    --text-secondary: whitesmoke;
    --text-tertiary-link: rgb(199, 199, 199);
    --background-primary: rgb(32, 32, 32);
    --background-secundary: black;
    --background-tertiary: rgb(0, 0, 0);
  }
}

/* Aanpassingen vanaf 700px breedte */

@media (min-width: 700px) {
  section:first-of-type h1 {
    width: 60%;
    font-size: 2em;
  }

  section:first-of-type p {
    width: 55%;
    font-size: 1.1em;
  }

  /* Grid veranderen zodat de dieren categorien zich aanpassen */

  section:nth-of-type(2) ul {
    grid-template-columns: 1fr 1fr;
  }
}

/* Aanpassingen vanaf 1100px breedte */

@media (min-width: 1100px) {
  section:first-of-type h1 {
    width: 60%;
    font-size: 2.3em;
  }

  section:first-of-type p {
    width: 55%;
    font-size: 1.2em;
  }

  /* Grid veranderen zodat de dieren categorien zich aanpassen */

  section:nth-of-type(2) ul {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* Artikelen aanpassen bij kleine schermen (onder 700px) */

@media (max-width: 700px) {
  section:nth-of-type(4) li {
    position: relative;
    grid-template-columns: 1fr 4fr;
    max-height: 9em;
    font-size: 0.8em;
  }

  section:nth-of-type(4) li img {
    width: 12em;
    height: auto;
  }

  section:nth-of-type(4) h3 {
    grid-row-start: 1;
    grid-column-start: 2;
    padding-top: 1.5em;
    padding-right: 1em;
  }

  section:nth-of-type(4) a:nth-of-type(2) {
    visibility: hidden;
  }

  section:nth-of-type(4) a:first-of-type {
    position: absolute;
    grid-row-start: 2;
    grid-column-start: 2;
  }
}

/* Nog meer aanpassing bij hele kleine schermen (onder 450px) */

@media (max-width: 450px) {
  section:nth-of-type(4) h3 {
    font-size: 0.85em;
  }
}