/* gallery page start */

/* hero flourish */
.gallery-hero-section{
  position: relative;
  overflow: hidden;
}
.gallery-hero-section::before{
  content: "";
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(closest-side, rgba(23,73,75,0.10), rgba(23,73,75,0));
  pointer-events: none;
  z-index: 0;
}
.gallery-hero-section .container{
  position: relative;
  z-index: 1;
}

/* category filter tabs */
.gallery-filter-tabs{
  padding: 4px 0;
}
.gallery-filter-tab{
  display: inline-flex;
  align-items: center;
  padding: 7px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--subtitle-text);
  border: 1px solid #e0e0e0;
  background: var(--white-color);
  transition: all 0.25s;
  white-space: nowrap;
}
.gallery-filter-tab:hover{
  border-color: var(--primary-light-color);
  color: var(--primary-color);
}
.gallery-filter-tab.active{
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white-color);
}
@media (max-width: 767px){
  .gallery-filter-tabs{
    flex-wrap: nowrap !important;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .gallery-filter-tabs::-webkit-scrollbar{
    height: 3px;
  }
  .gallery-filter-tabs::-webkit-scrollbar-thumb{
    background: var(--primary-light-color);
    border-radius: 10px;
  }
}

/* masonry grid: CSS columns let every tile keep its image's natural aspect
   ratio, so nothing is ever cropped or padded with dead space */
.gallery-bento{
  column-count: 4;
  column-gap: 20px;
  transition: opacity 0.2s ease;
}
.gallery-bento.is-loading{
  opacity: 0.5;
  pointer-events: none;
}

/* grid-level loader shown while a category switch / page fetch is in flight */
.gallery-grid-wrapper{
  position: relative;
  min-height: 160px;
}
.gallery-loader-overlay{
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border-radius: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}
.gallery-loader-overlay.show{
  opacity: 1;
  visibility: visible;
}
.gallery-spinner{
  height: 44px;
  width: 44px;
  border-radius: 50%;
  border: 3px solid rgba(23,73,75,0.15);
  border-top-color: var(--primary-color);
  animation: gallerySpin 0.7s linear infinite;
}
.gallery-btn-spinner{
  display: inline-block;
  height: 14px;
  width: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  border-radius: 50%;
  border: 2px solid rgba(23,73,75,0.25);
  border-top-color: var(--primary-color);
  animation: gallerySpin 0.7s linear infinite;
}
@keyframes gallerySpin{
  to{ transform: rotate(360deg); }
}

.gallery-load-more-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  border-radius: 100px;
  border: 1px solid var(--primary-color);
  background: transparent;
  color: var(--primary-color);
  transition: all 0.25s;
}
.gallery-load-more-btn:hover{
  background: var(--primary-color);
  color: var(--white-color);
}
.gallery-load-more-btn:disabled{
  opacity: 0.6;
  cursor: default;
}
.gallery-item{
  position: relative;
  display: block;
  width: 100%;
  min-height: 220px;
  padding: 0;
  border: none;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  margin: 0 0 20px;
  break-inside: avoid;
  background: #10201f;
  box-shadow: 0 4px 20px rgba(13,49,50,0.08);
  transition: transform 0.45s cubic-bezier(.2,.8,.2,1), box-shadow 0.45s ease;
}
.gallery-item.is-loaded{
  min-height: 0;
}
.gallery-item:hover{
  transform: translateY(-6px);
  box-shadow: 0 22px 46px rgba(13,49,50,0.20);
  z-index: 2;
}
.gallery-item img{
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: transform 0.6s ease, opacity 0.5s ease;
}
.gallery-item.is-loaded img{
  opacity: 1;
}
.gallery-item:hover img{
  transform: scale(1.08);
}

/* shimmer skeleton shown over each tile until its (often large) image finishes loading */
.gallery-item::after{
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: linear-gradient(100deg, rgba(255,255,255,0) 30%, rgba(255,255,255,0.10) 45%, rgba(255,255,255,0.10) 55%, rgba(255,255,255,0) 70%);
  background-color: #122a29;
  background-size: 200% 100%;
  animation: galleryShimmer 1.4s ease-in-out infinite;
  opacity: 1;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.gallery-item.is-loaded::after{
  opacity: 0;
  animation: none;
}
@keyframes galleryShimmer{
  0%{ background-position: 150% 0; }
  100%{ background-position: -50% 0; }
}
@media (max-width: 767px){
  .gallery-item{
    min-height: 140px;
  }
}
.gallery-item-tag{
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 40px;
  font-size: 12px;
  font-weight: 600;
  color: var(--white-color);
  background: rgba(13,49,50,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.gallery-item-overlay{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 16px;
  background: linear-gradient(180deg, rgba(13,49,50,0.05) 35%, rgba(6,26,27,0.82) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.gallery-item:hover .gallery-item-overlay{
  opacity: 1;
}
.gallery-item-icon{
  height: 56px;
  width: 56px;
  border-radius: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--white-color);
  font-size: 22px;
  transform: translateY(12px) scale(0.85);
  opacity: 0;
  transition: all 0.4s ease 0.05s;
}
.gallery-item:hover .gallery-item-icon{
  transform: translateY(0) scale(1);
  opacity: 1;
}
.gallery-item-play{
  background: var(--primary-color);
  border-color: var(--primary-color);
}
.gallery-item-title{
  color: var(--white-color);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease 0.1s;
}
.gallery-item:hover .gallery-item-title{
  opacity: 1;
  transform: translateY(0);
}

/* lightbox */
body.gallery-lightbox-active .modal-backdrop{
  background: rgba(6,26,27,0.9);
}
body.gallery-lightbox-active .modal-backdrop.show{
  opacity: 1;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.gallery-lightbox-modal .modal-content{
  background: var(--black-color);
  border-radius: 20px;
  overflow: hidden;
  border: none;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.gallery-lightbox-image,
.gallery-lightbox-video{
  max-height: 78vh;
  width: 100%;
  object-fit: contain;
  background: var(--black-color);
}
.gallery-lightbox-title{
  color: var(--white-color);
  padding: 14px 20px;
  text-align: center;
}
.gallery-lightbox-count{
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  color: var(--white-color);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 6px 14px;
  border-radius: 40px;
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.gallery-lightbox-close{
  position: absolute;
  top: 14px;
  right: 14px;
  height: 36px;
  width: 36px;
  border-radius: 100%;
  background-color: rgba(255,255,255,0.15);
  filter: brightness(0) invert(1);
  opacity: 1;
  z-index: 3;
  transition: background-color 0.3s ease;
}
.gallery-lightbox-close:hover{
  background-color: rgba(255,255,255,0.3);
}
.gallery-lightbox-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  height: 46px;
  width: 46px;
  border-radius: 100%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13,49,50,0.55);
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  color: var(--white-color);
  font-size: 18px;
  transition: background 0.3s ease, transform 0.3s ease;
}
.gallery-lightbox-nav:hover{
  background: var(--primary-color);
  transform: translateY(-50%) scale(1.08);
}
.gallery-lightbox-prev{
  left: 14px;
}
.gallery-lightbox-next{
  right: 14px;
}

/* touch devices can't hover, so give every tile an always-visible tap cue
   instead of relying on the hover overlay */
@media (hover: none){
  .gallery-item-overlay{
    opacity: 1;
    background: none;
  }
  .gallery-item-icon{
    position: absolute;
    top: 14px;
    right: 14px;
    height: 34px;
    width: 34px;
    font-size: 15px;
    opacity: 1;
    transform: none;
    background: rgba(6,26,27,0.55);
    border-color: rgba(255,255,255,0.5);
  }
  .gallery-item-title{
    display: none;
  }
}

@media (max-width: 1199px){
  .gallery-bento{
    column-count: 3;
  }
}
@media (max-width: 767px){
  .gallery-bento{
    column-count: 2;
    column-gap: 12px;
  }
  .gallery-item{
    margin: 0 0 12px;
    border-radius: 14px;
  }

  /* full-screen preview so controls can pin to the viewport instead of the
     modal content, which can grow taller than the screen in portrait mode */
  .gallery-lightbox-modal .modal-dialog{
    margin: 0;
    max-width: 100%;
    width: 100%;
    height: 100dvh;
  }
  .gallery-lightbox-modal .modal-content{
    height: 100dvh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .gallery-lightbox-modal .modal-body{
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
  }
  .gallery-lightbox-image,
  .gallery-lightbox-video{
    max-height: 58vh;
  }
  .gallery-lightbox-title{
    padding: 12px 56px;
    font-size: 13px;
  }
  .gallery-lightbox-close{
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
  }
  .gallery-lightbox-count{
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 4;
  }
  .gallery-lightbox-nav{
    position: absolute;
    top: 50%;
    height: 44px;
    width: 44px;
    font-size: 16px;
    z-index: 4;
  }
  .gallery-lightbox-prev{
    left: 8px;
  }
  .gallery-lightbox-next{
    right: 8px;
  }
}
/* gallery page end */
