/* Tech Kita V2.9 — Optimized Stacked Card Carousel */

.articles {
  margin-bottom: 32px;
}

.stacked-carousel {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: hidden;
}

.stacked-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  cursor: grab;
  will-change: transform, opacity;
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
              opacity 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  user-select: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.stacked-card:active {
  cursor: grabbing;
}

/* Card States */
.stacked-card.active {
  z-index: 5;
  transform: translateX(0) scale(1);
  opacity: 1;
}

.stacked-card.behind-1 {
  z-index: 4;
  transform: translateX(8px) scale(0.95);
  opacity: 0.85;
}

.stacked-card.behind-2 {
  z-index: 3;
  transform: translateX(16px) scale(0.9);
  opacity: 0.7;
}

.stacked-card.behind-3 {
  z-index: 2;
  transform: translateX(24px) scale(0.85);
  opacity: 0.5;
}

/* Swipe Out */
.stacked-card.swipe-out {
  transform: translateX(-120%) scale(0.9);
  opacity: 0;
  pointer-events: none;
}

/* Card Content */
.card-bg {
  position: absolute;
  inset: 0;
}

.card-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
  transition: transform 0.6s ease;
}

.stacked-card.active .card-bg img {
  transform: scale(1.02);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, 
    rgba(5, 5, 8, 0.1) 0%, 
    rgba(5, 5, 8, 0.4) 40%, 
    rgba(5, 5, 8, 0.85) 100%);
}

.card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px;
  z-index: 2;
}

.card-cat {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(0, 93, 250, 0.2);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #01a0fb;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.card-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* Card Counter */
.card-counter {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  z-index: 10;
}

/* Swipe Hint */
.swipe-hint {
  text-align: center;
  margin-top: 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  animation: swipeHint 2s ease-in-out infinite;
}

@keyframes swipeHint {
  0%, 100% { opacity: 0.3; transform: translateX(0); }
  50% { opacity: 0.6; transform: translateX(-5px); }
}

/* Mobile */
@media (max-width: 768px) {
  .stacked-carousel {
    height: 350px;
    margin: 0 -16px;
    padding: 0 16px;
  }
  
  .card-title {
    font-size: 20px;
  }
  
  .card-content {
    padding: 20px;
  }
}

/* === CAROUSEL ARROWS === */
.carousel-wrap {
  position: relative;
}
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(10,10,14,0.75);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, opacity 0.2s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 0;
}
.carousel-arrow:hover:not(:disabled) {
  background: rgba(30,30,40,0.9);
  border-color: rgba(255,255,255,0.3);
}
.carousel-arrow:active:not(:disabled) {
  background: rgba(0,93,250,0.6);
  transform: translateY(-50%) scale(0.92);
}
.carousel-arrow:disabled {
  opacity: 0.3;
  pointer-events: none;
}
.carousel-arrow--prev {
  left: 8px;
}
.carousel-arrow--next {
  right: 8px;
}

/* Responsive: larger on mobile for thumb touch */
@media (max-width: 768px) {
  .carousel-arrow {
    width: 44px;
    height: 44px;
    font-size: 26px;
  }
}

@media (min-width: 769px) {
  .swipe-hint { display: none; }
}
