/*
 * Distant view.
 *
 * Every rule here starts with `body.wl-view-distant` or a class this view
 * invented (`wl-d*`, `wld-*`). Nothing in this file can reach the street view:
 * that view keeps its own selectors and its own option, and the two are chosen
 * per request. The few shared pieces below — the view switch, the skip link —
 * are written for both views on purpose, because they exist on both.
 *
 * Two ideas hold the layout together:
 *
 * 1. The scenery is one fixed layer at the bottom of the window, anchored to
 *    the painted ground, with the character standing inside it. Because it is
 *    fixed, a long article cannot push the character around or leave it behind.
 *
 * 2. The page itself never scrolls: the shell is exactly one visible window
 *    tall, and the reading container is the one thing that scrolls — on a
 *    phone too. A phone previously scrolled the whole document instead, which
 *    produced a second scrollbar, swallowed the first seconds of the wheel and
 *    let the article push the character off the screen.
 *
 * 3. The scenery paints *over* the content. Its transparent upper part lets the
 *    article through; its painted ground and branches cover the text behind
 *    them, which is what makes the last part of a long article disappear into
 *    the picture instead of stopping on a hard line above it. The container
 *    therefore runs to the bottom of the window, and the scroll gets enough
 *    padding at its end for the last paragraph, file link and button to be
 *    brought up above the painted band.
 */

/* =========================================================================
   0. Shell
   The page is white. The artwork's transparent upper two thirds simply show
   this white: no gradient, no veil, no second background.
   ========================================================================= */

body.wl-view-distant {
	background-color: #ffffff;
	color: var(--wl-d-ink);
	/* One visible window, and the page inside it. The switch and the site's
	   blocks are the two flex children, so a switch that sits in the flow (a
	   narrow screen) takes its own height and the view underneath fills the
	   rest. Nothing on `body` or `html` is hidden: the shell simply has no
	   second scrollbar to hide, because it is exactly the height of the
	   window. */
	height: calc(100svh - var(--wp-admin--admin-bar--height, 0px));
	display: flex;
	flex-direction: column;
}

body.wl-view-distant .wp-site-blocks {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

/* Body copy switches to the font pair the owner chose. The pair is a pair:
   the display face never travels alone. */
body.wl-view-distant {
	font-family: var(--wl-d-font-body);
}

body.wl-view-distant h1,
body.wl-view-distant h2,
body.wl-view-distant h3,
body.wl-view-distant h4,
.wld-title,
.wld-top__title {
	font-family: var(--wl-d-font-display);
}

/* The switch itself.

   It is printed on every page of both views by `wp_body_open`, so it is styled
   once, here, for both. Small and quiet: it is a preference, not navigation,
   and it must never compete with the name or the reading column. The two links
   are real links, so it works with no script at all. */
.wl-viewswitch {
	position: fixed;
	top: 10px;
	left: 10px;
	z-index: 40;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px 4px 10px;
	border: 1px solid rgba(44, 42, 37, 0.14);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.86);
	box-shadow: 0 1px 1px rgba(44, 42, 37, 0.04), 0 8px 20px -14px rgba(44, 42, 37, 0.5);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	font-size: 12px;
	line-height: 1;
	letter-spacing: 0.02em;
}

.admin-bar .wl-viewswitch {
	top: 42px;
}

.wl-viewswitch__label {
	color: var(--wp--preset--color--ink-soft, #6a6459);
	font-size: 11px;
	letter-spacing: 0.08em;
}

.wl-viewswitch ul {
	display: flex;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wl-viewswitch__link {
	display: block;
	padding: 5px 9px;
	border-radius: 999px;
	color: var(--wp--preset--color--ink-soft, #6a6459);
	text-decoration: none;
}

.wl-viewswitch__link:hover,
.wl-viewswitch__link:focus-visible {
	background: rgba(44, 42, 37, 0.06);
	color: var(--wp--preset--color--ink, #2c2a25);
}

.wl-viewswitch__link.is-current {
	background: var(--wp--preset--color--ink, #2c2a25);
	color: #ffffff;
	font-weight: 600;
}

/* The effect switch, at the right end of the same pill.

   It is a separator away from the layout links because the two are different
   kinds of decision — which view you are reading, and whether the air is
   moving — and pressing one must never look like pressing the other. The
   hairline is drawn on the wrapper so the button keeps its own round shape. */
.wl-viewswitch__fx {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-inline-start: 2px;
	padding-inline-start: 8px;
	border-inline-start: 1px solid rgba(44, 42, 37, 0.14);
}

.wl-viewswitch__fxbutton,
.wl-viewswitch__fxselect {
	appearance: none;
	margin: 0;
	border: 1px solid transparent;
	border-radius: 999px;
	background: transparent;
	color: var(--wp--preset--color--ink-soft, #6a6459);
	font: inherit;
	font-size: 12px;
	line-height: 1;
	letter-spacing: 0.02em;
	padding: 5px 9px;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wl-viewswitch__fxselect {
	padding-inline-end: 22px;
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
		linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 12px) 50%, calc(100% - 8px) 50%;
	background-size: 4px 4px, 4px 4px;
	background-repeat: no-repeat;
}

.wl-viewswitch__fxbutton:hover,
.wl-viewswitch__fxselect:hover {
	background-color: rgba(44, 42, 37, 0.06);
	color: var(--wp--preset--color--ink, #2c2a25);
}

.wl-viewswitch__fxbutton:focus-visible,
.wl-viewswitch__fxselect:focus-visible {
	outline: 2px solid #78866a;
	outline-offset: 1px;
}

/* Running, the button says 停止特效 and is filled — the same inversion the
   current layout link uses, so "something is on" reads the same way twice. */
.wl-viewswitch__fxbutton[aria-pressed="true"] {
	background: var(--wp--preset--color--ink, #2c2a25);
	border-color: var(--wp--preset--color--ink, #2c2a25);
	color: #ffffff;
	font-weight: 600;
}

.wl-viewswitch__fxbutton[aria-pressed="true"]:hover {
	background: var(--wp--preset--color--ink, #2c2a25);
	color: #ffffff;
}

/* The scene dropdowns, one per view.

   The view keeps being a link; the caret beside it is the control that opens
   that view's scene list. The list is positioned against its own `<li>`, so
   each view's menu opens under that view rather than under the toolbar as a
   whole, and the two lists never fight for the same anchor. */

/* `display:flex` above would beat the user agent's `[hidden] { display: none }`
   and lay every closed menu out as an open row — the one rule that has to win,
   restated. */
.wl-viewswitch ul.wl-viewswitch__menu[hidden] {
	display: none;
}

.wl-viewswitch__view {
	position: relative;
}

.wl-viewswitch__caret {
	appearance: none;
	margin: 0;
	border: 1px solid transparent;
	border-radius: 999px;
	background: transparent;
	color: var(--wp--preset--color--ink-soft, #6a6459);
	font: inherit;
	line-height: 1;
	padding: 5px 4px;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

/* The caret is a drawn triangle, the same three-sided arrow the effect select
   uses, so the two "this opens a list" gestures look alike. */
.wl-viewswitch__caret::before {
	content: "";
	display: block;
	width: 7px;
	height: 7px;
	margin: 0 auto;
	border-inline-end: 1.5px solid currentColor;
	border-block-end: 1.5px solid currentColor;
	transform: rotate(45deg) translateY(-1px);
	transition: transform 0.15s ease;
}

.wl-viewswitch__caret:hover,
.wl-viewswitch__caret:focus-visible {
	background: rgba(44, 42, 37, 0.06);
	color: var(--wp--preset--color--ink, #2c2a25);
	outline: none;
}

.wl-viewswitch__caret:focus-visible {
	outline: 2px solid #78866a;
	outline-offset: 1px;
}

/* Open: the triangle turns to face up, the same inversion a select shows. */
.wl-viewswitch__caret[aria-expanded="true"] {
	background: rgba(44, 42, 37, 0.06);
	color: var(--wp--preset--color--ink, #2c2a25);
}

.wl-viewswitch__caret[aria-expanded="true"]::before {
	transform: rotate(-135deg) translateY(-1px);
}

.wl-viewswitch__menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 41;
	display: block;
	box-sizing: border-box;
	min-width: 148px;
	margin: 0;
	padding: 4px;
	border: 1px solid rgba(44, 42, 37, 0.14);
	border-radius: 10px;
	background: #ffffff;
	box-shadow: 0 1px 1px rgba(44, 42, 37, 0.04), 0 10px 24px -12px rgba(44, 42, 37, 0.45);
	list-style: none;
}

.wl-viewswitch__menu li {
	display: block;
}

.wl-viewswitch__scene {
	display: block;
	box-sizing: border-box;
	max-width: 240px;
	padding: 6px 9px;
	border-radius: 7px;
	color: var(--wp--preset--color--ink-soft, #6a6459);
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wl-viewswitch__scene:hover,
.wl-viewswitch__scene:focus-visible {
	background: rgba(44, 42, 37, 0.06);
	color: var(--wp--preset--color--ink, #2c2a25);
}

/* The scene being looked at, marked the way the current view link is marked. */
.wl-viewswitch__scene.is-current {
	background: rgba(44, 42, 37, 0.08);
	color: var(--wp--preset--color--ink, #2c2a25);
	font-weight: 600;
}

.wl-viewswitch__default {
	margin-inline-start: 6px;
	padding: 1px 5px;
	border-radius: 999px;
	background: rgba(120, 134, 106, 0.16);
	color: #5c6650;
	font-size: 10px;
	letter-spacing: 0.04em;
}

.wl-viewswitch__empty {
	padding: 6px 9px;
	color: var(--wp--preset--color--ink-soft, #6a6459);
	white-space: nowrap;
}

/* A menu anchored under a centered item can still reach past the window edge
   when the item sits near it; the small screens keep both menus clamped to the
   window instead of trusting the anchor. */
@media (max-width: 860px) {
	.wl-viewswitch__menu {
		left: 50%;
		transform: translateX(-50%);
		max-width: min(260px, calc(100vw - 24px));
	}

	.wl-viewswitch__scene {
		max-width: none;
	}
}

/* Below this width the floating pill sits on top of the page's own first line —
   the name on the front page, the site title on a reading page — because the
   narrowest layouts start their text at the very top left (without an admin
   bar the reading window's padding cannot keep clear of a 42px pill). A switch
   that covers the page it switches is not a switch. It becomes an ordinary bar
   above the page instead: it covers nothing, and at these widths the reading
   page scrolls inside its own column, so the switch has to be carried by the
   shell, not by the column — a switch that scrolls away with the article
   cannot switch the view back.

   The breakpoint matches the layout breakpoint of this file and `narrow()` in
   distant.js (860px): below it both views are single-column anyway, so an
   in-flow switch fits. On the reading pages the shell's `--wl-d-controls-top`
   and `--wl-d-controls-h` — which measure the floating pill, not this row —
   are zeroed so no second strip is reserved. On the front page the switch
   sits in the flow above the page as before. Wider windows keep the floating
   pill, where it has room of its own. */
@media (max-width: 860px) {
	/* Flush with the top of the visible window, full width, and in the flow, so
	   it covers neither the name above it nor the first line below it. The top
	   padding carries the notch: `env(safe-area-inset-top)` is 0 on a desktop
	   browser and 44–59px on a phone in landscape-under-a-notch, and a pill
	   tucked under the notch is a pill nobody can press. The side paddings do
	   the same for rounded corners. */
	.wl-viewswitch {
		position: static;
		width: 100%;
		box-sizing: border-box;
		margin: 0;
		padding: calc(env(safe-area-inset-top, 0px) + 7px)
			max(10px, env(safe-area-inset-right, 0px))
			7px
			max(10px, env(safe-area-inset-left, 0px));
		border: 0;
		border-bottom: 1px solid rgba(44, 42, 37, 0.1);
		border-radius: 0;
		background: rgba(255, 255, 255, 0.94);
		box-shadow: none;
		justify-content: center;
		flex-wrap: wrap;
		row-gap: 4px;
	}

	.wl-viewswitch ul {
		flex-wrap: wrap;
		justify-content: center;
	}

	.admin-bar .wl-viewswitch {
		margin-top: 0;
	}

	/* The switch is in the flow at this width, so the reading window no longer
	   has to reserve a fixed strip for a floating control: the flow itself puts
	   the page below it. */
	body.wl-view-distant {
		--wl-d-controls-top: 0px;
		--wl-d-controls-h: 0px;
	}
}

/* Switching is a page load. The content fades in rather than moving, and the
   character's view-transition name is dropped in this view so the change of
   composition never zooms one portrait into the other. */
body.wl-view-distant .wp-site-blocks {
	animation: wl-d-in 420ms var(--wp--custom--ease--soft, ease) both;
}

@keyframes wl-d-in {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

body.wl-view-distant .wl-ip {
	view-transition-name: none;
}

body.wl-view-distant ::view-transition-old(root),
body.wl-view-distant ::view-transition-new(root) {
	animation-duration: 320ms;
}

/* The shell is exactly one window tall, so the page itself never scrolls.

   Nothing here hides overflow on `body` or `html`: that would hide the symptom
   and leave every other page of the site paying for it. The distant view's shell
   is one visible window minus the admin bar, and each screen inside it fills
   what is left and carries its own single scrolling column — so the document
   simply has nothing to scroll. A short window then shortens those columns
   instead of growing a second scrollbar.

   The admin bar is subtracted rather than ignored: WordPress puts the whole
   document 32px down (`html` margin), so a shell that claimed the full 100svh
   under it made the page 32px too tall — a second scrollbar of exactly one
   admin bar, which is what the old layout had.

   Filled by the flex column, not by a percentage height: a percentage would
   resolve against the parent's height, which is itself only known once the
   child has been measured. As a growing flex item the height is definite from
   the start, which is what lets the column inside be a scroller instead of
   growing to its content. */
body.wl-view-distant .wld-home,
body.wl-view-distant .wld-read {
	flex: 1 1 auto;
	min-height: 0;
}

/* A view transition paints a `::view-transition` overlay across the whole
   window for as long as the transition runs. That overlay is hit-testable by
   default, so the first seconds of a wheel spin land on it and go nowhere: the
   article looks frozen until the transition ends. It is a picture of the old
   page, never something to click, so the pointer goes straight through it — for
   this view only, and with `:has(> body…)` so a browser without `:has()` simply
   ignores the rule. */
html:has(> body.wl-view-distant)::view-transition,
html:has(> body.wl-view-distant)::view-transition-group(*),
html:has(> body.wl-view-distant)::view-transition-image-pair(*),
html:has(> body.wl-view-distant)::view-transition-old(*),
html:has(> body.wl-view-distant)::view-transition-new(*) {
	pointer-events: none !important;
}

/* =========================================================================
   1. The scene
   A photograph-shaped strip at the bottom of the window. The file is 3:2 with
   everything painted into the lower third and the outer edges, so the strip is
   as tall as the file is at full width and anchored to the bottom; the top of
   the box is transparent and shows the page.
   ========================================================================= */

.wl-dscene {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	/* Above the reading container, below the navigation surfaces (which are
	   popovers in the top layer and therefore always above this). The content
	   scrolls behind this layer: the file's transparent sky lets the article
	   through, its painted ground and branches cover the rest, and the last
	   paragraphs of a long article sink into the picture instead of stopping at
	   a hard edge above it. */
	z-index: 6;
	/* Height is set per layer, never by stretching the file. The artwork is
	   drawn at the file's own 3:2 across the full width and anchored to the
	   bottom, so a shorter box crops transparent sky and, on the reading layer,
	   the tops of the far branches — never a side of the composition and never
	   a squashed horizon. */
	height: var(--wl-d-scene-h);
	width: 100%;
	/* The scenery is a picture, not a control: it must never take a wheel spin
	   or a click meant for the page. Controls printed inside it opt back in. */
	pointer-events: none;
	/* The dog's painted head reaches a hair past its own box at the far end of
	   its walk, so the page would grow a horizontal scrollbar of one or two
	   pixels on a narrow screen — the one thing a full-bleed layer must never
	   do. Only the horizontal axis is clipped: the speech cloud legitimately
	   rises above this box and cutting it in both axes would decapitate it. */
	overflow-x: clip;
	overflow-y: visible;
}

.wl-dscene a,
.wl-dscene button {
	pointer-events: auto;
}

.wl-dscene__art {
	position: absolute;
	inset: 0;
	background-image: var(--wl-d-scene);
	background-repeat: no-repeat;
	/* Width-fit, bottom-anchored: the file keeps its proportions at every
	   window width, and the box's own height decides how much of the sky above
	   the horizon is kept. */
	background-position: bottom center;
	background-size: 100% auto;
	/* No veil on the artwork. The front page shows the picture exactly as it
	   was painted: the window's own edges cut it, and a cut at the edge of a
	   full-bleed picture reads as framing, not as a flaw. The reading layer
	   adds the one softening it needs, in its own rule below. */
}

/*
 * The reading layer's horizontal mist.
 *
 * On a reading page the strip's own top edge is a horizontal cut through
 * whatever the picture paints there — the tops of the far branches — and a
 * branch that stops on a line reads as truncation. The gradient below turns
 * the artwork's own top band transparent, so the cut dissolves into the
 * page's white as one full-width horizontal mist. The two window edges are
 * deliberately not touched: a fade down each side is what read as two
 * vertical white bands, and that is not coming back.
 *
 * The fog is a mask on the picture, not a white sheet over it, and that is
 * what keeps the layering honest. Masked pixels simply stop painting, so:
 *
 * - Text, images, video, tables and controls are always "above the fog" —
 *   there is nothing there to fog them; whatever scrolls behind the band
 *   shows at full contrast.
 * - The painted ground at the bottom is outside the band and keeps painting
 *   solidly, so it still covers the content that slides in behind it. Fog
 *   and ground are handled as separate parts of the layer: one stops
 *   painting, the other never does.
 * - A mask is not an element: it can never take a click, a hover or a wheel
 *   spin, and the reading container's lower edge is untouched.
 */
.wl-dscene--read .wl-dscene__art {
	-webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 38%);
	mask-image: linear-gradient(to bottom, transparent 0, #000 38%);
}

/* Without a chosen file the layer is simply white: no placeholder box, because
   an empty frame at the bottom of the page would read as a broken image. */
.wl-dscene:not([style*="--wl-d-scene"]) .wl-dscene__art {
	background-image: none;
}

/* A soft edge where the painted ground meets the white page, so the strip does
   not end on a hard horizontal line across the screen.

   Removed. It was a white gradient laid across the top of the picture — the
   same pixels the content is supposed to show through — and with the scenery
   now painting over the article it fogged the text behind it as well. The
   artwork's own transparent sky already does the job: there was never a hard
   line to soften, only a second veil to take away. The reading layer's own
   horizontal mist is the one exception (see `.wl-dscene--read` above), and it
   lives on the scene layer where it cannot fog the column. */

/* --wl-d-scene-h: how tall the fixed strip is. On the front page it is the
   file's own 3:2 across the full width — the dark framing sits in the left and
   right edges of the picture and only reads as framing when the picture reaches
   the sides — capped by the window so a very wide screen does not fill itself
   with scenery.

   There used to be a second number next to it, `--wl-d-band`: how much of the
   bottom belonged to the scenery and had to stay clear of text. The content now
   runs behind the picture instead of stopping above it, so nothing reserves
   that band any more and the number is gone. What is left is the strip itself,
   which is also the amount of padding the scrollers put at their end — the
   room that lets the last paragraph be scrolled up in front of the picture. */
body.wl-view-distant {
	--wl-d-scene-h: min(calc(100vw * 2 / 3), 100svh);
	--wl-d-ip-base: clamp(170px, 30vh, 360px);
	--wl-d-ground-line: clamp(8px, 1.8vh, 26px);
	--wl-d-pad: clamp(20px, 3.4vw, 56px);
	/* Where the "版面 / 街景 / 遠景" switch sits and how tall it is. The reading
	   window starts level with it and reserves that height, so the two never
	   land on the same pixels. Kept next to the other scene metrics because it
	   is one more thing measured from the top of the window. */
	--wl-d-controls-top: 10px;
	--wl-d-controls-h: 30px;
	/* The page's own paper. The reading container is painted this colour, so a
	   container that reaches down over the scenery is a sheet of the same paper
	   the page is printed on, not a panel.

	   The value itself is not set here: it is the owner's 「閱讀區底色」, printed
	   onto `:root` with the other distant tokens. A literal in this block would
	   outrank that (body.wl-view-distant is more specific than :root) and the
	   field would appear to save and change nothing — which is exactly what it
	   did until the literal was removed. The `var(…, #ffffff)` fallbacks at the
	   two places that paint it keep an un-tokenised page white. */
}

body.wl-view-distant.admin-bar {
	--wl-d-controls-top: 42px;
}

/* The standing point: the figure's own box bottom is the base line, and the
   transparent band under the character's painted feet is measured by front.js
   and added back as a downward shift, so the feet land on the ground rather
   than the frame.

   The scene's whole-group nudge rides on `translate` — the independent
   transform axis — so it adds to the centring and the foot shift without ever
   having to rewrite them. The dog reads the same tokens on its own box, so the
   two move as one group and their distance stays what the settings set. */
.wl-dscene .wl-ip {
	position: absolute;
	inset-block-end: calc(var(--wl-d-ground-line) + var(--wl-d-ip-ground, 0px));
	inset-inline-start: var(--wl-d-ip-x, 62%);
	width: var(--wl-d-ip-h);
	height: var(--wl-d-ip-h);
	margin: 0;
	transform: translate(-50%, var(--wl-art-foot, 0px));
	translate: var(--wl-scene-dx-d, 0px) calc(-1 * var(--wl-scene-dy-d, 0px));
}

.wl-dscene .wl-ip__stage {
	position: absolute;
	inset: 0;
}

/*
 * The stage is a grid, and a percentage height inside a grid area whose height
 * depends on its contents resolves to `auto` — which is how a portrait video
 * ends up 171px wide and 304px tall in a 171px box, spilling below the scene and
 * lengthening the page. Absolute positioning resolves the same percentage
 * against the stage's padding box, which has a definite height here, so the
 * three layers fill the square the stylesheet sized.
 */
.wl-dscene .wl-ip__img,
.wl-dscene .wl-ip__motion,
.wl-dscene .wl-ip__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: bottom center;
	filter: drop-shadow(0 18px 26px rgba(70, 63, 48, 0.2));
}

/* The cloud hangs above the head. Its bottom is placed at the stage's top plus
   the configured gap, and the cloud's own translateY(--wl-art-top) — the one
   front.js measures — brings it down to exactly the painted head; that is how
   both views read the same distance without either of them guessing where the
   transparent margin ends.

   The two knobs: gap is distance from the head, lift is the cloud's own
   vertical nudge. Both are one number from one slider, and the settings label
   which way is up.

   `translate` is a separate axis from `transform`, which already carries the
   side placement. distant.js writes the distance the cloud would leave the
   window by when the figure stands near an edge — a phone puts the reading
   layer's figure at 86%, and a centred cloud there loses its right half. */
.wl-dscene .wl-bubble-slot {
	position: absolute;
	inset-block-end: calc(var(--wl-d-ip-h) + var(--wl-d-cloud-gap, 0px) - var(--wl-d-cloud-lift, 0px));
	left: 50%;
	width: max-content;
	/* The ceiling is the one size control this view has (see "cloud_max" in
	   distant.php); 20rem stays as the fallback for a page whose tokens have
	   not been printed. */
	max-width: min(var(--wl-d-cloud-cap, 20rem), 78vw);
	margin: 0;
	transform: translateX(-50%);
	/* The owner's nudge plus the script's edge correction, added rather than
	   swapped: one is a composition decision, the other keeps the cloud on
	   screen, and neither should be able to erase the other. */
	translate: calc(var(--wl-d-cloud-shift, 0px) + var(--wl-d-cloud-x, 0px)) 0;
	transition: inset-block-end 160ms ease, top 160ms ease, left 160ms ease, transform 160ms ease, translate 160ms ease;
}

/*
 * The cloud is as wide as its own sentence.
 *
 * It used to be `clamp(11rem, 22vw, 17rem)` — a fixed width, so a two-word
 * sentence got the same wide box as a full one and the words floated in the
 * middle of it. `fit-content` is the widest line's own width; `min-width` keeps
 * a one-word cloud from collapsing into a lozenge, and the ceiling is the
 * owner's "cloud_max" rather than a hard-coded 17rem.
 *
 * This is a width, not a `transform: scale`: the words keep their own size and
 * only the silhouette grows around them, which is also why a longer sentence
 * wraps at the ceiling instead of shrinking its own type.
 */
.wl-dscene .wl-bubble {
	width: fit-content;
	min-width: min(11rem, 100%);
	max-width: min(var(--wl-d-cloud-cap, 20rem), 78vw);
}

/* Per layer: size, horizontal position, ground offset and cloud geometry. */
.wl-dscene--home {
	--wl-d-ip-scale: var(--wl-d-home-ip-scale, 0.92);
	--wl-d-ip-x: var(--wl-d-home-ip-x, 62%);
	--wl-d-ip-ground: var(--wl-d-home-ip-ground, 0px);
	--wl-d-cloud-gap: var(--wl-d-home-cloud-gap, 0px);
	--wl-d-cloud-lift: var(--wl-d-home-cloud-lift, 0px);
	--wl-d-cloud-x: var(--wl-d-home-cloud-x, 0px);
	--wl-d-ip-h: calc(var(--wl-d-ip-base) * var(--wl-d-ip-scale));
}

.wl-dscene--read {
	--wl-d-ip-scale: var(--wl-d-read-ip-scale, 0.58);
	--wl-d-ip-x: var(--wl-d-read-ip-x, 82%);
	--wl-d-ip-ground: var(--wl-d-read-ip-ground, 0px);
	--wl-d-cloud-gap: var(--wl-d-read-cloud-gap, 0px);
	--wl-d-cloud-lift: var(--wl-d-read-cloud-lift, 0px);
	--wl-d-cloud-x: var(--wl-d-read-cloud-x, 0px);
	--wl-d-ip-h: calc(var(--wl-d-ip-base) * var(--wl-d-ip-scale));
}

/*
 * Where the cloud sits relative to the figure.
 *
 * `above` is the default and what this layer always did: centred over the head,
 * tail hanging straight down. `left` and `right` move the cloud beside the
 * figure instead — the head is no longer under the cloud, so the tail has to be
 * aimed back at it, which is what the last rule does.
 *
 * The figure never moves to meet the cloud. Someone setting the cloud to one
 * side asked for the figure to stay where it is.
 *
 * In the two side placements the rule further down places the cloud by its own
 * top edge; the comments there explain why that is the only measurement that
 * means anything beside a head.
 */
.wl-dscene .wl-bubble-slot {
	/* The measured head, plus the two knobs: gap is distance from the head,
	   lift is the cloud's own vertical nudge. Both are one number from one
	   slider, and the settings label which way is up. */
	inset-block-end: calc(var(--wl-d-ip-h) + var(--wl-d-cloud-gap, 0px) - var(--wl-d-cloud-lift, 0px));
	/* A separate axis from `transform`, which already carries the side
	   placement. distant.js writes the distance the cloud would leave the
	   window by when the figure stands near an edge — a phone puts the reading
	   layer's figure at 86%, and a centred cloud there loses its right half. */
	/* The owner's nudge plus the script's edge correction, added rather than
	   swapped: one is a composition decision, the other keeps the cloud on
	   screen, and neither should be able to erase the other. */
	translate: calc(var(--wl-d-cloud-shift, 0px) + var(--wl-d-cloud-x, 0px)) 0;
	transition: inset-block-end 160ms ease, left 160ms ease, transform 160ms ease, translate 160ms ease;
}

.wl-dscene--cloud-left .wl-bubble-slot,
.wl-dscene--cloud-right .wl-bubble-slot {
	/*
	 * A side cloud hangs beside the head, so its own top edge is what has to
	 * clear the head — not its bottom edge.
	 *
	 * With the cloud above the head, the number that mattered was the gap
	 * between the cloud's *bottom* and the painted head. Beside the head that
	 * measurement is meaningless: the silhouette's top edge is what the reader
	 * sees next to the character, so it is the top edge that is placed. The
	 * slot is measured down from the top of the figure's frame, and front.js
	 * supplies the distance from that frame to the first painted row — the
	 * actual head — as --wl-art-top. The 26px is the silhouette's own overhang
	 * (13px above its box) plus the air the default should keep: the top of the
	 * visible outline lands a little under the head, never across it.
	 *
	 * The gap slider still works, with the same wording as before: positive
	 * moves the cloud further from the head, negative brings it closer.
	 */
	inset-block-end: auto;
	top: calc(var(--wl-art-top, 0px) + 26px + var(--wl-d-cloud-gap, 0px) - var(--wl-d-cloud-lift, 0px));
}

/* The bubble's own downward shift exists to skip the transparent band when the
   cloud hangs above the head. In the side placements that band is already
   counted by the slot above, so applying it a second time would drop the cloud
   half a head lower than it was asked to be. */
.wl-dscene--cloud-left .wl-bubble,
.wl-dscene--cloud-right .wl-bubble {
	transform: translateY(var(--wl-cloud-shift, 0px));
}

.wl-dscene--cloud-left .wl-bubble-slot {
	/*
	 * Offset from the figure, not from the scene.
	 *
	 * The slot lives inside `.wl-ip`, whose width is the figure's own height, so
	 * a percentage here resolves against that small box — not against the scene
	 * that `--wl-d-ip-x` talks about. Sizing the offset from `--wl-d-ip-h`
	 * alone keeps "beside the head" true wherever the owner stands the
	 * character, including the reading layer's 18%.
	 */
	left: calc(var(--wl-d-ip-h) * 0.42);
	transform: translateX(-100%);
	/*
	 * A side cloud only has the room between the figure and that edge. The cap
	 * is measured by distant.js, which is the one place that knows how wide the
	 * window and the scene actually turned out; the fallback keeps a cloud on
	 * screen even with scripting off. Narrowing beats hanging off the edge: the
	 * copy is the point, and half a sentence is worse than a short line.
	 */
	max-width: min(var(--wl-d-cloud-cap, 20rem), 78vw, var(--wl-d-cloud-max, 20rem));
}

.wl-dscene--cloud-right .wl-bubble-slot {
	left: calc(var(--wl-d-ip-h) * 0.58);
	transform: translateX(0);
	max-width: min(var(--wl-d-cloud-cap, 20rem), 78vw, var(--wl-d-cloud-max, 20rem));
}

/* The tail, aimed back at the figure. On the left the cloud sits left of the
   head, so the tail sits on the cloud's right side and points right; mirrored
   on the right. The three dots already fan out along --wl-trail-dir. */
.wl-dscene--cloud-left .wl-bubble__trail {
	left: 82%;
	--wl-trail-dir: 1;
}

.wl-dscene--cloud-right .wl-bubble__trail {
	left: 18%;
	--wl-trail-dir: -1;
}

/* Bubbles alternate between two shapes; on the side placements both shapes put
   their tail on the side facing the figure, otherwise the tail would drift back
   to the middle with every rotation. */
.wl-dscene--cloud-left .wl-bubble[data-cloud="b"] .wl-bubble__trail {
	left: 90%;
}

.wl-dscene--cloud-right .wl-bubble[data-cloud="b"] .wl-bubble__trail {
	left: 10%;
}

/* -------------------------------------------------------------------------
   The cloud's fill, outline and silhouette.

   The default is exactly the cloud this site already had: the theme's card
   colour, no outline, and the soft puffy shape built from a base blob plus two
   lobes. Everything below is opt-in, and every variant keeps the same text
   box — only the shape drawn behind the words changes, so wrapping, rotation
   and the pause control behave identically in all three.

   The fill is set on the silhouette and on the three trail dots together,
   because the dots are part of the same cloud: a cream body with grey dots
   reads as a mistake, not as a style.
   ------------------------------------------------------------------------- */

.wl-dscene .wl-bubble__cloud {
	background: var(--wl-d-cloud-fill, #FBF7EE);
}

.wl-dscene .wl-bubble__trail i {
	background: var(--wl-d-cloud-fill, #FBF7EE);
}

/* 1. "cloud" is the default and the original: the theme's own radius and lobes
   are the shape. No overrides — this comment is here so the file says out loud
   that "cloud" means unchanged, not "one of the two new ones". */

/* 2. Rounded speech box: a proper rectangle with generous corners, and the
   lobes switched off — a rounded box with circles stuck to its sides is
   neither shape. */
.wl-dscene--shape-round .wl-bubble__cloud {
	inset: -10px -14px -8px;
	border-radius: 16px;
}

/* 3. Ellipse: one smooth oval, slightly wider than it is tall, so the text
   inside still gets a comfortable line. */
.wl-dscene--shape-ellipse .wl-bubble__cloud {
	inset: -18px -22px -16px;
	border-radius: 50%;
}

/* The lobes belong to the lobed silhouettes only: a rounded box or an oval
   with circles stuck to its sides is neither shape. */
.wl-dscene--shape-round .wl-bubble__cloud::before,
.wl-dscene--shape-round .wl-bubble__cloud::after,
.wl-dscene--shape-ellipse .wl-bubble__cloud::before,
.wl-dscene--shape-ellipse .wl-bubble__cloud::after {
	display: none;
}

/* 4. Puffy cloud: five round puffs of different sizes around a low base. The
   puffs are real boxes rather than extra radii, because a border-radius can
   describe one contour and a cloud is a row of humps; and they are sized in
   percent, so the whole silhouette keeps its proportions when the cloud grows
   to fit a longer sentence (the cloud is auto-sized, see front.js).
   The three `i` children exist for this shape and the one below; the default
   silhouette leaves them empty and invisible. */
.wl-dscene--shape-puffy .wl-bubble__cloud {
	inset: -20px -18px -15px;
	border-radius: 46% 54% 44% 56% / 62% 64% 42% 40%;
}

.wl-dscene--shape-puffy .wl-bubble__cloud::before {
	display: block;
	left: 4%;
	top: -26%;
	width: 34%;
	height: 74%;
}

.wl-dscene--shape-puffy .wl-bubble__cloud::after {
	display: block;
	right: 2%;
	top: -20%;
	width: 30%;
	height: 62%;
}

.wl-dscene--shape-puffy .wl-bubble__cloud i {
	position: absolute;
	display: block;
	background: inherit;
	border-radius: 50%;
}

.wl-dscene--shape-puffy .wl-bubble__cloud i:nth-child(1) {
	left: -7%;
	top: 8%;
	width: 30%;
	height: 70%;
}

.wl-dscene--shape-puffy .wl-bubble__cloud i:nth-child(2) {
	left: 40%;
	top: -32%;
	width: 26%;
	height: 56%;
}

.wl-dscene--shape-puffy .wl-bubble__cloud i:nth-child(3) {
	right: -6%;
	top: 14%;
	width: 26%;
	height: 60%;
}

/* 5. Flat, soft cloud: a long low body with three shallow humps along its top
   edge. It reads as a wide thought cloud, so it suits a longer sentence, and it
   is deliberately the lowest of the five. */
.wl-dscene--shape-flat .wl-bubble__cloud {
	inset: -13px -20px -9px;
	border-radius: 44% 56% 48% 52% / 70% 68% 32% 30%;
}

.wl-dscene--shape-flat .wl-bubble__cloud::before {
	display: block;
	left: 6%;
	top: -34%;
	width: 30%;
	height: 62%;
}

.wl-dscene--shape-flat .wl-bubble__cloud::after {
	display: block;
	right: 8%;
	top: -30%;
	width: 24%;
	height: 54%;
}

.wl-dscene--shape-flat .wl-bubble__cloud i {
	position: absolute;
	display: block;
	background: inherit;
	border-radius: 50%;
}

.wl-dscene--shape-flat .wl-bubble__cloud i:nth-child(1) {
	left: 34%;
	top: -40%;
	width: 26%;
	height: 62%;
}

/* The other two `i` children carry no lobe in this shape: a flat cloud is one
   long body with three humps, not five. */
.wl-dscene--shape-flat .wl-bubble__cloud i:nth-child(2),
.wl-dscene--shape-flat .wl-bubble__cloud i:nth-child(3) {
	display: none;
}

/* The outline, drawn as a ring around the silhouette's own alpha.
 *
 * It used to be a `border` on the puffs' base box, which is why choosing a
 * visible outline had to switch the puffs off: a border traced around three
 * overlapping circles leaves arcs inside the shape. A stack of four offset
 * drop-shadows adds no border at all — each pass paints the silhouette it was
 * given, so the ring follows the real contour of the base *and* every lobe,
 * with no seams to hide and no reason to drop the puffs.
 *
 * The trail dots keep a real border: a dot is one closed contour, so a border
 * on it is exact.
 */
.wl-dscene--line-solid .wl-bubble__cloud,
.wl-dscene--line-dashed .wl-bubble__cloud {
	--wl-cloud-ring: var(--wl-d-cloud-line-width, 2px);

	filter:
		drop-shadow(var(--wl-cloud-ring) 0 0 var(--wl-d-cloud-line, #D5CBB8))
		drop-shadow(calc(-1 * var(--wl-cloud-ring)) 0 0 var(--wl-d-cloud-line, #D5CBB8))
		drop-shadow(0 var(--wl-cloud-ring) 0 var(--wl-d-cloud-line, #D5CBB8))
		drop-shadow(0 calc(-1 * var(--wl-cloud-ring)) 0 var(--wl-d-cloud-line, #D5CBB8))
		drop-shadow(0 9px 16px rgba(70, 63, 48, 0.16));
}

/* A dashed ring needs a single contour to be dashed cleanly, and a silhouette
   built from puffs is not one. Rather than let the two shapes lie about the
   setting, the dashed option keeps its exact dashed border on the two
   single-contour shapes and draws the same ring as the solid style on the
   puffed ones — see the description under the control. */
.wl-dscene--shape-round.wl-dscene--line-dashed .wl-bubble__cloud,
.wl-dscene--shape-ellipse.wl-dscene--line-dashed .wl-bubble__cloud {
	filter: drop-shadow(0 9px 16px rgba(70, 63, 48, 0.16));
	border: var(--wl-d-cloud-line-width, 2px) dashed var(--wl-d-cloud-line, #D5CBB8);
}

/* The trail follows the outline: the dots take the same border. A width of 0
   means the same thing as "no line", so the two controls can never disagree
   into an invisible outline nobody can explain. */
.wl-dscene--line-solid .wl-bubble__trail i,
.wl-dscene--line-dashed .wl-bubble__trail i {
	border: var(--wl-d-cloud-line-width, 2px) solid var(--wl-d-cloud-line, #D5CBB8);
	box-sizing: border-box;
}

.wl-dscene--line-dashed .wl-bubble__trail i {
	border-style: dashed;
}

/* =========================================================================
   2. Front page
   The name, the introduction and the five topics sit in the white middle of
   the page. No cards, no frame: the topics are a row, and the categories
   appear underneath the row when asked for.
   ========================================================================= */

.wld-home {
	position: relative;
	display: grid;
	/* `safe center`: centred while it fits, and once it no longer fits the block
	   starts at the top instead of being centred into an area that cannot
	   scroll back up. Without `safe`, a short window centred the content and
	   put its first line above the scroller's reachable top. */
	align-content: safe center;
	justify-items: center;
	/* One visible window minus the admin bar, filled by the shell's flex column
	   (see the rule above). The content scrolls inside this block rather than
	   inside the document, so a phone in landscape, a laptop at 620px or a
	   browser with six toolbars shorten this column instead of adding a second
	   scrollbar. */
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	/* The bottom air is what lets the last line be scrolled up above the painted
	   character. It is measured against the figure — the thing that actually
	   blocks — not against the whole picture, whose sky is transparent and whose
	   strip can be taller than the window on a wide screen. */
	padding: var(--wl-d-pad);
	padding-bottom: calc(var(--wl-d-ip-base, 280px) + clamp(32px, 8vh, 96px));
	scrollbar-gutter: stable;
}

.wld-home__main {
	display: grid;
	/* WordPress gives every flow child of a group a 1.25rem top margin
	   (theme.json styles.spacing.blockGap). Inside a box that is already exactly
	   one screen tall, that margin is pure overflow: on a 780px window the page
	   came out 9px too tall and scrolled for nothing. The composition's own
	   spacing comes from the block gap below and the padding above. */
	align-content: start;
	margin-block-start: 0;
	justify-items: center;
	width: 100%;
	max-width: 56rem;
}

.wld-home__block {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: calc(18px + var(--wl-d-block-gap, 0px));
	width: 100%;
	text-align: center;
	transform: translateY(calc(var(--wl-d-block-shift, 0px) * -1));
}

.wld-title {
	margin: 0;
	font-size: calc(clamp(2.4rem, 4.6vw + 0.9rem, 4.4rem) * var(--wl-d-title-scale, 1));
	font-weight: 500;
	line-height: 1.08;
	letter-spacing: -0.02em;
	text-wrap: balance;
	color: var(--wl-d-ink);
}

.wld-title a {
	color: inherit;
	text-decoration: none;
}

.wld-home .wl-lead__role {
	max-width: 30rem;
	margin: 0;
	font-size: calc(1.0625rem * var(--wl-d-intro-scale, 1));
	line-height: 1.9;
	letter-spacing: 0.01em;
	color: var(--wl-d-ink-soft);
}

/* Social row: text and icons only, on white. */
.wld-home .wl-social {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 6px;
	margin: 4px 0 0;
	padding: 0;
	list-style: none;
}

.wld-home .wl-social__link {
	color: var(--wl-d-ink-soft);
}

.wld-home .wl-social__link:hover,
.wld-home .wl-social__link:focus-visible {
	color: var(--wl-d-ink);
}

.wld-home .wl-social__icon {
	color: currentColor;
}

.wld-home .wl-all-link {
	margin: 2px 0 0;
	font-size: var(--wp--preset--font-size--small);
}

.wld-home .wl-all-link a {
	color: var(--wl-d-ink-soft);
}

.wld-home .wl-all-link a:hover {
	color: var(--wl-d-accent);
}

/* =========================================================================
   3. Topic navigation
   Two controls per topic and never nested: the name is a link to the topic's
   own page, the caret is a button that opens that topic's categories. A link
   inside a link is invalid and unusable; one control that both navigates and
   expands cannot be operated from a keyboard at all.

   Three levels, two surfaces. The categories hang under the topic; the titles
   hang beside the category list, on whichever side of it has room. The titles
   used to be indented *inside* the category list, which pushed them below the
   category they belong to and made a title look like one more category. A
   separate surface is the only way to say "this is another level" with layout
   instead of with an indentation nobody can see at a glance.

   Both surfaces are popovers, so they are painted in the top layer: never
   clipped by a scrolling container, never underneath the fixed scenery, and
   never dependent on which ancestor happens to be a stacking context today.
   They stay exactly where they are in the DOM, so hover containment, focus
   order, Escape and the outside-click rule all keep working through the tree.

   Positioning comes from distant.js, because a top-layer element has no layout
   parent to be placed against. Nothing below sets top or left; the fallback
   block at the end of this section positions the panels for browsers without
   popover support, where the same markup is laid out inside the page.
   ========================================================================= */

.wl-dnav {
	position: relative;
	/* Above the fixed scenery: the panel opens downwards and would otherwise be
	   painted underneath a layer that is fixed at z-index 5. */
	z-index: 30;
	width: 100%;
}

.wl-dnav__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wl-dnav__item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0;
}

.wl-dnav__link {
	display: block;
	padding: 9px 5px 9px 8px;
	border-bottom: 2px solid transparent;
	color: var(--wl-d-ink);
	font-size: calc(1.0625rem * var(--wl-d-nav-scale, 1));
	line-height: 1.3;
	text-decoration: none;
	transition: border-color 160ms ease, color 160ms ease;
}

.wl-dnav__link:hover,
.wl-dnav__link:focus-visible {
	border-bottom-color: color-mix(in srgb, var(--wl-d-accent) 60%, transparent);
}

.wl-dnav__item.is-current .wl-dnav__link {
	border-bottom-color: var(--wl-d-ink);
	font-weight: 600;
}

.wl-dnav__toggle {
	display: grid;
	place-items: center;
	width: 26px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: none;
	color: var(--wl-d-ink-soft);
	cursor: pointer;
	transition: background-color 140ms ease, color 140ms ease;
}

.wl-dnav__toggle:hover,
.wl-dnav__toggle:focus-visible {
	background: rgba(44, 42, 37, 0.06);
	color: var(--wl-d-ink);
}

.wl-dnav__chevron {
	display: block;
	width: 7px;
	height: 7px;
	margin-top: -3px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	transition: transform 180ms var(--wp--custom--ease--soft, ease);
}

.wl-dnav__item.is-open .wl-dnav__toggle {
	background: rgba(44, 42, 37, 0.07);
	color: var(--wl-d-ink);
}

.wl-dnav__item.is-open .wl-dnav__chevron {
	margin-top: 3px;
	transform: rotate(225deg);
}

/* The panel that holds the five names, and the panel that holds one
   category's article titles.

   The second one is its own surface now, not an indented block inside the
   first. It used to open underneath the category, inside the category panel,
   which put the titles below the name you had just chosen and — on the first
   long topic — let the outer panel's own scrolling cut them off. As a separate
   surface it opens beside the category panel, where there is room for a long
   list, and the two are no longer in each other's way. */
.wl-dnav__panel,
.wl-dnav__sub {
	position: absolute;
	margin: 0;
	padding: 8px;
	border: 1px solid rgba(44, 42, 37, 0.12);
	border-radius: 14px;
	background: #ffffff;
	color: var(--wl-d-ink);
	box-shadow: 0 2px 4px rgba(44, 42, 37, 0.04), 0 22px 44px -26px rgba(44, 42, 37, 0.5);
	overflow-y: auto;
	overscroll-behavior: contain;
	text-align: left;
}

/* In the top layer. `inset: auto` undoes the user agent's centred `inset: 0`
   for popovers; the four numbers come from distant.js, which measured the row
   the surface belongs to.

   `transform: none` is not decoration. The fallback below positions the panel
   inside its topic with `left: 50%; transform: translateX(-50%)`, and that
   transform kept applying in the top layer as well — on top of a `left` that
   distant.js had already centred by hand. Every open panel was therefore half
   its own width to the left of where the script put it, which is what made the
   arrow sit over the middle of its panel instead of on the panel's edge. */
.wl-dnav__panel.is-top,
.wl-dnav__sub.is-top {
	position: fixed;
	inset: auto;
	margin: 0;
	transform: none;
}

.wl-dnav__panel {
	top: calc(100% + 4px);
	left: 50%;
	z-index: 20;
	width: max-content;
	min-width: 14rem;
	max-width: min(24rem, calc(100vw - 32px));
	max-height: min(58vh, 22rem);
	transform: translateX(-50%);
}

.wl-dnav__panel[hidden] {
	display: none;
}

.wl-dnav__cats {
	display: flex;
	flex-direction: column;
	gap: 1px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wl-dnav__catrow {
	position: relative;
	display: flex;
	flex-direction: column;
}

.wl-dnav__catline {
	display: flex;
	align-items: center;
	gap: 2px;
}

.wl-dnav__cat {
	flex: 1 1 auto;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 14px;
	padding: 8px 10px;
	border-radius: 8px;
	color: var(--wl-d-ink);
	font-size: 0.9375rem;
	line-height: 1.45;
	text-decoration: none;
}

.wl-dnav__cat:hover,
.wl-dnav__cat:focus-visible {
	background: color-mix(in srgb, var(--wl-d-accent) 12%, #ffffff);
}

.wl-dnav__cat.is-plain {
	color: var(--wl-d-ink-soft);
	font-size: 0.875rem;
}

.wl-dnav__count {
	flex: none;
	color: var(--wl-d-ink-soft);
	font-size: 0.75rem;
	font-variant-numeric: tabular-nums;
}

/* The caret beside a category opens its titles. It is a sibling of the link,
   never a wrapper: the name still navigates to the category list. */
.wl-dnav__subtoggle {
	flex: none;
	display: grid;
	place-items: center;
	width: 24px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: none;
	color: var(--wl-d-ink-soft);
	cursor: pointer;
	transition: background-color 140ms ease, color 140ms ease;
}

.wl-dnav__subtoggle:hover,
.wl-dnav__subtoggle:focus-visible {
	background: rgba(44, 42, 37, 0.06);
	color: var(--wl-d-ink);
}

.wl-dnav__catrow.is-open .wl-dnav__subtoggle {
	background: rgba(44, 42, 37, 0.07);
	color: var(--wl-d-ink);
}

.wl-dnav__catrow.is-open .wl-dnav__subtoggle .wl-dnav__chevron {
	margin-top: 3px;
	transform: rotate(225deg);
}

/* The third level: a surface of its own beside the category list.
   Not indented under it — that is what this rule replaced. Without popover
   support the same element falls back to a row under its category. */
.wl-dnav__sub {
	top: calc(100% + 2px);
	left: 12px;
	z-index: 21;
	width: max-content;
	min-width: 13rem;
	max-width: min(22rem, calc(100vw - 32px));
	max-height: min(58vh, 22rem);
}

.wl-dnav__sub[hidden] {
	display: none;
}

.wl-dnav__posts {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wl-dnav__post {
	display: block;
	padding: 6px 8px;
	border-radius: 6px;
	color: var(--wl-d-ink);
	font-size: 0.875rem;
	line-height: 1.4;
	text-decoration: none;
}

.wl-dnav__post:hover,
.wl-dnav__post:focus-visible {
	background: color-mix(in srgb, var(--wl-d-accent) 12%, #ffffff);
}

/* "所有內容" is the last destination, not a sixth topic.
   Under the row, smaller than the names, in the soft ink: the five topics are
   the navigation, this is the archive behind them. Same words, lower rank. */
.wl-dnav__all {
	margin: 6px 0 0;
	padding: 0;
	text-align: center;
}

.wl-dnav__all-link {
	color: var(--wl-d-ink-soft);
	font-size: 0.8125rem;
	line-height: 1.6;
	text-decoration: none;
	text-underline-offset: 3px;
}

.wl-dnav__all-link:hover,
.wl-dnav__all-link:focus-visible {
	color: var(--wl-d-ink);
	text-decoration: underline;
}

.wl-dnav__all-link[aria-current="page"] {
	color: var(--wl-d-ink);
	text-decoration: underline;
}

.wl-dnav__empty {
	margin: 0;
	color: var(--wl-d-ink-soft);
	font-size: 0.9375rem;
}

/* =========================================================================
   4. Reading window
   Two columns, one scroller. The site name and the five topics stand in a rail
   on the left; the article column next to it is the only thing that scrolls.
   The page itself never scrolls, so there is exactly one scrollbar.

   The container runs to the bottom of the window. It no longer stops above a
   reserved strip of ground: the scenery paints over its lower part instead,
   and the extra padding at the end of the scroll is what brings the last
   paragraph, file link and buttons back up above the painted band.
   ========================================================================= */

.wld-read {
	position: relative;
	/* The reading layer keeps a shorter strip than the front page: a reader
	   needs the column, and this file's branch line starts lower than the front
	   page's horizon, so a shorter crop loses only sky and branch tips. */
	--wl-d-scene-h: clamp(180px, 32vh, 340px);
	/* The rail width comes from the settings (`--wl-d-rail`, printed on :root),
	   not from a clamp here. It is the column that carries the site name and the
	   five topics, so how much room it gets is a layout decision the owner can
	   make, not a constant this file guesses. */
	display: grid;
	grid-template-columns: var(--wl-d-rail, 13rem) minmax(0, 1fr);
	/* One row: the whole shell, split into rail and column. The ground is no
	   longer a row — it is painted over the column. The height comes from the
	   shell's flex column (see the rule under "Shell"), so it is definite from
	   the start and the column can be a scroller. */
	grid-template-rows: minmax(0, 1fr);
	/* The container's top and bottom are two distances, not a height and an
	   offset. The floating switch always gets its own room; `read_top` adds the
	   owner's own breathing space below it, and `read_bottom` lifts the lower
	   edge off the bottom of the window (0 = flush with it). Because both are
	   the container's own padding, the grid row simply becomes what is left —
	   there is no second vertical number that could disagree with them. */
	padding-top: calc(var(--wl-d-controls-top) + var(--wl-d-read-top, 0px));
	padding-bottom: var(--wl-d-read-bottom, 0px);
	/* The panels are popovers in the top layer, so nothing here needs to clip
	   for them — but the reading area can be nudged sideways, and a container
	   pushed past the window edge must not give the page a horizontal
	   scrollbar. `clip` on one axis is the only value that lets the other stay
	   `visible`, so the rail's focus ring still shows. */
	overflow-x: clip;
	overflow-y: visible;
}

/*
 * The white ground, on its own layer.
 *
 * It used to be the scroller's own background, which coupled two things that
 * are not the same decision: where the paper ends, and how far the text fades
 * out. A mask applies to the whole element including its background, so the
 * only way to fade the content was to cut the paper off at the same height —
 * which is exactly what "下緣 0" looked like: the white area stopped hundreds of
 * pixels above the bottom of the window, in the middle of the scenery.
 *
 * Now the paper is a grid item in the same cell as the column, painted white
 * all the way down to the container's real lower edge, under the content and
 * under the scenery (which is a fixed layer above both). The content's fade is
 * a mask on the scroller alone, so it fades text to the page's white without
 * ever removing the paper, and the scenery's transparent sky has solid paper
 * behind it.
 *
 * `translate` is the horizontal position: one number moves the paper, the fade
 * and the column together, because they are the same box. The rail is not part
 * of that box and stays where the site's navigation belongs.
 */
.wld-read::before {
	content: "";
	grid-column: 2;
	grid-row: 1;
	justify-self: center;
	width: 100%;
	max-width: var(--wl-d-box, 56rem);
	background: var(--wl-d-paper, #ffffff);
	translate: var(--wl-d-read-left, 0px) 0;
	z-index: 0;
	/* A sheet of paper is not a control. */
	pointer-events: none;
}

.wld-top {
	grid-column: 1;
	grid-row: 1;
	align-self: start;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	min-width: 0;
	/* theme.json gives every flow child a 1.25rem top margin. Inside this
	   grid that margin was silently added above the rail and the column, which
	   is one of the reasons "下緣 0" never looked flush: the box was already
	   20px down before any of the layout rules ran. The shell's own padding
	   above is the only thing that should offset them. */
	margin-block-start: 0;
	/* Down past the floating switch, then the name. */
	padding: calc(var(--wl-d-controls-h) + 10px) 0 6px clamp(20px, 3.4vw, 56px);
}

.wld-top__title {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.wld-top__title a {
	color: var(--wl-d-ink);
	text-decoration: none;
}

/*
 * The column itself.
 *
 * Its box is the whole white area, top to bottom, because the paper it sits on
 * is that box (`.wld-read::before`). The fade is a mask on this element only, so
 * the scroller's own viewport is what fades — the paper underneath keeps its
 * full height and the scenery keeps its full silhouette.
 *
 * The extra bottom padding is what keeps the promise that nothing is lost to the
 * fade or to the picture: the last paragraph can be scrolled up above the painted
 * ground and read at full contrast. That is padding inside the scroller, which
 * makes the content longer, not a shorter container.
 */
.wld-scroll {
	grid-column: 2;
	grid-row: 1;
	position: relative;
	z-index: 1;
	min-height: 0;
	width: 100%;
	max-width: var(--wl-d-box, 56rem);
	margin-inline: auto;
	/* The same 1.25rem flow margin that lifted the rail; see `.wld-top`. */
	margin-block-start: 0;
	/* The horizontal position, shared with the paper. One number: the sheet, the
	   fade and the text move together, because they are one box. */
	translate: var(--wl-d-read-left, 0px) 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 0 clamp(16px, 3vw, 48px);
	/* Room to bring the last paragraph, file link and button up above the
	   painted ground. The scenery's top is `scene-h` above the bottom of the
	   window and this box's bottom is already `read-bottom` above it, so the
	   overlap is the difference — never a negative amount. */
	padding-bottom: calc(max(var(--wl-d-scene-h, 240px) - var(--wl-d-read-bottom, 0px), 0px) + 48px);
	scrollbar-gutter: stable;
	/* No background: the paper is a separate layer behind this one. Painting it
	   here would mean the mask has to cut the white ground off wherever the text
	   fades, which is exactly how the container's lower edge ended up hundreds
	   of pixels above the bottom of the window. */
	/* The only fade, and it is the scroller's own bottom: a mask can only touch
	   pixels inside this box, so it never fogs the scenery at either side. A
	   height of 0 makes the gradient zero-length and paints nothing, which is
	   why this rule needs no second branch to "truly switch the fade off". */
	-webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - var(--wl-d-read-fade, 72px)), transparent 100%);
	mask-image: linear-gradient(to bottom, #000 calc(100% - var(--wl-d-read-fade, 72px)), transparent 100%);
}

/* Compact topic rail: the same five topics, one per line, under the name.
   Only the topic itself — no caret and no panel, because a flyout hanging over
   the column would cover the paragraph someone is reading. */
.wl-dnav--compact {
	width: 100%;
}

.wl-dnav--compact .wl-dnav__list {
	flex-direction: column;
	align-items: flex-start;
	gap: 1px;
}

.wl-dnav--compact .wl-dnav__item {
	display: block;
	width: 100%;
}

.wl-dnav--compact .wl-dnav__link {
	display: block;
	padding: 4px 0;
	font-size: calc(0.875rem * var(--wl-d-nav-scale, 1));
	line-height: 1.45;
	color: var(--wl-d-ink-soft);
	border-bottom: 0;
}

.wl-dnav--compact .wl-dnav__item.is-current .wl-dnav__link {
	color: var(--wl-d-ink);
	font-weight: 600;
}

/* The ground band is gone: the content runs to the bottom of the window and the
   scenery is painted over it, so there is no row left to reserve. The class is
   kept out of the templates rather than kept as an empty row. */

/* =========================================================================
   5. The sheet
   One column of text, no card. The street view puts the article on a surface
   because it floats over a photograph; here the page is the surface, so a
   panel would only be an extra frame. The border and the shadow come off the
   same element that carries them, not off a descendant: the reading main is
   itself `.wl-article` / `.wl-list`, so a rule written for children never
   matched anything and the sheet kept a one-pixel frame with a surface behind
   it. White paper, no frame.
   ========================================================================= */

.wld-sheet {
	width: 100%;
	/* The sheet fills the reading container. The readable line length is a
	   different number, applied below to the things that are read as text: a
	   photograph or a table may use the whole container, a paragraph may not. */
	max-width: var(--wl-d-box, 56rem);
	margin-inline: auto;
	padding: 8px 0 40px;
	color: var(--wl-d-ink);
	font-size: calc(var(--wp--preset--font-size--medium, 1.0625rem) * var(--wl-d-body-scale, 1));
	line-height: var(--wl-d-leading, 1.85);
}

body.wl-view-distant .wld-sheet.wl-list,
body.wl-view-distant .wld-sheet.wl-article {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
}

body.wl-view-distant .wl-list__title,
body.wl-view-distant .wl-article__title {
	font-family: var(--wl-d-font-display);
	color: var(--wl-d-ink);
	font-size: clamp(1.7rem, 1.8vw + 0.9rem, 2.6rem);
	line-height: 1.14;
}

.wl-list__intro,
body.wl-view-distant .wl-list__intro {
	max-width: none;
	color: var(--wl-d-ink-soft);
	font-size: calc(var(--wp--preset--font-size--medium, 1.0625rem) * var(--wl-d-body-scale, 1));
	line-height: var(--wl-d-leading, 1.85);
}

/* Filter row: hairline rule and text tabs, the same reading as the street view
   but without the panel it used to sit on. */
body.wl-view-distant .wl-tags {
	border-bottom: 1px solid rgba(44, 42, 37, 0.14);
}

body.wl-view-distant .wl-tag {
	/* The filter row sits above the list and is smaller than body text; the
	   owner's slider scales that size, not the browser default. */
	font-size: calc(var(--wp--preset--font-size--small, 0.875rem) * var(--wl-d-tag-scale, 1));
	color: var(--wl-d-ink-soft);
}

body.wl-view-distant .wl-tag:hover {
	color: var(--wl-d-ink);
	box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--wl-d-accent) 55%, transparent);
}

body.wl-view-distant .wl-tag.is-current {
	color: var(--wl-d-ink);
	box-shadow: inset 0 -2px 0 var(--wl-d-ink);
}

/* Entries: separated by rules, not by cards. A list of twenty cards is a lot of
   boxes to look at before reading the first title. */
body.wl-view-distant .wl-entries {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

body.wl-view-distant .wl-entry {
	border-top: 1px solid rgba(44, 42, 37, 0.12);
}

body.wl-view-distant .wl-entry:first-child {
	border-top: 0;
}

body.wl-view-distant .wl-entry__link {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 4px 20px;
	padding: 20px 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: var(--wl-d-ink);
	text-decoration: none;
}

body.wl-view-distant .wl-entry__link:hover,
body.wl-view-distant .wl-entry__link:focus-visible {
	background: none;
	box-shadow: none;
}

body.wl-view-distant .wl-entry__title {
	font-family: var(--wl-d-font-display);
	color: var(--wl-d-ink);
	font-size: calc(1.15rem * var(--wl-d-body-scale, 1));
}

body.wl-view-distant .wl-entry__link:hover .wl-entry__title {
	color: var(--wl-d-accent);
}

body.wl-view-distant .wl-entry__excerpt,
body.wl-view-distant .wl-entry__topic,
body.wl-view-distant .wl-entry__tag,
body.wl-view-distant .wl-entry__tags {
	color: var(--wl-d-ink-soft);
}

body.wl-view-distant .wl-entry.has-cover .wl-entry__link {
	grid-template-columns: minmax(0, 1fr) auto;
}

body.wl-view-distant .wl-entry__cover {
	border-radius: 8px;
}

body.wl-view-distant .wl-pagination a,
body.wl-view-distant .wl-pagination span {
	color: var(--wl-d-ink-soft);
}

body.wl-view-distant .wl-pagination .current {
	background: var(--wl-d-ink);
	color: #ffffff;
}

/* The reading page's header: one back control, then — only once the real
   heading has scrolled away — a quiet copy of the title.

   The street view keeps its floating pill; here the bar is a row of its own,
   with no frame and no capsule. The arrow gets a square-ish hit area and real
   space around it, and the title starts after a hairline rule, so the two
   never read as a single run of characters ("←這是第二份測試" was exactly
   that: a 44px arrow with a 10px gap and the title's first glyph touching it).

   It is sticky rather than static, and it sticks to the scroller it lives in —
   `.wld-scroll` — not to the window. Sticking to the window would leave the
   arrow sitting over the scenery once the column had scrolled past it. */
body.wl-view-distant .wl-bar {
	position: sticky;
	top: 0;
	z-index: 6;
	display: flex;
	align-items: center;
	/* No gap: the separation between the two parts is the title's own rule and
	   padding, which only exists while the title does. A permanent gap would
	   leave the lone arrow sitting off its own left edge. */
	gap: 0;
	width: 100%;
	max-width: 100%;
	padding: 6px 0 10px;
	border: 0;
	border-radius: 0;
	/* The paper under the row, so the text that passes beneath it does not
	   show through. */
	background: var(--wl-d-paper, #ffffff);
	box-shadow: none;
}

body.wl-view-distant .wl-back {
	/* flex: 0 0 auto keeps the target its own size however long the title is:
	   a long headline may lose characters, it may never squeeze the control
	   someone needs to leave by. */
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	color: var(--wl-d-ink-soft);
	background: transparent;
	font-size: 1.1rem;
	line-height: 1;
	transition: background-color 160ms ease, color 160ms ease;
}

body.wl-view-distant .wl-back:hover {
	color: var(--wl-d-ink);
	background: color-mix(in srgb, var(--wl-d-accent) 14%, transparent);
}

body.wl-view-distant .wl-back:focus-visible {
	color: var(--wl-d-ink);
	outline: 2px solid var(--wp--preset--color--accent-deep, #4E5844);
	outline-offset: 2px;
}

body.wl-view-distant .wl-bar__title {
	/* Hidden until condensed — the article's own <h1> is the title on screen,
	   so the same words are never printed twice at once. */
	display: none;
	min-width: 0;
	flex: 1 1 auto;
	margin-left: 0.5rem;
	padding-left: 0.75rem;
	border-left: 1px solid color-mix(in srgb, var(--wp--preset--color--line, #D5CBB8) 70%, transparent);
	color: var(--wl-d-ink);
	font-size: 0.9375rem;
	line-height: 1.4;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

body.wl-view-distant .wl-bar.is-condensed .wl-bar__title {
	display: block;
}

body.wl-view-distant .wl-article__meta {
	color: var(--wl-d-ink-soft);
}

body.wl-view-distant .wl-article__meta a {
	color: var(--wl-d-accent);
}

body.wl-view-distant .wl-article__cover {
	margin-block: 6px;
	border-radius: 10px;
}

/* =========================================================================
   6. Prose
   Long-form text: the reader's own measure, the owner's leading, and nothing
   that can overflow. Media, tables, embeds and file blocks keep the panel
   width; text keeps the reading width.
   ========================================================================= */

body.wl-view-distant .wl-prose {
	margin-top: 22px;
	/* The prose block spans the container, so a photograph inside it can use the
	   whole width. The paragraphs inside are held to the readable measure
	   further down, which is the only place that number belongs. */
	max-width: var(--wl-d-box, 56rem);
	font-size: calc(var(--wp--preset--font-size--medium, 1.0625rem) * var(--wl-d-body-scale, 1));
	line-height: var(--wl-d-leading, 1.85);
	color: var(--wl-d-ink);
}

body.wl-view-distant .wl-prose > * {
	max-width: var(--wl-d-measure, 40rem);
}

/* Media keeps the container. A picture, a table or an embed is not read line by
   line, so the readable measure — which exists to keep the eye from losing its
   place — has nothing to protect here. */
body.wl-view-distant .wl-prose > img,
body.wl-view-distant .wl-prose > video,
body.wl-view-distant .wl-prose > iframe,
body.wl-view-distant .wl-prose > embed,
body.wl-view-distant .wl-prose > object,
body.wl-view-distant .wl-prose > table,
body.wl-view-distant .wl-prose > figure,
body.wl-view-distant .wl-prose > .wp-block-image,
body.wl-view-distant .wl-prose > .wp-block-video,
body.wl-view-distant .wl-prose > .wp-block-embed,
body.wl-view-distant .wl-prose > .wp-block-table,
body.wl-view-distant .wl-prose > .wp-block-gallery,
body.wl-view-distant .wl-prose > .wp-block-file {
	max-width: 100%;
}

body.wl-view-distant .wl-prose > * + * {
	margin-block-start: 1.15em;
}

body.wl-view-distant .wl-prose h2,
body.wl-view-distant .wl-prose h3,
body.wl-view-distant .wl-prose h4 {
	font-family: var(--wl-d-font-display);
	color: var(--wl-d-ink);
}

body.wl-view-distant .wl-prose a {
	color: var(--wl-d-accent);
}

body.wl-view-distant .wl-prose a:hover {
	color: var(--wl-d-ink);
}

body.wl-view-distant .wl-prose figcaption,
body.wl-view-distant .wl-prose cite {
	color: var(--wl-d-ink-soft);
}

body.wl-view-distant .wl-prose blockquote {
	border-inline-start: 2px solid color-mix(in srgb, var(--wl-d-accent) 45%, transparent);
	background: none;
}

body.wl-view-distant .wl-prose code {
	background: rgba(44, 42, 37, 0.05);
}

body.wl-view-distant .wl-prose pre {
	background: rgba(44, 42, 37, 0.045);
	border-radius: 10px;
}

body.wl-view-distant .wl-prose hr,
body.wl-view-distant .wl-prose th,
body.wl-view-distant .wl-prose td {
	border-color: rgba(44, 42, 37, 0.16);
}

/* Nothing runs past the column: images, video, tables and embeds are capped by
   the width they are given, and a wide table scrolls inside its own box rather
   than widening the page. */
body.wl-view-distant .wl-prose img,
body.wl-view-distant .wl-prose video,
body.wl-view-distant .wl-prose iframe,
body.wl-view-distant .wl-prose embed,
body.wl-view-distant .wl-prose object {
	max-width: 100%;
	height: auto;
}

body.wl-view-distant .wl-prose .wp-block-table,
body.wl-view-distant .wl-prose figure.wp-block-table {
	overflow-x: auto;
}

body.wl-view-distant .wl-prose table {
	width: 100%;
	border-collapse: collapse;
}

body.wl-view-distant .wl-prose .wp-block-file {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 14px;
	align-items: center;
}

/* Search field on the search template. */
body.wl-view-distant .wl-search {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	max-width: var(--wl-d-measure, 40rem);
}

body.wl-view-distant .wl-search input[type="search"] {
	flex: 1 1 12rem;
	min-width: 0;
	padding: 9px 12px;
	border: 1px solid rgba(44, 42, 37, 0.2);
	border-radius: 8px;
	background: #ffffff;
	color: var(--wl-d-ink);
}

body.wl-view-distant .wl-search .wp-block-search__button {
	padding: 9px 16px;
	border: 0;
	border-radius: 8px;
	background: var(--wl-d-ink);
	color: #ffffff;
	cursor: pointer;
}

/* A quiet social row at the end of a reading page: the same data the front
   page uses, so the links are reachable from anywhere. */
.wld-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 14px;
	margin-top: 34px;
	padding-top: 18px;
	border-top: 1px solid rgba(44, 42, 37, 0.12);
}

.wld-foot .wl-social {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wld-foot .wl-social__link {
	color: var(--wl-d-ink-soft);
}

.wld-foot .wl-social__link:hover,
.wld-foot .wl-social__link:focus-visible {
	color: var(--wl-d-ink);
}

/* =========================================================================
   7. Narrow screens and short windows
   The same model, one column narrower. A phone keeps the shell at exactly one
   visible window and keeps a single scrolling column — it no longer hands the
   scroll back to the document. That earlier arrangement produced two
   scrollbars, let the article push the character off the screen, and made the
   first seconds of a wheel do nothing; the composition is worth keeping, so it
   is narrowed rather than abandoned.

   On a phone the reading container itself is that one scroller: the rail row
   (site title and the five topics) is the first thing in it, so it scrolls
   away with the article instead of reserving a band of screen for itself. The
   article column keeps its shape and its tail padding; it simply no longer
   scrolls on its own. `front.js` looks for whichever of the two is actually
   scrollable, so scroll memory and the condensed bar follow the same box.

   The dynamic browser chrome is handled by measuring in `svh`, the *smallest*
   viewport height: the shell is one window minus the largest the toolbars will
   ever be, so the page never overflows when they slide in, and the column is
   simply a little shorter when they are out. Rotating the device only changes
   which media query applies, never which element scrolls.
   ========================================================================= */

@media (max-width: 860px) {
	body.wl-view-distant {
		/* A phone keeps the same 3:2 crop as the desktop front page: the dark
		   left and right edges are what makes the picture a view rather than a
		   band, and on a narrow screen they are the whole composition. */
		--wl-d-scene-h: calc(100vw * 2 / 3);
		--wl-d-ip-base: clamp(140px, 22vh, 240px);
	}

	body.wl-view-distant .wld-read {
		--wl-d-scene-h: clamp(150px, 26vh, 250px);
		/* The rail becomes a row above the article, and the container itself is
		   the one scroller: both rows are content-sized, and what does not fit
		   scrolls here — title, topics, article, all in one column, one
		   scrollbar. The desktop keeps the two-column grid with the article
		   column as the scroller; only this breakpoint changes hands. */
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto auto;
		min-height: 0;
		/* The admin bar is already outside this box (WordPress pushes the whole
		   document down by its height), so only the switch offset is added.
		   Both of the owner's vertical numbers still apply, but each is capped
		   against the window: on a phone a 260px top inset and a 260px bottom
		   inset together would leave nothing to read, and the controls would be
		   pushed out of reach. The caps are generous (a third and a quarter of
		   the window) and are only ever reached by extreme values. */
		padding-top: calc(var(--wl-d-controls-top) + min(var(--wl-d-read-top, 0px), 34svh));
		padding-bottom: min(var(--wl-d-read-bottom, 0px), 25svh);
		/* This is the one box that must not let the article's tail poke out
		   under the scenery into a second scrollbar: the vertical scroll lives
		   here and nowhere else, horizontal overflow is clipped, and nothing on
		   `body` or `html` is touched. */
		overflow-x: hidden;
		overflow-y: auto;
		/* The content fade belongs to the visible box, as on a desktop: the
		   scroller below is no longer the clipping box, so its own fade would
		   sit at the end of the article instead of at the bottom of the
		   window. On the container the fade stays where the reader sees it at
		   every scroll position. */
		-webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - min(var(--wl-d-read-fade, 72px), 14svh)), transparent 100%);
		mask-image: linear-gradient(to bottom, #000 calc(100% - min(var(--wl-d-read-fade, 72px), 14svh)), transparent 100%);
	}

	/* The paper moves to the second row, under the column, and takes the full
	   width — a phone has no room to inset a sheet. Inside the scrolling
	   container the grid tracks are content-sized, so the paper stretches the
	   full height of the content and scrolls with it: white behind every line,
	   to the very end. */
	body.wl-view-distant .wld-read::before {
		grid-column: 1;
		grid-row: 2;
		max-width: none;
		/* A sideways nudge on a phone is a way to lose text off the edge; the
		   column is already as wide as the screen allows. */
		translate: 0 0;
	}

	/* The rail row scrolls with the article now, so it needs no special
	   treatment beyond the row layout it already has. */
	body.wl-view-distant .wld-top {
		grid-column: 1;
		grid-row: 1;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: baseline;
		gap: 2px 14px;
		padding: 4px var(--wl-d-pad) 8px;
	}

	/* The article column keeps its shape and its tail padding — enough to bring
	   the last line above the painted figure — but it no longer scrolls on its
	   own: the container above is the scroller, and this is just the row of
	   content under the rail. No fade here either; the fade is the container's
	   (see the rule above), measured from the visible bottom of the window. */
	body.wl-view-distant .wld-scroll {
		grid-column: 1;
		grid-row: 2;
		max-width: none;
		min-height: 0;
		overflow-y: visible;
		translate: 0 0;
		padding: 0 var(--wl-d-pad) calc(var(--wl-d-ip-base, 240px) + clamp(24px, 6vh, 64px));
		-webkit-mask-image: none;
		mask-image: none;
	}

	body.wl-view-distant .wl-dnav--compact {
		width: auto;
	}

	body.wl-view-distant .wl-dnav--compact .wl-dnav__list {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 0 2px;
	}

	/* The desktop rail sizes each item to the full column so the list reads as
	   one straight line; here the list is a row that wraps, so an item is only
	   as wide as its link — that is what lets the five topics reflow by screen
	   width instead of forcing one topic per line. */
	body.wl-view-distant .wl-dnav--compact .wl-dnav__item {
		width: auto;
	}

	body.wl-view-distant .wl-dnav--compact .wl-dnav__link {
		padding: 4px 4px 4px 0;
	}

	body.wl-view-distant .wld-home {
		padding-bottom: calc(var(--wl-d-scene-h, 340px) + 24px);
	}

	body.wl-view-distant .wld-title {
		font-size: calc(clamp(2rem, 7vw, 2.9rem) * var(--wl-d-title-scale, 1));
	}

	/* The character stays bottom-right and shrinks: the reading column owns the
	   middle of a phone screen, and a large figure behind it would be a
	   watermark over the text. The scene stays fixed, so the article still
	   sinks behind the painted ground on a phone — the same composition, only
	   narrower. */
	.wl-dscene--read {
		--wl-d-ip-x: 86%;
	}

	/* The scene nudge switches to the mobile pair at the same breakpoint every
	   other device setting on these views uses. */
	.wl-dscene .wl-ip {
		translate: var(--wl-scene-dx-m, 0px) calc(-1 * var(--wl-scene-dy-m, 0px));
	}
}

/* Very short windows (a laptop in landscape, a phone rotated): the strip must
   not eat the reading column. The shell is already the height of the visible
   window, so this only shrinks the scenery. */
@media (max-height: 620px) {
	body.wl-view-distant {
		--wl-d-scene-h: min(calc(100vw * 2 / 3), 100svh);
		--wl-d-ip-base: clamp(130px, 24vh, 220px);
	}

	body.wl-view-distant .wld-read {
		--wl-d-scene-h: clamp(140px, 30vh, 220px);
	}
}

/* =========================================================================
   8. Motion
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
	body.wl-view-distant .wp-site-blocks {
		animation: none;
	}

	body.wl-view-distant .wl-dnav__chevron,
	body.wl-view-distant .wl-dnav__link {
		transition: none;
	}
}
