/* Container spacing and background */

/* Gallery grid layout */


html, body {
  height: 100%;
  overflow-x: hidden !important;
  
  margin: 0;
}


.gallery-page .gallery-d-none {
  display: none !important;
}

.gallery-scroll-wrapper {
  
  margin-top: 150px;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: hidden;

}

.gallery-scroll-area {
  flex-grow: 1;
  overflow-x: hidden !important;
  overflow-y: hidden;
  
}
.gallery-scroll-area .categories .cat-button {
  cursor: pointer;
}

.gallery-scroll-area .categories .cat-button:hover {
  background-color: var(--dark);
}

.gallery-scroll-area .categories .cat-button:hover {
  color: white !important;
}

.gallery-scroll-area .categories .active {
  background-color: var(--dark);
  transition: transform 0.3s ease;
}

.gallery-scroll-area .categories .active a{
  color: white !important;
}

/* Gallery Item */
.gallery-item {
  padding 0px !important;
  position: relative;
  margin: 10px;
  
  overflow: hidden;
  transition: transform 0.3s ease;
  animation: fadeIn 0.6s ease-in forwards;
  max-width: 400px;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  min-height: 300px;
  max-height: 300px;
  transition: transform 0.3s ease;
  cursor: pointer;  
}

.loader {
  width: 40px;
  height: 40px;
  border: 4px solid #ccc;
  border-top: 4px solid #333;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Overlay that disappears on hover */
.gallery-overlay {
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
  color: #fff;
  font-size: 1.2rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.gallery-item:hover .gallery-overlay {
  opacity: 0;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Fade-in animation */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.6s ease-in forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Lightbox styling */
.lightbox {
  z-index: 1050;
  background-color: rgba(0, 0, 0, 0.85);
}

/* Lightbox styling */
.lightbox img {
  max-height: 90vh;   /* Max height of the image */
  max-width: 90vw;    /* Max width of the image */
  object-fit: contain; /* Ensure the image fits proportionally */
  border-radius: 5px;
}

.lightbox .close,
.lightbox .nav {
  cursor: pointer;
  user-select: none;
  width: 50px;
  height: 50px;
}

.lightbox.hidden {
  display: none !important;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .gallery-item {
    width: 100%;
    margin:0px;;
    margin-top:5px;
    margin-left: 0px;
    margin-right: 0px;
  }

  .lightbox img {
    max-height: calc(110dvh); /* Adjust for bottom nav if needed */
  }
}

.lightbox-open {
  overflow: hidden;
  
}


.gallery-parent container .container, .roof-gallery .container-fluid {
    padding: 0px;
}



@media screen and (max-width: 768px) {
    
    #gallery {

        margin-bottom: 75px;
    }
}