/* Container for the entire gallery */
.rad-logo-gallery-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start; /* 👈 Left-aligns partial rows */
  align-items: center; /* 👈 Vertically centers logos */
  margin: -10px;
  padding: 20px;
}

/* Each logo item */
.rad-logo-gallery-item {
  padding: 10px;
  box-sizing: border-box;
  text-align: center;
  position: relative;
  cursor: move;
}

/* Trash icon button (hidden by default, shown on hover) */
.rad-logo-gallery-item:hover .components-icon-button {
  display: block;
}

.components-icon-button {
  display: none;
  position: absolute;
  top: 5px;
  right: 5px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 50%;
  padding: 2px;
  z-index: 10;
}

.rad-logo-gallery-item img {
  height: auto;
  width: auto;
  max-width: 100%;
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
}

/* Editor preview tweaks */
.wp-block-rad-logo-gallery-block .rad-logo-gallery-preview {
  margin-top: 20px;
}

/* Responsive support */
@media (max-width: 768px) {
  .rad-logo-gallery-item {
    flex: 1 1 50%; /* 2 per row on tablets */
  }
}

@media (max-width: 480px) {
  .rad-logo-gallery-item {
    flex: 1 1 100%; /* 1 per row on phones */
  }
}
