/* ========================================
   HORIZONTAL SCROLL LOCK SECTION
   ======================================== */

.scroll-lock-section {
  position: relative;
  width: 100%;
  /* height is set dynamically by JavaScript */
  background: transparent;
  margin-top: -100px;
  padding-top: 100px;
}

.scroll-lock-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 200px;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, #000 100%);
  z-index: 1;
  pointer-events: none;
}

.scroll-lock-container {
  position: sticky;
  top: 80px;
  width: 100%;
  height: calc(100vh - 80px);
  overflow: hidden;
  background: #000;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.history-header {
  padding: 70px 80px 30px;
  flex-shrink: 0;
}

.history-overline {
  font-family: 'PPSupplyMono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 4px;
}

.history-heading {
  font-family: 'PPSupplyMono', monospace;
  font-size: 48px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
  text-transform: lowercase;
}

.scroll-lock-track {
  display: flex;
  gap: 24px;
  padding: 0 80px 80px;
  align-items: center;
  will-change: transform;
}

.scroll-lock-item {
  flex: 0 0 calc((100vw - 160px - 72px) / 4); /* 4 items visible, accounting for padding and gaps (3 gaps × 24px) */
  height: auto;
  max-height: 70vh;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: all 0.3s ease;
}

/* Stagger items: each one 20px lower than the previous */
.scroll-lock-item:nth-child(4n+1) {
  margin-top: 0;
}

.scroll-lock-item:nth-child(4n+2) {
  margin-top: 20px;
}

.scroll-lock-item:nth-child(4n+3) {
  margin-top: 40px;
}

.scroll-lock-item:nth-child(4n+4) {
  margin-top: 60px;
}

.scroll-lock-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-10px);
}

.scroll-item-image {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

.scroll-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scroll-item-title {
  font-family: 'PPSupplyMono', monospace;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  line-height: 1.3;
}

.scroll-item-body {
  font-family: 'PPSupplyMono', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #999;
  overflow-y: auto;
  max-height: 200px;
}

.scroll-item-body p {
  margin: 0 0 12px 0;
}

.scroll-item-body p:last-child {
  margin-bottom: 0;
}

.scroll-item-body ul,
.scroll-item-body ol {
  list-style-position: inside;
  margin: 0 0 12px 0;
  padding: 0;
}

.scroll-item-body li {
  margin-bottom: 6px;
}

/* Custom scrollbar for body content */
.scroll-item-body::-webkit-scrollbar {
  width: 4px;
}

.scroll-item-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.scroll-item-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.scroll-item-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Mobile responsive */
@media (max-width: 1024px) {
  .scroll-lock-container {
    top: 60px;
    height: calc(100vh - 60px);
  }

  .history-header {
    padding: 50px 40px 30px;
  }

  .history-heading {
    font-size: 36px;
  }

  .scroll-lock-item {
    flex: 0 0 calc((100vw - 80px - 48px) / 3); /* 3 items visible on tablet */
    height: auto;
    max-height: 60vh;
  }

  .scroll-lock-track {
    padding: 0 40px 60px;
    gap: 24px;
  }

  /* Stagger for tablet: 3 items visible */
  .scroll-lock-item:nth-child(3n+1) {
    margin-top: 0;
  }

  .scroll-lock-item:nth-child(3n+2) {
    margin-top: 20px;
  }

  .scroll-lock-item:nth-child(3n+3) {
    margin-top: 40px;
  }

  /* Reset desktop stagger */
  .scroll-lock-item:nth-child(4n+4) {
    margin-top: 40px;
  }
}

@media (max-width: 768px) {
  .scroll-lock-container {
    top: 40px;
    height: calc(100vh - 40px);
  }

  .history-header {
    padding: 40px 30px 30px;
  }

  .history-heading {
    font-size: 28px;
  }

  .scroll-lock-item {
    flex: 0 0 calc(100vw - 80px); /* 1 item visible on mobile - narrower to align with title */
    height: auto;
    max-height: 70vh;
    padding: 20px;
    margin-top: 0 !important;
  }

  .scroll-lock-track {
    padding: 0 30px 40px;
    gap: 24px;
  }

  .scroll-item-title {
    font-size: 16px;
  }

  .scroll-item-body {
    font-size: 12px;
  }
}

/* Loading state */
.scroll-lock-section.loading {
  opacity: 0.5;
  pointer-events: none;
}
