/**
 * ImageSelector スタイル
 */

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

.zenblocks-image-selector__panel {
  margin-bottom: 12px;
}

.zenblocks-image-selector__tabs {
  margin-bottom: 10px;
}

.zenblocks-image-selector__tab-description {
  margin: 0 2px 10px;
  font-size: 11px;
  line-height: 1.5;
  color: #5a5a5a;
}

.zenblocks-image-selector__tab-description a {
  color: #2271b1;
  text-decoration: none;
}

.zenblocks-image-selector__tab-description a:hover {
  text-decoration: underline;
}

.zenblocks-image-selector__tab-button.components-button {
  min-height: 44px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
}

.zenblocks-image-selector__tab-button-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.zenblocks-image-selector__tab-button-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: currentColor;
}

.zenblocks-image-selector__tab-button .dashicon {
  width: 16px;
  height: 16px;
  font-size: 16px;
  color: currentColor;
}

.zenblocks-image-selector__tab-button.components-button.is-active,
.zenblocks-image-selector__tab-button.components-button.is-active .zenblocks-image-selector__tab-button-icon,
.zenblocks-image-selector__tab-button.components-button.is-active .dashicon {
  color: #fff;
}

.zenblocks-image-selector__panel-inner {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.zenblocks-image-selector__media-picker-button {
  font-size: 12px !important;
  padding: 6px 10px !important;
  min-height: 40px !important;
  width: 100%;
  justify-content: center;
}

.zenblocks-image-selector__media-picker-button.components-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.zenblocks-image-selector__url-input {
  margin-bottom: 0;
}

.zenblocks-image-selector__buttons {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.zenblocks-image-selector__buttons .components-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: top;
}

.zenblocks-image-selector__buttons .components-button .dashicon {
  margin: 0;
}

.zenblocks-image-selector__url-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.zenblocks-image-selector__url-row .components-base-control {
  margin-bottom: 0;
  flex: 1;
}

.zenblocks-image-selector__url-row .components-base-control__field {
  margin-bottom: 0;
}

.zenblocks-image-selector__url-row .components-text-control__input {
  font-size: 12px;
  min-height: 40px;
  height: 40px;
  box-sizing: border-box;
}

.zenblocks-image-selector__url-actions {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  flex: 0 0 auto;
}

.zenblocks-image-selector__url-actions .components-button {
  font-size: 12px !important;
  min-height: 40px !important;
  height: 40px !important;
}

.zenblocks-image-selector__url-actions .components-button.components-button {
  padding: 0 !important;
  width: 40px;
  min-width: 40px;
  margin: 0 !important;
}

.zenblocks-image-selector__url-apply-button .dashicon {
  margin: 0;
}

@media (max-width: 480px) {
  .zenblocks-image-selector__url-row {
    flex-direction: column;
    align-items: stretch;
  }

  .zenblocks-image-selector__url-actions {
    justify-content: flex-end;
  }
}

.zenblocks-image-selector__preview {
  margin-top: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  max-height: 150px;
}

.zenblocks-image-selector__preview img {
  width: 100%;
  height: auto;
  max-height: 150px;
  object-fit: cover;
  display: block;
}

.zenblocks-image-selector__remove-link-wrap {
  margin-top: 8px;
  text-align: right;
}

.zenblocks-image-selector__remove-link {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: #b32d2e;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.zenblocks-openverse-image-selector {
  margin-bottom: 12px;
}

.zenblocks-openverse-image-selector__toggle {
  width: 100%;
  justify-content: center;
  margin-bottom: 8px;
}

.zenblocks-openverse-image-selector__notice {
  margin: 0 2px 2px;
  font-size: 11px;
  line-height: 1.4;
  color: #5a5a5a;
}

.zenblocks-openverse-image-selector__content {
  margin-top: 10px;
  padding: 8px 0 0;
  border: 0;
  background: transparent;
}

.zenblocks-openverse-image-selector__provider-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.zenblocks-openverse-image-selector__provider-btn {
  font-size: 11px !important;
  min-height: 26px !important;
}

.zenblocks-openverse-image-selector__setup {
  margin: 8px 0 10px;
  padding: 10px;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  background: #fff;
}

.zenblocks-openverse-image-selector__setup-text {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #3c434a;
}

.zenblocks-openverse-image-selector__search {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.zenblocks-openverse-image-selector__search .components-base-control {
  flex: 1;
  margin-bottom: 0;
}

.zenblocks-openverse-image-selector__search .components-base-control__field {
  margin-bottom: 0;
}

.zenblocks-openverse-image-selector__search .components-text-control__input {
  height: 40px;
  min-height: 40px;
  margin: 0;
  box-sizing: border-box;
}

.zenblocks-openverse-image-selector__search-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px !important;
  margin: 0 !important;
  align-self: center;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.zenblocks-openverse-image-selector__search-button .dashicon {
  margin: 0;
}

.zenblocks-openverse-image-selector__categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  padding-right: 2px;
}

.zenblocks-openverse-image-selector__category-btn {
  font-size: 11px !important;
  min-height: 26px !important;
  padding: 0 10px !important;
}

.zenblocks-openverse-image-selector__loading {
  display: flex;
  justify-content: center;
  padding: 12px 0;
}

.zenblocks-openverse-image-selector__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 2px;
}

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

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

.zenblocks-openverse-image-selector__image-button {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 2px solid transparent;
  appearance: none;
  -webkit-appearance: none;
  background: #f0f0f0;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  line-height: 0;
  transition: border-color 0.15s ease;
}

.zenblocks-openverse-image-selector__image-button:hover {
  border-color: #007cba;
}

.zenblocks-openverse-image-selector__image-button:disabled {
  cursor: wait;
}

.zenblocks-openverse-image-selector__image-button img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.zenblocks-openverse-image-selector__importing {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 2px;
}

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

.zenblocks-openverse-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-openverse-image-selector__action-icon:not(:first-child) {
  border-left: 1px solid #e2e2e2;
}

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

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

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

.zenblocks-openverse-image-selector__attribution {
  margin: 4px 0 0;
  font-size: 10px;
  line-height: 1.3;
  color: #5a5a5a;
}

.zenblocks-openverse-image-selector__attribution a {
  color: #2271b1;
  text-decoration: none;
}

.zenblocks-openverse-image-selector__attribution a:hover {
  text-decoration: underline;
}

.zenblocks-openverse-image-selector__actions {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.zenblocks-media-type-tabs {
  display: flex;
  gap: 2px;
  background: #fff;
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
}

.zenblocks-media-type-tabs__button.components-button {
  flex: 1;
  min-width: 36px;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 12px !important;
  justify-content: center;
  font-size: 13px !important;
  font-weight: 500 !important;
  border: none !important;
  border-color: transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #757575 !important;
  box-shadow: none !important;
  transition: all 0.15s ease;
}

.zenblocks-media-type-tabs__button.components-button:first-child {
  border-radius: 4px 0 0 4px !important;
}

.zenblocks-media-type-tabs__button.components-button:last-child {
  border-radius: 0 4px 4px 0 !important;
}

.zenblocks-media-type-tabs__button.components-button:hover:not(:disabled):not(.is-active) {
  background: #f0f0f0 !important;
  color: #1e1e1e !important;
}

.zenblocks-media-type-tabs__button.components-button.is-active {
  background: #1e1e1e !important;
  color: #fff !important;
  box-shadow: none !important;
}
