/* LG Studio · Read the Practice chapter index
   Subordinate editorial sequence marker — not a third site header.
   Studio-owned tokens only; never Luis portfolio data-theme. */

.lg-practice-chapters {
  --lg-ch-ink: #0E0C0A;
  --lg-ch-ivory: #FAF6EF;
  --lg-ch-muted: rgba(250, 246, 239, 0.72);
  --lg-ch-accent: #C96E53;
  --lg-studio-chapter-h: 40px;

  position: sticky;
  /* Shared shell sets --lg-studio-chapter-top = strip + nav height */
  top: var(--lg-studio-chapter-top, calc(var(--lg-eco-strip-offset, 30px) + var(--lg-studio-nav-h, 56px)));
  z-index: 140;
  height: var(--lg-studio-chapter-h, 40px);
  box-sizing: border-box;
  background: var(--lg-ch-ink);
  color: var(--lg-ch-ivory);
  border-bottom: 1px solid rgba(250, 246, 239, 0.12);
  color-scheme: dark;
}

.lg-practice-chapters__inner {
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 4rem);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  white-space: nowrap;
}

.lg-practice-chapters__inner::-webkit-scrollbar {
  display: none;
}

.lg-practice-chapters__label {
  flex-shrink: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lg-ch-muted);
}

.lg-practice-chapters__sep {
  flex-shrink: 0;
  color: rgba(250, 246, 239, 0.32);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.625rem;
  user-select: none;
}

/* Specificity > body.studio-lovable a { color: inherit } */
body.studio-lovable .lg-practice-chapters a,
body.studio-lovable .lg-practice-chapters [aria-current="page"],
.lg-practice-chapters a,
.lg-practice-chapters [aria-current="page"] {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 100%;
  min-height: 0;
  padding: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--lg-ch-muted);
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.studio-lovable .lg-practice-chapters a:hover,
.lg-practice-chapters a:hover {
  color: var(--lg-ch-ivory);
}

body.studio-lovable .lg-practice-chapters [aria-current="page"],
.lg-practice-chapters [aria-current="page"] {
  color: var(--lg-ch-ivory);
  box-shadow: inset 0 -2px 0 var(--lg-ch-accent);
}

.lg-practice-chapters__num {
  color: var(--lg-ch-accent);
  font-weight: 500;
}

body.studio-lovable .lg-practice-chapters [aria-current="page"] .lg-practice-chapters__num,
.lg-practice-chapters [aria-current="page"] .lg-practice-chapters__num {
  color: var(--lg-ch-accent);
}

.lg-practice-chapters__short {
  display: none;
}

/* Immersive (El Revelado): fixed index without Studio header stack */
.lg-practice-chapters--immersive {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 45;
  background: rgba(11, 10, 8, 0.92);
  backdrop-filter: blur(8px);
}

.lg-practice-chapters--immersive .lg-practice-chapters__inner {
  max-width: none;
  padding-right: min(14rem, 42vw); /* clear lang + return chrome */
}

@media (max-width: 1080px) {
  :root {
    --lg-studio-chapter-h: 38px;
  }

  .lg-practice-chapters {
    --lg-studio-chapter-h: 38px;
  }

  body.studio-lovable .lg-practice-chapters a,
  body.studio-lovable .lg-practice-chapters [aria-current="page"],
  .lg-practice-chapters a,
  .lg-practice-chapters [aria-current="page"] {
    font-size: 0.6rem;
  }

  .lg-practice-chapters__full {
    display: none;
  }

  .lg-practice-chapters__short {
    display: inline;
  }
}
