/* ============================================================
   UIショーケース「器」コンポーネント (2026-07-10)
   docs/UI_SHOWCASE_DESIGN_2026-07-09.md 準拠

   build.mjs が IMGスロット(slot="ui-*")を ratio のアスペクト値から自動判定し、
   ページ側のマークアップ変更なしで以下のいずれかにラップする:
     - 横長 (aspect >= 0.9 : 16/9, 4/3 等) → 器A .ui-shot-window-frame（ブラウザ窓）
     - 縦長 (aspect <  0.9 : 9/16, 9/19.5 等) → 器B .ui-phone-frame（iPhoneベゼル）
   器C（番号ピン注釈）は主役画面のみページ側で個別マークアップする（.ui-annotated / .ui-pin）。
   トークン変数のみ使用（hex直書き禁止）。
   ============================================================ */

/* ---------------------------------------------------------------
   器A: ブラウザ窓（PC画面用）
   --------------------------------------------------------------- */
.ui-shot-window-frame {
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}
.ui-shot-window-chrome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: var(--cream-dim);
  border-bottom: 1px solid var(--line-soft);
}
.ui-shot-window-chrome .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.ui-shot-window-chrome .dot:nth-child(1) { background: var(--line); }
.ui-shot-window-chrome .dot:nth-child(2) { background: var(--butter); }
.ui-shot-window-chrome .dot:nth-child(3) { background: var(--sage); }
.ui-shot-window-title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--ink-2);
  margin-left: 0.35rem;
  white-space: nowrap;
}
.ui-shot-window-url {
  margin-left: auto;
  padding-left: 0.75rem;
  font-size: var(--text-xs);
  color: var(--ink-3);
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 3D傾き（トップ主役ヒーロー専用の将来拡張用。ページ側で is-tilt を付与） */
.ui-shot-window-frame.is-tilt {
  transform: perspective(1400px) rotateX(3deg) rotateY(-5deg);
}

/* ---------------------------------------------------------------
   器B: iPhoneベゼル（スマホ画面用）
   --------------------------------------------------------------- */
.ui-phone-frame {
  position: relative;
  isolation: isolate;
  max-width: 280px;
  margin-inline: auto;
  padding: 14px;
  background: var(--dark);
  border-radius: 44px;
  box-shadow: var(--shadow-float);
}
.ui-phone-frame::before {
  content: "";
  position: absolute;
  inset: -30px;
  z-index: -1;
  border-radius: 60px;
  background: radial-gradient(circle at 50% 32%, var(--blue) 0%, transparent 68%);
  opacity: 0.32;
  pointer-events: none;
}
.ui-phone-frame.stage-dark::before {
  background: radial-gradient(circle at 50% 32%, var(--dark-2) 0%, transparent 68%);
  opacity: 0.55;
}
.ui-phone-frame .img-slot {
  border-radius: 30px;
}
.ui-phone-notch {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 26%;
  max-width: 70px;
  height: 12px;
  background: var(--dark);
  border-radius: 8px;
  z-index: 3;
}
.ui-phone-btn {
  position: absolute;
  background: var(--dark-2);
  z-index: 0;
}
.ui-phone-btn-power { right: -3px; top: 30%; width: 3px; height: 52px; border-radius: 0 2px 2px 0; }
.ui-phone-btn-vol1 { left: -3px; top: 22%; width: 3px; height: 34px; border-radius: 2px 0 0 2px; }
.ui-phone-btn-vol2 { left: -3px; top: 30.5%; width: 3px; height: 34px; border-radius: 2px 0 0 2px; }

@media (min-width: 640px) {
  .ui-phone-frame { max-width: 300px; }
}

/* 扇状レイアウト（顧客アプリ/スタッフアプリ 複数台構成） */
.ui-phone-fan {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-block: 1rem 0.5rem;
}
/* flexアイテムはmax-widthだけでは基準幅が決まらず潰れるため、flex-basis/widthを明示指定する */
.ui-phone-fan .ui-phone-frame { flex: 0 0 auto; width: 42vw; max-width: 190px; }
@media (min-width: 640px) {
  .ui-phone-fan { gap: 0; flex-wrap: nowrap; }
  .ui-phone-fan .ui-phone-frame { width: 220px; max-width: 220px; }
  .ui-phone-fan .ui-phone-frame:nth-child(1) { transform: rotate(-7deg) translate(10px, 18px); z-index: 1; margin-right: -2.25rem; }
  .ui-phone-fan .ui-phone-frame:nth-child(2) { z-index: 2; }
  .ui-phone-fan .ui-phone-frame:nth-child(3) { transform: rotate(7deg) translate(-10px, 18px); z-index: 1; margin-left: -2.25rem; }
}

/* ---------------------------------------------------------------
   器C: 番号ピン注釈ステージ（主役画面のみ・最大5箇所）
   --------------------------------------------------------------- */
.ui-annotated { position: relative; }
.ui-pin {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--terra);
  color: var(--cream-2);
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(47, 58, 61, 0.35), 0 0 0 3px rgba(253, 254, 254, 0.85);
  transform: translate(-50%, -50%);
  z-index: 4;
}
.ui-pin-legend {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.ui-pin-legend li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: 1.65;
}
.ui-pin-legend .ui-pin-num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--terra);
  color: var(--cream-2);
  font-weight: 700;
  font-size: 0.72rem;
  margin-top: 0.15rem;
}

/* ---------------------------------------------------------------
   ストーリーツアー (/reji/ 「サロレジのある一日」)
   --------------------------------------------------------------- */
.ui-story {
  display: grid;
  gap: clamp(2.75rem, 2rem + 3vw, 4.5rem);
}
.ui-story-scene {
  display: grid;
  gap: 1.1rem;
  max-width: 480px;
  margin-inline: auto;
}
.ui-story-scene[data-wide] { max-width: 840px; }
.ui-story-time {
  font-family: var(--font-num);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--terra);
  letter-spacing: 0.05em;
}
.ui-story-line {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--ink);
  line-height: 1.5;
  margin: 0;
}

/* ---------------------------------------------------------------
   スクショレール（機能ページ・横スクロール帯）
   --------------------------------------------------------------- */
.ui-rail {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding: 0.5rem 0.15rem 1.25rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.ui-rail::-webkit-scrollbar { height: 8px; }
.ui-rail::-webkit-scrollbar-track { background: transparent; }
.ui-rail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.ui-rail-item {
  flex: 0 0 clamp(230px, 58vw, 340px);
  scroll-snap-align: start;
}
.ui-rail-caption {
  margin-top: 0.65rem;
  font-size: var(--text-xs);
  color: var(--ink-3);
  line-height: 1.6;
}
