@use 'global/common' as global;

// ------------------------------
// 変数
// ------------------------------
@import 'global/variables-fonts';

// ------------------------------
// focused image
// ------------------------------
.js-focused-image:not(.js-lazy-load) {
  visibility: hidden;
}

#acms-preview-area {
  position: fixed;
  inset: 0;
  z-index: global.zIndex(preview-area);
}

.js-media-unit {
  position: relative;
  z-index: 1;
  min-height: 300px;

  &.done {
    min-height: 0;
  }
}

.js-drop-area {
  .acms-media-img-file {
    width: 64px;
    height: auto;
  }
}

.flatpickr-calendar.open {
  z-index: global.zIndex(flatpickr) !important;
}

.js-acms-expand-btn {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 20;
  width: 32px;
  height: 32px;
  font-size: 16px;
  text-align: center;
  border: 1px solid rgb(0 0 0 / 10%);
  border-radius: 3px;
  box-shadow: rgb(0 0 0 / 20%) 0 3px 6px;
}

.js-acms-expand-btn .acms-icon {
  padding-right: 0;
}

.js-acms-expand {
  position: relative;
  box-sizing: border-box;
  padding: 0;
  background: global.$acms-color-white;
}

.js-acms-expand-inner {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding-top: 60px;
  overflow: hidden auto;
}

.js-acms-expanded {
  height: 100%;
}

.js-acms-expanded .js-acms-expand-btn {
  position: fixed;
}

.js-acms-expanding,
.js-acms-expanded {
  z-index: global.zIndex(js-ui-expand);
}

.smartblock-tooltip {
  z-index: global.zIndex(js-ui-expand) !important;
}

.js-acms-expanding,
.js-acms-expanded {
  .js-acms-expand-btn {
    top: 10px;
    right: 10px;
  }

  .js-acms-expand-inner {
    padding-top: 80px;
  }

  .js-acms-expand {
    padding: 10px;
  }
}

.js-acms-expanding .js-smartblock-edit {
  max-width: 780px;
  margin: 0 auto;
}

.ProseMirror figure.empty-node .caption {
  position: relative;
}

.ProseMirror figure.empty-node .caption::before {
  height: 0;
  color: global.$acms-color-gray70;
  pointer-events: none;
  content: 'キャプションを入力してください';
}

.lite-editor-tooltip-wrap {
  z-index: global.zIndex(lite-editor-bg) !important;
}

.acms-dragging {
  z-index: global.zIndex(acms-dragging) !important;
}

#emoji-picker .search-emojis {
  position: relative;
  display: block;
  width: 100%;
  height: 85%;
  min-height: 23px;
  margin-top: 1px;
  font-size: 13px;
  color: global.$acms-color-system-gray80;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
}

// ------------------------------
// Lazy Load
// ------------------------------

.js-lazy-load {
  opacity: 0;
  transition:
    opacity 0.8s cubic-bezier(0.5, 0, 0, 1) 0.1s,
    transform 0.9s cubic-bezier(0.5, 0, 0, 1) 0.1s;
  transform: translateY(30px);

  &.loading {
    opacity: 1;
    transform: translateY(0);
  }

  @media print {
    opacity: 1;
    transform: translateY(0);
  }
}

img.js-lazy-load {
  background: global.$acms-lazy-load-bg url('/themes/system/images/marker/icon-lazy-load-image.svg') no-repeat center /
    40px 40px;

  &.loaded {
    background: none;
  }
}

.js-lazy-load.is-movie {
  background: global.$acms-lazy-load-bg url('/themes/system/images/marker/icon-lazy-load-movie.svg') no-repeat center /
    40px 40px;
}
