.hub-gallery {
  margin: 1.5rem 0;
  color: hsl(var(--foreground, 222 47% 11%));
}

.hub-gallery__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.hub-gallery__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: hsl(var(--foreground, 222 47% 11%));
}

.hub-gallery__count {
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground, 215 16% 47%));
}

.hub-gallery__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.hub-gallery__empty {
  border: 1px dashed hsl(var(--border, 214 32% 91%));
  background: hsl(var(--muted, 210 40% 96%));
  color: hsl(var(--muted-foreground, 215 16% 47%));
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  font-size: 0.9rem;
}

.hub-gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.hub-gallery__item {
  border: 1px solid hsl(var(--border, 214 32% 91%));
  border-radius: 0.75rem;
  overflow: hidden;
  background: hsl(var(--card, 0 0% 100%));
  display: flex;
  flex-direction: column;
}

.hub-gallery__media {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  text-align: inherit;
  background: hsl(var(--muted, 210 40% 96%));
  cursor: pointer;
}

.hub-gallery__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.hub-gallery__item:hover .hub-gallery__image {
  transform: scale(1.04);
}

.hub-gallery__overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  transition: background 0.2s ease;
}

.hub-gallery__item:hover .hub-gallery__overlay {
  background: hsla(0, 0%, 0%, 0.12);
}

.hub-gallery--editor .hub-gallery__item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.6rem 0.75rem 0.75rem;
}

.hub-gallery--editor .hub-gallery__item-actions .components-button {
  font-size: 0.75rem;
}

@media (min-width: 768px) {
  .hub-gallery__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .hub-gallery__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.dark .hub-gallery__title {
  color: hsl(var(--foreground, 210 40% 98%));
}

.dark .hub-gallery__item {
  border-color: hsl(var(--border, 217 32% 18%));
  background: hsl(var(--card, 222 47% 11%));
}

.dark .hub-gallery__media {
  background: hsl(var(--muted, 217 32% 17%));
}

.dark .hub-gallery__empty {
  border-color: hsl(var(--border, 217 32% 18%));
  background: hsl(var(--muted, 217 32% 17%));
  color: hsl(var(--muted-foreground, 215 20% 65%));
}
