/*!
 * amicro-cards.css — 搭配 amicro-cards.js
 * 原版是 Tailwind class，這裡改寫成純 CSS，變數可直接覆寫主題。
 */

.amc {
  --amc-card-w: 8rem;
  --amc-card-h: 11rem;
  --amc-radius: 1rem;
  --amc-bg: #a3a3a3;
  --amc-bg-dark: #262626;
  --amc-border: rgba(229, 229, 229, 0.2);
  --amc-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.15), 0 2px 6px -2px rgba(0, 0, 0, 0.1);
  --amc-accent: #3b82f6;

  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ── 舞台 ─────────────────────────────────────────────── */

.amc-stage {
  position: relative;
  width: var(--amc-card-w);
  height: var(--amc-card-h);
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
}

/* 走馬燈：固定寬視窗 + 可平移的軌道 */
.amc-stage--track {
  height: 180px;
  overflow: visible;
  justify-content: flex-start;
}

.amc-track {
  display: flex;
  align-items: center;
  width: max-content;
  will-change: transform;
}

/* ── 卡片 ─────────────────────────────────────────────── */

.amc-card {
  position: absolute;
  inset: 0;
  border-radius: var(--amc-radius);
  border: 1px solid var(--amc-border);
  box-shadow: var(--amc-shadow);
  overflow: hidden;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

/* 走馬燈的卡是排在軌道上的，不是絕對定位 */
.amc-card--slide {
  position: relative;
  inset: auto;
  flex-shrink: 0;
  height: 110px;
  width: 110px;
  margin: 0 auto;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.amc-card--slide .amc-face {
  width: 110px;
  height: 110px;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* CoverFlow：3:4 直式小卡 */
.amc-card--flow {
  position: absolute;
  inset: auto;
  aspect-ratio: 3 / 4;
  height: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Time Machine：橫式相框 */
.amc-card--frame {
  inset: auto;
  width: 220px;
  height: 135px;
  border-radius: var(--amc-radius);
}

/* 郵票邊：虛線框 */
.amc-card--stamp {
  border: 2px dashed rgba(255, 255, 255, 0.6);
}

/* ── 卡面 ─────────────────────────────────────────────── */

.amc-face {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--amc-bg);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 0.875rem/1 system-ui, -apple-system, 'PingFang TC', 'Noto Sans TC', sans-serif;
  color: #525252;
}

.amc-face--image { background-color: transparent; }
.amc-face--mono { background: var(--amc-bg); }

@media (prefers-color-scheme: dark) {
  .amc-face { background: var(--amc-bg-dark); color: #a3a3a3; }
}

.amc[data-theme='dark'] .amc-face { background: var(--amc-bg-dark); color: #a3a3a3; }

/* ── 控制列（走馬燈 / CoverFlow）───────────────────────── */

.amc-controls {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  background: rgba(23, 23, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 20;
}

/* 導覽鈕：視覺維持小尺寸，用 min-width/height 把點擊區撐到 44px（行動裝置標準） */
.amc-nav {
  border: 0;
  background: transparent;
  color: #a3a3a3;
  font-size: 1rem;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.amc-nav:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.amc-dots { display: flex; align-items: center; justify-content: center; gap: 0.25rem; }

/* 圓點：視覺 4px，但用 ::before 把可點範圍撐開到 44px 高、至少 24px 寬 */
.amc-dot {
  position: relative;
  border: 0;
  padding: 0;
  height: 4px;
  width: 4px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: width 0.3s, background-color 0.3s;
}

.amc-dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: max(24px, 100%);
  height: 44px;
}

.amc-dot:hover { background: rgba(255, 255, 255, 0.5); }
.amc-dot.is-active { width: 16px; background: #fff; }

/* 鍵盤操作時的可見焦點（滑鼠點擊不顯示） */
.amc-nav:focus-visible,
.amc-dot:focus-visible,
.amc-tick:focus-visible {
  outline: 2px solid var(--amc-accent, #3b82f6);
  outline-offset: 3px;
}

/* ── 刻度時間軸（Time Machine）─────────────────────────── */

.amc[data-amc-effect^='time-machine'] {
  flex-direction: row;
  gap: 1.5rem;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(9, 9, 11, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.amc[data-amc-effect^='time-machine'] .amc-stage {
  width: 290px;
  height: 100%;
  min-height: 180px;
  flex: 1;
}

.amc-scrubber {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 0.5rem 0.25rem;
  z-index: 50;
}

/* 刻度：時間軸本質是密集排列，無法每格 44px（5 格會變 220px 高）。
   折衷把列高從 5px 拉到 ~13px，並靠 ::before 讓相鄰命中區不留空隙。 */
.amc-tick {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 5rem;
  padding: 5px 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.amc-tick::before {
  content: '';
  position: absolute;
  inset: -1px 0;
}

.amc-tick i {
  display: block;
  height: 3px;
  width: 24px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.5);
  transform-origin: right center;
  transition: transform 0.25s, background-color 0.25s, opacity 0.25s;
}

.amc-tick--sub i { background: rgba(255, 255, 255, 0.2); opacity: 0.3; }
.amc-tick--main:hover i { background: rgba(255, 255, 255, 0.8); transform: scaleX(1.25); }
.amc-tick--main.is-active i { background: var(--amc-accent); transform: scaleX(1.4); }

.amc-tick-label {
  position: absolute;
  right: 2.5rem;
  top: 0;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.9);
  opacity: 0;
  filter: blur(2px);
  transform: scale(0.8);
  transition: opacity 0.15s, filter 0.15s, transform 0.15s;
  pointer-events: none;
}

.amc-tick--main:hover .amc-tick-label { opacity: 1; filter: blur(0); transform: scale(1); }
.amc-tick--main.is-active .amc-tick-label { color: var(--amc-accent); }

/* ── CoverFlow 底板 ───────────────────────────────────── */

.amc[data-amc-effect^='cover-flow'] .amc-stage {
  width: 100%;
  height: 140px;
  background: rgba(9, 9, 11, 0.4);
  border-radius: 1rem;
}

/* ── focusBlur：文字連結聚焦效果 ───────────────────────── */

.amc-fb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.5rem 2.5rem;
  cursor: default;
}

.amc-fb-item {
  position: relative;
  font-weight: 600;
  font-size: 1.25rem;
  text-decoration: none;
  color: inherit;
  outline: none;
  transition: filter 0.3s, opacity 0.3s, color 0.3s;
}

.amc-fb-item.is-focus { color: var(--amc-accent, #3b82f6); }

.amc-fb-bracket {
  position: absolute;
  inset: -4px -8px;
  border: 2px dashed #404040;
  border-radius: 0.5rem;
  pointer-events: none;
  opacity: 0;
  transform: scale(1.3);
  transition: opacity 0.2s, transform 0.2s;
}

.amc-fb-item.is-focus .amc-fb-bracket { opacity: 1; transform: scale(1.1); }

/* ── 無障礙：使用者要求減少動態時，直接定位不做彈跳 ──────── */

@media (prefers-reduced-motion: reduce) {
  .amc-card, .amc-track { transition: none !important; }
}
