section.image-gallery {
  background: var(--color-white);

  .container {
    padding: 4rem 1rem;
  }

  h2 {
    color: var(--color-tcc-blue);
    text-align: center;
    margin-bottom: 2rem;
    width: 100%;
  }

  .image-gallery-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
  }

  .image-item {
    width: calc(50% - 0.6666rem);
    aspect-ratio: 3 / 2;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.5s ease;
    opacity: 1;
    transform: scale(1);
    max-height: 1000px;
    background: var(--color-white);
    box-shadow: 0 0 14px rgba(0, 0, 0, 0.1);
    border-radius: 1rem;

    img {
      transition: all 0.5s ease;
    }
  }

  .image-item:hover {
    transform: scale(1.02);

    img {
      transform: scale(1.05);
    }
  }

  .image-item.hidden-image {
    display: none;
  }

  .gallery-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .button-container {
    text-align: center;
    margin-top: 2rem;
  }

  .view-all-gallery-btn {
    cursor: pointer;
    color: var(--color-tcc-blue);
    padding: 1rem;
    margin: 0 auto;
    text-align: center;
    font-size: var(--text-3xl);
    font-weight: bold;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: none;
    border: none;
  }

  .view-all-gallery-btn .chevron {
    transition: transform 0.3s ease;
    font-size: inherit;
  }

  .view-all-gallery-btn.expanded .chevron {
    transform: rotate(180deg);
  }
}

/* Modal Styles */
.gallery-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallery-modal.active {
  opacity: 1;
  visibility: visible;
}

.gallery-modal .modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
}

.gallery-modal .modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-modal .modal-image {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.gallery-modal.active .modal-image {
  transform: scale(1);
  opacity: 1;
}

.gallery-modal .modal-close,
.gallery-modal .modal-prev,
.gallery-modal .modal-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  cursor: pointer;
  padding: 1rem;
  transition: background 0.3s ease;
  z-index: 10000;
}

.gallery-modal .modal-close:hover,
.gallery-modal .modal-prev:hover,
.gallery-modal .modal-next:hover {
  background: rgba(255, 255, 255, 0.2);
}

.gallery-modal .modal-close {
  top: 1rem;
  right: 1rem;
}

.gallery-modal .modal-close .material-symbols-rounded {
  font-size: 2rem;
  pointer-events: none;
}

.gallery-modal .modal-prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.gallery-modal .modal-next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.gallery-modal .modal-prev .material-symbols-rounded,
.gallery-modal .modal-next .material-symbols-rounded {
  font-size: 3rem;
}

@media (min-width: 1024px) {
  section.image-gallery {
    .container {
      padding: 5rem 2rem;
    }

    .image-item {
      width: calc(33.3333% - 0.6666rem);
    }
  }
}
