/* Masonry Grid Container */
.container1 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: 10px; /* Base row height */
  gap: 20px;
  padding: 20px;
}

/* Each Card */
.card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  display: block;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Images */
.card img {
  width: 100%;
  display: block;
  border-radius: 10px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* Hover zoom effect */
.card:hover img {
  transform: scale(1.05);
}
/* ===== IMAGE FULLSCREEN (ZOOM) ===== */
#imgModal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.95);

  display: none;              /* hidden by default */
  justify-content: center;
  align-items: center;
}

#imgModal img {
  max-width: 90%;
  max-height: 90vh;
}

/* FORCE CLOSE ICON TOP RIGHT */
#imgModal .close {
  position: fixed !important;   /* important */
  top: 15px !important;
  right: 20px !important;

  width: 45px;
  height: 45px;

  font-size: 30px;
  font-weight: bold;

  color: #fff;
  background: rgba(0,0,0,0.7);

  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  z-index: 999999 !important;  /* 🔥 ensures always visible */
}

/* hover */
#imgModal .close:hover {
  background: red;
}
/* Overlay text */
.card__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(0deg, rgba(0,0,0,0.8), transparent);
  color: #fff;
  padding: 15px;
  text-align: left;
  transition: all 0.3s ease;
}

.card:hover .card__overlay {
  background: rgba(0,0,0,0.9);
}

.card__overlay h3 {
  margin: 0;
  font-size: 1.2em;
  font-weight: bold;
}

.card__overlay p {
  margin: 5px 0 0;
  font-size: 0.9em;
  line-height: 1.2em;
  color:white;
}

/* Each card spans dynamic rows (JS will adjust) */
.card {
  grid-row-end: span 20;
}

/* Responsive */
@media(max-width: 900px) {
  .container1 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media(max-width: 600px) {
  .container1 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
