
.gallery .container {
  display: flex;
  flex-wrap: wrap;
  width: calc(100% - var(--margin))
}

.gallery {
  color: var(--dark);
  background: var(--bright);
}

.gallery .text-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 5rem;
  width: 100%;
}

.gallery .floater {
  position: relative;
  width: 54%;
  margin-right: 5vw;
  flex-grow: 1;
  max-width: 750px;
  min-width: 540px; 
  height: 300px;
}

.gallery .crossed_out {
  position: absolute;
  color: var(--dark);
  animation: rotating 5s linear infinite;
  animation-direction: alternate;
  animation-fill-mode: both;
}

.gallery .crossed_out .word:before {
  content: '';
  position: absolute;
  left: -10%;
  width: 120%;
  height: 4px;
  background: var(--white);
  top: 50%;
  margin-top: -2px;
  transform: rotate(10deg);
}

.gallery .crossed_out:nth-child(even) .word:before {
  transform: rotate(-8deg);
}

.gallery .crossed_out:nth-child(1) {
  left: 13%;
  top: 9%;
  transform: rotate(5deg);
  animation-duration: 15s;
  animation-delay: .6s;
  animation-direction: alternate-reverse;
}

.gallery .crossed_out:nth-child(2) {
  top: 25%;
  right: 14%;
  transform: rotate(-3deg);
  animation-delay: .2s;
  animation-duration: 12s;
  animation-direction: alternate-reverse;
}

.gallery .crossed_out:nth-child(3) {
  left: 8%;
  bottom: 24%;
  transform: rotate(-2deg);
  animation-duration: 9s;
  animation-delay: 1s;
}

.gallery .crossed_out:nth-child(4) {
  right: 5%;
  bottom: 7%;
  transform: rotate(6deg);
  animation-duration: 11s;
  animation-delay: .6s;
}

.gallery .crossed_out .word {
  animation: moving 5s linear infinite;
  animation-delay: inherit;
  animation-fill-mode: both;
}

.gallery .crossed_out:nth-child(1) .word {
  animation-direction: reverse;
  animation-duration: 7.8s;
  animation-delay: 1s;
}

.gallery .crossed_out:nth-child(2) .word { 
  animation-direction: reverse;
  animation-duration: 6.4s;
  animation-delay: .7s
}

.gallery .crossed_out:nth-child(3) .word {
  animation-direction: reverse;
  animation-duration: 7.2s;
  animation-delay: 1.6s
}

.gallery .crossed_out:nth-child(4) .word {
  animation-direction: reverse;
  animation-duration: 6.9s;
  animation-delay: .6s
}

@keyframes rotating {
  from { transform: rotate(-5deg) }
  to   { transform: rotate(5deg) }
}

@keyframes moving {
  from { transform: rotate(0deg) translateX(5px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(5px) rotate(-360deg); }
}

.gallery .text {
  width: 411px;
  max-width: 100%;
  flex-grow: 0;
  flex-shrink: 0; 
}

.gallery .carousel {
  position: relative;
  width: 100vw;
  left: 50%;
  margin-top: 140px;
  margin-left: -50vw;
  font-size: 0;
  overflow: visible;
  display: flex;
  align-items: stretch;
}

.gallery .carousel .flickity-page-dots {
  text-align: left;
  bottom: -45px;
  padding-left: var(--margin);
  
}

.gallery .carousel .flickity-page-dots .dot {
  background-color: white;
  opacity: 1;
  transform: scale(0.8);
  transition: transform 0.2s;
}

.gallery .carousel .flickity-page-dots .dot.is-selected {
  background-color: var(--dark);
  transform: scale(1);
}

@media screen and (max-width: 767px) {
  .gallery .carousel {
    margin-top: 50px;
    margin-bottom: 40px;
  }

  .gallery .carousel .flickity-page-dots {
    bottom: -35px
  }
}

.gallery .carousel.flickity-enabled {
  display: block;
}

.gallery .carousel-cell {
  flex: none;
  display: inline-flex;
  vertical-align: top;
  
  width: 25%;
  box-sizing: content-box;

  overflow: hidden;

  flex-direction: column;
  justify-content: center;
  align-items: flex-start;

  padding-left: 5vw;
  white-space: normal;
  font-size: 18px;
}

.gallery .carousel.flickity-resize .carousel-cell {
  min-height: 100%;
}

.gallery .carousel-cell.wide {
  width: 42%;
}

.gallery .carousel-cell picture,
.gallery .carousel-cell img {
  width: 100%;
}

.gallery .carousel-cell:first-child {
  padding-left: var(--margin);
}

.gallery .carousel-cell:last-child {
  padding-right: var(--margin);
}

.gallery .carousel figcaption {
  font-family: var(--header_font);
  font-size: 2.6rem;
  line-height: 1.2;
  color: white;
  border-bottom: 3px solid var(--dark);
  margin-top: 2rem;
}


@media screen and (max-width: 1100px) {
  .gallery .text-wrapper {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    flex-direction: column;
  }

  .gallery .floater {
    width: 100%;
    min-width: 0;
    max-width: 710px;
    margin: 4rem auto 0;
    order: 1;
  }


  .gallery .crossed_out:nth-child(1) {
    left: 13%;
    top: 5%;
  }

  .gallery .crossed_out:nth-child(2) {
    top: 22%;
    right: 6%;
  }

  .gallery .crossed_out:nth-child(3) {
    left: 4%;
    bottom: 25%;
  }

  .gallery .crossed_out:nth-child(4) {
    right: 5%;
    bottom: 0%;
  }
}

@media screen and (max-width: 1023px) {
  .gallery .carousel-cell {
    width: 62%;
  }

  .gallery .carousel-cell.wide {
    width: 90%;
  }
}

@media screen and (max-width: 767px) {
  .gallery .floater {
    max-width: 320px;
    flex-grow: 0;
    padding: 0;
    height: 100vw;
    max-height: 220px;
  }

  .gallery .crossed_out .word:before {
    height: 2px;
    margin-top: -1px;
  }

  .gallery .carousel figcaption {
    margin-top: .5rem;
  }
}