/**
 * PresetImageSelector スタイル
 */

.zenblocks-preset-image-selector {
  margin-bottom: 16px;
}

.zenblocks-preset-image-selector__content {
  margin-top: 12px;
}

.zenblocks-preset-image-selector__categories {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}

.zenblocks-preset-image-selector__category-btn {
  font-size: 11px !important;
  padding: 2px 8px !important;
  min-height: 24px !important;
}

.zenblocks-preset-image-selector__grid {
  display: grid !important;
  grid-auto-rows: auto;
  gap: 6px !important;
  max-height: 280px;
  overflow-y: auto;
  padding: 2px;
}

.zenblocks-preset-image-selector__item-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.zenblocks-preset-image-selector__image-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
}

/* スクロールバーのスタイル */
.zenblocks-preset-image-selector__grid::-webkit-scrollbar {
  width: 6px;
}

.zenblocks-preset-image-selector__grid::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 3px;
}

.zenblocks-preset-image-selector__grid::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 3px;
}

.zenblocks-preset-image-selector__grid::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}

.zenblocks-preset-image-selector__item {
  position: relative;
  width: 100%;
  height: 100%;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  margin: 0;
  background: #f0f0f0;
  transition: border-color 0.15s ease;
}

.zenblocks-preset-image-selector__item:hover {
  border-color: #007cba;
}

.zenblocks-preset-image-selector__item img {
  position: absolute;
  top: 0;
  left: 0;
}

.zenblocks-preset-image-selector__item.is-selected {
  border-color: #007cba;
  box-shadow: 0 0 0 1px #007cba;
}

.zenblocks-preset-image-selector__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.zenblocks-preset-image-selector__check {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  background: #007cba;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.zenblocks-preset-image-selector__check svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.zenblocks-preset-image-selector__item-actions {
  display: flex;
  width: 100%;
  min-height: 17px;
  border: 1px solid #d6d6d6;
  border-top: 0;
  background: #fff;
}

.zenblocks-preset-image-selector__action-icon {
  flex: 1 1 0;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 0;
  color: #1d2327;
  background: #fff;
  text-decoration: none;
  line-height: 1;
}

.zenblocks-preset-image-selector__action-icon:not(:first-child) {
  border-left: 1px solid #e2e2e2;
}

.zenblocks-preset-image-selector__action-icon svg {
  width: 12px;
  height: 12px;
}

.zenblocks-preset-image-selector__action-icon:hover {
  background: #f7f7f7;
}

.zenblocks-preset-image-selector__action-icon:focus,
.zenblocks-preset-image-selector__action-icon:focus-visible {
  z-index: 3;
}

.zenblocks-preset-image-selector__license {
  margin: 8px 0 0;
  padding: 8px;
  font-size: 10px;
  line-height: 1.5;
  color: #757575;
  background: #f9f9f9;
  border-radius: 4px;
}

.zenblocks-preset-image-selector__license a {
  color: #007cba;
  text-decoration: none;
}

.zenblocks-preset-image-selector__license a:hover {
  text-decoration: underline;
}

.zenblocks-preset-image-selector__actions {
  margin-top: 8px;
}

.zenblocks-preset-image-selector__clear-btn {
  font-size: 11px !important;
}

/* 区切り線 */
.zenblocks-preset-image-selector + .zenblocks-inspector-background-image__button-container {
  padding-top: 12px;
  border-top: 1px solid #e0e0e0;
  margin-top: 4px;
}
