/* How a post reads (18 November 2026, the owner): the text size on the post page (views/reading.js), and a little more room
   between the lines of a card on Home. Loaded after the clean layer, whose tokens (--cl-*) it uses.

   1. The five sizes. views/reading.js writes the chosen one on the post's place (data-text-size); here it becomes two
      factors that clean-post.css multiplies its sizes by: --rd-k for the text and its headings, --rd-t for the title,
      which grows more gently so a large title never takes the whole screen. The middle size is the page as it was.
   2. The pill and its panel. One quiet hairline pill at the top of the post, at the right; under it a small white panel
      with a small A, a line of five stops, a large A, and the name of the size. The chosen stop is the ink dot, which
      slides to the next one; the line is ink up to it. Monochrome: lilac is only the keyboard's ring.
      2b. Down in the post a quiet round Aa takes its place: in the margin beside the column, or in a phone's top bar.
   3. The post's words change size softly when a stop is chosen.
   4. The cards on Home: the summary and why it matters get a little more room between lines, a few pixels a card. */

/* ── 1. The five sizes ───────────────────────────────────────────────────────────────────────────────────────────── */
[data-viewpanel="post"] { --rd-k: 1; --rd-t: 1; }
[data-viewpanel="post"][data-text-size="smaller"] { --rd-k: .88; --rd-t: .92; }
[data-viewpanel="post"][data-text-size="small"] { --rd-k: .94; --rd-t: .96; }
[data-viewpanel="post"][data-text-size="large"] { --rd-k: 1.12; --rd-t: 1.06; }
[data-viewpanel="post"][data-text-size="larger"] { --rd-k: 1.26; --rd-t: 1.12; }

/* ── 2. The pill and its panel ───────────────────────────────────────────────────────────────────────────────────── */
/* the row at the top of the post: the page's own way back at the left when it shows one (the top bar holds it on an inner
   page), Text size at the right */
html .pp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 18px; }
html .pp-top > .pp-back { margin: 0 0 0 -4px; }
html .rd { position: relative; margin-left: auto; }

/* the pill is the page's other pills (the way back, Follow, the actions): 44 px, a hairline, the sans at 15 px */
html .rd-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px 0 15px; border: 1px solid var(--cl-line-2); border-radius: 999px; background: var(--cl-surface); font-family: var(--cl-sans); font-size: 15px; font-weight: 400; line-height: 1; color: var(--cl-ink); cursor: pointer; transition: border-color .2s var(--cl-out), background-color .2s var(--cl-out); }
html .rd-btn > i { font-size: 19px; color: var(--cl-ink-2); }
@media (hover: hover) { html .rd-btn:hover { border-color: var(--cl-line-3); background: var(--cl-hover); } }
html .rd-btn[aria-expanded="true"] { border-color: transparent; background: var(--cl-surface-2); }
html .rd-btn:focus-visible, html .rd-a:focus-visible { outline: 2px solid var(--cl-lilac); outline-offset: 2px; }
html .rd-btn:active { scale: .97; }

/* the panel: under the pill, its right edge on the pill's; it opens from the pill with the family's spring */
html .rd-pop { position: absolute; top: calc(100% + 10px); right: 0; z-index: 40; width: 320px; max-width: calc(100vw - 32px); padding: 12px 12px 14px; border: 1px solid var(--cl-line-2); border-radius: 22px; background: var(--cl-surface); box-shadow: var(--cl-shadow-pop); transform-origin: calc(100% - 48px) -10px;
  opacity: 0; visibility: hidden; translate: 0 -6px; scale: .97; transition: opacity .14s var(--cl-out), translate .2s var(--cl-out), scale .2s var(--cl-out), visibility 0s linear .2s; }
html .rd.is-open .rd-pop { opacity: 1; visibility: visible; translate: 0 0; scale: 1; transition: opacity .2s var(--cl-out), translate .5s var(--cl-spring), scale .5s var(--cl-spring), visibility 0s; }
html .rd-pop__row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 4px; }

/* the two A's, in the serif the post is read in: the small one makes the text smaller, the large one larger */
html .rd-a { display: grid; width: 44px; height: 44px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; font-family: var(--cl-serif); font-weight: 400; line-height: 1; color: var(--cl-ink); cursor: pointer; transition: background-color .16s var(--cl-out), color .16s var(--cl-out), opacity .16s var(--cl-out); }
html .rd-a--less { font-size: 15px; }
html .rd-a--more { font-size: 25px; }
@media (hover: hover) { html .rd-a:not([aria-disabled="true"]):hover { background: var(--cl-hover); } }
html .rd-a:not([aria-disabled="true"]):active { background: var(--cl-press); }
html .rd-a[aria-disabled="true"] { color: var(--cl-ink-4); opacity: .4; cursor: default; }

/* the line and its five stops: the rail is the line without its ends, so the first and the last stop are not cut */
html .rd-track { position: relative; height: 44px; border-radius: 999px; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
/* the keyboard's ring is drawn round the dot, not round the whole line (clean.css rings every focusable thing with !important) */
html .rd-track:focus-visible { outline: 0 !important; }
html .rd-rail { position: absolute; top: 50%; left: 11px; right: 11px; height: 0; pointer-events: none; }
html .rd-line, html .rd-fill { position: absolute; top: -1px; left: 0; height: 2px; border-radius: 2px; }
html .rd-line { right: 0; background: var(--cl-line-2); }
html .rd-fill { width: calc(var(--rd-i, 2) * 25%); background: var(--cl-ink-3); transition: width .5s var(--cl-spring); }
/* each stop is a small bead on the line: in the line's ink up to the chosen one, in its grey after it */
html .rd-dot { position: absolute; top: -3px; left: calc(var(--rd-n) * 25%); width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--cl-line-3); background: color-mix(in srgb, var(--cl-ink-3) clamp(0%, calc((var(--rd-i, 2) - var(--rd-n) + 1) * 100%), 100%), var(--cl-line-3)); transition: background-color .3s var(--cl-out); }
html .rd-thumb { position: absolute; top: -9px; left: calc(var(--rd-i, 2) * 25%); width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--cl-ink); box-shadow: 0 0 0 3px var(--cl-surface), var(--cl-shadow-1); transition: left .5s var(--cl-spring), box-shadow .16s var(--cl-out); }
html .rd-track:focus-visible .rd-thumb { box-shadow: 0 0 0 3px var(--cl-surface), 0 0 0 5px var(--cl-lilac); }

/* the name of the chosen size, under the line */
html .rd-pop__now { margin: 2px 0 0; font-size: 13.5px; line-height: 1.3; text-align: center; color: var(--cl-ink-3); font-variant-numeric: tabular-nums; }

/* ── 2b. The control that follows the reader ─────────────────────────────────────────────────────────────────────── */
/* Once the top pill has gone up out of sight, a quiet round Aa takes its place, out of the way of the words
   (views/reading.js shows it and says where): */
/* the round Aa: 40 px, a hairline, the icon alone; its word is kept for a screen reader */
html .rd-btn--round { position: relative; justify-content: center; gap: 0; width: 40px; height: 40px; padding: 0; overflow: hidden; }
html .rd-btn--round > i { flex: none; font-size: 18px; }
html .rd-btn--round .rd-btn__w { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* a wide screen: in the margin at the left of the column, a third of the way down the window, still while the page moves.
   --rd-sr is the distance from the window's right edge to 20 px left of the column, --rd-st its height, --rd-pw the
   width its panel has in the margin. It comes with a soft rise and goes with a fade. On hover, or with the keyboard on
   it, the word opens out of it to the left, into the margin; the panel drops under it, its right edge on the Aa's. */
html .rd--side { position: fixed; z-index: 60; top: var(--rd-st, 30vh); right: var(--rd-sr, auto); margin: 0;
  opacity: 0; visibility: hidden; translate: 0 8px; transition: opacity .18s var(--cl-out), translate .3s var(--cl-out), visibility 0s linear .3s; }
html .rd--side.is-shown { opacity: 1; visibility: visible; translate: 0 0; transition: opacity .3s var(--cl-out), translate .6s var(--cl-spring), visibility 0s; }
html .rd--side .rd-btn--round { flex-direction: row-reverse; transition: width .42s var(--cl-spring), padding .42s var(--cl-spring), gap .42s var(--cl-spring), border-color .2s var(--cl-out), background-color .2s var(--cl-out); }
html .rd--side .rd-btn--round:is(:hover, :focus-visible, [aria-expanded="true"]) { width: 124px; padding: 0 13px 0 15px; gap: 8px; justify-content: space-between; }
html .rd--side .rd-btn--round:is(:hover, :focus-visible, [aria-expanded="true"]) .rd-btn__w { position: static; width: auto; height: auto; clip-path: none; font-size: 14.5px; }
html .rd--side .rd-pop { width: var(--rd-pw, 320px); }

/* a phone or a narrow window: in the top bar, left of Search, the bell's size and edge; its panel drops under the bar,
   across the screen's width less the gutters */
html .rd--bar { display: none; position: static; margin: 0; }
/* the round Aa comes in with a small soft growth; the button is what moves, never the wrapper, which holds the panel (a
   wrapper that moves would carry the panel's fixed place with it) */
html .rd--bar.is-shown { display: block; }
html .rd--bar.is-shown .rd-btn--round { animation: rd-in .42s var(--cl-spring); }
html #appTopbar .rd--bar .rd-btn--round { border-color: var(--cl-line-2); background: var(--cl-surface); }
html #appTopbar .rd--bar .rd-btn--round > i { color: var(--cl-ink-2); }
html #appTopbar .rd--bar .rd-btn--round[aria-expanded="true"] { background: var(--cl-surface-2); }
html .rd--bar .rd-pop { position: fixed; top: 70px; left: 16px; right: 16px; width: auto; max-width: none; transform-origin: 70% -10px; }
@keyframes rd-in { from { opacity: 0; scale: .86; } to { opacity: 1; scale: 1; } }
/* the bar stays while its panel is open, even when the page moves under it */
html.rd-bar-open body #appTopbar.topbar-hidden { transform: none; }

/* while a size is being changed down in the post, views/reading.js keeps the paragraph in view in its place; the browser's
   own way of keeping something in place stands aside for that moment, so the two never pull against each other */
html.rd-holding { overflow-anchor: none; }

/* ── 3. The post's words change size softly ──────────────────────────────────────────────────────────────────────── */
html [data-viewpanel="post"] .pp-read :is(.pp-title, .pp-sum p, .pp-part__h, .pp-part p, .pp-find h2, .pp-find li > span, .pp-ask p) { transition: font-size .4s var(--cl-out); }

/* With motion reduced, index.html turns every change of every element into a transition of a hundredth of a millisecond;
   a line still "hidden" in that first instant cannot take the focus. So the panel, the pill that follows and everything
   inside them change at once, with no transition at all. */
@media (prefers-reduced-motion: reduce) {
  html :is(.rd-pop, .rd--side, .rd--bar), html :is(.rd-pop, .rd--side, .rd--bar) * { translate: none; scale: none; transition: none !important; animation: none !important; }
  html .rd-fill, html .rd-thumb, html .rd-btn, html .rd-a, html [data-viewpanel="post"] .pp-read :is(.pp-title, .pp-sum p, .pp-part__h, .pp-part p, .pp-find h2, .pp-find li > span, .pp-ask p) { transition: none; }
}
html.a11y-reduce-motion :is(.rd-pop, .rd--side, .rd--bar), html.a11y-reduce-motion :is(.rd-pop, .rd--side, .rd--bar) * { translate: none; scale: none; transition: none !important; animation: none !important; }

/* ── 4. The cards on Home: a little more room between lines ──────────────────────────────────────────────────────── */
/* the summary 1.6 to 1.7, why it matters 1.5 to 1.6, the shorter summary under a why 1.55 to 1.65; the list view keeps its
   own tighter lines (views/feed.css and clean.css name it with #feed, which wins) */
html .fc .fc-sum { line-height: 1.7; }
html body .fc .fc-body > :is(.fc-why, .fc-quest) { line-height: 1.6; }
html body .fc .fc-body > :is(.fc-why, .fc-quest) + .fc-sum { line-height: 1.65; }
