/**************/
/* 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 */
/*********************/

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: 40vh;
  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: 22.5%;
  left: 15%;
  width: 85%;
  max-width: 15em;
  color: var(--text-secondary);
  font-size: 1.8em;
  font-weight: 500;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.3;
}

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

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

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


/*********************/
/* FEATURED AMPHIBIANS */
/*********************/

section:nth-of-type(2) {
  padding-bottom: 2em;
  background-color: var(--background-primary);
}

section:nth-of-type(2) nav {
  display: flex;
  justify-content: center;
}

section:nth-of-type(2) h2 {
  margin: 0;
  padding: 1.5em;
  color: var(--text-primary);
  font-size: 2em;
  text-align: center;
  text-transform: uppercase;
}

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

section:nth-of-type(2) li {
  display: grid;
  grid-template-rows: 3fr 1fr 2fr 1fr;
  width: 15em;
  height: 25em;
  background-color: var(--background-tertiary);
  overflow: hidden;
}

section:nth-of-type(2) li img {
  grid-row: 1 / 1;
  /* handige shortcut voor start 1 eind 1 */
  height: 12.5em;
}

section:nth-of-type(2) li h3 {
  grid-row: 3 / 3;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 0.8em;
  max-width: 8em;
  color: var(--text-primary);
  font-size: 1.3em;
}

/* Animals link */

section:nth-of-type(2) li a:nth-of-type(2) {
  grid-row: 2 / 2;
  align-self: center;
  padding: 0;
  padding-left: 1.5em;
  background-color: var(--background-tertiary);
  color: var(--text-tertiary-link);
  font-size: 0.7em;
  text-transform: uppercase;
  text-decoration: underline;
}

/* Read link */

section:nth-of-type(2) li a:nth-of-type(1) {
  grid-row: 4 / 4;
  padding: 0;
  padding-left: 1.5em;
  padding-top: 1.7em;
  background-color: var(--background-tertiary);
  color: var(--text-primary);
  font-size: 0.7em;
}

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

section:nth-of-type(2) a:hover {
  font-size: 0.9em;
  font-weight: 800;
  letter-spacing: 0.5em;
  transition: 0.1s;
}

/* De surinam toad card, andere grootte en layout */

section:nth-of-type(2) li:first-child {
  grid-column: span 2;
  /* zo dat deze li item over twee columns spreidt */
  width: 33em;
  color: var(--text-secondary);
  overflow: hidden;
}

section:nth-of-type(2) li:first-child img {
  width: 130%;
  height: auto;
  translate: -15%;
  object-fit: cover;
}

section:nth-of-type(2) li:first-child a:first-of-type {
  padding: 0em;
}


section:nth-of-type(2) li:first-child a::before {
  display: none;
}

section:nth-of-type(2) li:first-child h3 {
  position: absolute;
  z-index: 10;
  padding-left: 0.5em;
  color: var(--text-secondary);
  font-size: 1.8em;
  font-weight: 500;
  transform: translateY(915%);
}

section:nth-of-type(2) li:first-child a:nth-of-type(2) {
  position: absolute;
  padding-left: 1.5em;
  background-color: transparent;
  color: var(--text-secondary);
  transform: translateY(800%);
}





/*********************/
/* ABOUT AMPHIBIANS */
/*********************/

section:nth-of-type(3) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-inline: auto;
  padding-top: 2em;
  padding-bottom: 2em;
  padding-left: 1.5em;
  padding-right: 1.5em;
  max-width: 50em;
  color: var(--text-primary);
  text-align: center;
}

section:nth-of-type(3) p {
  font-size: 0.9em;
}

section:nth-of-type(3) p:last-of-type {
  padding-top: 1em;
  color: rgb(139, 147, 155);
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

section:nth-of-type(3) p a {
  padding: 0.1em;
  background-color: var(--background-tertiary);
  color: rgb(139, 147, 155);
  font-size: 1em;
  text-decoration: underline;
}

section:nth-of-type(3) p a:hover {
  letter-spacing: 0.4em;
  transition: 0.1s;
}


/*********************/
/* LATEST AMPHIBIAN STORIES */
/*********************/

section:nth-of-type(4) {
  padding-bottom: 2em;
  background-color: var(--background-primary);
}

section:nth-of-type(4) nav {
  display: flex;
  justify-content: center;
}

section:nth-of-type(4) h2 {
  padding: 1.5em;
  color: var(--text-primary);
  font-size: 2em;
  text-align: center;
  text-transform: uppercase;
}

section:nth-of-type(4) ul {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3em;
}

section:nth-of-type(4) li {
  display: grid;
  grid-template-rows: 3fr 1fr 2fr 1fr;
  width: 15em;
  height: 25em;
  background-color: var(--background-tertiary);
  overflow: hidden;
}

section:nth-of-type(4) li img {
  grid-row: 1 / 1;
  height: 12.5em;
}

section:nth-of-type(4) li h3 {
  grid-row: 3 / 3;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 1em;
  max-width: 14em;
  color: var(--text-primary);
  font-size: 1.05em;
}

/* Animals link */

section:nth-of-type(4) li a:nth-of-type(2) {
  grid-row: 2 / 2;
  align-self: center;
  padding: 0;
  padding-left: 1.5em;
  background-color: var(--background-tertiary);
  color: var(--text-tertiary-link);
  font-size: 0.7em;
  text-transform: uppercase;
  text-decoration: underline;
}

/* Read link */

section:nth-of-type(4) li a:nth-of-type(1) {
  grid-row: 4 / 4;
  padding: 0;
  padding-left: 1.5em;
  padding-top: 1.7em;
  background-color: var(--background-tertiary);
  color: var(--text-primary);
  font-size: 0.7em;
}

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

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


/****************/
/* 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;
  }
}

/* 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;
  }
}

@media (max-width: 900px) {
  section:nth-of-type(2) ul {
    padding: 0;
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 600px) {
  section:nth-of-type(2) ul {
    grid-template-columns: 1fr;
  }

  section:nth-of-type(2) ul li:first-of-type {
    grid-column: 1/1;
    max-width: 15em;
  }

  section:nth-of-type(2) ul li:first-of-type img {
    height: 40em;
  }

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