.gallery {
  width: 100%;
  height: 100%;
}

.gallery .blocks {
  width: 100%;
}

.gallery .bloc-1 {
  height: 100%;
}

.gallery .bloc-2 {
  height: 50%;
}

.gallery .bloc-3 {
  height: 33%;
}

.gallery .bloc-4 {
  height: 25%;
}

.gallery .bloc-5 {
  height: 20%;
}

.gallery .bloc-6 {
  height: 16.65%;
}

.gallery img {
  -o-object-fit: cover;
     object-fit: cover;
  width: initial;
}

.trans {
  transition: all 1s ease;
  -moz-transition: all 1s ease;
  -ms-transition: all 1s ease;
  -o-transition: all 1s ease;
  -webkit-transition: all 1s ease;
}

.top {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  width: 80vw;
  height: 80vh;
  margin-top: 10vh;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 10vh;
}

.top ul {
  list-style: none;
  width: 100%;
  height: 100%;
  z-index: 1;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}

.top ul li {
  position: relative;
  float: left;
  overflow: hidden;
}

.top ul li::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  content: '';
  color: white;
  opacity: 0.4;
  text-align: center;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  pointer-events: none;
  transition: all 0.5s ease;
  -moz-transition: all 0.5s ease;
  -ms-transition: all 0.5s ease;
  -o-transition: all 0.5s ease;
  -webkit-transition: all 0.5s ease;
}

.top ul li:hover::before {
  opacity: 0;
  background-color: rgba(0, 0, 0, 0.90);
}

.top ul li img {
  width: 100%;
  height: auto;
  overflow: hidden;
}

.lightbox {
  position: fixed;
  width: 100%;
  height: 100%;
  text-align: center;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
}

.lightbox img {
  max-width: 90%;
  max-height: 80%;
  position: relative;
  top: -100%;
  /* Transition */
  transition: all 1s ease;
  -moz-transition: all 1s ease;
  -ms-transition: all 1s ease;
  -o-transition: all 1s ease;
  -webkit-transition: all 1s ease;
  margin: auto;
}

.lightbox:target {
  outline: none;
  top: 0;
  opacity: 1;
  pointer-events: auto;
  transition: all 1.2s ease;
  -moz-transition: all 1.2s ease;
  -ms-transition: all 1.2s ease;
  -o-transition: all 1.2s ease;
  -webkit-transition: all 1.2s ease;
}

.lightbox:target img {
  top: 0;
  top: 50%;
  transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
}

/* GALLERY GRID */
.hello {
  opacity: 1 !important;
}

.full {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.full .content {
  background-color: rgba(0, 0, 0, 0.75) !important;
  height: 100%;
  width: 100%;
  display: -ms-grid;
  display: grid;
}

.full .content img {
  left: 50%;
  -webkit-transform: translate3d(0, 0, 0);
          transform: translate3d(0, 0, 0);
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  width: initial;
}

.byebye {
  opacity: 0;
}

.byebye:hover {
  -webkit-transform: scale(0.2) !important;
      -ms-transform: scale(0.2) !important;
          transform: scale(0.2) !important;
}

.galleryG {
  display: -ms-grid;
  display: grid;
  grid-column-gap: 8px;
  grid-row-gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: 8px;
}

.galleryG img {
  max-width: 100%;
  border-radius: 8px;
  -webkit-box-shadow: 0 0 16px #333;
          box-shadow: 0 0 16px #333;
  -webkit-transition: all 1.5s ease;
  -o-transition: all 1.5s ease;
  transition: all 1.5s ease;
}

.galleryG img:hover {
  -webkit-box-shadow: 0 0 32px #333;
          box-shadow: 0 0 32px #333;
}

.galleryG .content {
  padding: 4px;
}

.galleryG .gallery-item {
  -webkit-transition: grid-row-start 300ms linear;
  -o-transition: grid-row-start 300ms linear;
  transition: grid-row-start 300ms linear;
  transition: grid-row-start 300ms linear, -ms-grid-row 300ms linear;
  -webkit-transition: -webkit-transform 300ms ease;
  transition: -webkit-transform 300ms ease;
  -o-transition: transform 300ms ease;
  transition: transform 300ms ease;
  transition: transform 300ms ease, -webkit-transform 300ms ease;
  -webkit-transition: all 0.5s ease;
  -o-transition: all 0.5s ease;
  transition: all 0.5s ease;
  cursor: pointer;
}

.galleryG .gallery-item:hover {
  -webkit-transform: scale(1.025);
      -ms-transform: scale(1.025);
          transform: scale(1.025);
}

@media (max-width: 600px) {
  .galleryG {
    grid-template-columns: repeat(auto-fill, minmax(30%, 1fr));
  }
}

@media (max-width: 400px) {
  .galleryG {
    grid-template-columns: repeat(auto-fill, minmax(50%, 1fr));
  }
}

/* GALLERY MASONRY */

#galleryS {
  display: -ms-grid;
  display: grid;
  height: calc(100vh - 10px);
  -ms-grid-rows: 1fr 0.5em 1fr 0.5em 1fr 0.5em 1fr 0.5em 1fr 0.5em 1fr;
  -ms-grid-columns: 1fr 0.5em 1fr 0.5em 1fr 0.5em 1fr 0.5em 1fr 0.5em 1fr;
      grid-template: repeat(6, 1fr)/repeat(6, 1fr);
  grid-gap: 0.5em;
}

@media (max-width: 800px) {
  #galleryS {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: start;
        -ms-flex-align: start;
            align-items: flex-start;
    -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
  }

  #galleryS>div {
    width: 48%;
    margin: 1%;
  }
}

@media (max-width: 800px) and (max-width: 350px) {
  #galleryS>div {
    width: 98%;
  }
}

#galleryS>div:nth-child(6n+1) {
  -ms-grid-column-span: 2;
  grid-column: span 2;
  -ms-grid-row-span: 2;
  grid-row: span 2;
}

#galleryS>div:nth-child(2) {
  -ms-grid-column-span: 3;
  grid-column: span 3;
  -ms-grid-row-span: 3;
  grid-row: span 3;
}

#galleryS>div:nth-child(4) {
  -ms-grid-column-span: 1;
  grid-column: span 1;
  -ms-grid-row-span: 2;
  grid-row: span 2;
}

#galleryS>div>a {
  opacity: 0;
  position: absolute;
  color: #000;
  background-color: #000;
  text-shadow: 0 -1px 5px #fff, -1px 0px 5px #fff, 0 1px 5px #fff, 1px 0px 5px #fff;
  padding: 2rem;
  mix-blend-mode: difference;
  width: 100%;
  height: 100%;
  -webkit-transition: all ease 1s;
  -o-transition: all ease 1s;
  transition: all ease 1s;
  font-size: 14px;
  text-transform: uppercase;
  text-align: center;
}

#galleryS>div>img {
  width: 100%;
  min-height: 100%;
  -webkit-transition: all ease 1s;
  -o-transition: all ease 1s;
  transition: all ease 1s;
  -o-object-fit: cover;
     object-fit: cover;
}

#galleryS>div:hover img {
  -webkit-filter: blur(4px);
          filter: blur(4px);
}

#galleryS>div:hover a {
  opacity: 1;
}

#galleryS>div {
  overflow: hidden;
  position: relative;
  -webkit-box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2), 0 3px 20px 0 rgba(0, 0, 0, 0.19);
          box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2), 0 3px 20px 0 rgba(0, 0, 0, 0.19);
}

#galleryS div,
#galleryS a {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  text-decoration: none;
}

[id^=lightbox-] {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  opacity: 0;
  -webkit-transition: opacity 450ms ease-in-out;
  -o-transition: opacity 450ms ease-in-out;
  transition: opacity 450ms ease-in-out;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  pointer-events: none;
}

[id^=lightbox-]:target {
  opacity: 1;
  pointer-events: inherit;
}

[id^=lightbox-]:target img {
  -webkit-filter: blur(0);
          filter: blur(0);
}

[id^=lightbox-] .content {
  max-width: 90%;
  position: relative;
  color: #fff;
}

[id^=lightbox-] .content:hover>a.close {
  opacity: 1;
  -webkit-transform: scale(1, 1);
      -ms-transform: scale(1, 1);
          transform: scale(1, 1);
}

[id^=lightbox-] .content:hover>.title {
  opacity: 1;
  -webkit-transform: translateY(-3px);
      -ms-transform: translateY(-3px);
          transform: translateY(-3px);
}

[id^=lightbox-] .content:hover>.title::after {
  opacity: 1;
}

[id^=lightbox-] .content>* {
  -webkit-transition: all 450ms ease-in-out;
  -o-transition: all 450ms ease-in-out;
  transition: all 450ms ease-in-out;
}

[id^=lightbox-] .title {
  display: block;
  margin: 0;
  padding: 1em;
  position: absolute;
  bottom: 0;
  width: 100%;
  -webkit-transform: translateY(50%);
      -ms-transform: translateY(50%);
          transform: translateY(50%);
  font-size: 1.5em;
  opacity: 0;
}

[id^=lightbox-] .title::after {
  content: " ";
  background-color: rgba(0, 0, 0, 0.4);
  bottom: 0;
  left: 0;
  height: 100%;
  width: 100%;
  position: absolute;
  -webkit-transition: all 350ms ease-in-out 250ms;
  -o-transition: all 350ms ease-in-out 250ms;
  transition: all 350ms ease-in-out 250ms;
  opacity: 0;
  -webkit-transform-origin: bottom;
      -ms-transform-origin: bottom;
          transform-origin: bottom;
  mix-blend-mode: soft-light;
}

[id^=lightbox-] img {
  max-height: 90vh;
  max-width: 100%;
  margin: 0;
  padding: 0;
  -webkit-filter: blur(50px);
          filter: blur(50px);
}

[id^=lightbox-] a.close {
  width: 2em;
  height: 2em;
  position: absolute;
  right: 0;
  top: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-transform: scale(0, 0);
      -ms-transform: scale(0, 0);
          transform: scale(0, 0);
  opacity: 0;
  -webkit-transform-origin: right top;
      -ms-transform-origin: right top;
          transform-origin: right top;
  text-decoration: none;
  color: #fff;
}

[id^=lightbox-] a.close::after {
  content: "X";
}
