@use '../global/common' as global;

/* ------------------------------
 @ablogcms/kanban（メニュー管理等のカンバンボード）
 styled-components から移行した基礎スタイル。
------------------------------- */

// EditableLabel（レーン名・カード項目のインライン編集）のプレースホルダー表示
.acms-kanban-editable-label {
  // contentEditable は plaintext-only 属性値を使わずプレーン boolean で描画しているため、
  // Safari 等での書式付き貼り付けを防ぐのに -webkit-user-modify が必要（標準の代替プロパティなし）。
  // stylelint-disable-next-line property-no-deprecated
  -webkit-user-modify: read-write-plaintext-only;
}

.acms-kanban-editable-label--has-placeholder::before {
  color: inherit;
  cursor: text;
  content: attr(data-placeholder);
  opacity: 0.5;
}

.acms-kanban-board {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  height: 100vh;
  padding: 5px;
  overflow-y: hidden;
  color: global.$acms-color-black;
  background-color: global.$acms-color-system-gray10;
}

.acms-kanban-lane {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  height: auto;
  max-height: 90%;
  padding: 10px;
  margin: 5px;

  // ボード背景 (system-gray10) と同色だとレーンの境界が消えて平坦に見えるため、
  // 新規レーン作成フォーム (.acms-kanban-new-lane) と同じ system-gray20 で一段濃くする
  background-color: global.$acms-color-system-gray20;
  border-radius: 3px;
}

.acms-kanban-lane-header {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  padding: 0 5px;
  margin-bottom: 0;
}

.acms-kanban-lane-footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 10px;
  padding: 0;
  appearance: none;
  background: none;
  border: none;
}

.acms-kanban-lane-scroll {
  display: flex;
  flex-direction: column;
  align-self: center;
  justify-content: space-between;
  width: 100%;
  min-width: 250px;
  max-height: 90vh;
  padding-bottom: 20px;
  margin-top: 10px;
  overflow: hidden auto;

  &.acms-kanban-lane-scroll-dragover {
    padding-bottom: 130px;
  }
}

.acms-kanban-lane-title {
  width: 70%;
  font-weight: bold;
  cursor: grab;

  @include global.font-size(15);
}

.acms-kanban-lane-label {
  width: 30%;
  padding-right: 10px;
  text-align: right;

  @include global.font-size(13);
}

.acms-kanban-card {
  position: relative;
  box-sizing: border-box;
  width: auto;
  min-width: 230px;
  padding: 10px;
  margin: 1px 2px 7px;
  cursor: pointer;
  background-color: global.$acms-color-white;
  border: 0;
  border-radius: 2px;
  box-shadow: global.$acms-shadow-elevation-low;

  &:hover {
    color: global.$acms-color-black-dark;
  }
}

.acms-kanban-card-header {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  padding-bottom: 6px;
  color: global.$acms-color-black-dark;
  border-bottom: 1px solid global.$acms-color-gray40;
}

.acms-kanban-card-title {
  width: 70%;
  font-weight: bold;

  @include global.font-size(14);
}

.acms-kanban-card-label {
  width: 30%;
  padding-right: 10px;
  text-align: right;

  @include global.font-size(10);
}

.acms-kanban-card-detail {
  color: global.$acms-color-gray90;
  white-space: normal;

  @include global.font-size(12);
}

.acms-kanban-card-footer {
  display: flex;
  flex-flow: row wrap;
  justify-content: flex-end;
  padding-top: 6px;
  text-align: right;
  border-top: 1px solid global.$acms-color-gray40;
}

.acms-kanban-tag {
  padding: 2px 3px;
  margin: 2px 5px;
  border-radius: 3px;

  @include global.font-size(10);
}

.acms-kanban-add-card-link {
  position: absolute;
  bottom: 3px;
  display: block;
  width: 100%;
  padding: 5px 2px;
  font: inherit;
  color: global.$acms-color-gray90;
  text-align: left;
  text-decoration: none;
  appearance: none;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 0 0 3px 3px;

  &:hover {
    color: global.$acms-color-black;
    text-decoration: underline;
  }
}

.acms-kanban-new-lane-title {
  width: 268px;
  height: auto;

  @include global.font-size(15);
}

.acms-kanban-new-lane {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  height: auto;
  padding: 5px;
  margin: 5px;
  background-color: global.$acms-color-system-gray20;
  border-radius: 3px;
}

.acms-kanban-new-lane-buttons {
  margin-top: 10px;
}

.acms-kanban-delete-wrapper {
  position: absolute;
  top: -1px;
  right: 2px;
  text-align: center;
}

.acms-kanban-delete-button {
  display: inline-block;
  width: 15px;
  height: 15px;
  padding: 0;
  margin: 0 0 8px;
  line-height: 1;
  color: global.$acms-color-gray80;
  appearance: none;
  cursor: pointer;
  background: inherit;
  border: none;
  opacity: 0;

  @include global.font-size(11);

  .acms-kanban-card:hover & {
    opacity: 1;
  }

  &:hover {
    color: global.$acms-color-danger70;
  }
}

.acms-kanban-collapse-btn,
.acms-kanban-expand-btn {
  position: relative;
  width: 36px;
  margin: 0 auto;
  cursor: pointer;

  @include global.font-size(14);
}

.acms-kanban-collapse-btn {
  &::before {
    position: absolute;
    top: 0;
    left: 0;
    content: '';
    border-right: 7px solid transparent;
    border-bottom: 7px solid global.$acms-color-gray90;
    border-left: 7px solid transparent;
    border-radius: 6px;
  }

  &::after {
    position: absolute;
    top: 4px;
    left: 4px;
    content: '';
    border-right: 3px solid transparent;
    border-bottom: 3px solid global.$acms-color-gray20;
    border-left: 3px solid transparent;
  }
}

.acms-kanban-expand-btn {
  &::before {
    position: absolute;
    top: 0;
    left: 0;
    content: '';
    border-top: 7px solid global.$acms-color-gray90;
    border-right: 7px solid transparent;
    border-left: 7px solid transparent;
    border-radius: 6px;
  }

  &::after {
    position: absolute;
    top: 0;
    left: 4px;
    content: '';
    border-top: 3px solid global.$acms-color-gray20;
    border-right: 3px solid transparent;
    border-left: 3px solid transparent;
  }
}
