/**
 * css/gallery-rail.css — 横方向ギャラリーの共通基盤
 * 計画: .kilo/plans/20261105-horizontal-gallery-ux-unification-plan.md §3・§5-1
 *
 * スクロールバー非表示・scroll-snap・フォーカス・共通コントロールだけを持つ。
 * 列幅・額縁・行数・余白はページ固有 CSS（creation-wix-media.css / character-modal.css）で上書きする。
 * 読み込み順: ページ固有 CSS より先（inc/enqueue.php priority 40）。
 */

/* レール本体（<ul> を想定） */
.tokikai-gallery-rail {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tokikai-gallery-rail::-webkit-scrollbar {
  display: none;
}

.tokikai-gallery-rail:focus-visible {
  outline: 2px solid var(--color-main, #5f568e);
  outline-offset: 3px;
  border-radius: 6px;
}

.tokikai-gallery-rail > li {
  scroll-snap-align: start;
}

/* ギャラリー見出しの右端に置く「前へ / 現在位置 / 次へ」。
   ピル型の囲みは作らず、サイト既存の白地・1px藤色系ボーダー・8px角丸に合わせる。 */
.tokikai-gallery-controls {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.tokikai-gallery-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0 0 2px;
  border: 1px solid var(--color-border, #dce6ee);
  border-radius: 8px;
  background: #ffffff;
  color: var(--color-main, #5f568e);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

/* 見た目は36px、タップ領域は44px以上（左右に4pxずつ広げる） */
.tokikai-gallery-btn::after {
  content: "";
  position: absolute;
  inset: -4px;
}

.tokikai-gallery-btn:hover:not(:disabled) {
  border-color: var(--color-fuji, #bbb7da);
  background: var(--color-bg-fuji, #f6f3fb);
}

.tokikai-gallery-btn:focus-visible {
  outline: 2px solid var(--color-main, #5f568e);
  outline-offset: 2px;
}

.tokikai-gallery-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* 数字だけのカウンタ。囲まず、既存のテキスト色・太さに合わせる。 */
.tokikai-gallery-counter {
  min-width: 68px;
  padding: 0 3px;
  color: var(--color-fuji-deep, #5f568e);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .tokikai-gallery-rail {
    scroll-behavior: smooth;
  }
}
