/* ホバーで塗りが広がるボタン（Interactive Hover Button）。CSS だけで動く。
   色は --tb-ihb-bg（地）・--tb-ihb-fg（文字）・--tb-ihb-primary（広がる塗り）・--tb-ihb-on-primary（塗りの上の文字）で変える。
   幅 --tb-ihb-width は「文字の幅×1.7＋40px」以上にすると、左の点と文字が重ならない（4文字なら10rem、5文字なら12rem が目安）。 */
.tb-interactive-hover-button {
  --tb-ihb-bg: #fff;
  --tb-ihb-fg: #171717;
  --tb-ihb-primary: #171717;
  --tb-ihb-on-primary: #fafafa;
  --tb-ihb-line: #e5e5e5;
  --tb-ihb-width: 10rem;
  --tb-ihb-ease: cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: inline-block;
  width: var(--tb-ihb-width);
  min-width: max-content;
  box-sizing: border-box;
  overflow: hidden;
  padding: 8px;
  border: 1px solid var(--tb-ihb-line);
  border-radius: 9999px;
  background: var(--tb-ihb-bg);
  color: var(--tb-ihb-fg);
  font: inherit;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* 最初に見えている文字。ホバーで右へ抜けて消える */
.tb-interactive-hover-button__label {
  display: inline-block;
  transform: translateX(4px);
  transition: all 0.3s var(--tb-ihb-ease);
}
/* ホバーで右から入ってくる文字と矢印 */
.tb-interactive-hover-button__hover {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--tb-ihb-on-primary);
  opacity: 0;
  transform: translateX(48px);
  transition: all 0.3s var(--tb-ihb-ease);
}
.tb-interactive-hover-button__hover svg { width: 24px; height: 24px; flex: none; }
/* 左寄りの小さな点。ホバーで全体を塗りつぶすまで広がる */
.tb-interactive-hover-button__dot {
  position: absolute;
  left: 20%;
  top: 40%;
  width: 8px;
  height: 8px;
  border-radius: 8px;
  background: var(--tb-ihb-primary);
  transform: scale(1);
  transition: all 0.3s var(--tb-ihb-ease);
}
.tb-interactive-hover-button:is(:hover, :focus-visible) .tb-interactive-hover-button__label { transform: translateX(48px); opacity: 0; }
.tb-interactive-hover-button:is(:hover, :focus-visible) .tb-interactive-hover-button__hover { transform: translateX(-4px); opacity: 1; }
.tb-interactive-hover-button:is(:hover, :focus-visible) .tb-interactive-hover-button__dot { left: 0; top: 0; width: 100%; height: 100%; transform: scale(1.8); }
.tb-interactive-hover-button:focus-visible { outline: 2px solid var(--tb-ihb-primary); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .tb-interactive-hover-button__label,
  .tb-interactive-hover-button__hover,
  .tb-interactive-hover-button__dot { transition: none; }
}
