/* ===== gallery.css ===== */
/* Simple, responsive flex gallery: 3/2/1 columns */

/* Root variables */
:root {
  --gallery-gap: 20px;     /* space between items */
  --overlay-bg: rgba(0,0,0,0.45);
  --overlay-bg-hover: rgba(0,0,0,0.6);
  --overlay-text: #fff;
  --radius: 20px;
  --shadow: 0 6px 18px rgba(0,0,0,0.08);
}

/* Gallery grid layout */
.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gallery-gap);    /* space between items */
  justify-content: space-between;
}

/* Gallery item styling */
.gallery-grid .gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #f6f6f6;
  flex: 1 1 calc(33.333% - var(--gallery-gap)); /* 3 items per row */
  max-width: calc(33.333% - var(--gallery-gap));
  margin-bottom: var(--gallery-gap); /* ensures bottom gap */
  margin-right:   var(--gallery-gap); ;
}

/* Make the image fill and crop nicely */
.gallery-grid .gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  aspect-ratio: 4 / 3;       /* maintains a neat tile shape */
  object-fit: cover;
  transition: transform 0.35s ease;
}

/* Clickable area (keeps the existing structure) */
.gallery-grid .gallery-item .gallery-image {
  display: block;
  position: relative;
}

/* Overlay content (icon + title) */
.gallery-grid .gallery-item .content {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  background: var(--overlay-bg);
  color: var(--overlay-text);
  opacity: 0;
  transition: opacity 0.25s ease, background 0.25s ease;
  padding: 10px;
}

.gallery-grid .gallery-item .content i {
  font-size: 20px;
  line-height: 1;
}

.gallery-grid .gallery-item .content h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

/* Hover effects */
.gallery-grid .gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-grid .gallery-item:hover .content {
  opacity: 1;
  background: var(--overlay-bg-hover);
}

/* Tablet: 2 items per row */
@media (max-width: 991px) {
  .gallery-grid .gallery-item {
    flex: 1 1 calc(50% - var(--gallery-gap)); /* 2 items per row */
    max-width: calc(50% - var(--gallery-gap));
  }
}

/* Mobile: 1 item per row */
@media (max-width: 599px) {
  .gallery-grid .gallery-item {
    flex: 1 1 100%; /* 1 item per row */
    max-width: 100%;
    margin-right:   0; ;
  }
}
