/*
   THE LONG-FORM AIDS : the chapter jumps, the wing indexes, the tongue
   switcher, and the onward blocks of the longest rooms.
   KD sitting, 2026-10-04. Additive chrome only : every verse, prayer, article,
   and tongue standeth exactly where it stood; these rules add the finding aids
   above them, and cut no word.
   The onward block's structure and class names are fixed by KC's spec v1.0
   (docs/kc-onward-journey-spec-2026-10-04.md). Provisional rules for it stand
   marked below until css/onward.css landeth.
   TEMPLE MARK unassigned : the keeper's to set.
*/

/* ---- the pill rows : one grammar for the jumps and the indexes ---------- */
.chapter-toc,
.liturgy-index,
.prayer-index,
.tongue-index {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem 0.55rem;
  max-width: var(--body-max);
  margin: 1.25rem auto 0.5rem;
  font: 500 0.8rem/1.5 var(--font-ui);
}
@media (max-width: 48rem) {
  .chapter-toc,
  .liturgy-index { justify-content: flex-start; }
}
.chapter-toc a,
.liturgy-index a,
.prayer-index a,
.tongue-index a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 0.8rem;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-pill, 999px);
  color: var(--ink);
  text-decoration: none;
}
.chapter-toc a:hover,
.chapter-toc a:focus-visible,
.liturgy-index a:hover,
.liturgy-index a:focus-visible,
.prayer-index a:hover,
.prayer-index a:focus-visible,
.tongue-index a:hover,
.tongue-index a:focus-visible {
  border-color: var(--brass);
  color: var(--brass);
}
.prayer-index .index-label,
.tongue-index .index-label {
  align-self: center;
  color: var(--bureau);
  font-variant: small-caps;
  letter-spacing: 0.05em;
}

/* ---- the bottom book-switcher : the family at the foot of the page ------ */
.book-switcher-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.8rem;
  max-width: var(--body-max);
  margin: 2.5rem auto 0;
  font: 500 0.8rem/1.5 var(--font-ui);
}
.book-switcher-bottom [aria-current="page"] {
  text-decoration: underline double;
  text-underline-offset: 0.35em;
}

/* ---- the verse leaves, calm at rest : revealed by hand or by key --------
   The share-leaf row under every verse is quiet until wanted. Pointer
   devices reveal it on hover or keyboard focus within the verse block;
   touch devices keep it present, as it always was; print never shows it. */
@media screen and (hover: hover) and (pointer: fine) {
  body.scriptures .scripture-block > .share-leaf {
    height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    transition: opacity 160ms ease;
  }
  body.scriptures .scripture-block:hover > .share-leaf,
  body.scriptures .scripture-block:focus-within > .share-leaf {
    height: auto;
    opacity: 1;
    margin-top: 0.9rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.scriptures .scripture-block > .share-leaf { transition: none; }
}

/* ---- the tongue switcher ------------------------------------------------ */
.tongue-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.55rem;
  max-width: var(--body-max);
  margin: 0.75rem auto 0;
  font: 500 0.8rem/1.5 var(--font-ui);
}
.tongue-switcher:empty { display: none; }
.tongue-switcher .switcher-label {
  color: var(--bureau);
  font-variant: small-caps;
  letter-spacing: 0.05em;
}
.tongue-choice {
  font: inherit;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 0.8rem;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-pill, 999px);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.tongue-choice:hover,
.tongue-choice:focus-visible {
  border-color: var(--brass);
  color: var(--brass);
}
.tongue-choice[aria-pressed="true"] {
  border-color: rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.08);
  color: var(--brass);
}
.tongue-switcher .switcher-status {
  flex: 1 1 100%;
  text-align: center;
  color: var(--bureau);
  font-weight: 400;
}

/* The folded leaves take no room : the stack is a column of margins on
   screen when folded, and returneth to its grid when shown. */
@media screen {
  body.tongue-fold-mode .leaf-stack {
    display: block;
  }
  body.tongue-fold-mode .leaf-stack > * + * {
    margin-top: 0.9rem;
  }
  body.tongue-fold-mode [hidden="until-found"] {
    margin: 0;
    padding: 0;
    border: 0;
    min-height: 0;
    background: none;
  }
  /* A leaf the browser's find openeth getteth its full card dress back the
     moment beforematch fires, so the found word standeth readably where it
     always stood. */
  body.tongue-fold-mode [hidden="until-found"].leaf-found {
    margin-top: 0.9rem;
    padding: 0.85rem 1rem;
    border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
    background: color-mix(in srgb, var(--paper) 96%, var(--ink) 4%);
  }
  body.tongue-fold-mode.tongue-fold-fallback [data-tongue-folded] {
    display: none;
  }
}
/* On paper nothing is folded : the finder's leaves and the fallback's all
   lay out together, whatever the reader left folded on screen. */
@media print {
  .tongue-switcher { display: none !important; }
  body.tongue-fold-mode [hidden="until-found"] {
    display: block !important;
    content-visibility: visible !important;
  }
  body.tongue-fold-mode.tongue-fold-fallback [data-tongue-folded] {
    display: block !important;
  }
}

/* ---- the sealed door : a badge, not a broken button --------------------- */
.sealed-door {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.55rem;
  padding: 1rem 1.15rem;
  border: 1px dashed color-mix(in srgb, var(--ink) 30%, transparent);
  border-radius: 4px;
  color: var(--bureau);
}
.sealed-door .sealed-glyph {
  align-self: center;
  flex: 0 0 auto;
  color: var(--brass);
  font-family: "Noto Sans Symbols 2", "Cormorant SC", Georgia, serif;
}
.sealed-door .wing-door-name {
  color: var(--ink);
}
.sealed-door .sealed-note {
  flex: 1 1 20rem;
}

/* ---- the wing's cards : one bordered language --------------------------- */
@media (min-width: 56rem) {
  .covenant .wing-doors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---- reparare : a balanced cluster of six pills ------------------------- */
@media (min-width: 48rem) {
  body[data-room="reparare"] .orientation-index {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, max-content));
    justify-content: center;
  }
}

/* ---- the hero subtitles : balanced, a wider measure ---------------------
   The house's own `body.site-page main > p` rule (modern.css) setteth the
   ledes at --body-max (34rem) and outranketh a plain class selector; this
   rule matcheth its specificity so the wing's ledes breathe wider. */
body.covenant.site-page main > .orientation-lede,
body.covenant .orientation-lede {
  max-width: 44rem;
  text-wrap: balance;
}

/* ---- the onward block : provisional rules until css/onward.css lands ----
   KC maintains css/onward.css (onward-why, wing-road); until it landeth,
   these rules keep the block legible, and they yield to the spec's own
   sheet in the cascade (it is linked after this one). */
.onward-why {
  display: block;
  margin-top: 0.2rem;
  color: var(--bureau);
  font: 400 0.78rem/1.5 var(--font-ui);
}
.pager.onward { align-items: stretch; }
.pager.onward a {
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  max-width: 24rem;
}
.wing-road {
  max-width: var(--body-max);
  margin: 0.75rem auto 0;
  color: var(--bureau);
  font: 400 0.85rem/1.5 var(--font-ui);
  text-align: center;
}
.wing-road a { color: var(--brass); }
.wing-road-step { color: var(--brass); }
.wing-continues {
  margin-top: 3rem;
}

/* ---- the walk's station progress ---------------------------------------- */
.walk-station {
  margin: 0 0 0.35rem;
  color: var(--brass);
  font: 500 0.78rem/1.5 var(--font-ui);
  font-variant: small-caps;
  letter-spacing: 0.08em;
}

/* ---- print views : the block is of the screen ---------------------------
   The doors and the road are navigation; on paper they are noise. The
   head-of-room link stayeth: it is a <p>, and the house's own browser
   audit requireth every reading paragraph to keep its box on paper. */
@media print {
  .pager.onward,
  .wing-road { display: none !important; }
  /* A no-print note (the printables' continuation line) reacheth no sheet;
     the head-of-room link carrieth no no-print class and so keepeth its
     box, as the reading-paragraph audit requireth. */
  p.no-print { display: none !important; }
}

/* ---- the printable pactum : one "Article the First", not two -------------
   KD brief (2026-10-04): the folio label and the article-number duplicated
   the eyebrow. The folio keepeth the sheet's rule; the article-number is
   collapsed on this view alone, by the house's zero-box technique (the text
   stayeth in the document; only the box is spent, so the reading paragraph
   keepeth its place for finders and for the audits). No word leaveth the
   room (pactum.html) or the gathering's text. */
body.print-covenant .canon-body .article-number {
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
}
