/* work around for lack of aspect ratio support */
.gallery .card::after { content: ""; display: block; padding-bottom: 100%; }
.gallery .card a img { position: absolute; width: 100%; height: 100%; object-fit: cover; left: 0; top: 0; }
.gallery .card { position: relative; } 

.gallery > :nth-child(3n+1) {
  background-color: #3278AE;
}
.gallery > :nth-child(3n+2) {
  background-color: #104F7E;
}
.gallery > :nth-child(3n+3) {
  background-color: #1b719e;
}
.gallery > :nth-child(3n+4) {
  background-color: #1376bb;
}

.card a {
  font-family: futura-pt;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  padding: 0;
}

.gallery .card {
  aspect-ratio: 1;
  width: 23%;
  height: 23%;
  margin: 1%;
  flex: 20%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  text-align: center;
  border-radius: 5%;
  flex-direction: column;
  align-content: center;
  justify-content: space-evenly;
}

.gallery .card a {
  color: #fff;
  font-weight: bold;
  line-height: 120%;
  padding: 1rem;
  border: none;
}

.gallery .card a:hover {
  color: #fff;
  text-decoration: underline;
}

.gallery .card img {
  padding: 7%;
  border-radius: 20%;
}

.gallery .block {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 1rem
}

.gallery .block h3, .gallery .block li {
  flex: 100%;
  background-color: inherit;
  color: #fff;
  line-height: 120%;
  margin: 0.5rem;
}

.gallery .block a {
  color: #fff;
  border-color: rgb(255, 255, 255, 0.7);
}

.gallery .block a:hover {
  color: #fff;
  border-color: rgb(255, 255, 255, 1);
}

@media screen and (min-width: 767px) {
  .gallery .card {
    font-size: 2.5vw;
  }
}

@media screen and (max-width: 767px) {
  .gallery .card {
    flex: 40%;
    font-size: 5vw;
  }
}

/* really tiny screens */
@media screen and (max-width: 300px) {
  .gallery .card a {
    font-size: 100%;
  }
}
