.bahman-gallery {
  display: flex;
  gap: 20px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1rem;

  .tabs {
    align-self: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
    gap: 5px;
    align-items: center;
    overflow: hidden;

    .tab {
      transition: all 0.2s ease;
      flex: 1;
      text-align: center;
      cursor: pointer;
      padding: 10px 5px;
      border: 2px solid #0002;
      -webkit-line-clamp: 1;
      line-clamp: 1;
      text-overflow: ellipsis;
      white-space: nowrap;

      &:hover {
        background-color: #0002;
      }

      &.active {
        background-color: #222;
        border-color: #222;
        color: white;
        border-inline-end: none;
      }
    }
  }

  .gallery {
    display: none;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    align-self: stretch;
    gap: 5px;
    width: 100%;

    .item {
      position: relative;
      cursor: pointer;

      .image {
        width: 100%;
        height: auto;
        aspect-ratio: 1/1;
        object-fit: cover;
        background-color: #0002;
      }

      .icon {
        transition: all 0.2s ease;
        position: absolute;
        top: 10px;
        left: 10px;
        width: 20px;
        height: 20px;
        filter: invert() drop-shadow(0 0 1px #0004);
      }

      &:hover {
        .icon {
          width: 25px;
          height: 25px;
        }
      }
    }
  }

  .lightbox {
    display: none;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    align-items: center;
    justify-content: center;
    background-color: #000d;
    z-index: 1000000;

    .toolbar {
      z-index: 10000000;
      position: absolute;
      top: 30px;
      right: 40px;
      background-color: transparent;
      border: none;
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 10px;

      .toolbar-button {
        font-size: 1.5rem;
        cursor: pointer;
        color: #fff;
        padding: 2px 10px;
        text-shadow: 0 0 1px #000;
      }
    }

    .swiper {
      width: 100%;
      height: 100%;
      outline: none;

      .swiper-pagination-bullet {
        background-color: #fff8;
        outline: none !important;

        &.swiper-pagination-bullet-active {
          background-color: #fff;
        }
      }

      .swiper-button-next,
      .swiper-button-prev {
        padding: 10px;
        margin-inline: 10px;
        color: #fff;
        outline: none !important;
      }

      .swiper-slide {
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;

        video {
          object-fit: contain;
          width: 1000px;
          max-width: 75%;
        }
      }
    }
  }
}

@media screen and (max-width: 940px) {
  .bahman-gallery .gallery {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media screen and (max-width: 640px) {
  .bahman-gallery .tabs {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .bahman-gallery .gallery {
    grid-template-columns: 1fr 1fr;
  }
}