body {
  display: block;
}

.grid {
  position: relative;
  transition: opacity 0.8s linear 1s;
  margin-top: 7rem;
  grid-auto-flow: dense;
  display: grid;
  gap: 0;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: auto;
}

.lazyload,
.lazyloading {
  filter: blur(10px);
}

.lazyloaded {
  transition: all 300ms;
  filter: blur(0px);
}

.item {
  display: inline-flex;
  z-index: 1;
  color: #fff;
  padding: 5px;
  cursor: pointer;
  box-sizing: border-box;
  height: auto;
}

/* Portraits images size and ratio */
.portrait {
  aspect-ratio: 5/7;
}

.portrait.large {
  grid-column: span 6;
  grid-row: span 12;
}

.portrait.medium {
  grid-column: span 4;
  grid-row: span 8;
}

.portrait.tiny {
  grid-column: span 2;
  grid-row: span 4;
}

.landscape {
  aspect-ratio: 10/7;
}

/* Landscapes images size and ratio */
.landscape.tiny {
  grid-column: span 4;
  grid-row: span 4;
}

.landscape.medium {
  grid-column: span 6;
  grid-row: span 6;
}

.landscape.large {
  grid-column: span 8;
  grid-row: span 8;
}

.item-content {
  position: relative;
  width: 100%;
}

.blured {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: -1;
}

picture {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.item-content picture img {
  width: 100%;
  height: 100%;
  display: block;
  mix-blend-mode: normal;
  object-fit: cover;
  object-position: center center;
}

.item-content picture:hover img,
.item-content:hover video {
  opacity: 0.5;
  transition: all 300ms ease-in-out;
}

.item-content video {
  display: inline-block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
}

.item-content:hover > .serie-title {
  opacity: 1;
  transition: all 300ms ease-in-out;
}

.serie-title {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  margin: auto;
  height: 1em;
  text-align: center;
  opacity: 0;
  pointer-events: none;
}

/* The Modal (background) */
.modal {
  display: none;
  position: fixed;
  left: 0;
  top: -1;
  width: 100%;
  height: calc(100% + 1px);
  overflow: hidden;
  background-image: url("../../imgs/background.webp");
  background-repeat: repeat-y;
  background-size: 100%;
  z-index: 99;
}

/* Modal Content */
.modal-content {
  position: relative;
  margin: 0;
  width: calc(100vw - calc(var(--gutter-width) * 2));
  height: calc(100vh - calc(var(--gutter-width) * 2));
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  column-gap: var(--gutter-width);
  padding: var(--gutter-width);
}

#toggle {
  display: none;
}

#back-button {
  cursor: pointer;
  height: 2em;
  width: 2em;
  background-image: url("../../imgs/close.png");
  background-size: 50%;
  background-repeat: no-repeat;
  background-position: center;
}

.arrow {
  height: 1em;
  width: 1em;
  background-repeat: no-repeat;
}

#next .arrow {
  height: 2em;
  background-image: url("../../imgs/next.png");
  background-size: 75%;
  background-repeat: no-repeat;
  background-position: center;
}
#prev .arrow {
  height: 2em;
  background-image: url("../../imgs/prev.png");
  background-size: 75%;
  background-repeat: no-repeat;
  background-position: center;
}

#lightbox {
  display: none;
  -webkit-transition: 0.5s ease-in-out;
  -moz-transition: 0.5s ease-in-out;
  -o-transition: 0.5s ease-in-out;
  transition: 0.5s ease-in-out;
}

#lightbox button:first-of-type {
  display: none;
}

.swiper {
  margin-left: 0 !important;
  margin-right: 0 !important;
  grid-column: 1 / span 6;
  position: relative;
  overflow: hidden;
  list-style: none;
  padding: 70px 0 0 0;
  z-index: 1;
}

.swiper-slide {
  display: none;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(6, 1fr);
  column-gap: var(--gutter-width);
  display: grid;
  justify-content: center;
  text-align: center;
  padding-bottom: 1rem;
  background-color: transparent;
}

.swiper-slide picture {
  grid-column: 1 / span 8;
  grid-row: 1 / span 6;
  height: 100%;
  position: relative;
  display: inline-block;
  overflow: hidden;
  margin: 0;
  object-fit: contain;
  object-position: center center;
  width: 100%;
  height: 100%;
}

.swiper-slide picture img,
.swiper-slide picture video {
  display: block;
  position: absolute;
  left: 0;
  max-height: 100%;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  object-fit: contain;
  object-position: center center;
  width: 100%;
  height: 100%;
}

.swiper-button-next,
.swiper-button-prev {
  height: 97%;
  top: 0;
  right: 0;
  width: 25%;
  margin: 0;
}

#prev,
#next {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.swiper-button-prev {
  left: 0;
  justify-content: left;
}

.swiper-button-next {
  justify-content: right;
}

.swiper-button-next:after,
.swiper-button-prev:after {
  content: " ";
}

#prev p,
#next p {
  font-size: 30px;
}

#next {
  right: 0;
  justify-content: right;
}

.caption-container {
  position: fixed;
  left: 0;
  top: 0;
  width: calc(100% - 40px);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-column-gap: var(--gutter-width);
  padding: var(--gutter-width);
  z-index: 90;
  min-height: 60px;
}

.demo {
  opacity: 0.6;
}

.active,
.demo:hover {
  height: calc(100vh - 40px);
  padding: var(--gutter-width);
  opacity: 1;
}

.caption {
  grid-column: 1 / span 4;
  text-align: left;
}
.number {
  padding: var(--gutter-width) 0 0 0;
  grid-column: 5 / span 4;
  text-align: right;
  display: flex;
  justify-content: flex-start;
  flex-direction: column-reverse;
}

.caption {
  padding: var(--gutter-width) 0 0 0;
}

#preload_inner {
  color: black;
}

.fancybox-active {
  overflow: hidden;
}

.hamburger-lightbox {
  visibility: visible;
  position: fixed;
  right: var(--gutter-width);
  top: 25px;
  z-index: 999;
}

@media screen and (max-width: 750px) {
  .caption,
  .number {
    grid-column: 1 / span 8;
    text-align: center;
  }

  .number {
    padding: 0;
  }

  .serie-title {
    visibility: hidden;
  }

  /* Landscapes images size and ratio */

  .item {
    padding: 2px;
  }

  .modal-content {
    width: calc(100% - calc(8px * 2));
    height: calc(100% - calc(8px * 2));
    padding: 8px;
  }

  .hamburger-lightbox {
    right: 8px;
  }
}

@media screen and (max-width: 550px) {
  .number {
    margin-bottom: 4.5em;
    flex-direction: column;
  }
}
