/*
Theme Name: Willy
Theme URI: https://example.invalid/willy
Author: Willy
Description: 個人網站的 Block Theme。視覺層：整個站台的外觀只放在這裡。資料（主題、分類、內容、外觀設定）由 Willy Core 外掛提供，換主題不會動到內容。
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 8.0
Version: 1.0.0
Text Domain: willy
Tags: block-theme, full-site-editing, wide-blocks
*/

/* =========================================================================
   0. Tokens
   Colours, type, spacing and radius come from theme.json. The few values
   below are local measurements that are easier to express in CSS than as a
   theme.json preset (layout widths, the scene, the one-screen rules).
   ========================================================================= */

:root {
	/* The shell is where the page is allowed to breathe outwards. It is wide on
	   purpose: the rail keeps its place near the edge and the content column gets
	   the rest. It is not a reading measure. */
	--wl-shell: 1560px;
	--wl-gutter: clamp(20px, 3.4vw, 56px);
	--wl-card-w: min(100%, 34rem);
	/* Reading panel: what the eye scans line by line. Body text never exceeds
	   its own measure (~40rem); the panel that holds the article may be wider so
	   images, tables and video have room. */
	--wl-panel: 68rem;
	--wl-media: 64rem;
	--wl-surface: var(--wp--preset--color--card);
	--wl-surface-raised: #fffdf8;
	--wl-focus: 0 0 0 3px rgba(120, 134, 106, 0.42);
	--wl-shadow-card: 0 1px 0 rgba(44, 42, 37, 0.04), 0 10px 30px -18px rgba(44, 42, 37, 0.35);
	--wl-shadow-lift: 0 1px 0 rgba(44, 42, 37, 0.05), 0 22px 44px -26px rgba(44, 42, 37, 0.42);
	--wl-shadow-panel: 0 1px 0 rgba(44, 42, 37, 0.05), 0 24px 60px -38px rgba(44, 42, 37, 0.5);

	/* The reading surface, as one material. The article, the list and the home
	   deck all read these, so the three cannot drift apart, and a preset only
	   has to redefine them (section 10c) rather than restate every panel. */
	--wl-preset-edge: color-mix(in srgb, var(--wp--preset--color--line) 62%, transparent);
	--wl-preset-edge-strong: color-mix(in srgb, var(--wp--preset--color--line) 92%, transparent);
	--wl-preset-surface: linear-gradient(
		180deg,
		rgba(255, 253, 248, 0.96) 0%,
		rgba(251, 247, 238, 0.94) 100%
	);
	--wl-preset-shadow: 0 1px 1px rgba(44, 42, 37, 0.03), 0 14px 34px -30px rgba(44, 42, 37, 0.55);
	--wl-preset-shadow-lift: 0 1px 1px rgba(44, 42, 37, 0.04), 0 20px 40px -32px rgba(44, 42, 37, 0.6);
	--wl-preset-radius-panel: 16px;
	--wl-preset-radius-item: 10px;
}

/* =========================================================================
   1. Base
   ========================================================================= */

html {
	-webkit-text-size-adjust: 100%;
	scrollbar-gutter: stable;
}

/* Padding never adds to a declared height, so a one-screen block really is one
   screen, and a card's border sits inside its own width. */
*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	background-color: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--body);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.wp-site-blocks {
	isolation: isolate;
}

a {
	text-underline-offset: 0.22em;
	text-decoration-thickness: 1px;
}

:where(a, button, input, textarea, select, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-deep);
	outline-offset: 3px;
	border-radius: 4px;
}

img,
video {
	max-width: 100%;
	height: auto;
}

/* Skip link, kept as the first focusable element by templates. */
.wl-skip {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 100;
	padding: 10px 16px;
	border-radius: var(--wp--custom--radius--sm);
	background: var(--wp--preset--color--card);
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--small);
	box-shadow: var(--wl-shadow-card);
	transform: translateY(-200%);
	transition: transform var(--wp--custom--transition--base) var(--wp--custom--ease--soft);
}

.wl-skip:focus-visible {
	transform: translateY(0);
}

/* =========================================================================
   2. Background scene
   One fixed layer behind every screen. The background is separated from the
   IP so either can be replaced without touching the other.
   ========================================================================= */

.wl-scene {
	position: fixed;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	pointer-events: none;
	background-color: #e9e2d3;
}

.wl-scene__image {
	position: absolute;
	inset: -2%;
	background-image:
		radial-gradient(78% 58% at 82% 8%, rgba(255, 244, 219, 0.92) 0%, rgba(255, 244, 219, 0) 62%),
		radial-gradient(64% 46% at 12% 96%, rgba(138, 143, 112, 0.55) 0%, rgba(138, 143, 112, 0) 68%),
		radial-gradient(94% 40% at 46% 104%, rgba(176, 160, 122, 0.6) 0%, rgba(176, 160, 122, 0) 70%),
		linear-gradient(178deg, #dfe1d6 0%, #ece4d1 34%, #f3ead9 58%, #e4d7bd 82%, #cdc3a8 100%);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	filter: saturate(0.94);
	transform: scale(1.02);
}

/* When a background image is uploaded, --wl-bg replaces the gradient. The
   custom property is set on .wl-scene, the shared parent of this layer and the
   veil, so both can read it. */
.wl-scene[style*="--wl-bg"] .wl-scene__image {
	background-image: var(--wl-bg);
	filter: none;
}

/* The veil reads --wl-veil from that same parent. At 0% it is fully
   transparent (the photograph shows as it is); at 100% the right-hand side is
   the solid page colour, which is what keeps the cards readable over a busy
   image. */
.wl-scene__veil {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(
			100deg,
			rgba(245, 240, 230, 0.18) 0%,
			rgba(245, 240, 230, calc(var(--wl-veil, 82%) * 0.42)) 42%,
			rgba(245, 240, 230, calc(var(--wl-veil, 82%) * 0.94)) 68%,
			rgba(245, 240, 230, var(--wl-veil, 82%)) 100%
		);
}

/* =========================================================================
   3. Shared shell
   ========================================================================= */

/* The theme's own grid and flex containers space their children with gap.
   WordPress adds a 1.25rem top margin to every flow child, which would double
   the spacing, so it is cleared inside these containers only.
   `.wl-stage > *` belongs on this list for a second reason: the stage is a group
   block too, so the skip link and the grid both picked up that margin, and the
   stage ended up 20px taller than the viewport it was told to fill. */
.wl-stage > *,
.wl-stage__grid > *,
.wl-page__grid > *,
.wl-lead > *,
.wl-rail > *,
.wl-list > *,
.wl-home__panel > *,
.wl-article > * {
	margin-block: 0;
}

.wl-stage,
.wl-page {
	position: relative;
	min-height: 100svh;
	padding: var(--wl-gutter);
}

/* WordPress gives every flow child of .wp-site-blocks a 1.25rem top margin
   (theme.json styles.spacing.blockGap). On the home page that margin is exactly
   the 20px that made a 100%-zoom laptop window scroll: the stage was already
   min-height:100svh and the margin was added on top of it. The page's own
   vertical rhythm comes from the stage's padding, so the margin is cleared
   here — only for the stage, so the reading pages keep their normal flow. */
.wp-site-blocks > .wl-stage {
	margin-block-start: 0;
}

.wl-stage {
	display: grid;
	align-items: center;
	justify-items: center;
}

/* The home composition fits one screen where the screen allows it, and scrolls
   where it does not. The cap is no longer a fixed 720px: at 900–990px tall that
   fixed value plus the padding was taller than the window, so the promise
   "one screen on a laptop" failed exactly where it mattered. It is now derived
   from the viewport and only capped at the point where the two halves start to
   look stretched. */
.wl-stage__grid {
	display: grid;
	grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
	gap: clamp(24px, 4.4vw, 76px);
	align-items: stretch;
	/* The home composition keeps its own, narrower stage: it is a two-part
	   portrait, not a reading column, so the wider shell would only add air
	   between the two halves. */
	width: min(1320px, 100%);
	min-height: min(660px, calc(100svh - 2 * var(--wl-gutter)));
}

.wl-lead {
	display: flex;
	flex-direction: column;
	/* Name, intro, illustration and social links share one centre line: the
	   illustration is the widest element, so everything else stacks on it. */
	align-items: center;
	justify-content: flex-end;
	gap: clamp(12px, 1.8vh, 20px);
	min-width: 0;
	text-align: center;
}

.wl-lead__head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

.wl-lead__role {
	text-align: center;
}

/* =========================================================================
   4. IP and dialogue
   ========================================================================= */

.wl-ip {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	/* The figure is as wide as its media, so the bubble can anchor to the
	   illustration's edge rather than to the whole grid column. */
	width: fit-content;
	max-width: 100%;
	margin: 0;
	min-width: 0;
}

.wl-ip--hero {
	flex: 0 0 auto;
	min-height: 0;
}

/* The fixed scene.
   front.js measures where the layout put the figure and pins it at that exact
   spot, leaving a same-sized spacer behind so nothing reflows. These rules only
   describe the resulting state: the figure is out of the flow and shares the
   viewport with the background, which is already fixed.

   Two guarantees belong here rather than in the script. The figure itself never
   takes a click — a scene must not sit between the visitor and the page — and
   the foreground panels are lifted above it so the reading column always stays
   legible when it scrolls over the character. `position: relative` on those
   panels creates the stacking context z-index needs; without it the panels
   would keep painting at z-index auto and the character would float on top of
   the text. */
.wl-ip.is-scene-fixed {
	position: fixed;
	z-index: 0;
	pointer-events: none;
	margin: 0;
}

/* The character's own controls stay usable where they are not covered. */
.wl-ip.is-scene-fixed a,
.wl-ip.is-scene-fixed button {
	pointer-events: auto;
}

.wl-ip-spacer {
	flex: 0 0 auto;
	max-width: 100%;
}

.wl-home__panel,
.wl-article,
.wl-list {
	position: relative;
	z-index: 1;
}

.wl-ip__stage {
	/* The still frame and the video share one cell so either can be the visible
	   layer: the video paints over the still, and hiding the video (unsupported
	   alpha) leaves the still exactly where it was, with no reflow. */
	display: grid;
	grid-template-areas: "ip";
	align-items: end;
	justify-items: center;
	width: 100%;
}

.wl-ip__img,
.wl-ip__motion,
.wl-ip__video {
	grid-area: ip;
	display: block;
	width: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	object-position: bottom center;
	filter: drop-shadow(0 26px 34px rgba(70, 63, 48, 0.22));
}

/* One box, three files.
   The still export and the video export are different shapes — a 1024x1024
   still and a 720x1280 video here — so `width: auto` gave each layer a
   different width and the figure resized the instant the handover happened:
   on an inner page the rail portrait went from 99px wide to 56px wide and the
   character slid sideways by more than a fifth of its own width. That is the
   "position jump" that survived the flicker fix, and it is a layout bug, not a
   decoding one.
   The box is now square and takes its size from a single token, so every layer
   occupies exactly the same space and `object-fit: contain` centres whatever
   shape the file happens to be inside it. `--wl-ip-h` is the same number the
   dog's stage reference and the measured ground line already work from. */
.wl-ip--hero {
	--wl-ip-h: clamp(230px, 42vh, 440px);
}

.wl-ip--hero .wl-ip__img,
.wl-ip--hero .wl-ip__motion,
.wl-ip--hero .wl-ip__video {
	height: var(--wl-ip-h);
	width: var(--wl-ip-h);
}

/* One slot, three paints, and only one of them visible. front.js decides which:
   the video where the alpha plane survives, the animated WebP where it does
   not, and the still frame until that decision is made and if it fails. The
   rule is written for all three, so "hidden" can never mean something different
   per layer — that asymmetry is what let a still frame stay visible underneath
   a playing video. */
.wl-ip__img[hidden],
.wl-ip__motion[hidden],
.wl-ip__video[hidden] {
	display: none;
}

.wl-ip__motion,
.wl-ip__video {
	position: relative;
	z-index: 1;
}

.wl-ip__placeholder {
	display: grid;
	place-items: center;
	width: clamp(150px, 26vh, 240px);
	aspect-ratio: 3 / 4;
	border: 1px dashed rgba(44, 42, 37, 0.28);
	border-radius: var(--wp--custom--radius--xl);
	background: rgba(251, 247, 238, 0.5);
	color: var(--wp--preset--color--ink-soft);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.14em;
}

/* -------------------------------------------------------------------------
   Dialogue cloud
   A thought cloud: a soft silhouette plus a trail of three dots that shrink
   towards the character. It hangs above the illustration and reaches into the
   artwork's transparent margin, so the visible distance to the hair is what the
   reader measures — not the frame. front.js measures that margin from the
   artwork's own alpha channel and writes it to --wl-art-top.

   Its two positions are a small vertical offset of the same box, so swapping
   between them cannot move the illustration or the text under it.
   ------------------------------------------------------------------------- */

.wl-bubble-slot {
	--wl-trail-room: 26px;
	/* Air between the lowest dot and the character's visible head. Measured
	   against the painted pixels, so this is the distance a reader sees. */
	--wl-cloud-gap: 44px;

	position: relative;
	display: flex;
	justify-content: center;
	width: 100%;
	max-width: 100%;
	/* Room for the trail below the cloud. */
	padding-bottom: var(--wl-trail-room);
	/* A fixed gap: the transparent band at the top of the artwork is NOT
	   subtracted here.
	   It used to be, which meant the figure's height depended on a measurement
	   taken a few hundred milliseconds after first paint. The whole figure is
	   bottom-anchored, so correcting that number moved the character and the dog
	   14px up the screen — one visible jump, after everything had already
	   settled. The band is now added to the cloud's own transform instead (see
	   `.wl-bubble`), which moves the cloud into the empty margin without
	   changing any box on the page. */
	margin-bottom: calc(var(--wl-cloud-gap) - var(--wl-trail-room));
}

.wl-bubble {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	/* The transparent band between the artwork's frame and its visible head,
	   measured by front.js and written onto the slot. Moving the cloud down by
	   that amount gives the reader the same gap as before, and unlike a margin
	   it cannot change the height of anything — so the first frame and the
	   measured frame are the same layout. */
	--wl-cloud-shift: 0px;
	/*
	 * The cloud is as wide as the sentence it holds.
	 *
	 * It used to be a fixed `clamp(13rem, 26vw, 18rem)`, which meant a two-word
	 * sentence got the same wide box as a full one, with the words floating in
	 * the middle of it. `fit-content` is the natural width of the text, and the
	 * max-width is the only ceiling: past it the sentence wraps, which is what
	 * "a long sentence" should look like.
	 *
	 * That is also why this is a width and not a scale: the text keeps its own
	 * size and only the box around it grows. front.js then measures each
	 * sentence and writes the exact width, so the box follows the rotation line
	 * by line instead of being as wide as the longest one for ever.
	 */
	width: fit-content;
	min-width: min(12rem, 100%);
	max-width: clamp(13rem, 26vw, 18rem);
	padding: 16px 22px 12px;
	/* No border and no card shadow: this is a cloud, not another panel. The
	   silhouette below carries the edge instead. */
	background: none;
	transform: translateY(calc(var(--wl-art-top, 0px) + var(--wl-cloud-shift)));
	transition:
		transform var(--wp--custom--transition--slow) var(--wp--custom--ease--out),
		width var(--wp--custom--transition--base) var(--wp--custom--ease--soft);
}

/* The two clouds: one a little higher, on the other side of the head. */
.wl-bubble[data-cloud="b"] {
	--wl-cloud-shift: -14px;
}

/* The silhouette. One base shape with two lobes is enough to read as a cloud
   while staying quiet; drop-shadow follows the combined alpha, so the lobes and
   the base share a single soft edge instead of three outlines. */
.wl-bubble__cloud {
	position: absolute;
	inset: -13px -17px -11px;
	border-radius: 46% 54% 48% 52% / 58% 56% 54% 52%;
	background: var(--wp--preset--color--card);
	filter: drop-shadow(0 9px 16px rgba(70, 63, 48, 0.16));
}

/* Three extra lobes, used only by the two puffed silhouettes the distant view
   offers. They live in the markup so those shapes can be built from real boxes
   (a border-radius describes one contour; a cloud is a row of humps) and stay
   invisible in every other shape, including the street view's own cloud. */
.wl-bubble__cloud i {
	display: none;
}

.wl-bubble__cloud::before,
.wl-bubble__cloud::after {
	content: "";
	position: absolute;
	background: inherit;
	border-radius: 50%;
}

/* A wider lobe on the left, a smaller one on the right: asymmetric on purpose,
   so the outline never looks like a row of identical bubbles. */
.wl-bubble__cloud::before {
	left: -3%;
	top: 22%;
	width: 44%;
	height: 82%;
}

.wl-bubble__cloud::after {
	right: -1%;
	top: 30%;
	width: 33%;
	height: 70%;
}

/* Three dots, largest first, drifting towards the head. The drift direction is
   the only thing that changes between the two positions, so the trail always
   points at the character instead of at the panel. */
.wl-bubble__trail {
	--wl-trail-dir: 1;
	--wl-trail-drop: 0px;

	position: absolute;
	bottom: calc(-1 * (var(--wl-trail-room) - 2px));
	left: 34%;
	width: 11px;
	height: 26px;
	transform: translateX(-50%) translateY(var(--wl-trail-drop));
	transition:
		left var(--wp--custom--transition--slow) var(--wp--custom--ease--out),
		transform var(--wp--custom--transition--slow) var(--wp--custom--ease--out);
}

.wl-bubble[data-cloud="b"] .wl-bubble__trail {
	--wl-trail-dir: -1;
	/* The higher cloud moves up 14px, so its trail is 14px longer: both
	   positions then end at the same distance from the head. */
	--wl-trail-drop: 14px;
	left: 62%;
}

.wl-bubble__trail i {
	position: absolute;
	display: block;
	border-radius: 50%;
	background: var(--wp--preset--color--card);
	transform: translateX(calc(var(--wl-trail-dir) * var(--wl-dot-x, 0px)));
}

.wl-bubble__trail i:nth-child(1) {
	--wl-dot-x: 0px;
	left: 0;
	top: 0;
	width: 11px;
	height: 11px;
}

.wl-bubble__trail i:nth-child(2) {
	--wl-dot-x: 15px;
	left: 0.5px;
	top: 11px;
	width: 7.5px;
	height: 7.5px;
}

.wl-bubble__trail i:nth-child(3) {
	--wl-dot-x: 28px;
	left: 2.5px;
	top: 20px;
	width: 5px;
	height: 5px;
}

.wl-bubble__stack {
	display: grid;
	place-items: center;
	min-height: 3.4em;
	/* The text sits on the silhouette, above its own shadow. */
	position: relative;
	z-index: 1;
}

.wl-bubble__line {
	grid-area: 1 / 1;
	/* 100% of the column the widest sentence set; the cloud itself is now
	   `fit-content`, so this only ever fills a box that was measured from text. */
	width: 100%;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.7;
	color: var(--wp--preset--color--ink);
	text-align: center;
	overflow-wrap: anywhere;
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition:
		opacity var(--wp--custom--transition--base) var(--wp--custom--ease--soft),
		transform var(--wp--custom--transition--base) var(--wp--custom--ease--soft),
		visibility 0s linear var(--wp--custom--transition--base);
}

.wl-bubble__line.is-active {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition-delay: 0s;
}

/* The pause control for the cloud.
   Quiet by default: it fades in when the pointer is over the cloud or when the
   keyboard reaches it, and fades out again when neither is true. Hover alone
   would hide it from a touch screen — where there is no hover at all — so
   `hover: none` keeps it visible there. It is never `display:none`: the button
   stays in the tab order, and focusing it always brings it back. */
.wl-bubble__pause {
	position: relative;
	z-index: 1;
	align-self: center;
	padding: 2px 6px;
	border: 0;
	border-radius: var(--wp--custom--radius--sm);
	background: transparent;
	color: var(--wp--preset--color--ink-soft);
	font: inherit;
	font-size: 11px;
	line-height: 1.6;
	letter-spacing: 0.08em;
	cursor: pointer;
	opacity: 0;
	transition: opacity 160ms ease;
}

.wl-bubble:hover .wl-bubble__pause,
.wl-bubble:focus-within .wl-bubble__pause,
.wl-bubble__pause:focus-visible {
	opacity: 1;
}

@media (hover: none) {
	.wl-bubble__pause {
		opacity: 0.7;
	}
}

.wl-bubble__pause:hover {
	opacity: 1;
	background: rgba(44, 42, 37, 0.06);
}

@media (prefers-reduced-motion: reduce) {
	.wl-bubble__pause {
		transition: none;
	}
}

/* Compact variant used on inner pages: a small avatar, no cloud. */
.wl-ip--compact {
	--wl-ip-h: clamp(84px, 11vh, 112px);
}

.wl-ip--compact .wl-ip__img,
.wl-ip--compact .wl-ip__motion,
.wl-ip--compact .wl-ip__video {
	height: var(--wl-ip-h);
	width: var(--wl-ip-h);
	filter: drop-shadow(0 12px 18px rgba(70, 63, 48, 0.18));
}

/* =========================================================================
   4b. Vertical nudges and type scale — home page only
   Four things can be moved up or down from the appearance settings: the site
   name, the intro line, the IP and the dialogue cloud. Each is a transform, so
   none of them can reflow the page — a large number slides the element over
   its neighbours instead of pushing them, which is what makes a negative value
   and a value past the screen edge safe.

   The numbers arrive as --wl-<kind>-offset-desktop|mobile and
   --wl-<kind>-scale-desktop|mobile (see willy_print_accent()). Desktop is the
   base; the mobile pair takes over at the layout's own single-column width, so
   there is one rule set and no per-browser values.

   Everything here is scoped to .wl-stage, which only the front page renders.
   The second layer and the article sidebar share the same blocks and the same
   data — the portrait, the name, the intro — but their position, size and
   spacing belong to their own responsive layout. Nudging the hero must not drag
   a 136px rail out of place, and the sidebar must not need a second set of
   coordinates for every element it reuses.

   A positive nudge means UP. The stored number is printed as-is and negated
   here, so the sign in the settings field and the direction on screen cannot
   drift apart in opposite directions.
   ========================================================================= */

.wl-stage .wp-block-site-title {
	transform: translateY(calc(-1 * var(--wl-title-offset-desktop, 0px)));
}

.wl-stage .wl-lead__role {
	transform: translateY(calc(-1 * var(--wl-intro-offset-desktop, 0px)));
}

/* The hero figure moves on two axes. Horizontal reads as the field promises
   (positive right); vertical keeps the sign flip, so positive is still up. Both
   live in one translate() because an element has one transform — writing two
   rules would make the second silently cancel the first.

   The scene's whole-group nudge rides on `translate`, the independent
   transform axis, so it adds to the character's own two axes without either
   rule knowing about the other. The dog reads the same tokens on its own box,
   which is how a nudge moves the pair and not one of them. */
.wl-stage .wl-ip {
	transform: translate(
		var(--wl-ip-offset-x-desktop, 0px),
		calc(-1 * var(--wl-ip-offset-desktop, 0px))
	);
	translate: var(--wl-scene-dx-d, 0px) calc(-1 * var(--wl-scene-dy-d, 0px));
}

/* The cloud keeps its measured margin (that is what anchors it to the visible
   head) and adds the nudge on top. */
.wl-stage .wl-bubble-slot {
	transform: translateY(calc(-1 * var(--wl-bubble-offset-desktop, 0px)));
}

/* The type scale multiplies the size the theme already chose, so 100% is "the
   design as drawn" and the plugin never has to know a pixel value. */
.wl-stage .wp-block-site-title {
	font-size: calc(clamp(2.1rem, 3.4vw + 0.4rem, 3.4rem) * var(--wl-title-scale-desktop, 1));
}

.wl-stage .wl-lead__role {
	font-size: calc(var(--wp--preset--font-size--small) * var(--wl-intro-scale-desktop, 1));
}

@media (max-width: 860px) {
	.wl-stage .wp-block-site-title {
		transform: translateY(calc(-1 * var(--wl-title-offset-mobile, 0px)));
		font-size: calc(clamp(2.1rem, 3.4vw + 0.4rem, 3.4rem) * var(--wl-title-scale-mobile, 1));
	}

	.wl-stage .wl-lead__role {
		transform: translateY(calc(-1 * var(--wl-intro-offset-mobile, 0px)));
		font-size: calc(var(--wp--preset--font-size--small) * var(--wl-intro-scale-mobile, 1));
	}

	.wl-stage .wl-ip {
		transform: translate(
			var(--wl-ip-offset-x-mobile, 0px),
			calc(-1 * var(--wl-ip-offset-mobile, 0px))
		);
		translate: var(--wl-scene-dx-m, 0px) calc(-1 * var(--wl-scene-dy-m, 0px));
	}

	.wl-stage .wl-bubble-slot {
		transform: translateY(calc(-1 * var(--wl-bubble-offset-mobile, 0px)));
	}
}

/* =========================================================================
   4c. Inner scene: the figure's own nudges
   The rail portrait is a 136px column, so its position is a separate question
   from the hero's, and the two axes are separate values: the figure sits too
   far left there, and a vertical shift in a narrow column means something it
   cannot mean on a full-width hero.

   Same sign convention as section 4b — a positive number moves the figure in
   the direction the label promises: x right, y up. Both are transforms, so a
   nudge slides the figure over the rail's padding instead of reflowing the
   column, and the dog measures the moved figure because it measures rectangles.

   Scoped to the rail: the hero's own nudge lives in 4b and the two must never
   stack on the same element, or a visitor setting both would move the figure
   by their sum.
   ========================================================================= */

.wl-rail .wl-ip {
	transform: translate(
		var(--wl-inner-ip-x-desktop, 0px),
		calc(-1 * var(--wl-inner-ip-y-desktop, 0px))
	);
	/* The scene nudge on the inner page: the rail figure is a different
	   composition from the hero, so it reads the read layer's pair. */
	translate: var(--wl-scene-dx-d, 0px) calc(-1 * var(--wl-scene-dy-d, 0px));
}

/* The horizontal strip the rail becomes below 860px has its own geometry, and
   the two numbers are stored separately for exactly that reason. */
@media (max-width: 860px) {
	.wl-rail .wl-ip {
		transform: translate(
			var(--wl-inner-ip-x-mobile, 0px),
			calc(-1 * var(--wl-inner-ip-y-mobile, 0px))
		);
		translate: var(--wl-scene-dx-m, 0px) calc(-1 * var(--wl-scene-dy-m, 0px));
	}
}

/* =========================================================================
   5. Site title and social row
   ========================================================================= */

.wl-lead__title,
.wp-block-site-title {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(2.1rem, 3.4vw + 0.4rem, 3.4rem);
	font-weight: 500;
	line-height: 1.08;
	letter-spacing: -0.018em;
	text-wrap: balance;
}

.wp-block-site-title a {
	color: inherit;
	text-decoration: none;
	background-image: linear-gradient(currentColor, currentColor);
	background-repeat: no-repeat;
	background-size: 0% 1px;
	background-position: 0 100%;
	transition: background-size var(--wp--custom--transition--base) var(--wp--custom--ease--out);
}

.wp-block-site-title a:hover {
	background-size: 100% 1px;
}

.wl-lead__role {
	margin: 0;
	color: var(--wp--preset--color--ink-soft);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.14em;
	text-transform: none;
}

/* --- Legibility over the photograph --------------------------------------

   The name, the intro and the social row are the only text on the site that is
   laid directly on the background image, and the image is the visitor's own
   photograph: it can be bright in one corner and almost black in another, and
   a colour that works on one will fail on the other. Three things fix that,
   and none of them is a card:

   1. A local gradient. A soft radial wash of paper behind the head feathered to
      fully transparent, so the text sits in a slightly lighter pocket of the
      same photograph instead of on top of it. It has no edge, no border and no
      blur filter, which is what separates it from the "text in a big white
      box" the site is trying to avoid.
   2. A tight halo, not a shadow. One-pixel paper-coloured text shadow plus a
      very low-opacity wide one: at a glance it reads as the text being crisp,
      not as a glow, and it keeps the letterforms dark ink instead of grey.
   3. Opacity that follows the scrim. Both of the above are mixed from the paper
      colour at partial strength, so raising the site's veil slider darkens the
      photograph AND lets the wash sit lighter again — the two controls cannot
      fight each other.

   Type size, weight, tracking and `text-wrap: balance` are untouched: this is
   about the surface behind the text, not about the text. */
.wl-lead__head {
	position: relative;
	/* Above the scene, below the name: the wash must not tint the illustration
	   that sits in the same column. */
	isolation: isolate;
}

.wl-lead__head::before {
	content: "";
	position: absolute;
	/* Tight enough to sit behind the two lines and no further: the illustration
	   starts a few pixels below the head, and a wash that reached it would paint
	   a halo onto the character. */
	/* The head's own box does not contain the title as it is actually drawn:
	   首頁微調 can nudge the name up (34px on this site) or down, and the wash
	   used to stop at the un-nudged box — so the name sat on the bare
	   photograph with the wash starting below it. The top inset therefore
	   follows the same stored nudge the title uses. Percentage insets resolve
	   against the head's height, which is why only the top needs the calc. */
	inset: calc(var(--wl-title-offset-desktop, 0px) * -1 - 14%) -11% -8%;
	z-index: -1;
	pointer-events: none;
	/* Measured, not eyeballed: at 74% a bright sky still left the small text at
	   2.9:1, because the wash covers the head's box but the box is bigger than the
	   words. Raising it to 90% and widening the core puts the photograph at a
	   paper-like luminance behind every line, and the stops below are what keep
	   the edge invisible — the gradient reaches transparent only at the very rim,
	   so there is no boundary to see. */
	background: radial-gradient(
		74% 68% at 50% 50%,
		color-mix(in srgb, var(--wp--preset--color--paper) 90%, transparent) 0%,
		color-mix(in srgb, var(--wp--preset--color--paper) 82%, transparent) 46%,
		color-mix(in srgb, var(--wp--preset--color--paper) 52%, transparent) 76%,
		transparent 100%
	);
}

/* On the narrow layouts the head is almost as wide as the column, so the wash
   widens with it rather than leaving the ends of a long line uncovered. */
@media (max-width: 1024px) {
	.wl-lead__head::before {
		inset: calc(var(--wl-title-offset-mobile, 0px) * -1 - 12%) -8%;
	}
}

.wl-stage .wp-block-site-title {
	text-shadow:
		0 1px 0 color-mix(in srgb, var(--wp--preset--color--paper) 72%, transparent),
		0 0 22px color-mix(in srgb, var(--wp--preset--color--paper) 52%, transparent);
}

.wl-stage .wl-lead__role {
	/* Darker than its normal ink-soft on purpose. This is the one line of small
	   text laid on the photograph with nothing behind it but the wash, and
	   ink-soft measured 2.9:1 on a bright sky even after the wash was
	   strengthened. Ink is the same hue, so the line stays the quiet second line
	   it was — it is legible now instead of merely lighter. */
	color: color-mix(in srgb, var(--wp--preset--color--ink) 88%, var(--wp--preset--color--ink-soft));
	text-shadow: 0 1px 0 color-mix(in srgb, var(--wp--preset--color--paper) 82%, transparent);
}

.wl-social {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wl-social__item {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* The QR button is a sibling of the link, never a child of it: a button
   inside a link is invalid and unreachable by keyboard. */
.wl-qr__toggle {
	flex: none;
	padding: 1px 5px;
	border: 1px solid currentColor;
	border-radius: var(--wp--custom--radius--sm);
	background: transparent;
	color: color-mix(in srgb, var(--wp--preset--color--ink-soft) 80%, transparent);
	font: inherit;
	font-size: 10px;
	line-height: 1.6;
	letter-spacing: 0.06em;
	cursor: pointer;
	opacity: 0.8;
	transition:
		opacity var(--wp--custom--transition--fast) var(--wp--custom--ease--soft),
		color var(--wp--custom--transition--fast) var(--wp--custom--ease--soft);
}

.wl-qr__toggle:hover,
.wl-qr__toggle[aria-expanded="true"] {
	opacity: 1;
	color: var(--wp--preset--color--ink);
}

.wl-qr__panel {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 20;
	/* The panel hangs off a small inline item, so its width must not be
	   squeezed to that item's width. */
	width: max-content;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 10px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--md);
	background: var(--wp--preset--color--card);
	box-shadow: var(--wl-shadow-lift);
}

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

.wl-qr__panel img {
	display: block;
	width: 132px;
	height: 132px;
	object-fit: contain;
	border-radius: 6px;
	background: #fff;
}

.wl-qr__close {
	padding: 1px 8px;
	border: 0;
	border-radius: var(--wp--custom--radius--sm);
	background: transparent;
	color: var(--wp--preset--color--ink-soft);
	font: inherit;
	font-size: 11px;
	cursor: pointer;
}

.wl-qr__close:hover {
	background: rgba(44, 42, 37, 0.06);
	color: var(--wp--preset--color--ink);
}

/* A real link and an unset placeholder must not look alike: one is something
   the visitor can press, the other is a note to the site owner. Both sit on the
   photograph, so both carry a small surface of their own — a light chip for the
   link, a dashed outline for the placeholder — and the difference is in the
   shape, not only in the colour. */
.wl-social__link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 5px 11px;
	border-radius: var(--wp--custom--radius--pill);
	background: color-mix(in srgb, var(--wp--preset--color--card) 88%, transparent);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wp--preset--color--line) 60%, transparent);
	color: var(--wp--preset--color--ink-soft);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
	transition:
		color var(--wp--custom--transition--fast) var(--wp--custom--ease--soft),
		background-color var(--wp--custom--transition--fast) var(--wp--custom--ease--soft),
		box-shadow var(--wp--custom--transition--fast) var(--wp--custom--ease--soft);
}

a.wl-social__link:hover,
a.wl-social__link:focus-visible {
	background: var(--wl-surface-raised);
	box-shadow:
		inset 0 0 0 1px color-mix(in srgb, var(--wp--preset--color--line) 92%, transparent),
		var(--wl-focus);
	outline: none;
	color: var(--wp--preset--color--ink);
}

.wl-social__icon {
	display: inline-flex;
}

/* The placeholder keeps the photograph showing through instead of getting a
   chip: it is deliberately the quieter of the two, and the dashed edge says
   "not a link yet" before the label does. */
.wl-social__link.is-pending {
	/* A placeholder is still text on the photograph, so it needs the same floor
	   as a real link — a plain pill without the solid edge and without a hover
	   state. The shape difference (dashed "示意" tag, muted colour, help cursor)
	   is what says "not a link yet"; the background is what makes it readable. */
	background: color-mix(in srgb, var(--wp--preset--color--paper) 94%, transparent);
	box-shadow: none;
	color: color-mix(in srgb, var(--wp--preset--color--ink-soft) 92%, transparent);
	cursor: help;
}

.wl-social__pending {
	flex: none;
	padding: 0 5px;
	border: 1px dashed currentColor;
	border-radius: var(--wp--custom--radius--pill);
	font-size: 10px;
	line-height: 1.7;
	letter-spacing: 0.04em;
	white-space: nowrap;
	opacity: 0.85;
}

/* =========================================================================
   6. Topic cards
   The same markup serves the home page and any other template that places
   the block; only the width changes.
   ========================================================================= */

.wl-home__panel {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 14px;
	min-width: 0;
	padding: clamp(18px, 2.2vw, 36px);
	/* The surface every panel shares, so the article, the list and this deck
	   read as one material. See section 10b for the values and why. */
	border: 1px solid var(--wl-preset-edge);
	border-radius: var(--wl-preset-radius-panel);
	background: var(--wl-preset-surface);
	box-shadow: var(--wl-preset-shadow);
	view-transition-name: wl-deck;
}

.wl-cards {
	display: flex;
	flex-direction: column;
	gap: clamp(10px, 1.2vh, 15px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.wl-card {
	/* The card is a container, not a link: the title block is the big link and
	   each sub line is its own small link, so they can never nest. */
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: clamp(11px, 1.5vh, 16px) clamp(16px, 1.7vw, 24px) clamp(9px, 1.1vh, 12px);
	border: 1px solid var(--wl-preset-edge-strong);
	border-radius: var(--wl-preset-radius-item);
	background: var(--wp--preset--color--card);
	box-shadow: none;
	color: var(--wp--preset--color--ink);
	transition:
		transform var(--wp--custom--transition--base) var(--wp--custom--ease--out),
		box-shadow var(--wp--custom--transition--base) var(--wp--custom--ease--out),
		border-color var(--wp--custom--transition--base) var(--wp--custom--ease--soft);
}

/* The hover says "this is the row" with a tone and a rule rather than by
   lifting the box off the page, which is what made a list read as a stack of
   floating cards. */
.wl-card:hover {
	transform: none;
	background: var(--wl-surface-raised);
	border-color: color-mix(in srgb, var(--wp--preset--color--accent) 46%, var(--wp--preset--color--line));
	box-shadow: var(--wl-preset-shadow);
}

.wl-card:active {
	transform: translateY(0);
}

.wl-card__main {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	color: inherit;
	text-decoration: none;
}

.wl-card__main:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-deep);
	outline-offset: 4px;
	border-radius: var(--wp--custom--radius--sm);
}

.wl-card__text {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.wl-card__title {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.06rem, 0.5vw + 0.95rem, 1.28rem);
	font-weight: 500;
	line-height: 1.32;
	letter-spacing: -0.006em;
}

/* The small links stay quiet until they are hovered or focused: the big title
   stays the obvious entry, and only one affordance is loud at a time. */
.wl-card__subs {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 16px;
	margin: 2px 0 0;
	padding: 0;
	list-style: none;
}

.wl-card__sub {
	display: inline-block;
	padding: 2px 0;
	color: color-mix(in srgb, var(--wp--preset--color--ink-soft) 82%, transparent);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.6;
	text-decoration: none;
	transition: color var(--wp--custom--transition--fast) var(--wp--custom--ease--soft);
}

.wl-card__sub:hover,
.wl-card__sub:focus-visible {
	color: var(--wp--preset--color--ink);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.wl-card__sub.is-plain {
	color: color-mix(in srgb, var(--wp--preset--color--ink-soft) 68%, transparent);
}

.wl-card__art {
	flex: none;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: var(--wp--preset--radius-item);
	color: var(--wp--preset--color--accent-deep);
	background: color-mix(in srgb, var(--wp--preset--color--accent) 8%, transparent);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wp--preset--color--accent) 16%, transparent);
	transition: background-color var(--wp--custom--transition--base) var(--wp--custom--ease--soft);
}

.wl-card:hover .wl-card__art {
	background: color-mix(in srgb, var(--wp--preset--color--accent) 22%, transparent);
}

.wl-card__img {
	width: 30px;
	height: 30px;
	object-fit: cover;
	border-radius: 6px;
}

.wl-card__art .wl-icon {
	width: 26px;
	height: 26px;
}

.wl-all-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	align-self: flex-end;
	margin-top: 2px;
	color: var(--wp--preset--color--ink-soft);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
	transition: color var(--wp--custom--transition--fast) var(--wp--custom--ease--soft);
}

.wl-all-link:hover {
	color: var(--wp--preset--color--ink);
}

/* =========================================================================
   7. Inner pages: rail + content
   ========================================================================= */

.wl-page__grid {
	display: grid;
	/* The rail keeps its place near the edge of a wide screen; everything the
	   shell gains goes to the content column. The shell is wide on purpose —
	   the reading measure is enforced on the text itself, not by starving the
	   whole page. */
	grid-template-columns: clamp(8.5rem, 9.5%, 13rem) minmax(0, 1fr);
	gap: clamp(20px, 2.6vw, 48px);
	align-items: start;
	width: min(var(--wl-shell), 100%);
	margin-inline: auto;
}

.wl-rail {
	position: sticky;
	/* Clears the WordPress toolbar when an editor is logged in; the fallback is
	   zero for visitors, so the rail sits at the top of the gutter. */
	top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--wl-gutter));
	display: flex;
	flex-direction: column;
	gap: 16px;
	/* The rail sits over the photograph, where the veil is thinnest. It gets its
	   own quiet surface so its labels stay readable over any background, rather
	   than depending on the visitor choosing a pale image. */
	padding: clamp(12px, 1.1vw, 16px) clamp(12px, 1.1vw, 16px) 14px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--line) 70%, transparent);
	border-radius: var(--wp--custom--radius--lg);
	background: color-mix(in srgb, var(--wl-surface) 94%, transparent);
	box-shadow: var(--wl-shadow-card);
	min-width: 0;
	/* A sticky box taller than the space the viewport leaves it is not held at
	   `top` any more: once the article has been scrolled the box is clamped
	   against the bottom of its grid area and pushed upwards with the content,
	   which reads as the sidebar scrolling along with the text. Capping the
	   height at what the toolbar and the gutters leave, and letting the rail
	   scroll inside itself when the labels need more room, keeps the rail
	   beside the reader at every window height. */
	align-self: start;
	/* Two declarations on purpose: `dvh` is the honest one (it shrinks when a
	   phone's toolbar appears), but a browser that does not know it drops the
	   whole declaration and would silently lose the cap — which is exactly the
	   defect this is here to prevent. The `vh` line above it is the fallback. */
	max-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px) - (var(--wl-gutter) * 2));
	max-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px) - (var(--wl-gutter) * 2));
	overflow-y: auto;
	overscroll-behavior: contain;
}

.wl-rail .wl-ip {
	align-items: flex-start;
}

.wp-block-site-title.wl-rail__title {
	font-size: clamp(1.05rem, 0.4vw + 0.95rem, 1.2rem);
	letter-spacing: -0.01em;
}

.wl-rail .wl-nav a {
	/* The rail can be a tenth of the page, so labels wrap instead of
	   overflowing; the row still reads as one block, and the bar keeps its
	   clearance even when the label takes two lines. */
	padding: 8px 8px 8px 15px;
	overflow-wrap: anywhere;
}

.wl-rail .wl-social {
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
}

/* The rail's index. Four states have to be told apart at a glance in a column
   this narrow: where the reader is, what else is clickable, what the pointer is
   on, and where the keyboard is.

   It used to mark the current item with a 2px inset line on a translucent
   cream fill. In a 136px column that reads as a smudge along the edge rather
   than as a selected row — the mark was thinner than the letter strokes, and
   the fill was so close to the rail's own colour that the row looked dirty
   instead of chosen. The mark is now a real indicator: a solid bar with air
   around it, a tinted fill, ink text and a weight step. Hover stays a plain
   light fill with no bar, so it can never be mistaken for the current page. */
.wl-nav ul {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wl-nav a {
	position: relative;
	display: block;
	/* Tall enough to be a comfortable target in a column where everything is
	   narrow: 9px of padding around a 19px line is still under the 44px a
	   touch target wants, which is why the rail switches to a horizontal strip
	   below 860px instead of asking this list to be something it cannot be. */
	padding: 9px 10px 9px 16px;
	border-radius: 8px;
	color: var(--wp--preset--color--ink-soft);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.45;
	text-decoration: none;
	transition:
		background-color var(--wp--custom--transition--fast) var(--wp--custom--ease--soft),
		color var(--wp--custom--transition--fast) var(--wp--custom--ease--soft),
		box-shadow var(--wp--custom--transition--fast) var(--wp--custom--ease--soft);
}

.wl-nav a:hover {
	background: color-mix(in srgb, var(--wp--preset--color--card) 92%, transparent);
	color: var(--wp--preset--color--ink);
}

/* The keyboard and the pointer get the same visible response, plus the shared
   focus ring: hover alone must never be the only signal. */
.wl-nav a:focus-visible {
	outline: none;
	color: var(--wp--preset--color--ink);
	background: color-mix(in srgb, var(--wp--preset--color--card) 92%, transparent);
	box-shadow: var(--wl-focus);
}

.wl-nav a.is-current {
	color: var(--wp--preset--color--ink);
	font-weight: 600;
	background: color-mix(in srgb, var(--wp--preset--color--accent) 16%, var(--wp--preset--color--card));
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wp--preset--color--accent) 34%, transparent);
}

/* The bar is drawn rather than inset so it can have its own width, rounding and
   clearance from the label instead of sitting on the text's baseline. */
.wl-nav a.is-current::before {
	content: "";
	position: absolute;
	inset-block: 9px;
	inset-inline-start: 5px;
	width: 3px;
	border-radius: 2px;
	background: var(--wp--preset--color--accent);
}

.wl-nav a.is-current:hover {
	background: color-mix(in srgb, var(--wp--preset--color--accent) 22%, var(--wp--preset--color--card));
}

.wl-list {
	display: flex;
	flex-direction: column;
	gap: 18px;
	min-width: 0;
	/* The list sits on its own readable surface for the same reason the article
	   does: the heading, the filter row and the cards all sit over a photograph
	   whose brightness is not this page's decision. */
	padding: clamp(18px, 2.2vw, 40px);
	border: 1px solid var(--wl-preset-edge);
	border-radius: var(--wl-preset-radius-panel);
	background: var(--wl-preset-surface);
	box-shadow: var(--wl-preset-shadow);
	view-transition-name: wl-deck;
}

.wl-list__title,
.wl-article__title {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.9rem, 2.4vw + 0.9rem, 3rem);
	font-weight: 500;
	line-height: 1.16;
	letter-spacing: -0.014em;
	text-wrap: balance;
}

.wl-list__intro {
	max-width: 34rem;
	margin: 0;
	color: var(--wp--preset--color--ink-soft);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.85;
}

/* Category filter tags.

   A filter should show its state in the same place as the label, so the selected
   tab is the label itself: ink text, medium weight, and a rule sitting on the
   row's own baseline. It used to be a filled ink block, which made the filter
   the heaviest thing on the page and competed with the reading panel for the
   eye. The row carries one continuous rule, so the tabs read as an index of
   what is on the page rather than as a cloud of separate pills. */
.wl-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 4px;
	margin: 2px 0 0;
	padding: 0 0 0;
	list-style: none;
	border-bottom: 1px solid var(--wl-preset-edge);
}

.wl-tag {
	display: inline-flex;
	align-items: baseline;
	gap: 5px;
	padding: 7px 12px 8px;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--wp--preset--color--ink-soft);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.01em;
	text-decoration: none;
	box-shadow: inset 0 -2px 0 transparent;
	transition:
		color var(--wp--custom--transition--fast) var(--wp--custom--ease--soft),
		box-shadow var(--wp--custom--transition--fast) var(--wp--custom--ease--soft);
}

.wl-tag:hover {
	background: none;
	color: var(--wp--preset--color--ink);
	box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--wp--preset--color--accent) 55%, transparent);
}

/* Keyboard focus gets the same rule the pointer gets, plus the shared ring:
   hover must never be the only way to see which tab you are on. */
.wl-tag:focus-visible {
	color: var(--wp--preset--color--ink);
	box-shadow: inset 0 -2px 0 var(--wp--preset--color--accent), var(--wl-focus);
	outline: none;
}

.wl-tag.is-current {
	background: none;
	color: var(--wp--preset--color--ink);
	font-weight: 600;
	box-shadow: inset 0 -2px 0 var(--wp--preset--color--ink);
}

/* Selected or not, the count stays quieter than its label, and both keep the
   same optical size so switching tabs does not reflow the row. */
.wl-tag__count {
	font-size: 10px;
	font-variant-numeric: tabular-nums;
	opacity: 0.55;
	transition: opacity var(--wp--custom--transition--fast) var(--wp--custom--ease--soft);
}

.wl-tag.is-current .wl-tag__count {
	opacity: 0.8;
}

/* The topic tabs sit directly under the topic name and filter the list below,
   so they share the row rule and take a little more room than a loose tag
   cloud. */
.wl-tags--topic {
	gap: 2px 4px;
	margin-top: -4px;
	margin-bottom: 2px;
	padding-bottom: 0;
	border-bottom: 1px solid var(--wl-preset-edge);
}

.wl-tags--topic .wl-tag {
	padding: 8px 10px;
}

/* =========================================================================
   8. Content list
   ========================================================================= */

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

.wl-entry__link {
	display: flex;
	align-items: flex-start;
	gap: clamp(14px, 1.4vw, 22px);
	padding: clamp(15px, 1.4vw, 20px) clamp(16px, 1.5vw, 24px);
	border: 1px solid var(--wl-preset-edge-strong);
	border-radius: var(--wl-preset-radius-item);
	background: var(--wp--preset--color--card);
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	transition:
		transform var(--wp--custom--transition--base) var(--wp--custom--ease--out),
		background-color var(--wp--custom--transition--base) var(--wp--custom--ease--soft),
		border-color var(--wp--custom--transition--base) var(--wp--custom--ease--soft);
}

/* The row responds with a tone and an edge instead of a lift, so a list of
   twenty entries stays a list rather than twenty floating cards, and the same
   signal is bound to keyboard focus below. */
.wl-entry__link:hover,
.wl-entry__link:focus-visible {
	transform: none;
	background: var(--wl-surface-raised);
	border-color: color-mix(in srgb, var(--wp--preset--color--accent) 46%, var(--wp--preset--color--line));
	box-shadow: var(--wl-preset-shadow);
	outline: none;
}

.wl-entry__cover {
	flex: none;
	width: clamp(84px, 9vw, 120px);
	aspect-ratio: 4 / 3;
	object-fit: cover;
	/* A straight edge rather than a soft one: at 100px wide a 12px radius turns
	   a photograph into a badge. */
	border-radius: 4px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--line) 70%, transparent);
	background: var(--wp--preset--color--paper-deep);
}

.wl-entry__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.wl-entry__title {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.05rem, 0.35vw + 0.98rem, 1.22rem);
	font-weight: 500;
	line-height: 1.34;
	letter-spacing: -0.006em;
}

.wl-entry__excerpt {
	color: var(--wp--preset--color--ink-soft);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.65;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
}

.wl-entry__topic {
	align-self: flex-start;
	margin-top: 2px;
	padding: 1px 8px;
	border-radius: var(--wp--custom--radius--pill);
	background: color-mix(in srgb, var(--wp--preset--color--accent) 12%, transparent);
	color: var(--wp--preset--color--accent-deep);
	font-size: 10px;
	letter-spacing: 0.04em;
}

/* Tags are shown, not promoted: a quiet row under the card, separated from the
   card surface so they never read as a second level of navigation the way the
   topic pill and the category filter do. Their links are siblings of the card
   link, never inside it. */
.wl-entry {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.wl-entry__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	padding-inline-start: clamp(16px, 1.5vw, 24px);
}

.wl-entry.has-cover .wl-entry__tags {
	/* Line the row up with the title, past the cover thumbnail. */
	padding-inline-start: calc(clamp(14px, 1.4vw, 22px) + clamp(84px, 9vw, 120px));
}

.wl-entry__tag {
	color: color-mix(in srgb, var(--wp--preset--color--ink-soft) 88%, transparent);
	font-size: 11px;
	line-height: 1.5;
	letter-spacing: 0.02em;
	text-decoration: none;
	border-bottom: 1px solid color-mix(in srgb, currentColor 32%, transparent);
	transition: color var(--wp--custom--transition--fast) var(--wp--custom--ease--soft);
}

.wl-entry__tag::before {
	content: "#";
	opacity: 0.55;
}

.wl-entry__tag:hover {
	color: var(--wp--preset--color--ink);
}

.wl-pagination {
	margin-top: 8px;
}

.wl-pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wl-pagination a,
.wl-pagination span {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--pill);
	background: rgba(251, 247, 238, 0.7);
	color: var(--wp--preset--color--ink-soft);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
}

.wl-pagination .current {
	background: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--card);
}

.wl-empty {
	padding: 22px;
	border: 1px dashed var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--lg);
	color: var(--wp--preset--color--ink-soft);
	font-size: var(--wp--preset--font-size--small);
}

/* =========================================================================
   9. Single article
   ========================================================================= */

/*
 * The article is one opaque reading panel over the photograph: a single quiet
 * surface with a hairline border, generous padding and a restrained shadow,
 * rather than a white wash or a card per paragraph. The panel may be wide so
 * media have room; the text inside keeps its own reading measure.
 */
.wl-article {
	--wl-pad: clamp(18px, 2.2vw, 44px);

	max-width: var(--wl-panel);
	min-width: 0;
	padding: var(--wl-pad);
	border: 1px solid var(--wl-preset-edge);
	border-radius: var(--wl-preset-radius-panel);
	background: var(--wl-preset-surface);
	box-shadow: var(--wl-preset-shadow), inset 0 0 0 1px rgba(213, 203, 184, 0.28);
}

/*
 * The back control and a one-line copy of the title share this row. It is
 * stuck to the top of the viewport so the way out is always reachable in a
 * long article, and it keeps a solid surface of its own: a transparent bar
 * would let body text run underneath it. It sits inside the panel's padding,
 * so it can never cover more than the text column.
 */
.wl-bar {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + clamp(6px, 1vw, 12px));
	z-index: 5;
	/* A compact pill, not a full-width band: it only needs to hold the arrow and,
	   once the heading is gone, one line of the title. Staying narrow means it
	   covers as little of the page as a way out can. */
	width: -moz-fit-content;
	width: fit-content;
	max-width: 100%;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 4px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--line) 55%, transparent);
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wl-surface-raised);
	transition: box-shadow var(--wp--custom--transition--base) var(--wp--custom--ease--soft);
}

/* Only once the real heading has left the viewport does the copy appear, so
   the same words are never on screen twice. The full title always stays in
   the body; this row shows one line of it. */
.wl-bar.is-condensed {
	/* The condensed bar already sits on the panel's own surface; it should read
	   as a label on the page, not as a second card floating above it. */
	box-shadow: none;
	border-color: var(--wl-preset-edge);
	background: var(--wl-surface-raised);
}

.wl-bar__title {
	display: none;
	min-width: 0;
	overflow: hidden;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(0.9rem, 0.3vw + 0.86rem, 1rem);
	line-height: 1.35;
	color: var(--wp--preset--color--ink);
	white-space: nowrap;
	text-overflow: ellipsis;
}

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

/* The arrow is the whole control: no label, so it needs a real hit area and a
   visible focus ring. Its accessible name comes from aria-label. */
.wl-back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: var(--wp--custom--radius--pill);
	color: var(--wp--preset--color--ink-soft);
	font-size: 1.15rem;
	line-height: 1;
	text-decoration: none;
	transition:
		background-color var(--wp--custom--transition--fast) var(--wp--custom--ease--soft),
		color var(--wp--custom--transition--fast) var(--wp--custom--ease--soft);
}

.wl-back:hover {
	background: color-mix(in srgb, var(--wp--preset--color--accent) 14%, transparent);
	color: var(--wp--preset--color--ink);
}

/* The global focus ring squares off at 4px; a round control keeps its shape so
   the ring reads as part of it. */
.wl-back:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-deep);
	outline-offset: 2px;
	border-radius: var(--wp--custom--radius--pill);
}

.wl-article__title {
	/* Headings may run a little wider than body text without hurting the eye,
	   but they stop well short of the panel edge. */
	max-width: 46rem;
	margin-top: 14px;
}

.wl-article__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	max-width: var(--wp--custom--measure--reading);
	margin-top: 12px;
	color: var(--wp--preset--color--ink-soft);
	font-size: var(--wp--preset--font-size--small);
}

.wl-article__meta a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid color-mix(in srgb, currentColor 40%, transparent);
	padding-bottom: 1px;
}

.wl-article__cover {
	margin: 26px 0 0;
	border-radius: var(--wp--custom--radius--lg);
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--paper-deep);
}

.wl-article__cover img {
	display: block;
	width: 100%;
	height: auto;
}

/*
 * Body copy keeps a reading measure of its own (~40rem, roughly 70 characters at
 * this size), while media may use the wider panel: a photograph or a table
 * squeezed into the text column wastes the screen, and text stretched across it
 * is unreadable. So the measure lives on the text blocks, not on .wl-prose.
 */
.wl-prose {
	margin-top: 30px;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.85;
}

.wl-prose > * {
	max-width: var(--wp--custom--measure--reading);
}

.wl-prose > :where(
		figure,
		.wp-block-image,
		.wp-block-gallery,
		.wp-block-video,
		.wp-block-embed,
		.wp-block-table,
		table,
		.wp-block-columns,
		.wp-block-file,
		pre,
		.alignwide,
		.alignfull
	) {
	/* Media may use the full panel width; the cap only matters on a very wide
	   screen, where no image needs to be longer than this. */
	max-width: min(100%, var(--wl-media));
}

.wl-prose > * + * {
	margin-block-start: 1.25em;
}

.wl-prose h2,
.wl-prose h3,
.wl-prose h4 {
	margin-block-start: 1.9em;
	margin-block-end: 0.5em;
	line-height: 1.3;
	text-wrap: balance;
}

.wl-prose a {
	color: var(--wp--preset--color--accent-deep);
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, currentColor 42%, transparent);
}

.wl-prose a:hover {
	text-decoration-color: currentColor;
}

.wl-prose figure {
	margin-inline: 0;
}

.wl-prose figcaption {
	margin-top: 8px;
	color: var(--wp--preset--color--ink-soft);
	font-size: var(--wp--preset--font-size--small);
	text-align: center;
}

.wl-prose img,
.wl-prose video,
.wl-prose iframe {
	border-radius: var(--wp--custom--radius--md);
}

.wl-prose blockquote {
	margin-inline: 0;
	padding: 4px 0 4px 20px;
	border-left: 2px solid var(--wp--preset--color--accent);
	color: var(--wp--preset--color--ink-soft);
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.7;
}

.wl-prose blockquote cite {
	display: block;
	margin-top: 8px;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-style: normal;
}

.wl-prose ul,
.wl-prose ol {
	padding-left: 1.3em;
}

.wl-prose li + li {
	margin-block-start: 0.4em;
}

.wl-prose hr {
	margin-block: 2.4em;
	border: 0;
	border-top: 1px solid var(--wp--preset--color--line);
}

.wl-prose table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--small);
}

.wl-prose th,
.wl-prose td {
	padding: 9px 12px;
	border-bottom: 1px solid var(--wp--preset--color--line);
	text-align: left;
}

.wl-prose th {
	background: rgba(251, 247, 238, 0.7);
	font-weight: 600;
}

.wl-prose code {
	padding: 0.15em 0.4em;
	border-radius: 4px;
	background: rgba(44, 42, 37, 0.07);
	font-size: 0.92em;
}

.wl-prose pre {
	padding: 16px 18px;
	border-radius: var(--wp--custom--radius--md);
	background: #2c2a25;
	color: #f4efe4;
	overflow-x: auto;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.7;
}

.wl-prose pre code {
	padding: 0;
	background: none;
	color: inherit;
}

/* File download / attachment block, styled when it appears inside prose. */
.wl-prose .wp-block-file {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--md);
	background: var(--wp--preset--color--card);
}

.wl-prose .wp-block-file a:not(.wp-block-file__button) {
	font-weight: 500;
}

.wl-prose .wp-block-file__button {
	padding: 6px 14px;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--card);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
}

/* =========================================================================
   10. Footer note
   ========================================================================= */

.wl-foot {
	margin-top: 64px;
	padding-top: 20px;
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--line) 70%, transparent);
	color: var(--wp--preset--color--ink-soft);
	font-size: var(--wp--preset--font-size--small);
}

.wl-foot__inner {
	width: min(var(--wl-shell), 100%);
	margin-inline: auto;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	justify-content: space-between;
}

/* =========================================================================
   10b. Appearance preset: 夜墨（深墨閱讀）

   The second preset, and the only one that changes the material rather than
   the tuning. It is a whole surface: dark panels, warm-white text, the category
   tabs lit instead of ruled in ink, and a rail that recedes so the reading
   column is the only lit thing on the page.

   Why this direction, from ui-ux-pro-max: `--domain style "editorial dark ink
   reading surface calm mature"` returns `dark-mode-oled` — deep, low-emission
   surfaces with "minimal glow, low white emission, high readability, visible
   focus" and a checklist of "text contrast 7:1+, no white background". That is
   the opposite end of the same brand: the current preset is paper, this one is
   ink, and both keep the green accent and the serif.

   What does NOT change, by design: the background photograph, the IP and its
   dog, the dialogue cloud, the header, the type sizes, the reading measure and
   every saved position. A preset is a reading surface, not a theme rebuild —
   the settings for the person, the dog and the text all keep working, and
   switching back to 現況 restores the light paper exactly.

   Contrast is the one thing that has to be right rather than merely different:
   body text is #F0EAE0 on #24231F (about 13:1), the secondary tone #B3AB9B on
   the same surface (about 4.9:1), and the accent is lightened from the brand
   green only where it has to carry text.
   ========================================================================= */

body.wl-preset-night {
	/* The material. Overriding the same five tokens the base defines means
	   every panel, card and edge follows without a second list of selectors. */
	--wl-preset-surface: linear-gradient(180deg, #262520 0%, #201f1b 100%);
	--wl-preset-edge: color-mix(in srgb, #f0eae0 14%, transparent);
	--wl-preset-edge-strong: color-mix(in srgb, #f0eae0 22%, transparent);
	--wl-preset-shadow: 0 1px 0 rgba(0, 0, 0, 0.4), 0 18px 40px -30px rgba(0, 0, 0, 0.9);
	--wl-preset-shadow-lift: 0 1px 0 rgba(0, 0, 0, 0.45), 0 24px 48px -32px rgba(0, 0, 0, 0.95);
	--wl-preset-radius-panel: 12px;
	--wl-preset-radius-item: 8px;

	/* Text, on every surface this preset owns. */
	--wl-night-ink: #f0eae0;
	--wl-night-soft: #b3ab9b;
	--wl-night-quiet: #8d8677;
	--wl-night-accent: #a9bd93;
	--wl-night-fill: rgba(240, 234, 224, 0.06);
	--wl-night-fill-strong: rgba(240, 234, 224, 0.1);
}

/* --- The panels themselves ------------------------------------------------ */

body.wl-preset-night .wl-article,
body.wl-preset-night .wl-list,
body.wl-preset-night .wl-home__panel {
	color: var(--wl-night-ink);
	background: var(--wl-preset-surface);
	border-color: var(--wl-preset-edge);
}

/* The headings and the reading copy are the reason for the whole preset, so
   they get a colour of their own rather than inheriting whatever the theme
   variable said. */
body.wl-preset-night .wl-article__title,
body.wl-preset-night .wl-list__title,
body.wl-preset-night .wl-prose,
body.wl-preset-night .wl-prose > *,
body.wl-preset-night .wl-card__title,
body.wl-preset-night .wl-entry__title {
	color: var(--wl-night-ink);
}

body.wl-preset-night .wl-prose a,
body.wl-preset-night .wl-article__meta a {
	color: var(--wl-night-accent);
	text-decoration-color: color-mix(in srgb, var(--wl-night-accent) 55%, transparent);
}

body.wl-preset-night .wl-list__intro,
body.wl-preset-night .wl-entry__excerpt,
body.wl-preset-night .wl-article__meta,
body.wl-preset-night .wl-card__sub,
body.wl-preset-night .wl-entry__tag,
body.wl-preset-night .wl-tag__count {
	color: var(--wl-night-soft);
}

body.wl-preset-night .wl-prose blockquote {
	border-inline-start-color: var(--wl-night-accent);
	color: var(--wl-night-soft);
}

body.wl-preset-night .wl-prose code,
body.wl-preset-night .wl-prose pre {
	background: rgba(0, 0, 0, 0.32);
	color: var(--wl-night-ink);
	border-color: var(--wl-preset-edge);
}

body.wl-preset-night .wl-prose hr,
body.wl-preset-night .wl-prose th,
body.wl-preset-night .wl-prose td {
	border-color: var(--wl-preset-edge);
}

/* The condensed title bar sits over the text it belongs to; on a dark panel it
   has to be the panel's own colour or it reads as a hole. */
body.wl-preset-night .wl-bar,
body.wl-preset-night .wl-bar.is-condensed {
	background: color-mix(in srgb, #262520 92%, transparent);
	border-color: var(--wl-preset-edge);
	color: var(--wl-night-ink);
	box-shadow: none;
}

body.wl-preset-night .wl-back,
body.wl-preset-night .wl-bar__title {
	color: var(--wl-night-soft);
}

body.wl-preset-night .wl-back:hover,
body.wl-preset-night .wl-bar a:hover {
	color: var(--wl-night-ink);
}

/* --- Cards ---------------------------------------------------------------- */

body.wl-preset-night .wl-card,
body.wl-preset-night .wl-entry__link {
	background: var(--wl-night-fill);
	border-color: var(--wl-preset-edge);
	color: var(--wl-night-ink);
}

body.wl-preset-night .wl-card:hover,
body.wl-preset-night .wl-entry__link:hover,
body.wl-preset-night .wl-card:focus-within,
body.wl-preset-night .wl-entry__link:focus-visible {
	background: var(--wl-night-fill-strong);
	border-color: color-mix(in srgb, var(--wl-night-accent) 60%, transparent);
	box-shadow: none;
}

body.wl-preset-night .wl-card__art {
	color: var(--wl-night-accent);
	background: rgba(169, 189, 147, 0.12);
	box-shadow: inset 0 0 0 1px rgba(169, 189, 147, 0.22);
}

body.wl-preset-night .wl-card__sub,
body.wl-preset-night .wl-entry__topic {
	color: var(--wl-night-soft);
}

body.wl-preset-night .wl-entry__cover {
	border-color: var(--wl-preset-edge);
}

/* --- Category tabs: lit, not ruled --------------------------------------- */

body.wl-preset-night .wl-tags,
body.wl-preset-night .wl-tags--topic {
	border-bottom-color: var(--wl-preset-edge);
}

body.wl-preset-night .wl-tag {
	color: var(--wl-night-soft);
}

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

body.wl-preset-night .wl-tag.is-current {
	color: var(--wl-night-ink);
	box-shadow: inset 0 -2px 0 var(--wl-night-accent);
}

body.wl-preset-night .wl-tag__count {
	color: var(--wl-night-quiet);
}

/* --- The rail recedes so the reading column is the only lit surface ------ */

body.wl-preset-night .wl-rail {
	background: color-mix(in srgb, #232220 82%, transparent);
	border-color: var(--wl-preset-edge);
	box-shadow: none;
}

body.wl-preset-night .wp-block-site-title.wl-rail__title a {
	color: var(--wl-night-ink);
}

body.wl-preset-night .wl-nav a {
	color: var(--wl-night-soft);
}

body.wl-preset-night .wl-nav a:hover {
	background: var(--wl-night-fill);
	color: var(--wl-night-ink);
}

body.wl-preset-night .wl-nav a.is-current {
	background: color-mix(in srgb, var(--wl-night-accent) 20%, transparent);
	color: var(--wl-night-ink);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wl-night-accent) 34%, transparent);
}

body.wl-preset-night .wl-nav a.is-current::before {
	background: var(--wl-night-accent);
}

body.wl-preset-night .wl-nav a:focus-visible {
	background: var(--wl-night-fill-strong);
	color: var(--wl-night-ink);
}

body.wl-preset-night .wl-rail .wl-social__link {
	color: var(--wl-night-soft);
}

/* The chips on the home page sit on the photograph, not on a panel, so the
   night preset gives them its own dark glass rather than a paper chip that
   would be the brightest thing on the page. */
body.wl-preset-night .wl-stage .wl-social__link {
	background: color-mix(in srgb, #24231f 88%, transparent);
	box-shadow: inset 0 0 0 1px var(--wl-preset-edge);
	color: var(--wl-night-ink);
}

body.wl-preset-night .wl-stage a.wl-social__link:hover,
body.wl-preset-night .wl-stage a.wl-social__link:focus-visible {
	background: color-mix(in srgb, #2c2b26 94%, transparent);
	color: var(--wl-night-ink);
}

body.wl-preset-night .wl-stage .wl-social__link.is-pending {
	background: color-mix(in srgb, #171613 94%, transparent);
	box-shadow: none;
	color: var(--wl-night-soft);
}

body.wl-preset-night .wl-rail .wl-social__link:hover {
	color: var(--wl-night-ink);
}

/* --- The footer note ------------------------------------------------------ */

body.wl-preset-night .wl-foot {
	color: var(--wl-night-soft);
	border-top-color: var(--wl-preset-edge);
}

body.wl-preset-night .wl-foot a {
	color: var(--wl-night-soft);
}

body.wl-preset-night .wl-foot a:hover {
	color: var(--wl-night-ink);
}

/* The home page's text is laid on the photograph, so its legibility layer has
   to invert with the preset: the same wash that lightens a pocket of paper
   behind dark ink would put a grey film behind light ink. Here the wash is the
   night surface's own colour and the halo is dark, which keeps the name crisp
   against a bright sky without a single white patch on the page. */
body.wl-preset-night .wl-lead__head::before {
	/* Same geometry as the light version, darker and denser. Light ink over a
	   photograph needs the surface pulled down, not up: at 68% the photo still
	   showed through at 0.6 luminance and the name measured 1.6:1 — the night
	   preset was the worst case of the whole check, not the safest. */
	background: radial-gradient(
		74% 68% at 50% 50%,
		color-mix(in srgb, #171613 94%, transparent) 0%,
		color-mix(in srgb, #171613 88%, transparent) 46%,
		color-mix(in srgb, #171613 62%, transparent) 76%,
		transparent 100%
	);
}

body.wl-preset-night .wl-stage .wp-block-site-title {
	color: var(--wl-night-ink);
	text-shadow:
		0 1px 0 color-mix(in srgb, #1b1a17 60%, transparent),
		0 0 22px color-mix(in srgb, #1b1a17 55%, transparent);
}

body.wl-preset-night .wl-stage .wl-lead__role {
	color: var(--wl-night-soft);
	text-shadow:
		0 1px 0 color-mix(in srgb, #171613 82%, transparent),
		0 0 10px color-mix(in srgb, #171613 70%, transparent);
}

/* The dialogue cloud keeps its paper colour in both presets: it belongs to the
   character, not to the reading surface, and a dark cloud over a photograph
   would read as another panel. Nothing here changes it. */

/* =========================================================================
   11. Responsive
   ========================================================================= */

@media (max-width: 1024px) {
	.wl-stage__grid {
		grid-template-columns: minmax(0, 1fr);
		min-height: 0;
		gap: 26px;
	}

	.wl-stage {
		align-items: start;
		padding-top: clamp(26px, 5vh, 52px);
	}

	.wl-lead {
		gap: 14px;
	}

	.wl-ip--hero {
		--wl-ip-h: clamp(180px, 30vh, 300px);
	}

	.wl-card-w {
		width: 100%;
	}
}

@media (max-width: 860px) {
	.wl-page__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 22px;
	}

	/* One column: the panels keep their own surface but drop the outward
	   padding they no longer need to justify. */
	.wl-article,
	.wl-list {
		border-radius: var(--wp--custom--radius--lg);
	}

	.wl-rail {
		position: static;
		/* One column on a phone: the header is meant to scroll away with the
		   article, so the desktop height cap and its inner scrolling are
		   switched off here. */
		max-height: none;
		overflow-y: visible;
		align-self: auto;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		gap: 10px 14px;
		padding: 10px 12px;
	}

	.wl-ip--compact {
		flex: none;
	}

	.wl-ip--compact {
		--wl-ip-h: 62px;
	}

	/* The nav keeps a whole row of its own and scrolls inside itself, so the
	   page itself never gains a horizontal scrollbar. */
	.wl-nav {
		flex: 1 1 100%;
		min-width: 0;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.wl-nav::-webkit-scrollbar {
		display: none;
	}

	.wl-nav ul {
		flex-direction: row;
		align-items: center;
		gap: 2px;
		width: max-content;
	}

	/* In the horizontal strip the column's side bar has nowhere to go, so the
	   same indicator turns under the label: same idea, same colour, no
	   rotation of the layout. */
	.wl-nav a {
		white-space: nowrap;
		padding: 6px 11px 8px;
		/* Measured, then fixed: at 6px/8px the strip's targets were 35px tall,
		   which is under the 44px touch minimum — and this strip is only ever
		   used at the widths where a finger is what taps it. The height comes
		   from a minimum instead of more padding so the underline still sits on
		   the strip's own baseline. */
		min-height: 44px;
		align-items: center;
	}

	/* The current item keeps a fill as well as the underline: an underline alone
	   on a strip that scrolls sideways is easy to lose among the other labels,
	   and the four states have to stay separable at this size too. */
	.wl-nav a.is-current {
		background: color-mix(in srgb, var(--wp--preset--color--accent) 16%, transparent);
		box-shadow: inset 0 -2px 0 var(--wp--preset--color--accent);
	}

	.wl-nav a.is-current::before {
		content: none;
	}

	body.wl-preset-night .wl-nav a.is-current {
		background: color-mix(in srgb, var(--wl-night-accent) 20%, transparent);
		box-shadow: inset 0 -2px 0 var(--wl-night-accent);
	}

	.wl-rail .wl-social {
		flex: 1 1 100%;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 4px 14px;
	}
}

@media (max-width: 640px) {
	.wl-stage,
	.wl-page {
		padding: clamp(16px, 4.4vw, 24px);
	}

	.wl-scene__veil {
		background:
			linear-gradient(
				180deg,
				rgba(245, 240, 230, 0.5) 0%,
				rgba(245, 240, 230, calc(var(--wl-veil, 82%) * 0.86)) 52%,
				rgba(245, 240, 230, var(--wl-veil, 82%)) 100%
			);
	}

	.wl-bubble {
		/* Leave room for the silhouette's own overhang, or the cloud's lobes
		   land on the screen edge and read as a cropped panel again. Only the
		   ceiling changes here: the cloud still sizes itself to its sentence. */
		max-width: min(100% - 26px, 22rem);
	}

	.wl-bubble__cloud {
		inset: -12px -11px -10px;
	}

	/* On a phone the illustration is narrower and the two clouds sit almost on
	   the same axis, so the trail stays under the middle of the cloud. */
	.wl-bubble__trail {
		left: 50%;
	}

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

	.wl-card {
		padding: 13px 16px 11px;
	}

	.wl-card__subs {
		gap: 2px 14px;
	}

	.wl-card__art {
		width: 38px;
		height: 38px;
	}

	.wl-entry__cover {
		width: 76px;
	}

	.wl-qr__panel {
		/* On a phone the toggle can be close to the left edge, so the panel
		   anchors to the whole social list instead of to one item. */
		left: 0;
		right: auto;
	}

	.wl-article__title {
		font-size: clamp(1.6rem, 5vw + 0.5rem, 2.2rem);
	}

	/* A phone has no room for a panel inside a panel: keep the surface, drop
	   the double padding so text keeps a usable measure. */
	.wl-article,
	.wl-list {
		padding: clamp(14px, 4.4vw, 22px);
	}

	.wl-bar {
		gap: 6px;
	}

	.wl-bar__title {
		font-size: 0.9rem;
	}

	.wl-back {
		width: 2.5rem;
		height: 2.5rem;
	}

	/* The tag row lines up with the card text, not with the thumbnail, because
	   the cover sits above rather than beside the title at this width. */
	.wl-entry.has-cover .wl-entry__tags {
		padding-inline-start: clamp(16px, 1.5vw, 24px);
	}
}

@media (max-width: 380px) {
	.wl-social {
		gap: 4px 12px;
	}

	.wl-card__sub {
		/* The small links stay reachable; only their spacing tightens. */
		font-size: var(--wp--preset--font-size--small);
	}
}

/* =========================================================================
   12. Motion: reduce or remove when the visitor asks for it
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.wl-card:hover,
	.wl-entry__link:hover {
		transform: none;
	}
}

/* Cross-document view transitions.
   Purely declarative: unsupported browsers navigate normally, and nothing
   here can block a link. */
@view-transition {
	navigation: auto;
}

/* The character travels between the home page and an inner page.

   Naming the same element on both sides is the whole implementation: the
   browser measures where it actually was and where it actually lands, so the
   move follows the real layout — hero-sized in the middle of the front page,
   avatar-sized in the rail of an article — instead of a guessed position. No
   script, no history patching, and back/forward animate like any other
   navigation because they are ordinary navigations.

   The figure is named, not just the media stage. The dog and the speech cloud
   live inside the figure and outside the stage, so naming only the stage
   snapshotted the character and the dog into two independent groups whose
   order in the transition was up to the browser — which is how the dog could
   appear behind the character for the first frames of a navigation and then
   come out in front. With the whole figure captured as one group, the dog's
   position relative to the character is decided inside a single snapshot, by
   the same z-index that decides it at rest. (Named group + separate dog group
   was tried and is worse: the dog's snapshot has no character in it, so the
   dog vanishes for the middle of the animation.)

   The duration is one custom property, set from the appearance settings, so
   both directions of every navigation share it. It animates the snapshot and
   nothing else: it is not a delay before or after navigation, and `0` removes
   the animation entirely rather than making the visitor wait. */
.wl-ip {
	view-transition-name: wl-ip;
}

/* The speech cloud leaves the figure's group and cross-fades on its own: left
   inside, it would be squeezed from a 288px-wide cloud into the rail's 56px
   during the move, which is the one thing the earlier comment on this rule got
   right. Inner pages render no cloud, so in that direction it is a plain
   fade-out, and a fade-in on the way back. */
.wl-ip .wl-bubble-slot {
	view-transition-name: wl-bubble;
}

::view-transition-group(wl-ip) {
	animation-duration: var(--wl-transition-duration, 420ms);
	animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

::view-transition-old(wl-bubble),
::view-transition-new(wl-bubble) {
	animation-duration: max(120ms, var(--wl-transition-duration, 420ms));
	animation-timing-function: ease;
}

::view-transition-old(wl-deck),
::view-transition-new(wl-deck) {
	animation-duration: 380ms;
	animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reduced motion turns the transition off entirely rather than shortening it:
   the navigation is an ordinary one, so it completes at the browser's own
   speed with no snapshot to wait for. This was already the rule; naming the
   figure instead of its media box does not change it. */
@media (prefers-reduced-motion: reduce) {
	@view-transition {
		navigation: none;
	}
}


/* ---------------------------------------------------------------------------
   嵌入式整頁 HTML（貼進文章的 .wl-embed）
   貼進來的整頁 HTML 本來自帶排版，但它被三層上限夾住，只用了面板一半寬度：
     1. .wl-prose > * 的閱讀寬度 --wp--custom--measure--reading（40rem）
     2. WordPress 的 is-layout-constrained（42rem）
     3. .wl-embed 自己的 @scope 規則把 margin 設成 0，於是靠左、右邊留白
   用 :has() 只放寬「裡面含有 .wl-embed 的那個外層」，一般文章仍保持原閱讀寬度。
--------------------------------------------------------------------------- */
.wl-article .entry-content > :has(.wl-embed),
.wl-article .wl-prose > :has(.wl-embed) {
	max-width: none;
}

.wl-article .wl-embed {
	max-width: none !important;
	width: 100%;
	margin-inline: 0 !important;
}

/* 白底仍鋪滿面板，但內文收在可讀寬度內並居中：
   44em ≈ 748px（17px 字級），比主題預設的 40rem 略寬、又不會頂到面板兩側。
   小螢幕時 max-width 會自然退回可用寬度，不需要額外斷點。 */
.wl-article .wl-embed .wrap {
	max-width: 44em;
	margin-inline: auto;
	padding: 0 0 8px;
}
