@import url('https://fonts.googleapis.com/css?family=Arvo');

body,
html {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
  height: 100%;
  background: #f5f4f4;
  font-size: 16px;
  font-family: 'Arvo', monospace;

  @supports(display: grid) {
    display: block;
  }

  @media screen and (min-width: 576px) {
      font-size: 24px;
  }

  @media screen and (min-width: 768px) {
      font-size: 16px;
  }

  @media screen and (min-width: 1152px) {
      font-size: 24px;
  }

  @media screen and (min-width: 1536px) {
      font-size: 32px;
  }

  .pagebody {
      font-size: 8px;

      @media screen and (min-width: 576px) {
          font-size: 10px;
      }

      @media screen and (min-width: 768px) {
          font-size: 12px;
      }

      @media screen and (min-width: 1152px) {
          font-size: 14px;
      }

      @media screen and (min-width: 1536px) {
          font-size: 16px;
      }
  }
}

a {
  text-decoration: none;
}

.message {
  border: 1px solid #d2d0d0;
  padding: 2em;
  font-size: 1rem;
  box-shadow: -2px 2px 10px 0px rgba(#444, 0.4);

  @supports(display: grid) {
    display: none;
  }
}

.section {
  display: none;
  margin: 0 2rem;

  @media screen and (min-width: 768px) {
    margin: 0 4rem;
  }

  @supports(display: grid) {
    display: block;
  }
}

.section, .message {
  @media screen and (min-width: 768px) {
      margin: 0 2rem;
  }
}

h1 {
  font-size: 1rem;
  margin: 1em 0;
}

.grid {
  display: grid;
  grid-gap: 30px;
  grid-auto-flow: row dense;
  grid-template-columns: repeat(1, minmax(10px, 1fr));

  @media screen and (min-width: 768px) {
    grid-template-columns: repeat(2, minmax(350px, 1fr));
  }
}

.item {
  font-size: 0.5rem;
  position: relative;
  aspect-ratio: 9 / 5;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-sizing: border-box;
  background: #0c9a9a;
  color: #fff;
  grid-column-start: auto;
  grid-row-start: auto;
  color: #fff;
  background-size: cover;
  background-position: center;
  box-shadow: -2px 2px 10px 0px rgba(#444, 0.4);
  transition: transform 0.3s ease-in-out;
  cursor: pointer;
  counter-increment: item-counter;
  background-position: left;
  background-repeat: no-repeat;
  background-size: contain;

  &:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: black;
    opacity: 0.3;
    transition: opacity 0.3s ease-in-out;
  }

  &:hover {
    transform: scale(1.05);

    &:after {
      opacity: 0;
    }
  }

  &--full {
    grid-column-end: auto;

    @media screen and (min-width: 768px) {
      grid-column: 1/-1;
    }
  }
}

.item-details {
    aspect-ratio: 3 / 5;
    background-color: #ffd585;
    align-self: end;
    height: 100%;
    position: relative;
    z-index: 1;
    padding: 15px;
    color: #444;
    background: #fff;
    letter-spacing: 1px;
    color: #828282;
    display: inline-flex;
    align-items: center;
}

.item-image {
    align-self: begin;
    display: inline-block;
    height: 100%;
    aspect-ratio: 6 / 5;
    background-repeat: no-repeat;
    position: absolute;
    background-size: cover;
}

.item-country-name {
    font-size: 0.6rem;
    display: inline-block;
    margin: 2em 0 2em 0;
    width: 100%;
    text-align: center;
    font-weight: bold;
}

.footer {
    text-align: right;
    padding: 20px;
    font-size: 0.5rem;
}

.footer a {
    font-size: 0.5rem;
}
