.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* більші картки */
  gap: 1rem;
  padding: 1rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.gallery-item img {
  width: 100%;
  height: auto;
  cursor: pointer;
  transition: transform 0.3s ease;
  display: block;
  border-radius: 8px;
}

.gallery-item img:hover {
  transform: scale(1.05);
}

.caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 1rem;
  background: rgba(90, 62, 43, 0.8);
  color: #fffaf4;
  font-size: 0.9rem;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  text-align: center;
}

/* Модальне вікно */
#modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.8);
  align-items: center;
  justify-content: center;
}

#modal img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(255,255,255,0.3);
  cursor: pointer;
}


/* Позиціонування та базовий вигляд кнопки у прев’ю */
.gallery-item {
  position: relative;
}

.gallery-delete-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: rgba(255, 255, 255, 0.9);
  color: #c0392b;
  font-size: 1.2rem;
  padding: 6px;
  border-radius: 50%;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background-color 0.2s ease, transform 0.1s ease;
  z-index: 2;
}

/* Ефект ховера */
.gallery-delete-icon:hover {
  background-color: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
}

/* Активний стан */
.gallery-delete-icon:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
