/* ============================================
   Jekan Slider — Frontend CSS
   ============================================ */

/* Slider container — full viewport width */
.jekan-slider {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
  z-index: 1;
}

/* Track — CSS Grid forces ALL children into the SAME cell.
   This guarantees overlap; slides CANNOT appear below each other. */
.jekan-slider-track {
  display: grid !important;
  grid-template-areas: "s" !important;
  overflow: hidden !important;
  width: 100% !important;
}

/* Every direct child occupies the single grid cell "s" */
.jekan-slider-track > * {
  grid-area: s !important;
  min-width: 0 !important;
}

/* Sizer image — invisible, in-flow, sets the grid cell height naturally */
.jekan-slider-sizer {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  visibility: hidden !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
  z-index: 0 !important;
}

/* Slides — all overlap in the same grid cell, hidden via opacity */
.jekan-slide {
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  transition: opacity 0.6s ease-in-out;
}

/* Active slide — visible, on top */
.jekan-slide.active {
  opacity: 1;
  z-index: 3;
  pointer-events: auto;
}

/* Fading-out: old slide stays briefly visible behind new during crossfade */
.jekan-slide.fading-out {
  z-index: 2;
  pointer-events: none;
  /* opacity transitions from 1→0 via the base rule */
}

/* Slide transition: slide mode */
.jekan-slider[data-transition="slide"] .jekan-slide {
  opacity: 1;
  transform: translateX(100%);
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0s;
}

.jekan-slider[data-transition="slide"] .jekan-slide:not(.active):not(.slide-out-left) {
  opacity: 0;
}

.jekan-slider[data-transition="slide"] .jekan-slide.active {
  transform: translateX(0);
  pointer-events: auto;
}

.jekan-slider[data-transition="slide"] .jekan-slide.slide-out-left {
  transform: translateX(-100%);
  pointer-events: none;
}

/* Image — fills slide, no crop, centered */
.jekan-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  user-select: none;
  -webkit-user-drag: none;
}

/* Clickable slides */
.jekan-slide[data-link] {
  cursor: pointer;
}

/* Caption overlay */
.jekan-slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 30px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  z-index: 3;
}

.jekan-slide-caption span {
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ---- Arrows ---- */
.jekan-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.45);
  border: none;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 0;
  line-height: 1;
}

.jekan-arrow:hover {
  background: rgba(49, 151, 210, 0.85);
  transform: translateY(-50%) scale(1.1);
}

.jekan-arrow-prev {
  left: 16px;
}

.jekan-arrow-next {
  right: 16px;
}

.jekan-arrow svg {
  display: block;
}

/* ---- Dots ---- */
.jekan-dots {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.jekan-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all 0.4s ease;
  padding: 0;
  outline: none;
}

.jekan-dot:hover {
  background: rgba(255, 255, 255, 0.7);
}

.jekan-dot.active {
  width: 36px;
  height: 10px;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6), 0 0 3px rgba(255, 255, 255, 0.9);
}

/* ---- Touch swipe indicator ---- */
.jekan-slider.grabbing {
  cursor: grabbing;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .jekan-arrow {
    width: 36px;
    height: 36px;
  }

  .jekan-arrow-prev {
    left: 6px;
  }
  .jekan-arrow-next {
    right: 6px;
  }

  .jekan-arrow svg {
    width: 18px;
    height: 18px;
  }

  .jekan-dots {
    bottom: 8px;
    gap: 6px;
  }

  .jekan-dot {
    width: 8px;
    height: 8px;
  }

  .jekan-dot.active {
    width: 28px;
    height: 8px;
  }

  .jekan-slide-caption span {
    font-size: 14px;
  }
}
