.body__project {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.header__project {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  background-color: var(--body-color);
  z-index: var(--z-fixed);
  transition: box-shadow .4s, background-color .4s;
}

.header__project {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  height: auto;
  padding: 1rem 2rem;
}

.photographie {
  margin-top: 153.6px;
  padding-top: 0;
}

.filters-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem auto 0 auto;
  grid-column: 1 / 4;
  justify-self: center;
  width: 100%;
  max-width: 1100px;
  box-sizing: border-box;
  padding: 0 1rem;
}

.filters-scroll-container {
  overflow-x: auto;
  scroll-behavior: smooth;
  flex: 1;
  scrollbar-width: none;
}

.filters-scroll-container::-webkit-scrollbar {
  display: none;
}

.gallery__filters {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0;
  width: max-content;
  user-select: none;
  scrollbar-width: none;
  cursor: grab;
}

.filter-btn {
  position: relative;
  padding: 0.5rem 1rem 0.5rem 2.8rem;
  background-color: var(--black-color);
  color: var(--white-color);
  border: none;
  font-size: 0.9rem;
  transition: background 0.3s ease;
  clip-path: polygon(15px 0, 100% 0, 100% 100%, 15px 100%, 0 50%);
  cursor: pointer;
}

.filter-btn::before {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--white-color);
  border-radius: 50%;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  z-index: 2;
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--first-color);
}

.scroll-arrow {
  border: none;
  background: none;
  color: var(--black-color);
  font-size: 1.5rem;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: color 200ms ease-in-out;
}

.scroll-arrow:hover {
  color: var(--title-color);
}

.gallery__filters.dragging {
  cursor: grabbing;
}

.gallery {
  display: grid;
  width: 80%;
  margin: 2rem auto 0 auto;
  grid-column-gap: 8px;
  grid-row-gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: 10px;
}

.content {
  display: block;
  padding: 4px;
  /* display: flex; */
  /* flex-direction: column; */
}

.gallery__item {
  --row-span: 1;
  grid-row-end: span var(--row-span);
  overflow: hidden;
  grid-row-end: span var(--row-span, 1);
  transition: grid-row-start 300ms linear;
  transition: transform 300ms ease;
  transition: all 0.5s ease;
  cursor: pointer;
}

.gallery__item:hover {
  transform: scale(1.025);
}

.gallery__item img {
  display: block;
  max-width: 100%;
  border-radius: 4px;
  object-fit: cover;
  filter: grayscale(0.2);
  transition: all 0.5s ease;
}

.gallery__item img:hover {
  filter: grayscale(0);
}

.gallery__item img.loaded {
  opacity: 1;
}

.gallery__pagination {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--body-color, rgba(255, 255, 255, 0.95));
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  justify-content: center;
  scroll-snap-type: x mandatory;
  gap: 0.5rem;
  z-index: 1000;
  max-width: 100vw;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.gallery__pagination::-webkit-scrollbar {
  height: 6px;
}

.gallery__pagination::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.gallery__pagination button {
  background-color: var(--container-color);
  color: var(--text-color);
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s ease;
  scroll-snap-align: center;
  white-space: nowrap;
  flex: 0 0 auto;
}

.gallery__pagination button.active,
.gallery__pagination button:hover {
  background-color: var(--first-color);
  color: var(--white-color);
}

.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  backdrop-filter: blur(12px);
  background-color: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(12px);
  justify-content: center;
  align-items: center;
  padding: 2rem;
  box-sizing: border-box;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  overflow: auto;
}

.lightbox-title {
  color: white;
  font-size: 1.2rem;
  font-weight: 500;
  max-width: 90%;
  text-align: center;
  word-break: break-word;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 1rem;
  object-fit: contain;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 2.5rem;
  color: var(--black2-color);
  padding: 0.2rem 0.6rem;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10000;
}

.show-scroll {
  bottom: 4rem !important;
}

@media (min-width: 1200px) {
  .filters-wrapper {
    max-width: 1200px;
  }

  .filter-btn {
    font-size: 1rem;
    padding: 0.6rem 1.2rem 0.6rem 3.2rem;
  }

  .filter-btn::before {
    width: 9px;
    height: 9px;
    left: 10px;
  }

  .scroll-arrow {
    font-size: 1.6rem;
    padding: 0.5rem;
  }
}

/* Tablette */
@media (max-width: 991px) {
  .filter-btn {
    font-size: 0.9rem;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
  }

  .filter-btn::before {
    width: 7px;
    height: 7px;
    left: 7px;
  }

  .scroll-arrow {
    font-size: 1.3rem;
    padding: 0.4rem;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .photographie {
    margin-top: 132px;
  }

  .gallery {
    margin-top: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(50%, 1fr));
  }

  .filters-wrapper {
    padding: 0 0.5rem;
    margin: 0.5rem auto;
  }

  .filter-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem 0.4rem 2.2rem;
  }

  .filter-btn::before {
    width: 6px;
    height: 6px;
    left: 6px;
  }

  .scroll-arrow {
    display: none;
  }

  .gallery__pagination {
    justify-content: flex-start;
    padding-left: 1rem;
    max-width: calc(100vw - 10vw);
  }
}