/* The reading pages (the owner's message 151 of 4 Dec 2026, the picture "privacy-1130-left" of message 129): the policy
   and terms pages, the disclaimer, Docs, Trust, the service description and the articles. From 1024 px a page is two
   parts on the header's frame: the list "On this page" at the left, staying on the screen with the page's date line
   under it, and the text at the right in the one reading column (--col, css/product.css), its right edge on the
   frame's. Under 1024 the list sits above the text, folded shut (js/main.js shuts it; with no script it stays open).
   One list, one behaviour: js/main.js marks the section in view. A label keeps to two lines; a longer one is cut
   with "..." and js/main.js gives it its full words on hover. No word of a page changes.
   Checked by tools/check-reading-pages.py (the markup), tools/check-toc-mark.py (the mark, the fold, the label
   lines) and tools/check-reading-layout.py (the edges). */

/* product.css loads last on every page (tools/sync-shell.py), so a rule here that meets one of its column rules
   starts at :root to outrank it. */

/* the fold: "On this page" opens and shuts the list under 1024 */
.toc-fold > summary { display: block; list-style: none; cursor: pointer; }
.toc-fold > summary::-webkit-details-marker { display: none; }
.toc-fold > summary .mini-h { display: flex; align-items: center; gap: var(--space-1); margin: 0; }
.toc-fold > summary .mini-h::after {
  content: ""; width: 6px; height: 6px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-25%) rotate(45deg);
}
.toc-fold[open] > summary .mini-h::after { transform: translateY(25%) rotate(-135deg); }
.toc-fold[open] > summary { margin-bottom: var(--gap-heading); }
.toc-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--r); }

/* a label keeps to two lines; its number stands at the left of its first line */
.legal-toc .toc-fold ol a {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  position: relative; padding-left: calc(var(--space-2) + 26px); line-height: 1.45;
}
.legal-toc .toc-fold ol a::before { position: absolute; left: var(--space-2); top: var(--space-0); line-height: calc(0.9rem * 1.45); }

/* a hovered line never looks like the marked one (the owner's message 166, item 2): the ground is the mark's alone;
   with a pointer a hovered line's words are underlined, and on a touch screen hovering shows nothing */
:root .legal-toc a:not(.is-active):hover { background: none; }
@media (hover: hover) and (pointer: fine) {
  :root .legal-toc a:not(.is-active):hover { text-decoration: underline; text-underline-offset: 0.2em; }
}

/* the date line under the list: its own rule above it, none under it (the list's rule or the text's follows) */
.reading .legal-toc .legal-meta { border-bottom: 0; padding-bottom: 0; }

/* under 1024: the list above the text, in the text's column, a rule under it */
@media (max-width: 1023.98px) {
  .reading > .legal-toc, .sd-toc { position: static; padding-bottom: var(--space-2); border-bottom: 1px solid var(--line); }
  .reading .legal-toc ol, .sd-toc ol { grid-template-columns: minmax(0, 1fr) !important; }
  .reading .legal-toc .legal-meta { margin: var(--space-2) 0 0; }
  /* the service description's list stands on the page ground between two bands: 64 above and below its heading */
  .sd-toc { width: min(1088px, 100% - 32px); margin: 0 auto; padding: var(--space-5) 0; }
}

@media (min-width: 1024px) {
  .legal-shell.reading, .article-shell.reading {
    display: grid; width: min(1088px, 100% - 32px); margin-inline: auto; align-items: start;
    grid-template-columns: minmax(0, 1fr) var(--col); column-gap: var(--space-4); row-gap: 0;
  }
  :root .reading > :not(.legal-toc) { grid-row: auto; grid-column: 2; }
  :root .reading > .legal-toc, .sd-toc > .toc-fold {
    grid-column: 1; grid-row: 1 / span 40; position: sticky; top: 96px; align-self: start;
    max-height: calc(100vh - 120px); overflow: auto; padding-bottom: 0; border-bottom: 0; font-size: 0.9rem;
  }
  .reading .legal-toc ol, .sd-toc ol { grid-template-columns: minmax(0, 1fr) !important; }
  .reading .legal-toc a, .sd-toc a { margin-inline: 0; }
  /* the list is always open here: its heading is a heading, not a switch */
  .toc-fold > summary { pointer-events: none; cursor: default; }
  .toc-fold > summary .mini-h::after { display: none; }
  /* the text column is the reading column itself: its blocks take its full width */
  :root .reading > *, :root .reading .legal-content > * { max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; }
  /* the column's first heading stands 64 under the band's top, as the list's heading beside it; the text's last
     block keeps no space under it, so the references stand 64 under the text */
  :root .reading > .legal-toc:first-child + .legal-content > section:first-child { padding-top: 0; }
  :root .reading .legal-content > :last-child, :root .reading .legal-content > :last-child > li:last-child { margin-bottom: 0; }
  /* the date line under the list, one item a row */
  .reading .legal-toc .legal-meta { display: grid; gap: var(--space-1); margin: var(--space-3) 0 0; padding: var(--space-2) 0 0; border-top: 1px solid var(--line); border-bottom: 0; }
  /* the title block on the text column's edges */
  :root main:has(.reading) .legal-hero .shell > *, :root main:has(.reading) .research-hero .shell > :not(.article-hero-art) {
    max-width: none; margin-left: calc(100% - var(--col)); margin-right: 0;
  }

  /* the service description: its sections stay as they are (the PDF is built from them), each block on the text
     column; the list is a sticky band of no height at the frame's left, from the first section to the page's foot */
  .sd-toc { position: sticky; top: 96px; height: 0; z-index: 1; width: min(1088px, 100% - 32px); margin-inline: auto; }
  .sd-toc > .toc-fold { position: static; width: calc(100% - var(--col) - var(--space-4)); padding-top: var(--space-5); }
  :root main:has(> .sd-toc) .sd .sd-wrap > *, :root main:has(> .sd-toc) .sd .sd-wrap :is(p, li) { max-width: none; }
  :root main:has(> .sd-toc) :is(.sd, .sd-top) .sd-wrap > * { margin-left: calc(100% - var(--col)); margin-right: 0; }
  /* the reading column holds the tables whole: sd.css's 640 px floor made them scroll sideways by 6 px at 1130
     (message 152, after no.108) */
  :root main:has(> .sd-toc) .sd table { min-width: 0; }
}
