/* teaching-immersion.css — the immersion layer on the teaching pages (js/teaching-immersion.js).
   The reading hairline, "In this teaching" (the movements as an outline the
   gold marker follows), the ❖ that blooms above each section title, and
   "Continue the walk" — the doorway to the next teaching. Parchment, gold,
   serif; the app's cascade and tap tokens (motion.css). */

/* Reading hairline — fills as the page is read. */
.tch-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 101;
  background: var(--kw-accent); transform-origin: 0 50%; transform: scaleX(0);
  pointer-events: none;
}

/* In this teaching */
.tch-outline {
  max-width: 760px; margin: 22px auto 34px; padding: 22px 24px 20px;
  background: var(--kw-surface); border: 0.5px solid var(--kw-separator);
  border-radius: var(--kw-r-xl, 20px); box-shadow: var(--kw-card-shadow);
}
@media (max-width: 784px) { .tch-outline { margin-inline: 12px; } }
.tch-outline__eyebrow, .tch-next__eyebrow {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-family: var(--kw-font-ui); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--kw-accent-deep);
  margin: 0 0 8px; white-space: nowrap;
}
.tch-outline__eyebrow::before, .tch-outline__eyebrow::after,
.tch-next__eyebrow::before, .tch-next__eyebrow::after {
  content: "\2756"; font-family: Georgia, serif; font-size: 12px; letter-spacing: 0; color: var(--kw-accent);
}
.tch-outline__meta {
  text-align: center; font-family: var(--kw-font-verse, Georgia, serif); font-style: italic;
  font-size: 0.95rem; line-height: 1.4; color: var(--kw-label-2); margin: 0 0 14px;
}
.tch-outline__list { list-style: none; margin: 0; padding: 0; position: relative; border-left: 1px solid var(--kw-separator); }
.tch-outline__marker {
  position: absolute; left: -1px; top: 0; width: 2px; height: 0; background: var(--kw-accent);
  transition: transform 0.35s var(--kw-ease-settle), height 0.35s var(--kw-ease-settle), opacity 0.35s var(--kw-ease-settle);
  opacity: 0;
}
.tch-outline__list.has-current .tch-outline__marker { opacity: 1; }
.tch-outline__list li a {
  display: flex; align-items: baseline; gap: 14px; padding: 10px 6px 10px 18px;
  text-decoration: none; color: var(--kw-label);
  transition: opacity var(--kw-tap-release) var(--kw-ease-settle);
}
.tch-outline__list li a:active { opacity: var(--kw-tap-dim); transition-duration: var(--kw-tap-press); }
.tch-outline__n { font-family: var(--kw-font-serif); font-weight: 600; font-size: 0.95rem; color: var(--kw-accent); min-width: 1.4em; font-variant-numeric: tabular-nums; }
.tch-outline__t { flex: 1; font-family: var(--kw-font-serif); font-weight: 500; font-size: 1.05rem; line-height: 1.35; transition: color 0.35s var(--kw-ease-settle); }
.tch-outline__chev { color: var(--kw-label-3); font-size: 1.2rem; line-height: 1; transition: color 0.35s var(--kw-ease-settle), transform 0.35s var(--kw-ease-settle); }
.tch-outline__list li.is-done .tch-outline__t { color: var(--kw-label-2); }
.tch-outline__list li.is-current .tch-outline__t { color: var(--kw-accent-deep); }
.tch-outline__list li.is-current .tch-outline__chev { color: var(--kw-accent); transform: translateX(2px); }
.tch-outline__list li a:hover .tch-outline__t { color: var(--kw-accent-hover); }
#main h2 { scroll-margin-top: 96px; }
/* The outline mount ([data-tch-outline]) ships in the HTML with --tch-n set to
   the number of movements, so its height is reserved before the script fills
   it and nothing below shifts; empty, it is an invisible reservation. */
.tch-outline:empty {
  min-height: calc(100px + var(--tch-n, 5) * 43px);
  background: none; border-color: transparent; box-shadow: none;
}
@media (scripting: none) { .tch-outline:empty { display: none; } }

/* The ❖ above each section title blooms as its section arrives. */
body.kw-motion:not(.kw-reduced) .kw-cascade.is-in [class$="-h2"]::before {
  animation: tch-bloom 0.7s var(--kw-ease-settle) both 0.25s;
}
@keyframes tch-bloom { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }

/* Continue the walk — the doorway to the next teaching. */
.tch-next { max-width: 760px; margin: 56px auto 44px; padding: 0 24px; }
@media (max-width: 784px) { .tch-next { padding: 0 12px; } }
.tch-next__eyebrow { margin-bottom: 14px; }
.tch-next__door {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; isolation: isolate;
  border-radius: var(--kw-r-xl, 20px); background: var(--kw-inset, #1C1410);
  box-shadow: var(--kw-card-shadow); text-decoration: none;
}
.tch-next__door img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(0.95) brightness(0.9); transition: filter 0.35s var(--kw-ease-settle);
}
.tch-next__door::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(16, 11, 8, 0.84) 0%, rgba(16, 11, 8, 0.32) 48%, rgba(16, 11, 8, 0.04) 76%);
}
.tch-next__text { position: absolute; left: 22px; right: 72px; bottom: 20px; z-index: 2; display: flex; flex-direction: column; gap: 6px; }
.tch-next__label { font-family: var(--kw-font-ui); font-size: 11px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: #D9B24C; }
.tch-next__title { font-family: var(--kw-font-serif); font-weight: 600; font-size: clamp(20px, 3.4vw, 28px); line-height: 1.2; color: #fff; text-shadow: 0 1px 16px rgba(0, 0, 0, 0.5); }
.tch-next__chev {
  position: absolute; right: 18px; bottom: 18px; z-index: 2; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-family: var(--kw-font-ui); font-size: 22px; font-weight: 500; line-height: 1; padding-bottom: 2px;
  transition: transform 0.22s var(--kw-ease-settle);
}
.tch-next__door:hover img { filter: saturate(1.02) brightness(1); }
.tch-next__door:hover .tch-next__chev { transform: translateX(2px); }
.tch-next__door:focus-visible { outline: 3px solid var(--kw-accent); outline-offset: 2px; }

/* ── The verse bands — Scripture arrives line by line, out of light ──────
   teaching-immersion.js wraps each word (.tch-w) and, when the band comes
   into view, gives every word of a visual line the same delay, so the verse
   lands a line at a time, each line settling out of a warm glow; the
   reference follows. Resting state is visible (nothing hides without
   body.kw-motion); under Reduce Motion the band keeps the plain cascade. */
.tch-verse .tch-w { display: inline-block; }
body.kw-motion .tch-verse .tch-w, body.kw-motion .tch-verse cite { opacity: 0; }
body.kw-motion .tch-verse.is-in .tch-w { animation: tch-line 0.7s var(--kw-ease-settle) both; }
body.kw-motion .tch-verse.is-in cite { animation: tch-line 0.6s var(--kw-ease-settle) both; }
/* Opacity and transform only — a text-shadow keyframe repaints every word
   span for the whole 0.7 s; the settle from a lift reads as the same arrival. */
@keyframes tch-line {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
