/* עיצוב כרטיסיות גלריה בלבד */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 2rem;
  box-sizing: border-box;
}

/* במסכים גדולים - 4 עמודות */
@media (min-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 1400px;
  }
  .gallery-card {
    max-width: none;
  }
  .gallery-card img {
    aspect-ratio: 4/3;
    height: auto;
  }
}

/* במסכים בינוניים - 3 עמודות */
@media (min-width: 900px) and (max-width: 1199px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
  }
  .gallery-card {
    max-width: none;
  }
  .gallery-card img {
    aspect-ratio: 4/3;
    height: auto;
  }
}

.gallery-card {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0,0,0,0.10);
  transition: box-shadow 0.3s;
  cursor: pointer;
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  display: block;
}

.gallery-card:hover {
  box-shadow: 0 12px 35px rgba(0,0,0,0.15);
  transform: translateY(-5px);
}

.gallery-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 18px;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-card:hover img {
  transform: scale(1.05);
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0 1rem;
    margin-top: 1rem;
  }
  .gallery-card {
    border-radius: 16px;
    max-width: none;
    width: 100%;
  }
  .gallery-card img {
    border-radius: 16px;
    aspect-ratio: 1/1;
    height: 140px;
    object-fit: cover;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    padding: 0 0.8rem;
  }
  .gallery-card {
    border-radius: 14px;
    min-height: 120px;
  }
  .gallery-card img {
    border-radius: 14px;
    height: 120px;
  }
}

@media (max-width: 375px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    padding: 0 1rem;
  }
  .gallery-card {
    border-radius: 16px;
    min-height: 160px;
  }
  .gallery-card img {
    border-radius: 16px;
    height: 200px;
  }
}

/* עיצוב מודאל תמונה בגלריה */
.gallery-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s;
}
.gallery-modal[style*="display: flex"] {
  display: flex !important;
}
.gallery-modal img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  background: #fff;
}
.gallery-modal-close {
  position: absolute;
  top: 2vw;
  right: 2vw;
  font-size: 2.5rem;
  color: #fff;
  background: rgba(0,0,0,0.3);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
  transition: background 0.2s;
}
.gallery-modal-close:hover {
  background: rgba(0,0,0,0.6);
}
@media (max-width: 600px) {
  .gallery-modal img {
    max-width: 98vw;
    max-height: 60vh;
    border-radius: 12px;
  }
  .gallery-modal-close {
    top: 4vw;
    right: 4vw;
    font-size: 2rem;
    width: 38px;
    height: 38px;
  }
}
