/* "On this page" for the long reading and decision pages (compare, faq, status, privacy-policy; inc/page-toc.php).
   Owner, 2026-11-12: no pager, all of the content on the page, a side contents list - sticky beside the text on a
   desktop, a compact jump menu on a phone. Only these pages load this file. */
/* modern.css clips sideways overflow with `hidden` on html AND body, which makes body a scroll container that never
   scrolls: a sticky list inside it never sticks and a jump to a heading lands short. `clip` keeps the clipping and no scroll box. */
html, body { overflow-x: hidden; overflow-x: clip; }
.pg-layout { display: grid; gap: 16px; }
.pg-main { min-width: 0; }
.pg-toc {
    background: var(--dark);
    border: 1px solid var(--tint-08);
    border-radius: 16px;
    box-shadow: inset 0 0 0 999px var(--surface-a50);
    margin-bottom: 4px;
}
/* with script, on a phone or a tablet: a one-line bar that stays under the header while the page scrolls; its list drops
   over the page instead of pushing it down, so opening and closing it never moves the text */
.pg-toc.pg-js { position: sticky; top: 72px; z-index: 5; }
.pg-toc.pg-js details { position: relative; }
.pg-toc summary {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 48px; padding: 0 18px;
    cursor: pointer; list-style: none;
    font-family: var(--font-mono); font-size: 12px; letter-spacing: .07em; text-transform: uppercase;
    color: var(--text-muted);
}
.pg-toc summary::-webkit-details-marker { display: none; }
.pg-toc summary::after {
    content: ''; width: 8px; height: 8px; flex: none;
    border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s ease;
}
.pg-toc details[open] > summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.pg-toc summary:focus-visible { outline: 2px solid var(--copper-ink, #FF7A45); outline-offset: -2px; border-radius: 14px; }
html[dir="rtl"] .pg-toc summary { font-family: var(--font-body); font-size: 13px; letter-spacing: 0; }
.pg-toc ol { list-style: none; margin: 0; padding: 0 18px 10px; }
.pg-toc.pg-js ol {
    position: absolute; inset-inline: -1px; top: calc(100% + 6px);
    background: var(--dark); box-shadow: inset 0 0 0 999px var(--surface-a50), 0 18px 40px rgba(0, 0, 0, .28);
    border: 1px solid var(--tint-08); border-radius: 16px; padding-block: 6px;
    max-height: calc(100svh - 190px); overflow-y: auto; overscroll-behavior: contain;
}
.pg-toc li { break-inside: avoid; margin: 0; padding: 0; }
.pg-toc li::before { content: none; }
.pg-toc a {
    display: block; min-height: 44px; padding: 11px 0; box-sizing: border-box;
    font-size: 14.5px; line-height: 1.4; color: var(--text-2); text-decoration: none;
    border-block-start: 1px solid var(--tint-08);
    transition: color var(--dur-1, 160ms) ease;
}
.pg-toc li:first-child a { border-block-start: 0; }
.pg-toc a:hover, .pg-toc a:focus-visible { color: var(--copper-ink); }
.pg-toc a[aria-current="true"] { color: var(--copper-ink); font-weight: 600; }
/* a heading reached from the list clears the header and, on a phone, the folded bar */
.pg-main [id] { scroll-margin-top: 64px; }
@media (min-width: 640px) and (max-width: 1099px) {
    .pg-toc ol { columns: 2; column-gap: 32px; }
    .pg-toc li:nth-child(2) a { border-block-start: 0; }
}
@media (min-width: 1100px) {
    .pg-layout { grid-template-columns: 15rem minmax(0, 1fr); gap: clamp(28px, 3vw, 48px); align-items: start; }
    /* beside the text, as tall as its list needs and no taller than the screen; always open */
    .pg-toc, .pg-toc.pg-js {
        position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 120px); overflow-y: auto;
        background: none; box-shadow: none; border: 0; border-radius: 0;
        border-inline-start: 1px solid var(--line, var(--tint-08)); padding-inline-start: 20px; margin: 0;
    }
    .pg-toc summary { min-height: 0; padding: 0 0 8px; cursor: default; pointer-events: none; }
    .pg-toc summary::after { display: none; }
    .pg-toc ol, .pg-toc.pg-js ol { position: static; padding: 0; max-height: none; overflow: visible; columns: auto; background: none; box-shadow: none; border: 0; border-radius: 0; }
    .pg-toc a { min-height: 0; padding: 6px 0; font-size: 14px; border-block-start: 0; }
    .pg-main [id] { scroll-margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) { .pg-toc summary::after { transition: none; } }
