/*
 * WAUW plain pages: page not found, and text documents. Ink on ivory.
 */
:is(.wd-404, .wd-doc) { color: var(--wp--preset--color--contrast); font-size: 1rem; }
:is(.wd-404, .wd-doc) :is(h1, h2, h3, p, ul, ol) { margin: 0; }
:is(.wd-404, .wd-doc) h1 { color: inherit; font-size: var(--wx-title); letter-spacing: -0.02em; line-height: 1.1; }

/* ---------- 404: the mirror wall asks ---------- */
.wd-wall { position: relative; overflow: hidden; height: clamp(13.5rem, 31vw, 28rem); background: #12344a; }
/* The photo is placed by its mirrors (33.6% down), so the five of them fill the width at every size. */
.wd-wall__pic { position: absolute; top: 50%; right: 0; width: 184%; aspect-ratio: 2560 / 1707; transform: translateY(-33.6%); }
.wd-wall__pic img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
/* Exactly over the fifth mirror; only its strokes change, the dot is the photo's own. */
.wd-wall__ask { position: absolute; top: 22.2%; left: 80.08%; width: 13.48%; height: 22.86%; }
.wd-lost { display: grid; gap: 2.5rem; width: min(96rem, 100% - 2 * var(--wauw-gutter)); margin-inline: auto; padding-block: clamp(2.25rem, 4vw, 3.75rem) clamp(3.5rem, 6vw, 5.5rem); }
.wd-lost h1 { text-wrap: balance; }
.wd-lost p { max-width: 32rem; margin-top: 1rem; font-size: 1.125rem; line-height: 1.55; }
.wd-find { box-sizing: border-box; display: flex; gap: 0.85rem; align-items: center; max-width: 30rem; min-height: 3.5rem; margin-top: 1.75rem; padding: 0.4rem 1.4rem; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wp--preset--color--contrast) 58%, #fff); color: inherit; font-size: 1.0625rem; line-height: 1.25; text-decoration: none; transition: box-shadow 0.2s; }
.wd-find:hover { box-shadow: inset 0 0 0 2px var(--wp--preset--color--contrast); }
.wd-find svg { flex: none; }
.wd-ways { padding: 0; list-style: none; border-top: 1px solid color-mix(in srgb, currentColor 16%, transparent); }
.wd-ways a { display: block; padding: 0.7rem 0; border-bottom: 1px solid color-mix(in srgb, currentColor 16%, transparent); color: inherit; font-family: var(--wp--preset--font-family--display); font-size: 1.35rem; line-height: 1.3; text-decoration: none; }
.wd-ways a:hover { text-decoration: underline 1px; text-underline-offset: 0.3em; }
@media (min-width: 60rem) {
	.wd-lost { grid-template-columns: minmax(0, 1fr) 22rem; gap: 5rem; }
	.wd-ways { margin-top: 0.75rem; }
}

/* ---------- Text documents ---------- */
.wd-sheet { padding: clamp(2rem, 5vw, 4.5rem) var(--wauw-gutter) clamp(3.5rem, 7vw, 6rem); }
.wd-sheet > h1 { margin-bottom: clamp(1.25rem, 3vw, 2.75rem); text-wrap: balance; }
/* The contents are built by plain.js; the space is there from the start so the text never moves. */
.wd-toc { min-height: 3.5rem; margin-bottom: 1.5rem; }
.wd-sheet:not(:has(.wd-text :is(h2, p > strong))) .wd-toc { display: none; }
.wd-toc summary { display: flex; align-items: center; justify-content: space-between; min-height: 3.5rem; border-block: 1px solid color-mix(in srgb, currentColor 16%, transparent); font-weight: 600; cursor: pointer; list-style: none; }
.wd-toc summary::-webkit-details-marker { display: none; }
.wd-toc summary::after { content: ""; width: 0.55rem; height: 0.55rem; margin-right: 0.3rem; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translate(-2px, -2px); }
.wd-toc [open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.wd-toc ol { padding: 0.5rem 0 0; list-style: none; }
.wd-toc a { display: block; padding: 0.6rem 0; color: inherit; line-height: 1.35; text-decoration: none; }
.wd-toc a:hover { text-decoration: underline 1px; text-underline-offset: 0.3em; }
.wd-toc a[aria-current] { font-weight: 700; }

.wd-text { max-width: 42rem; font-size: 1.0625rem; line-height: 1.7; overflow-wrap: break-word; }
.wd-text > * + * { margin-top: 1.1em !important; }
.wd-text :is(h2, h3) { color: inherit; font-family: var(--wp--preset--font-family--display); font-weight: 400; letter-spacing: 0; line-height: 1.25; scroll-margin-top: calc(var(--wauw-header) + 1.5rem); text-wrap: balance; }
.wd-text h2 { font-size: clamp(1.5rem, 2.2vw, 1.9rem); }
.wd-text h3 { font-size: 1.25rem; }
.wd-text > * + h2 { margin-top: 2em !important; }
.wd-text :is(h2, h3) + * { margin-top: 0.5em !important; }
.wd-text > :first-child { margin-top: 0 !important; }
.wd-text > :is(ul, ol) { padding-left: 1.3em; }
.wd-text > :is(ul, ol) li + li { margin-top: 0.5em; }
.wd-text a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
.wd-text :is(img, video, iframe) { max-width: 100%; height: auto; }
.wd-text table { width: 100%; border-collapse: collapse; }
.wd-text :is(th, td) { padding: 0.7rem 0.75rem 0.7rem 0; border-bottom: 1px solid color-mix(in srgb, currentColor 16%, transparent); text-align: left; vertical-align: top; }
/* Pages written as "bold line, break, text": the bold line is the heading. plain.js makes it a real one. */
.wd-text > p > strong:first-child:is(:has(+ br), :has(> br:last-child)) { display: block; margin-bottom: 0.3em; font-family: var(--wp--preset--font-family--display); font-size: clamp(1.5rem, 2.2vw, 1.9rem); font-weight: 400; line-height: 1.25; }
.wd-text > p > strong:first-child + br { display: none; }
.wd-text > p:has(> strong:first-child + br) { margin-top: 2em !important; }
/* Inside a run of headings with no text of their own, only the first is one; the rest are address lines. */
.wd-text h2 + h2:has(+ h2) { margin-top: 0 !important; font-family: inherit; font-size: 1em; line-height: 1.7; }
/* ... and the heading after them starts a new part. */
.wd-text h2 + h2 + h2:not(:has(+ h2)) { margin-top: 2em !important; }

.wd-help { max-width: 42rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid color-mix(in srgb, currentColor 16%, transparent); }
.wd-help__ask { font-weight: 600; }
.wd-help a { display: inline-flex; align-items: center; min-height: 2.75rem; color: inherit; text-decoration: underline 1px; text-underline-offset: 0.3em; }

@media (min-width: 60rem) {
	.wd-sheet { display: grid; grid-template-columns: 15rem minmax(0, 42rem) minmax(0, 1fr); gap: 0 4rem; padding-inline: max(var(--wauw-gutter), calc((100% - 96rem) / 2)); }
	.wd-sheet > h1 { grid-column: 1 / -1; }
	.wd-toc, .wd-help { position: sticky; top: calc(var(--wauw-header) + var(--wp-admin--admin-bar--height, 0px) + 1.5rem); align-self: start; margin: 0; }
	.wd-toc { min-height: 0; max-height: calc(100vh - var(--wauw-header) - 3rem); overflow-y: auto; scrollbar-width: thin; }
	.wd-toc summary { min-height: 0; padding-bottom: 0.75rem; border-top: 0; pointer-events: none; }
	.wd-toc summary::after { display: none; }
	.wd-toc a { padding: 0.4rem 0; }
	.wd-text { grid-column: 2; }
	.wd-help { grid-column: 3; padding-top: 0; border: 0; }
}
@media (min-width: 60rem) and (max-width: 78rem) {
	.wd-sheet { grid-template-columns: 14rem minmax(0, 42rem); }
	.wd-help { position: static; grid-column: 2; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid color-mix(in srgb, currentColor 16%, transparent); }
}
@media print {
	.wx-lacquer, .wd-toc, .wp-site-blocks > :is(header, footer) { display: none !important; }
}
