/* アイコンボタン類 */
/* Icon button controls */

.button-icon {
  position: relative;
  display: grid;
  flex: 0 0 48px;
  place-items: center;
  inline-size: 48px;
  block-size: 48px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.2s;

  @media (any-hover: hover) {
    &:hover {
      background-color: var(--bg);
    }
  }

  /* 文字なしボタンの疑似要素アイコン */
  /* Pseudo-element icon for textless buttons */
  &::before,
  &::after {
    position: absolute;
    width: 20px;
    height: 2px;
    border-radius: 20px;
    background: currentColor;
    content: "";
  }
}

.button-menu {
  /* ::before本体とbox-shadowによる三本線 */
  /* Three lines from ::before and box-shadow */
  &::before {
    width: 24px;
    height: 2px;
    border-radius: 20px;
    background: currentColor;
    box-shadow:
      0 -6px 0 currentColor,
      0 6px 0 currentColor;
  }

  &::after {
    /* 三本線では不要な二本目疑似要素 */
    /* Unused second pseudo-element for the three-line icon */
    content: none;
  }
}

.button-close {
  transition:
    background-color 0.2s,
    rotate 0.2s ease;

  @media (any-hover: hover) {
    &:hover {
      rotate: 90deg;
    }
  }

  /* ::beforeと::afterの交差による×印 */
  /* X mark from crossed ::before and ::after */
  &::before {
    rotate: 45deg;
  }

  &::after {
    rotate: -45deg;
  }
}
