/* ===========================================================
   Tispa つなぎカルーセル  (2026-05 展示会対応 / リニューアル前)
   名前空間: tcr-  ※既存Bootstrap等と衝突しないよう独立
   依存: なし（Vanilla / レスポンシブ）
   =========================================================== */

.tcr-root {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  background: #fff;
  -webkit-user-select: none;
  user-select: none;
}

.tcr-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.tcr-track {
  display: flex;
  width: 100%;
  transition: transform .6s cubic-bezier(.4, .0, .2, 1);
  will-change: transform;
}

.tcr-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
}

.tcr-slide img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

/* --- 左右矢印 --- */
.tcr-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, .35);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
  transition: background .2s ease, opacity .2s ease;
  opacity: .85;
}

.tcr-arrow:hover,
.tcr-arrow:focus {
  background: rgba(0, 0, 0, .6);
  opacity: 1;
  outline: none;
}

.tcr-arrow:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .6);
}

.tcr-arrow svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.tcr-prev { left: 12px; }
.tcr-next { right: 12px; }

/* --- 丸ポチインジケーター (バナー下部に配置) ---
   見た目は小さく(8px)、タップ領域は24x24px確保するため
   button自体を24x24透明にし、::beforeで内側に丸を描画する */
.tcr-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  margin: 8px 0 0;
  list-style: none;
  line-height: 1;
}

.tcr-dots li {
  display: flex;
  margin: 0;
  padding: 0;
  line-height: 0;
}

.tcr-dot {
  display: block;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.tcr-dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border: 2px solid #5cb8e6;
  border-radius: 50%;
  background: transparent;
  transform: translate(-50%, -50%);
  transition: background .2s ease, transform .2s ease;
}

.tcr-dot:hover::before,
.tcr-dot:focus::before {
  background: rgba(92, 184, 230, .5);
}

.tcr-dot:focus { outline: none; }

.tcr-dot.is-active::before {
  background: #5cb8e6;
  transform: translate(-50%, -50%) scale(1.2);
}

/* --- スクリーンリーダー向け --- */
.tcr-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- 広い画面では矢印をバナーの外側に逃がす --- */
@media (min-width: 1080px) {
  .tcr-prev { left: -56px; }
  .tcr-next { right: -56px; }
  .tcr-arrow {
    background: rgba(0, 0, 0, .45);
  }
}

/* --- スマホ: 矢印を画像下のドットと同じ行に並べる --- */
@media (max-width: 600px) {
  .tcr-root {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }
  .tcr-viewport {
    order: 1;
    flex: 0 0 100%;
  }
  .tcr-arrow {
    position: static;
    transform: none;
    width: 22px;
    height: 22px;
    margin: 8px 8px 0;
    background: #5cb8e6;
    color: #fff;
    opacity: 1;
  }
  .tcr-arrow svg {
    width: 18px;
    height: 18px;
  }
  .tcr-arrow:hover,
  .tcr-arrow:focus {
    background: #4aa6d4;
    opacity: 1;
  }
  .tcr-prev { order: 2; }
  .tcr-dots { order: 3; margin: 8px 0 0; }
  .tcr-next { order: 4; }
}

/* --- 小型画面ではさらに矢印を一段小さく --- */
@media (max-width: 480px) {
  .tcr-arrow {
    width: 20px;
    height: 20px;
  }
  .tcr-arrow svg {
    width: 16px;
    height: 16px;
  }
}

/* --- アクセシビリティ: 動きを減らす設定 --- */
@media (prefers-reduced-motion: reduce) {
  .tcr-track {
    transition: none;
  }
}
