/**
 * Shared edge-bleed rail chrome (progress + prev/next + heading View all).
 * Pair with public/modules/nw-edge-rail.js and view/index/public/nw-edge-rail-bar.html.
 * Track / viewport sizing stays on the host module sheet (e.g. nw-catalog.css).
 *
 * Markup hooks:
 *   [data-nw-edge-rail]           root section
 *   [data-nw-edge-rail-viewport]  overflow clip
 *   [data-nw-edge-rail-track]     flex track
 *   [data-nw-edge-rail-bar]       footer row
 *   [data-nw-edge-rail-progress]  thin track
 *   [data-nw-edge-rail-progress-fill]
 *   [data-nw-edge-rail-prev|next]
 *   .nw-edge-rail__viewall        heading CTA (optional)
 */

.nw-edge-rail__bar {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 28px;
}

.nw-edge-rail__progress {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 2px;
  border-radius: 999px;
  background: #eef1f7;
  overflow: hidden;
}

.nw-edge-rail__progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  min-width: 0;
  border-radius: inherit;
  background: color-mix(in srgb, var(--main-color) 72%, #9aa8d8);
  transition: width 0.45s var(--nw-surface-ease, var(--ease-lift, cubic-bezier(0.2, 0.7, 0.2, 1)));
}

@supports not (background: color-mix(in srgb, red, blue)) {
  .nw-edge-rail__progress-fill {
    background: var(--main-color);
  }
}

.nw-edge-rail__nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nw-edge-rail__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--nw-border);
  background: linear-gradient(135deg, #ffffff, #f8f7ff);
  color: #6e7788;
  box-shadow: var(--shadow-soft, 0 4px 12px #0f1b3510);
  cursor: pointer;
  transition:
    background 0.25s var(--nw-surface-ease, ease),
    color 0.25s var(--nw-surface-ease, ease),
    border-color 0.25s var(--nw-surface-ease, ease),
    box-shadow 0.25s var(--nw-surface-ease, ease),
    opacity 0.2s ease;
  /* no transform — Mai: hover 不位移 */
  transform: none;
}

.nw-edge-rail__btn i {
  font-size: 22px;
  line-height: 1;
}

/* Remix chevrons sit optically left in the circle — nudge next/right glyphs */
.nw-edge-rail__btn[data-nw-edge-rail-next] i,
.nw-edge-rail__btn[data-nw-switch-next] i,
.nw-edge-rail__btn[data-process-next] i {
  transform: translateX(1px);
}

/* Hover is PC only (touch screens have none). Keyboard focus styles stay on every screen. */
@media (min-width: 1280px) and (hover: hover) {
  .nw-edge-rail__btn:hover:not(:disabled) {
    background: var(--nw-gradient-brand, var(--gradient-action));
    background-size: 150% 100%;
    background-position: 100% 50%;
    border-color: transparent;
    color: #fff;
    box-shadow: var(--nw-shadow-brand-hover, 0 6px 14px #615ced33);
    transform: none;
  }
}
.nw-edge-rail__btn:focus-visible:not(:disabled) {
  background: var(--nw-gradient-brand, var(--gradient-action));
  background-size: 150% 100%;
  background-position: 100% 50%;
  border-color: transparent;
  color: #fff;
  box-shadow: var(--nw-shadow-brand-hover, 0 6px 14px #615ced33);
  transform: none;
}

.nw-edge-rail__btn:disabled,
.nw-edge-rail__btn[aria-disabled="true"] {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
  pointer-events: none;
}

/* Heading CTA — compact site button, sits title-row right */
.nw-edge-rail__viewall.button,
a.nw-edge-rail__viewall.button {
  min-height: 44px;
  gap: 14px;
  padding: 0 18px;
  font-size: var(--text-caption);
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 6px; /* optical lift vs multi-line lead */
}

.nw-edge-rail__viewall.button i {
  font-size: 16px;
  line-height: 1;
}

@media (max-width: 800px) {
  .nw-edge-rail__bar {
    gap: 18px;
    margin-top: 22px;
  }

  .nw-edge-rail__btn {
    width: 36px;
    height: 36px;
  }

  .nw-edge-rail__btn i {
    font-size: 18px;
  }

  .nw-section-head .nw-edge-rail__viewall.button,
  .section-heading .nw-edge-rail__viewall.button {
    margin-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nw-edge-rail__progress-fill {
    transition: none;
  }
}

/* Autoplay pause/play — only shown when root has autoplay */
.nw-edge-rail__autoplay[hidden] {
  display: none !important;
}

.nw-edge-rail:not(.nw-edge-rail--autoplay) .nw-edge-rail__autoplay {
  display: none !important;
}

.nw-edge-rail__autoplay.is-paused {
  color: var(--main-color);
  border-color: #c9d4f5;
}

/* Play triangle optical center — remix play glyph sits left in the em box */
.nw-edge-rail__autoplay.is-paused i,
.nw-edge-rail__autoplay .ri-play-mini-fill {
  transform: translateX(2px);
}

