@media (max-width: 1000px) {
    .portfolio-columns {
        --column-count: 2;
    }
}

@media (max-width: 550px) {
    .portfolio-columns {
        --column-count: 1;
    }
}

.portfolio-columns {
    --column-count: 3; /* Default */
    display: flex;
    gap: 15px;
}

.column {
    display: grid;
    flex-grow: 1;
    min-width: 0;
    flex-basis: calc(100% / var(--column-count) - 15px);
}


/* Portfolio section styles */
.portfolio-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    background-color: #000000;
    box-sizing: border-box;
    position: relative;
    padding: 20px; 
    margin-bottom: 0px;
}

.portfolio-columns {
    flex-wrap: wrap;
    width: 100%;
    justify-content: space-between;
}

.image-container {
    width: 100%;
    display: flex;
    overflow: hidden;
    position: relative;
    margin-bottom: 15px;
    break-inside: avoid;
}

.image-container img {
    width: 100%;
    height: auto; /* Maintain aspect ratio */
    object-fit: cover;
    transition: transform ease-in-out 0.3s;
}

.image-container img:hover {
    transform: scale(1.1);
    object-fit: cover;
}

@keyframes nextImageAnimation {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-150%);
    }
}

@keyframes prevImageAnimation {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(150%);
    }
}

.section-image {
    position: relative;
    text-align: center;
    margin-bottom: 20px; /* Adjust the margin as needed */
}

.section-image img {
    max-width: 100%; /* Ensure the image doesn't exceed its container */
    height: auto; /* Maintain aspect ratio */
}

.thumbnail {
    cursor: pointer;
    position: relative;
    z-index: 1; /* Ensure it's above other elements */
}

/* Lightbox Core Styles */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  touch-action: none;
}

.lightbox.active {
  display: block;
  opacity: 1;
}

.lightbox__overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
}

.lightbox__container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__track {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.lightbox__slide {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.lightbox__image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  user-select: none;
  touch-action: none;
  transition: transform 0.3s ease;
}

.lightbox__close {
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: 4rem;
  height: 4rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 2.4rem;
  cursor: pointer;
  z-index: 10001;
  transition: all 0.3s ease;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 4rem;
  height: 4rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 10001;
  transition: all 0.3s ease;
}

.lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.lightbox__nav--prev {
  left: 2rem;
}

.lightbox__nav--next {
  right: 2rem;
}

@media (max-width: 768px) {
  .lightbox__nav {
    width: 3rem;
    height: 3rem;
    font-size: 1.5rem;
  }
  
  .lightbox__close {
    top: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    font-size: 2rem;
  }
}

.lightbox__image-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Enhanced lightbox transitions */
.lightbox__track {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.lightbox__slide {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
}

.lightbox__image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Loading spinner */
.lightbox__loader {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -20px 0 0 -20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Better touch handling */
.lightbox__track {
  touch-action: pan-y pinch-zoom;
}

.lightbox__image {
  touch-action: manipulation;
}