/* Reset & basic styles */
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
}

.controls {
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

/* Commented out other effects */
/*
.effect2 .gallery-card img:hover {
  filter: grayscale(100%);
}

.effect3 .gallery-card img:hover {
  transform: rotate(5deg);
}
*/

.pagination {
  width: 100%;
  max-width: 1200px;   /* same as gallery width */
  margin-top: 25px;
  display: flex;
  justify-content: center;  /* center the buttons as a group */
  gap: 15px;                /* space between Prev and Next */
  align-items: center;
}
/* Hide cards by default (JS will show the right ones) */
.gallery-card {
  display: none;
  width: 100%;
  padding: 0px;      /* creates visible breathing room */
  box-sizing: border-box;
}


/* Responsive breakpoints */
@media (max-width: 900px) {
  .gallery-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .gallery-container {
    grid-template-columns: repeat(1, 1fr);
  }
}

/******************************************************************************/
/* GALLERY */
/******************************************************************************/
.gallery-wrapper {
  width: 80%;
  display: flex;
  flex-direction: column;
  align-items: center; /* centers the gallery block */
}

.gallery-container {
  width: 100%;
  max-width: 1000px;   /* SAME width for gallery & pagination */
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  justify-items: center; /* centers images inside grid cells */
}

/* Image base styles */
.gallery-card img {
  width: 90%;
  aspect-ratio: 16 / 9;   /* or 4 / 3 */
  object-fit: contain;
  height: auto;
  transition: transform 0.4s ease, filter 0.4s ease;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  margin: 0 auto;
  height: auto;
}

/* Image size classes — adjust max-width manually */
.gallery-container.small .gallery-card img {
  max-width: 200px;
  margin: 0 auto;
  display: block;
}

.gallery-container.medium .gallery-card img {
  max-width: 250px;
  margin: 0 auto;
  display: block;
}

.gallery-container.large .gallery-card img {
  max-width: 300px;
  margin: 0 auto;
  display: block;
}

/* Hover zoom effect */
.effect1 .gallery-card img:hover {
  transform: scale(1.25);
}

.gallery-title {
  display: block;
  width: 100%;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.gallery-container img {
  width: 100%; /* Fill the grid cell */
  aspect-ratio: 7 / 6;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

/* Lightbox *************************************************/
.lightbox {
    display: none;
    position: fixed;
    z-index: 999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
}

.lightbox-content {
    display: block;
    margin: auto;
    max-width: 80%;
    max-height: 80%;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

@media (max-width: 900px) {
    .gallery-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px) {
    .gallery-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }

    .gallery-container img {
        aspect-ratio: 1 / 1;
    }
}

/* Apply zoom only on larger screens */
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .gallery-container img:hover {
    transform: scale(2.5);
    z-index: 2;
    position: relative;
  }
}

/*added*/
@media (max-width: 1024px) {
  .gallery-container {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .gallery-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .gallery-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/******************************************************************************/
/* HOME PAGE GALLERY*/
/******************************************************************************/
.home-gallery-section {
  display: flex;
  justify-content: center;
  padding: 40px 20px;
  background-color: #f9f9f9;
}

.home-gallery-container {
  max-width: 1000px;
  width: 100%;
}

.home-gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
}

.home-gallery-item {
  flex: 1 1 30%;
  max-width: 300px;
  text-align: center;
}

.home-gallery-item img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px; /* space between image and title */
}

/* New: Title above description */
.home-image-title {
  font-weight: 400;
  font-size: 1.5rem;
  color: #132153;
  margin-bottom: 4px;
  padding: 0 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  text-align: center;
}

.home-image-description {
  margin-top: 10px;
  font-size: 1.125rem;
  color: #414960;
  line-height: 1.4;
  padding: 0 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  text-align: center;
}

/* Mobile responsiveness */
@media (max-width: 900px) {
  .home-gallery-item {
    flex: 1 1 45%;
  }
}

@media (max-width: 600px) {
  .home-gallery-item {
    flex: 1 1 100%;
  }
  .home-image-title {
    font-size: 1rem;
    padding: 0 5px;
  }
  .home-image-description {
    font-size: 0.95rem;
    padding: 0 5px;
  }
}

/* Optional: limit to 3 lines on small screens with line clamping */
@media (max-width: 500px) {
  .home-image-description {
    display: -webkit-box;
    display: box; /* Standard fallback */
    -webkit-box-orient: vertical;
    box-orient: vertical; /* Standard fallback */
    -webkit-line-clamp: 3;
    line-clamp: 3; /* Standard syntax */
    overflow: hidden;
    text-overflow: ellipsis;
  }
}