/* =========================================================
   PLANTS EDITOR 上部メニューのツールチップ（見た目だけを扱う）
   - title 属性の標準ツールチップ（マウスカーソルの右下に出る）の代わりに、
     aria-label の文字をボタンの真下・中央に表示する。
   - ドロップダウン付きのボタン（aria-haspopup="true"）には表示しない。
   - 表組ツールバーを開いている間の表アイコンにも表示しない（ツールバーと重なるため）。
   - body の zoom: 0.8 で縮小して表示される前提の値。
   ========================================================= */

/* ツールチップの位置の基準にする */
.command-icon-button {
  position: relative;
}

.command-icon-button::after {
  content: attr(aria-label);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  z-index: 1020;
  padding: 4px 10px;
  border-radius: 4px;
  background: #000;
  color: #fff;
  font-family: Meiryo, "メイリオ", "Yu Gothic UI", sans-serif;
  font-size: 16px;
  font-weight: normal;
  line-height: 1.4;
  white-space: nowrap;
  transform: translateX(-50%);
  visibility: hidden;
  /* ツールチップの上をクリックしても、ボタンが押されないようにする */
  pointer-events: none;
}

/* ホバーしてから少し遅れて表示する（離れたときはすぐ消える） */
.command-icon-button:hover::after,
.command-icon-button:focus-visible::after {
  visibility: visible;
  transition: visibility 0s linear 0.4s;
}

/* ドロップダウン付きのボタン、開いている表組ツールバーの表アイコンには出さない */
.command-icon-button[aria-haspopup="true"]::after,
.command-icon-button[aria-expanded="true"]::after {
  content: none;
}
