/* Square Grid Container */
.square-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 columns by default */
  gap: 15px; /* Spacing between squares */
  width: 90%;
  max-width: 800px;
  margin: 0 auto;
  padding: 10px;
  margin-top: 30px;
}

/* Square Items */
.square-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  aspect-ratio: 1/1; /* Force square aspect ratio */
}

/* Square Images */
.square-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

/* Square Overlay */
.square-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.square-overlay span {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  padding: 10px;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

/* Hover Effects */
.square-item:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.square-item:hover .square-overlay {
  opacity: 1;
}

.square-item:hover .square-overlay span {
  transform: translateY(0);
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
  .square-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .square-grid {
    grid-template-columns: 1fr; /* 1 column on mobile */
    max-width: 300px; /* Smaller container for mobile */
  }

  .square-overlay span {
    font-size: 1rem; /* Smaller text on mobile */
  }
}














/* Added lately to make the grid responsive with mobile (displaying all the 6 images in one column) */

/* Square Grid Container */
.square-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* 3 columns by default */
  gap: 15px;
  /* Spacing between squares */
  width: 90%;
  max-width: 800px;
  margin: 0 auto;
  padding: 10px;
  margin-top: 30px;
}

/* Square Items */
.square-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  aspect-ratio: 1/1;
  /* Force square aspect ratio */
}

/* Square Images */
.square-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

/* Square Overlay */
.square-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.square-overlay span {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  padding: 10px;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

/* Hover Effects */
.square-item:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.square-item:hover .square-overlay {
  opacity: 1;
}

.square-item:hover .square-overlay span {
  transform: translateY(0);
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
  .square-grid {
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns on tablets */
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .square-grid {
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns on mobile */
    gap: 10px;
  }

  .square-overlay span {
    font-size: 1rem;
    /* Smaller text on mobile */
  }
}