/* Tutorials page layout (TK-105, FR-20).
   Logical properties throughout. The ONE horizontal scroller on this page is
   .lb-tut-strip, and it is an inner element — html/body stay overflow-x: clip
   (main.css:59), so document.scrollWidth is unaffected and the 320px overflow
   assertion still passes. Do not lift that scroll onto an ancestor. */

.lb-tut { display: flex; gap: 28px; align-items: flex-start; padding-block: 28px 64px; }
/* The rail is pinned, so its height is the viewport minus the pin offset and a
   little breathing room. Twelve chapters plus "Read everything" already outgrow
   a laptop window, and a rail taller than the screen means scrolling the whole
   page to reach chapter 12 — the pin then buys nothing. The SEARCH box stays
   put and the chapter list scrolls inside it; the thin token scrollbar comes
   from the global rule in main.css. */
.lb-tut-rail {
  flex: 0 0 260px; inline-size: 260px; min-inline-size: 0;
  position: sticky; inset-block-start: 76px;
  display: flex; flex-direction: column;
  max-block-size: calc(100dvh - 76px - 28px);
}
.lb-tut-detail { flex: 1 1 auto; min-inline-size: 0; }

/* ── search ─────────────────────────────────────────────────────────────── */
.lb-tut-search { margin-block-end: 14px; }
.lb-tut-search input {
  inline-size: 100%;
  min-block-size: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;               /* ≥16px stops iOS zooming on focus */
}
.lb-tut-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.lb-tut-count { display: block; margin-block-start: 6px; color: var(--text3); font-size: .78rem; }

/* ── chapter rail ───────────────────────────────────────────────────────── */
/* The list's own wrapper has to be able to shrink too, or the cap on the rail
   lands on an element that simply overflows it. */
.lb-tut-navwrap { display: flex; flex-direction: column; min-block-size: 0; flex: 1 1 auto; }
.lb-tut-nav {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 2px;
  /* min-block-size:0 is what lets a grid child actually shrink inside the flex
     column — without it the list keeps its full content height and the rail
     overflows instead of scrolling. */
  overflow-y: auto; min-block-size: 0; overscroll-behavior: contain;
  padding-inline-end: 4px;
}
.lb-tut-nav a {
  display: flex; align-items: center; gap: 8px;
  min-block-size: 44px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text2);
  text-decoration: none;
  font-size: .86rem;
  min-inline-size: 0;
}
.lb-tut-nav a:hover { background: var(--bg3); color: var(--text); }
.lb-tut-nav a[aria-current="page"] { background: var(--accent-glow); color: var(--accent); font-weight: 600; }
.lb-tut-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lb-tut-n { font-family: var(--mono); font-size: .72rem; color: var(--text3); min-inline-size: 16px; }
.lb-tut-label { flex: 1 1 auto; min-inline-size: 0; overflow-wrap: anywhere; }
.lb-tut-dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--success); flex: 0 0 auto; }

.lb-tut-actions { margin-block-start: 16px; display: grid; gap: 8px; }

/* ── mobile chapter strip ───────────────────────────────────────────────── */
.lb-tut-strip { display: none; }

/* ── chapter header ─────────────────────────────────────────────────────── */
.lb-ch-head { margin-block-end: 22px; }
.lb-ch-eyebrow { color: var(--text3); font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; }
.lb-ch-title { font-size: 1.55rem; font-weight: 600; margin: 6px 0 8px; overflow-wrap: anywhere; }
.lb-ch-outcome { color: var(--accent); font-size: 1rem; font-weight: 500; margin: 0 0 10px; overflow-wrap: anywhere; }
.lb-ch-blurb { color: var(--text2); font-size: .92rem; line-height: 1.75; margin: 0 0 12px; max-inline-size: 68ch; overflow-wrap: anywhere; }
.lb-ch-proof {
  margin: 0 0 12px; padding: 10px 14px;
  border-inline-start: 3px solid var(--success);
  background: var(--bg3); border-radius: var(--radius);
  color: var(--text2); font-size: .85rem; line-height: 1.6;
}
.lb-ch-xrefs { color: var(--text3); font-size: .8rem; margin: 0; }
.lb-ch-xrefs a { color: var(--text2); }

.lb-ch-video { margin-block-end: 26px; }

/* ── a feature entry ────────────────────────────────────────────────────── */
.lb-feat { padding-block: 22px; border-block-start: 1px solid var(--border); min-inline-size: 0; }
.lb-feat:focus-visible { outline: none; }
.lb-feat--target { border-inline-start: 3px solid var(--accent); padding-inline-start: 14px; }
.lb-feat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block-end: 6px; }
.lb-feat-title { font-size: 1.05rem; font-weight: 600; margin: 0; flex: 1 1 260px; min-inline-size: 0; overflow-wrap: anywhere; }
.lb-feat-what { color: var(--text2); font-size: .9rem; line-height: 1.7; margin: 0 0 12px; max-inline-size: 68ch; overflow-wrap: anywhere; }

.lb-feat-disambig {
  margin: 0 0 12px; padding: 10px 14px;
  border: 1px solid var(--border2);
  border-inline-start: 3px solid var(--warning);
  border-radius: var(--radius);
  background: var(--bg3);
  color: var(--text2); font-size: .84rem; line-height: 1.6;
}
.lb-feat-truth { margin: 12px 0 0; color: var(--text3); font-size: .82rem; line-height: 1.6; }

.lb-steps-label { margin: 0 0 6px; color: var(--text3); font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; }
.lb-feat-path { margin: 0 0 14px; padding-inline-start: 20px; display: grid; gap: 6px; }
.lb-feat-path li { color: var(--text2); font-size: .89rem; line-height: 1.7; min-inline-size: 0; overflow-wrap: anywhere; }

/* The control name, borrowing the .rc-chip anatomy rather than loading the
   33 KB stylesheet it lives in. */
.lb-ui {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--bg3);
  color: var(--text);
  font-weight: 500;
  font-size: .86rem;
  unicode-bidi: isolate;
}

.lb-jump { flex: 0 0 auto; }

/* ── search results ─────────────────────────────────────────────────────── */
.lb-results { display: grid; gap: 0; }
.lb-result-chapter { margin-block: 18px 0; color: var(--text3); font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; }

/* ── print / read-everything mode ───────────────────────────────────────── */
.lb-tut--print .lb-tut-rail,
.lb-tut--print .lb-tut-strip { display: none; }
.lb-tut--print .lb-ch-video { display: none; }
.lb-tut--print .lb-tut { display: block; }
.lb-tut--print .lb-ch-head { margin-block-start: 40px; }

@media print {
  .navbar, .lb-tut-rail, .lb-tut-strip, .lb-ch-video, .lb-jump, .lb-footer { display: none !important; }
  .lb-tut { display: block; padding: 0; }
  .lb-feat { break-inside: avoid; }
  .lb-shot img { max-inline-size: 16cm; }
  a[href^="/"]::after { content: " (linesbidder" attr(href) ")"; font-size: .8em; color: #555; }
}

/* ── narrow ─────────────────────────────────────────────────────────────── */
@media (max-width: 899px) {
  .lb-tut { display: block; padding-block: 16px 48px; }
  /* Stacked above the content, the rail is not pinned and has the whole page to
     be tall in — a capped, separately-scrolling list would just be a second
     scroll trap on a phone. */
  .lb-tut-rail { position: static; inline-size: auto; flex: none; margin-block-end: 18px; display: block; max-block-size: none; }
  .lb-tut-navwrap { display: block; }
  .lb-tut-nav { overflow-y: visible; padding-inline-end: 0; }
  .lb-tut-nav { display: none; }
  .lb-tut-strip {
    display: flex; gap: 6px;
    padding: 8px 0;
    overflow-x: auto;                 /* the one permitted scroller — see header */
    scroll-snap-type: inline mandatory;
    -webkit-overflow-scrolling: touch;
    min-inline-size: 0;
  }
  .lb-tut-strip a {
    flex: 0 0 auto;
    scroll-snap-align: start;
    display: inline-flex; align-items: center; gap: 6px;
    min-block-size: 44px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg2);
    color: var(--text2);
    text-decoration: none;
    font-size: .82rem;
    white-space: nowrap;
  }
  .lb-tut-strip a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
  .lb-tut-strip a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .lb-ch-title { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .lb-tut-strip { scroll-behavior: auto; }
}
