/* « Sur cette page » of the Unisson documentation model: the "toc" rail, and the "toc-inline" disclosure under 1100 px
   (attribute collapsed). The host carries the model's body font, as the section frame of pack-catalog does. */
:host {
  --mono: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: block;
  color: var(--pack-ink);
  font: 16px / 1.6 var(--sans);
  font-feature-settings: normal;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  vertical-align: baseline;
}
/* The rail sticks under the site header, as the model's aside does: the host is the grid item of the docs layout. */
:host(:not([collapsed])) {
  position: sticky;
  inset-block-start: calc(var(--pack-top-h, 64px) + 28px);
}
:host([hidden]) {
  display: none;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
h2 {
  margin: 0;
}
/* The kernel's link is a 44 px inline-flex target: the model's links are plain inline links. */
a {
  display: inline;
  min-block-size: 0;
  gap: normal;
  color: var(--pack-link);
  text-underline-offset: auto;
}
:focus-visible {
  outline: 2px solid var(--pack-focus);
  outline-offset: 3px;
  border-radius: 6px;
}

/* rail (.toc) */
[part="rail"] {
  font-size: 14px;
}
[part="heading"] {
  margin: 0 0 10px;
  font: 700 11px var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pack-mut);
}
[part="rail"] [part="list"] {
  list-style: none;
  margin: 0;
  padding: 0 0 0 2px;
  border-inline-start: 1px solid var(--pack-line2);
}
[part="rail"] [part="link"] {
  display: block;
  margin-inline-start: -1px;
  padding: 5px 0 5px 14px;
  border: 0;
  border-inline-start: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--pack-mut);
  text-decoration: none;
  line-height: 1.4;
}
[part="rail"] [part="link"]:hover {
  color: var(--pack-ink);
}
[part="rail"] [part="link"][aria-current="true"] {
  color: var(--pack-ink);
  font-weight: 600;
  border-inline-start-color: var(--pack-c1);
}
/* The model's ".toc a" rule also reaches the top link: same padding and transparent rule, no underline. */
[part="top"] {
  display: inline-block;
  margin-block-start: 16px;
  margin-inline-start: -1px;
  padding: 5px 0 5px 14px;
  border-inline-start: 2px solid transparent;
  font: 600 12px var(--mono);
  color: var(--pack-link);
  text-decoration: none;
}
[part="top"]:hover {
  color: var(--pack-ink);
}

/* disclosure (details.disc.toc-inline) */
[part="toggle"] {
  list-style: none;
  inline-size: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-block-size: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--pack-line2);
  background: var(--pack-panel2);
  font: 600 13px var(--mono);
  color: var(--pack-ink);
}
[part="toggle"]::-webkit-details-marker {
  display: none;
}
[part="toggle"] svg {
  flex: none;
}
[part="disclosure"][open] > [part="toggle"] svg {
  transform: rotate(180deg);
}
/* glow border */
[part~="panel"] {
  position: relative;
  margin-block-start: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--pack-panel);
  border: 1px solid var(--pack-line);
  box-shadow: var(--pack-shadow);
}
[part~="panel"]::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, var(--pack-c1), transparent 35%, transparent 65%, var(--pack-c2));
  opacity: 0.55;
  pointer-events: none;
  -webkit-mask:
    linear-gradient(var(--pack-ink) 0 0) content-box,
    linear-gradient(var(--pack-ink) 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(var(--pack-ink) 0 0) content-box exclude,
    linear-gradient(var(--pack-ink) 0 0);
}
/* The model leaves the folded list to the browser's list: bullets, underlined links in the link colour. */
[part~="panel"] [part="list"] {
  border-inline-start: 1px solid var(--pack-line2);
}
[part~="panel"] [part="link"],
[part~="panel"] [part="link"][aria-current] {
  border-color: transparent;
  background: transparent;
  color: var(--pack-link);
}

/* The chevron turns only when motion is welcome, as the model's reduced-motion rule leaves it. */
@media (prefers-reduced-motion: no-preference) {
  [part="toggle"] svg {
    transition: transform 0.2s;
  }
}
/* Forced colours: the glow border is decoration; the plain borders and the current rule stay. */
@media (forced-colors: active) {
  [part~="panel"]::after {
    display: none;
  }
  [part="rail"] [part="list"] {
    border-inline-start-color: CanvasText;
  }
  [part="rail"] [part="link"][aria-current="true"] {
    border-inline-start-color: Highlight;
  }
}
