/* ==========================================================================
   トップへ戻るボタン（全ページ共通・右下追従）
   右下に固定電話バー（[data-js="fixed-contact"]）がある間は、その高さ分だけ
   上へ逃がす。高さは js/back-to-top.js が --back-to-top-offset に設定する。
   ========================================================================== */
.back-to-top {
  --back-to-top-gap: 20px;

  position: fixed;
  right: var(--back-to-top-gap);
  bottom: calc(var(--back-to-top-offset, 0px) + var(--back-to-top-gap));
  /* 固定電話バーと同じ階層。モバイルメニュー（z-index: 1000）より下に置く */
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2em;
  box-sizing: border-box;
  min-width: 3.75rem;
  min-height: 3.75rem;
  padding: 0.5em;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #007f85;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-decoration: none;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease,
    background-color 0.2s ease;
}

.back-to-top:hover {
  background: #005f63;
}

.back-to-top__icon {
  width: 0.7em;
  height: 0.7em;
  margin-top: 0.35em;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
}

/* ページ先頭付近では非表示（visibility も切り替えてフォーカス対象から外す） */
.back-to-top.is-hidden {
  opacity: 0;
  visibility: hidden;
}

@media screen and (max-width: 1023px) {
  .back-to-top {
    --back-to-top-gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: none;
  }
}
