* {
    box-sizing: border-box;
}

body {
    --background-color: white;
    --text-color: black;
    --elements-color: white;
    --box-shadow: 0 2px 4px 0 rgba(0,0,0,0.2);
    margin: 0;
    font-family: Nunito, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
}

body.dark {
    --background-color: hsl(207, 26%, 17%);
    --text-color: white;
    --elements-color: hsl(209, 23%, 22%); 
    --box-shadow: 0 2px 4px 0 rgba(255, 255, 255, 0.6);
}

a {
    text-decoration-line: none;
    color: inherit;
}

.header-container {
    box-shadow: var(--box-shadow);
    padding-inline: 24px;
    background-color: var(--elements-color);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 24px;
}

.title {
    font-weight: 800;
}

.theme-changer {
    cursor: pointer;
}

.countries-container {
    display: flex;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 24px;
    margin-top: 16px;
    gap: 44px;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 20px;
}

.country-card {
    width: 250px;
    box-shadow: 0 0 8px 0 rgba(0,0,0,0.2);
    border-radius: 5px;
    overflow: hidden;
    padding-bottom: 20px;
    display: inline-block;
    background-color: var(--elements-color);
}

.country-card > img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.card-text {
    padding: 8px;
    margin-block: 2px;
}

.card-title {
    font-size: 24px;
    margin-block: 16px;
}

.card-text > p {
    margin-block: 8px;
}

.search-filter-container {
    max-width: 1200px;
    margin-inline: auto;
    margin-top: 16px;
    padding-inline: 24px;
    margin-bottom: 48px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.search-container {
    box-shadow:  0 0 8px 0 rgba(0,0,0,0.15);
    max-width: 350px;
    width: 100%;
    border-radius: 4px;
    padding-left: 24px;
    color: #999;
    overflow: hidden;
    background-color: var(--elements-color);
    color: var(--text-color);
}

.search-container input {
    border: none;
    outline: none;
    padding: 16px;
    width: 90%;
    background-color: inherit;
    color: inherit;
}

.search-container input::placeholder {
    color: #999;
}

.filter-by-region {
    width: 200px;
    padding: 16px;
    border: none;
    outline: none;
    box-shadow: 0 0 8px 0px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    background-color: var(--elements-color);
    color: var(--text-color);
}

.skeleton {
  opacity: .7;
  animation: skeleton-loading 1s linear infinite alternate;
}

.skeleton-text {
  width: 90%;
  height: .5rem;
  margin-bottom: .25rem;
  border-radius: .125rem;
}

.skeleton-text:first-child {
  margin-bottom: 0;
  width: 50%;
}

.skeleton-text:last-child {
  margin-bottom: 30px;
  width: 70%;
}

@keyframes skeleton-loading {
  0% {
    background-color: hsl(200, 20%, 70%);
  }

  100% {
    background-color: hsl(200, 20%, 95%);
  }
}

@media (max-width: 600px) {
    .search-filter-container {
        display: flex;
        flex-direction: column;
    }

    .countries-container {
        display: flex;
        max-width: 1200px;
        margin-inline: auto;
        padding-inline: 24px;
        margin-top: 16px;
        gap: 44px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .title {
        font-size: medium;
        margin-right: 10px;
    }

    .header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        max-width: 1300px;
        margin-inline: auto;
        padding-inline: 10px;
    }

    .header-content > span {
        font-size: small;
    }
}