/* Section index navigation + page-style transitions */

.section-index {
  position: fixed;
  left: clamp(0.75rem, 2vw, 1.5rem);
  top: 50%;
  z-index: 880;
  transform: translateY(-50%);
  pointer-events: none;
  direction: ltr;
}

.section-index__track {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0.35rem 0;
}

.section-index__indicator {
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: var(--section-index-item-h, 28px);
  background: linear-gradient(180deg, #e7e2d9 0%, #c4b896 100%);
  border-radius: 2px;
  transform: translateY(var(--section-index-offset, 0px));
  transition: transform 0.55s cubic-bezier(0.76, 0, 0.24, 1),
    height 0.45s cubic-bezier(0.76, 0, 0.24, 1);
  box-shadow: 0 0 12px rgba(196, 184, 150, 0.35);
  will-change: transform;
}

.section-index__list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.section-index__item {
  margin: 0;
  padding: 0;
}

.section-index__btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.35rem 0.5rem 0.35rem 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.38);
  font-family: var(--font-primary, "Noto Sans Hebrew", sans-serif);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.35s ease, opacity 0.35s ease;
  opacity: 0.72;
}

.section-index__btn:hover,
.section-index__btn:focus-visible {
  color: rgba(255, 255, 255, 0.92);
  opacity: 1;
  outline: none;
}

.section-index__btn.is-active {
  color: #f4f1ea;
  opacity: 1;
}

.section-index__num {
  font-family: var(--font-en-display, "Noto Sans", sans-serif);
  font-size: 0.58rem;
  min-width: 1.1rem;
  text-align: left;
}

.section-index__label {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transition: max-width 0.45s cubic-bezier(0.76, 0, 0.24, 1),
    opacity 0.35s ease;
}

.section-index:hover .section-index__label,
.section-index:focus-within .section-index__label {
  max-width: 9rem;
  opacity: 1;
}

.section-index__btn.is-active .section-index__label {
  opacity: 1;
  max-width: 9rem;
}

/* Transition overlay — Barba-style wipe */
.section-transition {
  position: fixed;
  inset: 0;
  z-index: 870;
  pointer-events: none;
  overflow: hidden;
  visibility: hidden;
}

.section-transition.is-active {
  visibility: visible;
  pointer-events: auto;
}

.section-transition__panel {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50.5%;
  background: #1a1916;
  will-change: transform;
}

.section-transition__panel--top {
  top: 0;
  transform: translateY(-101%);
}

.section-transition__panel--bottom {
  bottom: 0;
  transform: translateY(101%);
}

.section-transition__label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  font-family: var(--font-en-display, "Noto Sans", sans-serif);
  font-size: clamp(0.65rem, 1.2vw, 0.75rem);
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(231, 226, 217, 0.55);
  opacity: 0;
  pointer-events: none;
}

html.is-section-transitioning {
  overflow: hidden;
}

html.is-section-transitioning .section-index {
  pointer-events: none;
  opacity: 0.35;
}

@media (max-width: 768px) {
  .section-index {
    left: 0.5rem;
    transform: translateY(-50%) scale(0.92);
  }

  .section-index__label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .section-index__indicator {
    transition: transform 0.2s ease;
  }
}
