@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.bacajuga-wrap {
  width: 100%;
  margin: 36px 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  container-type: inline-size;
}

/* ── Label ─────────────────────────────────────────────── */
.bacajuga-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 8px;
  padding-left: 2px;
}

/* ── Viewport ───────────────────────────────────────────── */
.bacajuga-viewport {
  position: relative;
  overflow: hidden;
  padding: 6px 0 18px;
}

/* ── Track ──────────────────────────────────────────────── */
.bacajuga-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  will-change: transform;
  padding-bottom: 2px;
}
.bacajuga-track::-webkit-scrollbar { display: none; }
.bacajuga-track.is-dragging { cursor: grabbing; scroll-snap-type: none; }

/* ── Skeleton ───────────────────────────────────────────── */
.bj-skeleton {
  flex: 0 0 min(340px, 82vw);
  height: 76px;
  border-radius: 40px;
  background: linear-gradient(90deg, #1a1f00 25%, #252c00 50%, #1a1f00 75%);
  background-size: 200% 100%;
  animation: bj-shimmer 1.4s ease-in-out infinite;
  scroll-snap-align: start;
}
@keyframes bj-shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* ── Card ───────────────────────────────────────────────── */
.bj-card {
  flex: 0 0 min(340px, 82vw);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bj-card-bg, #1a1f00);
  border-radius: 40px;
  padding: 10px 18px 10px 10px;
  min-height: 72px;
  text-decoration: none !important;
  color: inherit;
  scroll-snap-align: start;
  transition: background .18s, transform .15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(229,255,17,.08);
}
.bj-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(229,255,17,.04);
  opacity: 0;
  transition: opacity .18s;
}
.bj-card:hover::before,
.bj-card:focus-visible::before { opacity: 1; }
.bj-card:focus-visible {
  outline: 2px solid rgba(229,255,17,.6);
  outline-offset: 2px;
}
.bj-card:active { transform: scale(.98); }

/* ── Thumbnail ──────────────────────────────────────────── */
.bj-thumb {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 50%;
  overflow: visible;
  background: #252c00;
  position: relative;
  z-index: 1;
}
.bj-thumb img,
.bj-thumb .bj-thumb-inner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  display: block;
  object-fit: cover;
}
.bj-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bj-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

/* ── Content ─────────────────────────────────────────────── */
.bj-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bj-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--bj-title-color, #e5ff11);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-decoration: none !important;
}
.bj-excerpt {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,.45);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  text-decoration: none !important;
}

/* ── Arrow ───────────────────────────────────────────────── */
.bj-arrow {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(229,255,17,.7);
  transition: transform .18s;
}
.bj-card:hover .bj-arrow { transform: translateX(3px); }
.bj-arrow svg { width: 14px; height: 14px; }

/* ── Fade edges (desktop) ────────────────────────────────── */
@container (min-width: 600px) {
  .bacajuga-viewport::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 40px;
    background: linear-gradient(to left, var(--bj-page-bg, #fff) 0%, transparent 100%);
    pointer-events: none;
  }
}

/* ── Desktop: mouse drag only, no snap ──────────────────── */
@container (min-width: 600px) {
  .bacajuga-track {
    scroll-snap-type: none;
    cursor: default;
  }
  .bj-card {
    flex: 0 0 300px;
    transform: rotate(-2deg);
    transition: transform .22s cubic-bezier(0.34,1.4,0.64,1), background .18s;
  }
  .bj-card:hover { transform: rotate(0deg) scale(1.02); }
}


/* ── Mobile stack mode ──────────────────────────────────── */
.bj-mobile-stack .bacajuga-viewport {
  overflow: visible;
}
.bj-mobile-stack .bacajuga-track {
  overflow: visible;
  cursor: default;
}
.bj-mobile-stack .bj-card {
  scroll-snap-align: unset;
  will-change: transform, opacity;
  touch-action: none;
}
/* Counter badge: shows X/total */
.bj-counter {
  text-align: right;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

/* Initial tilt on mobile stack top card */
.bj-mobile-stack .bj-card:first-child {
  transform: rotate(-2deg) !important;
}
/* After JS takes over, tilt is set inline — this just sets the starting feel */

/* ── Dividers ────────────────────────────────────────────── */
.bj-divider {
  height: 1px;
  background: #e5e7eb;
  border: none;
  display: block;
}
/* Top divider (after label) */
.bacajuga-label + .bj-divider {
  margin-bottom: 0;
}
/* Bottom divider (after dots) */
.bj-dots + ul + .bj-divider,
.bj-dots + .bj-divider {
  margin-top: 14px;
}

/* ── Desktop: bullet list ─────────────────────────────────── */
@container (min-width: 600px) {
  /* Hide swipe track entirely */
  .bacajuga-viewport { display: none; }

  /* Show list instead */
  .bacajuga-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 2px 0;
  }
  .bacajuga-list-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 14px;
    line-height: 1.5;
  }
  .bacajuga-list-item .bj-star {
    flex-shrink: 0;
    width: 13px;
    height: 13px;
    color: #d97706;
    position: relative;
    top: 1px;
  }
  .bacajuga-list-item a {
    color: #111;
    text-decoration: none;
    font-weight: 500;
    transition: color .15s;
  }
  .bacajuga-list-item a:hover { color: #374151; text-decoration: underline; }
}

/* Mobile: hide list, show swipe */
@container (max-width: 599px) {
  .bacajuga-list { display: none; }
}

/* ── Dark mode — Foxiz / system ────────────────────────────
   Foxiz adds: body.dark-mode / html[data-theme="dark"] / body.foxiz-dark
   ─────────────────────────────────────────────────────────── */
/* Dark mode — Foxiz: data-theme="dark" on body */
[data-theme="dark"] .bacajuga-list-item a {
  color: rgba(255,255,255,0.88) !important;
}
[data-theme="dark"] .bacajuga-label {
  color: rgba(255,255,255,0.45) !important;
}

/* Light/default — force back to dark text when data-theme="default" */
[data-theme="default"] .bacajuga-list-item a {
  color: #111 !important;
}
[data-theme="default"] .bacajuga-label {
  color: #6b7280 !important;
}
[data-theme="dark"] .bj-divider {
  background: rgba(255,255,255,0.12) !important;
}
[data-theme="default"] .bj-divider {
  background: #e5e7eb !important;
}
/* Also watch via JS MutationObserver for runtime toggle */

/* ── Swipe dot navigation ────────────────────────────────── */
.bj-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  margin-bottom: 4px;
}
.bj-dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: rgba(0,0,0,0.15);
  transition: width .3s cubic-bezier(0.34,1.4,0.64,1), background .3s;
  flex-shrink: 0;
}
.bj-dot-active {
  width: 20px;
  background: var(--bj-title-color, #e5ff11);
  box-shadow: 0 0 6px var(--bj-title-color, #e5ff11);
}
/* Only show dots on mobile */
@container (min-width: 600px) {
  .bj-dots { display: none; }
}
[data-theme="dark"] .bj-dot {
  background: rgba(255,255,255,0.2);
}
