/* ===== scroll-section.css ===== */
/* Layout + variables */
:root {
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --spill: 220px; /* how much image spills outside the right edge */
}

.scroll-section {
  position: relative;
  display: flex;
  padding: 4rem 2rem;
  background: #fff;
}

/* container keeps overflow visible so images can spill */
.scroll-container {
  display: flex;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  overflow: visible;
}

/* Sidebar (desktop) */
.scroll-sidebar {
  flex: 0 0 280px;
  position: sticky;
  top: 120px;
  align-self: flex-start;
  padding: 1rem 0;
}

.sidebar-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.sidebar-items {
  display: flex;
  flex-direction: column;
}

.sidebar-item {
  border-bottom: 1px solid #e5e7eb;
  opacity: 0.6;
  padding: 0.75rem 0;
  transition: color 0.28s var(--ease-smooth), opacity 0.28s var(--ease-smooth), padding 0.28s var(--ease-smooth);
}
.sidebar-item:last-child { border-bottom: none; }

.sidebar-item h3 {
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0;
}

.sidebar-item p {
  font-size: 0.9rem;
  color: #6b7280;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  transition: opacity 0.35s var(--ease-smooth), max-height 0.35s var(--ease-smooth), margin-top 0.28s var(--ease-smooth);
}

.sidebar-item.active {
  opacity: 1;
  color: #111827;
  padding: 1.25rem 0;
}
.sidebar-item.active p {
  opacity: 1;
  max-height: 8em;
  margin-top: 0.45rem;
}

/* Content column */
.scroll-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6rem;
  overflow: visible; /* let images overflow to right */
}

/* Each part */
.scroll-part {
  position: relative;
  overflow: visible;
}

/* Images - default "dimmed + shifted to right" state,
   they will be animated by JS using transform & opacity. */
.scroll-part img {
  display: block;
  width: calc(100% + var(--spill));
  max-width: none;
  margin-right: calc(-1 * var(--spill));
  height: auto;
  border-radius: 1rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  will-change: transform, opacity;
  /* don't set transitions here — we drive with RAF for smoothness */
  opacity: 0.2; 
  transform: translate3d(80px,0,0) scale(0.96);
  backface-visibility: hidden;
}

/* Mobile: hide sidebar, show text below each image */
@media (max-width: 767px) {
  .scroll-container { flex-direction: column; }
  .scroll-sidebar { display: none; }
  .scroll-text { display: block; margin-top: 1rem; }
  .scroll-text h3 { font-size: 1.15rem; font-weight: 600; margin: 0 0 .25rem 0; color: #111827; }
  .scroll-text p { color: #374151; font-size: 0.95rem; line-height: 1.45; margin: 0; }
  /* On mobile we keep images full width (no spill) */
  .scroll-part img {
    width: 100%;
    margin-right: 0;
    transform: none;
    opacity: 1;
  }
  .sidebar-item p { display: none; } /* sidebar hidden anyway */
}

/* small accessibility helper: remove outline from images but keep focusable styles if needed */
.scroll-part img:focus {
  outline: 3px solid rgba(59,130,246,0.25);
  outline-offset: 3px;
}
