/* ============================================================
 Quick Carousel – Vertical Variant Navigator
 Slides in from the right edge of the viewport.
 ============================================================ */

/* ── Custom properties ─────────────────────────────────────── */
:root {
  --qc-width: 88px;
  --qc-bg: rgba(18, 18, 24, 0.96);
  --qc-border: rgba(255, 255, 255, 0.08);
  --qc-accent: var(--main-colour);
  --qc-handle-bg: rgba(18, 18, 24, 0.88);
  --qc-handle-w: 22px;
  --qc-radius: 12px 0 0 12px;
  --qc-transition: 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  /* Above .theme-selector (z-index: 9999) so an open carousel covers it. */
  --qc-z: 10000;
}

/* ── Hidden on pages without record variants ───────────────── */
/* JS adds .qc-unavailable to all three pieces when no div.container[id]
 exist on the page (homepage, lyrics, merch galleries, etc.). */
#qc-handle.qc-unavailable,
#quick-carousel.qc-unavailable,
#qc-overlay.qc-unavailable {
  display: none !important;
}

/* ── Tap-to-close overlay (mobile) ────────────────────────── */
#qc-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: calc(var(--qc-z) - 1);
  pointer-events: none;
}

#qc-overlay.qc-overlay-visible {
  display: block;
  pointer-events: all;
}

/* ── Pull-tab / handle ─────────────────────────────────────── */
#qc-handle {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: var(--qc-handle-w);
  height: 72px;
  background: var(--qc-handle-bg);
  border: 1px solid var(--qc-border);
  border-right: none;
  border-radius: var(--qc-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: calc(var(--qc-z) + 1);
  transition: transform var(--qc-transition), width var(--qc-transition),
    background var(--qc-transition), right var(--qc-transition);
  /* Always visible – acts as the reveal trigger */
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.4);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#qc-handle:hover,
#qc-handle:focus-visible {
  background: var(--qc-accent);
  width: 28px;
  outline: none;
}

/* When panel is open, slide the handle to the left of the panel */
#qc-handle.qc-open {
  right: var(--qc-width);
  background: var(--qc-accent);
}

.qc-handle-icon {
  font-size: 14px;
  color: #fff;
  line-height: 1;
  transition: transform 0.2s ease;
  pointer-events: none;
}

/* ── The panel ─────────────────────────────────────────────── */
#quick-carousel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  /* dynamic viewport height (handles mobile browser chrome) */
  width: var(--qc-width);
  background: var(--qc-bg);
  border-left: 1px solid var(--qc-border);
  border-radius: var(--qc-radius);
  z-index: var(--qc-z);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.55);
  transform: translateX(100%);
  transition: transform var(--qc-transition);
  overflow: hidden;
  /* Hidden initially but kept in the DOM */
  pointer-events: none;
}

#quick-carousel.qc-open {
  transform: translateX(0);
  pointer-events: all;
}

/* ── Header ─────────────────────────────────────────────────── */
.qc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px 8px;
  border-bottom: 1px solid var(--qc-border);
  flex-shrink: 0;
}

.qc-header span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.qc-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.qc-close:hover,
.qc-close:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

/* ── Scrollable list ────────────────────────────────────────── */
.qc-list {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 6px 4px;
  scroll-behavior: smooth;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.qc-list::-webkit-scrollbar {
  width: 4px;
}

.qc-list::-webkit-scrollbar-track {
  background: transparent;
}

.qc-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

/* ── Empty state ────────────────────────────────────────────── */
.qc-empty {
  color: rgba(255, 255, 255, 0.35);
  font-size: 11px;
  text-align: center;
  padding: 24px 8px;
  line-height: 1.5;
  margin: 0;
}

/* ── Individual item (button) ──────────────────────────────── */
.qc-item {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  text-align: center;
}

.qc-item:hover,
.qc-item:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(-3px);
  outline: none;
}

.qc-item:active {
  transform: translateX(-1px) scale(0.97);
  background: var(--main-colour_clear);
  border-color: var(--qc-accent);
}

/* Thumbnail image inside each item */
.qc-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  /* Slight vinyl-disc feel */
  filter: brightness(0.92) saturate(1.1);
  transition: filter 0.15s, transform 0.15s;
}

.qc-item:hover img,
.qc-item:focus-visible img {
  filter: brightness(1.05) saturate(1.2);
  transform: scale(1.05);
}

/* Text fallback when no image */
.qc-item-label {
  display: block;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.5);
  word-break: break-all;
  padding: 4px 0;
  line-height: 1.3;
}

/* ── Reduced-motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

  #quick-carousel,
  #qc-handle,
  .qc-item {
    transition: none;
  }
}

/* ── Touch / mobile tweaks ──────────────────────────────────── */
@media (pointer: coarse) {

  /* Make items a touch larger on touch screens */
  .qc-item {
    padding: 5px;
    margin-bottom: 5px;
  }

  /* Handle is always slightly more prominent on touch */
  #qc-handle {
    width: 24px;
    height: 80px;
  }
}

/* ── Narrow-screen fallback ─────────────────────────────────── */
@media (max-width: 360px) {
  :root {
    --qc-width: 76px;
  }
}