/**
 * retech/jump-nav block styles — in-page jump bar (sticky under the fixed header).
 *
 * Prototype sources: ret-ch/assets/css/solutions.css 21.1 (1704–1760), the
 *   responsive part of 21.5 (1938/1939, 1954/1955, 1969), and the dark state of
 *   23.1 (2018–2026). Classes move from `.jump-nav*` to `.retech-x-jump-nav*` and
 *   variables become this site's tokens.
 *
 * Ownership (important): this file may only define `.retech-x-jump-nav*`.
 *   `.retech-x-wrap` (content width) and `.retech-x-section--light|--dark`
 *   (shared backgrounds) are owned solely by blocks/style-index.css — this block
 *   only consumes them, and defining them again trips E5 in check-css (one class
 *   anchored by two or more block files). The retech-base layer must not appear
 *   here either.
 *
 * Layer order: `@layer retech-block` < `@layer retech-responsive`; every @media
 *   must live in retech-responsive (including prefers-reduced-motion), otherwise
 *   check-css reports E4. The only breakpoints are 1240 / 1080 / 700 (the
 *   prototype's 767 step converges to this project's 700).
 */

@layer retech-block {
  /* Default background = light state. The dark state is overridden by
     [data-header="dark"] — that attribute is also the input of the header probe in
     blocks/view.js (see the render.php file header). */
  .retech-x-jump-nav {
    position: sticky;
    top: var(--retech-x-header-h);
    z-index: 40;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(10px) saturate(130%);
    border-bottom: 1px solid var(--retech-x-line);
  }

  .retech-x-jump-nav__inner {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 52px;
  }

  .retech-x-jump-nav__title {
    flex: 0 0 auto;
    color: var(--retech-x-ink-3);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .retech-x-jump-nav__list {
    /* ★ flex:1 1 auto and min-width:0 are both required; do not delete them:
       this is a child of .retech-x-jump-nav__inner (display:flex) and scrolls
       horizontally itself. A flex child defaults to min-width:auto and will not
       shrink below its content, so this scroll container widened the whole flex
       parent → horizontal overflow across the page (measured on the prototype's
       guillotine-cutter page at 390px: 643 > 390). min-width:0 lets it actually
       shrink and keeps the scrolling inside. Acceptance requires zero horizontal
       overflow at 1440 / 1080 / 700 — dropping this line brings the bug back. */
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .retech-x-jump-nav__list::-webkit-scrollbar {
    display: none;
  }

  .retech-x-jump-nav__list a {
    display: block;
    padding: 7px 13px;
    border-radius: var(--retech-x-r-pill);
    color: var(--retech-x-ink-2);
    font-size: 13px; /* prototype --fs-xs (retech.css:95); no font-size token here, so a literal */
    font-weight: 600;
    white-space: nowrap;
    transition: background-color var(--retech-x-dur-fast) var(--retech-x-ease-ui),
                color var(--retech-x-dur-fast) var(--retech-x-ease-ui);
  }
  .retech-x-jump-nav__list a:hover {
    background: var(--retech-x-gray-light);
    color: var(--retech-x-ink);
  }
  /* Current section — the scroll-spy in blocks/view.js adds .retech-x-active to
     a[data-retech-spy] (the prototype calls it .is-current, same semantics). */
  .retech-x-jump-nav__list a.retech-x-active {
    background: var(--retech-x-flow);
    color: #fff;
  }

  /* ── Dark state: tone="dark" ───────────────────────────────────────────────
     Prototype section 23.1. data-header is emitted straight from the block
     attribute; no JS involved. */
  .retech-x-jump-nav[data-header="dark"] {
    background: rgba(15, 21, 26, .94);
    border-bottom-color: var(--retech-x-line-dark);
    backdrop-filter: blur(18px) saturate(130%);
  }
  .retech-x-jump-nav[data-header="dark"] .retech-x-jump-nav__title {
    color: var(--retech-x-w40);
  }
  .retech-x-jump-nav[data-header="dark"] .retech-x-jump-nav__list a {
    color: var(--retech-x-w72);
  }
  .retech-x-jump-nav[data-header="dark"] .retech-x-jump-nav__list a:hover {
    background: var(--retech-x-w08);
    color: #fff;
  }
  .retech-x-jump-nav[data-header="dark"] .retech-x-jump-nav__list a.retech-x-active {
    background: var(--retech-x-flow);
    color: #fff;
  }
}

@layer retech-responsive {
  /* Prototype solutions.css:1938/1939 (≤1080): tighten the gap and hide the label,
     leaving the whole width to the links. */
  @media (max-width: 1080px) {
    .retech-x-jump-nav__inner {
      gap: 12px;
    }
    .retech-x-jump-nav__title {
      display: none;
    }
  }

  /* Prototype solutions.css:1954/1955 (≤767): tighter padding and font size (700 is this project's breakpoint). */
  @media (max-width: 700px) {
    .retech-x-jump-nav__list a {
      padding: 7px 11px;
      font-size: 12px;
    }
  }

  /* Prototype solutions.css:1969 — honours the system "reduce motion" setting. */
  @media (prefers-reduced-motion: reduce) {
    .retech-x-jump-nav__list a {
      transition: none;
    }
  }
}
