@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;600;800&display=swap');
@import "theme-toggle.css";

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 1rem;
  color: var(--text);
}

header {
  background-color: var(--elements);
  -webkit-box-shadow: 0px 0px 5px 0px var(--shadow);
  box-shadow: 0px 0px 5px 0px var(--shadow);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 20px;
}

nav h1 {
  font-weight: 800;
}

nav h1, .theme-toggle > span, input, .filter-region select {
  font-size: 0.875rem;
}

.theme-toggle > span {
  font-weight: 600;
}

body {
  background-color: var(--background-color);
}

.container-header {
  display: flex;
  justify-content: space-around;
  flex-direction: column;
  padding-top: 25px;
  min-height: 200px;
}

.search i {
  position: absolute;
}

.search {
  width: 90vw;
  margin: 0 auto;
  margin-bottom: 10px;
}

.icon {
  padding: 10px;
  min-width: 40px;
  line-height: 2rem;
  margin-left: 10px;
}

.icon, .search input {
  color: var(--input);
}

.search input {
  width: 100%;
  padding: 1rem;
  text-align: center;
}

.filter-region select {
  align-items: flex-start;
  margin-left: 20px;
  padding: .9rem .5rem;
  width: 200px;
  background-color: var(--elements);
}

.search input, .filter-region select, .country-container, .borders button {
  border: none;
  -webkit-box-shadow: 0px 0px 5px 0px var(--shadow);
  box-shadow: 0px 0px 5px 0px var(--shadow);
  border-radius: 5px;
}

.container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3rem;
  padding-top: 1rem;
}

.country-container {
  cursor: pointer;
  background-color: var(--elements);
}

.image-container {
  width: 320px;
  height: 200px;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
}

.country-details {
  font-weight: 600;
  max-width: 320px;
  padding: 2rem 1.5rem;
}

.country-details h2 {
  font-weight: 800;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.country-details p {
  font-weight: 600;
  margin: 0.3rem 0;
}

.country-details span {
  margin-right: 10px;
  font-weight: 400;
}

.wrapper {
  width: 300px;
  margin: auto;
}

a > button {
  background-color: var(--elements);
  width: 100px;
  font-size: 0.875rem;
  color: var(--text);
  padding: .2rem .5rem;
  margin-top: 1.5rem;
  border: none;
  border-radius: 5px;
  -webkit-box-shadow: 0px 0px 5px 3px var(--shadow);
  box-shadow: 0px 0px 5px 3px var(--shadow);
}

a > button i {
  margin-right: .5rem;
}

.flex-container {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.country-text {
  display: flex;
  flex-direction: column;
}

.country-text h3 {
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

p .strong {
  font-weight: 600;
}

p.details {
  margin: .3rem 0;
}

.right, .border-container {
  margin-top: 2rem;
}

.borders {
  /* display: grid; */
  /* grid-template-columns: repeat(auto-fill, minmax(3rem, 1fr)); */
  /* gap: .4rem; */
  margin-top: .5rem;
}

.borders button {
  cursor: pointer;
  padding: .3rem;
  background-color: var(--elements);
  margin: .2rem;
}

.inline-block {
  display: inline-block;
  padding-right: .5rem;
}

.theme-toggle {
  cursor: pointer;
}

@media (min-width: 767.9px) {
  
  main {
    display: flex;
    justify-content: center;
  }

  .index-wrapper {
    width: 90vw;
    margin: auto;
  }

  nav {
    width: 90vw;
    margin: auto;
    padding: 30px 0;
  }

  header nav h1 {
    font-size: 1.3rem;
  }
  
  .search {
    width: 400px;
    margin: 0;
  }

  .container {
    justify-content: space-between;
    row-gap: 2rem;
    column-gap: 0;
  }

  .container-header {
    flex-direction: row;
    justify-content: space-between;
    min-height: 0;
    margin-bottom: 2rem;
  }

  /* .country-container {
    max-width: 300px;
  } */

  .wrapper {
    width: 90vw;
    padding-top: 5rem;
  }

  .flex-container {
    flex-direction: row;
    justify-content: space-between;
  }

  .flex-container img {
    max-height: 250px;
    flex: 1;
  }

  .country-text {
    align-self: center;
  }

  .info {
    margin-top: -1rem;
  }
}

@media (min-width: 1023.9px) {
  .flex-container img {
    max-width: 50%;
    max-height: 300px;
  }

  .country-text {
    width: 50%;
  }

  .info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }

  .index-wrapper {
    width: 95vw;
  }
}

@media (min-width: 1439.9px) {
  
  .flex-container {
    justify-content: flex-start;
    gap: 10rem;
  }
  
  .flex-container img {
    max-width: 800px;
    max-height: 600px;
  }

  .info {
    justify-content: flex-start;
    gap: 5rem;
  }

  .country-text {
    width: 40%;
  }

  .country-text h3 {
    font-size: 2rem;
  }
}