/*
 * Tate — vertical writing theme (巻物で左へ).
 * Everything is writing-mode: vertical-rl: lines run top to bottom and follow each other right to left;
 * the page (.maki) unrolls to the LEFT. Logical properties throughout: inline = top/bottom, block = right/left.
 * Generic font families only; no web fonts. Dark mode is a manual toggle (html.dark), never the OS setting.
 */

:root {
	--kami: #f6f2e7;      /* paper */
	--sumi: #1c1b19;      /* ink */
	--usuzumi: #5c5850;   /* light ink */
	--shu: #b3282d;       /* vermilion (masthead) */
	--sen: #d6ccb6;       /* rules */
	--sen-link: #8a8270;  /* underline of a link: 3.4:1 on the paper, 3.7:1 on a card (WCAG 1.4.11 asks 3:1) */
	--hikari: #fffdf7;    /* raised paper (cards) */
	--obi: 4.75rem;       /* band width (block size) */
	--bar: 0px;           /* the admin bar along the top, when shown */
	--bar-side: 0px;      /* the admin bar as a strip along the right edge (日本語縦 plugin) */
	--pan: 0px;           /* the breadcrumbs' strip at the band's left (body.tate-pan) */
	--ma: 1.5rem;         /* the gap between large blocks */
	color-scheme: light;
}

html.dark {
	--kami: #17171b;
	--sumi: #e7e2d7;
	--usuzumi: #a39e93;
	--shu: #e0676b;
	--sen: #3b3a40;
	--sen-link: #706e7a;  /* 3.6:1 on the paper, 3.2:1 on a card */
	--hikari: #212127;
	color-scheme: dark;
}

/* ------------------------------------------------------------------
 * The page: vertical, never scrolled itself (the scroll is .maki).
 * The page's writing mode is taken from <body> (measured in Chromium): both are set.
 * direction stays ltr even on a right-to-left site language: WordPress then prints
 * <html dir="rtl"> and body.rtl, and in vertical-rl an rtl direction runs the lines bottom to top.
 * An author rule beats the dir attribute; everything below inherits ltr from <body>.
 * ------------------------------------------------------------------ */
html,
body {
	writing-mode: vertical-rl;
	direction: ltr;
	inline-size: 100%;
	block-size: 100%;
	margin: 0;
	overflow: hidden;
}

/*
 * An RTL site gets core's -rtl block styles (wp-block-library-rtl.css), and two of their rules set
 * direction: rtl again. The admin bar keeps its own direction (admin-bar-rtl.css sets it on #wpadminbar).
 */
.rtl .wp-block-cover .wp-block-cover__inner-container,
.rtl .wp-block-cover-image .wp-block-cover__inner-container,
.rtl .wp-block-media-text > .wp-block-media-text__content {
	direction: ltr;
}

body {
	background: var(--kami);
	color: var(--sumi);
	font-family: serif;
	font-size: 18px;
	line-height: 1.85;
	text-orientation: mixed;
	font-kerning: normal;
	line-break: strict;
	-webkit-text-size-adjust: 100%;
}

a {
	color: inherit;
	text-decoration-color: var(--sen-link);
	text-underline-offset: 0.2em;
}

a:hover,
a:focus {
	color: var(--shu);
	text-decoration-color: currentColor;
}

:focus-visible {
	outline: 2px solid var(--shu);
	outline-offset: 2px;
}

img,
video {
	max-inline-size: 100%;
	block-size: auto;
}

/* 縦中横 (1–4 digits) and upright abbreviations (inc/tcy.php). */
.tcy {
	text-combine-upright: all;
}

.seiritsu {
	text-orientation: upright;
	font-variant-east-asian: full-width;
}

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	block-size: 1px;
	inline-size: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	word-wrap: normal !important;
}

/*
 * Shown at the top of the band, over the masthead, not over the text: below the admin bar when it
 * runs along the top, left of it when it is a strip along the right edge. Core's block styles set
 * .screen-reader-text:focus with physical left/top (5px) and grey text: the insets on the far side
 * are reset here (with left: 5px the box stretched from the band across the whole page), and the
 * text takes the ink of the page (the grey was 1.9:1 on the dark scheme's paper).
 */
.skip-link.screen-reader-text:focus {
	clip-path: none;
	block-size: auto;
	inline-size: auto;
	z-index: 1000;
	inset-block: calc(var(--bar-side) + 0.5rem) auto;
	inset-inline: calc(var(--bar) + 0.5rem) auto;
	padding: 0.5em;
	color: var(--sumi);
	background: var(--hikari);
	border: 1px solid var(--sen);
}

/* ------------------------------------------------------------------
 * The admin bar (the theme turned off the core bump).
 *  - By default it stays horizontal along the top; the band and the scroll move down by --bar.
 *  - With the 日本語縦 plugin it is a strip along the RIGHT edge: the plugin adds
 *    body.ja-tate-adminbar-vertical, with the strip's width in --ja-tate-adminbar-size.
 *    The band and the scroll then move LEFT by --bar-side instead.
 * ------------------------------------------------------------------ */
body.admin-bar:not(.ja-tate-adminbar-vertical) {
	--bar: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar:not(.ja-tate-adminbar-vertical) {
		--bar: 46px;
	}
}

body:not(.ja-tate-adminbar-vertical) #wpadminbar {
	writing-mode: horizontal-tb;
}

body.ja-tate-adminbar-vertical {
	--bar-side: var(--ja-tate-adminbar-size, 32px);
}

/* ------------------------------------------------------------------
 * The band along the right edge: masthead, menu, search, dark toggle (top to bottom); on a post or
 * a page, the breadcrumbs in a strip along its left, which makes the band --pan wider: as wide as
 * the columns the trail takes (--pan-w, measured by tate.js; one column until then or without it),
 * at most four columns.
 * ------------------------------------------------------------------ */
body.tate-pan {
	--pan: min(var(--pan-w, calc(1.75rem + 4px)), calc(7rem + 4px));
}

.obi {
	/* In the flow of the scroll (.maki), its first block at the right: not fixed, it rolls away with the
	   page. Relative: the breadcrumbs' strip is placed against it. Its width: at least the usual band,
	   wider when the masthead or the menu need more columns. */
	position: relative;
	min-block-size: calc(var(--obi) + var(--pan));
	flex: none;
	display: flex;
	flex-direction: row; /* row = top to bottom in vertical-rl */
	flex-wrap: var(--obi-wrap, nowrap); /* two strips on a low window (below) */
	align-items: center;
	align-content: center; /* and row-gap: for the two strips only (one line ignores both) */
	gap: 0.75rem 1.25rem;
	padding-block: 0.5rem calc(0.5rem + var(--pan));
	padding-inline: 1.25rem;
	box-sizing: border-box;
	background: var(--kami);
	border-block-end: 3px double var(--sumi);
}

/*
 * The masthead: the title and under it the tagline. Their wrapper is no box (display: contents): the
 * title and the tagline are items of the band themselves, so that the band, when its contents are
 * longer than it, shrinks the tagline and the menu (they wrap into more columns) but never the title.
 * While the wrapper was the item, shrinking it wrapped the title too, as soon as the band was low
 * (縦書きの見｜本 from a band of about 1000px with a menu of seven items, from 768px with six; Japanese
 * text breaks between any two characters, so the title's minimum was one character). The title takes
 * up to half of the band's height, the tagline as much (but it shrinks first, and the tools do not
 * shrink at all). Nothing is cut: a title longer than half the band, or a squeezed tagline, wraps into
 * more columns and the band grows wider to hold them (the band's width is auto, see .obi). The
 * tagline's margin brings it back from the band's gap to the 0.5rem it had under the title. The
 * title's padding, cancelled by its margin, keeps room for the focus outline of its link.
 */
.obi-daiji {
	display: contents;
}

.daiji,
.fukudai {
	margin: 0;
	min-inline-size: 0;
	max-inline-size: 50%;
	overflow-wrap: anywhere; /* never cut: a long title or tagline wraps into more columns */
}

.daiji {
	flex: none;
}

.fukudai {
	flex: 0 1 auto;
	margin-inline-start: calc(0.5rem - 1.25rem);
}

.daiji {
	padding: 4px;
	margin: -4px;
	font-family: serif;
	font-size: 2.1rem;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: 0.08em;
}

.daiji a {
	color: var(--shu);
	text-decoration: none;
}

.fukudai {
	font-size: 0.8rem;
	color: var(--usuzumi);
}

/*
 * Breadcrumbs (inc/breadcrumbs.php): home, the main category or the parent pages, and the page shown,
 * "/" between the items. As on the 然 site they are the column that follows the band: a strip along
 * its left (the band is --pan wider on a page that shows them, body.tate-pan), top to bottom from the
 * height of the masthead, in small text. So they take nothing from the menu, the search box and the
 * switch, however low the window. As on 然, a trail longer than the band wraps into a second column
 * (and more), and the strip widens with it: tate.js puts the list's width into --pan-w, and the band,
 * the scroll and the pictures' caps follow --pan. Nothing is ellipsised. Past four columns, and while
 * the strip is one column (before the script has run, or without it), what does not fit scrolls
 * sideways in the strip (overflow: auto): nothing is out of reach, and a link reached with Tab is
 * scrolled into view (`clip` would not do that). When the whole trail is in view the script makes
 * the strip no scroller at all (.is-whole): Firefox would make a scroller a Tab stop of its own and
 * cut the focus outlines at its edges. The links are light ink, the page shown ink.
 * Room for the focus outline (2px + 2px) inside the scroller: along the line the list's inline
 * padding (taken off the strip's), across it the line height (1.75rem for 19px of glyphs in
 * Chromium). The list's 2px of block padding hold the inline boxes where they are taller than the
 * line (32px in Firefox, measured): else they would overflow the strip, which would scroll by 2px.
 */
.obi-pan {
	position: absolute;
	inset-block-end: 0;
	inset-inline: 0;
	max-block-size: var(--pan); /* block-size auto: as wide as the columns, up to the band's room */
	overflow: auto;
	scrollbar-width: thin;
	padding-inline: calc(1.25rem - 4px);
	box-sizing: border-box;
	font-family: sans-serif;
	font-size: 0.8rem;
	line-height: 1.75rem;
	color: var(--usuzumi);
	background: var(--kami); /* over whatever of the band's own parts runs out of their column */
	overflow-wrap: anywhere; /* a long word without a break still wraps */
}

.obi-pan.is-whole {
	overflow: visible;
}

.obi-pan ol {
	margin: 0;
	padding-block: 2px;
	padding-inline: 4px;
	list-style: none;
}

.obi-pan li {
	display: inline;
}

.obi-pan li + li::before {
	content: "/";
	content: "/" / "";
	margin-inline: 0.35em;
	opacity: 0.75;
}

.obi-pan a {
	text-decoration: none;
}

.obi-pan .pan-ima {
	color: var(--sumi);
}

/* The icons on the centre of their column: baseline puts a box with no baseline of its own on the
 * vertical line's central one. `middle` (half the x-height off the baseline) left them 2px right of
 * the text in Chromium (0 in Firefox); baseline: 0.5px and 0 (2026-10-16, the owner's photo). */
.obi-pan .pan-e {
	inline-size: 1.1em;
	block-size: 1.1em;
	vertical-align: baseline;
}

.obi-pan .pan-ima .pan-e {
	margin-inline-end: 0.25em;
}

/*
 * The padding, cancelled by the margin, leaves room inside the clip for the focus outline (2px at 2px)
 * of an edge link. The links are blocks as wide as their column, the line of the menu's own font
 * (1.6 × 0.95rem, 24px), so the outline is 4px outside the column in every browser. As inline boxes
 * they were as wide as the font's height, not the line's: 22px in Edge, 36px in Firefox (measured),
 * which is wider than the column was (33px, the line of the body's 18px serif): Firefox's outline came
 * 5px out of it, and the clip cut its sides. Two columns now take 53px, inside the one-strip band's
 * 57px; at 33px they came out of it on both sides (to the window's edge, onto the breadcrumbs).
 * The text of a link is still 36px wide in Firefox, 6px beyond its block on each side, and there it
 * takes the pointer: the columns being 4px apart, without the clip a link of the left column caught
 * clicks 1.8px inside the one at its right. The clip is across the line only (the block axis; the
 * glyphs, 1em, are well inside the 24px): along it, a glyph's ink can pass the end of the link's box
 * by a fraction of a pixel (内 in Edge), which a clip on both axes cut.
 */
.obi-nav {
	flex: 1 1 var(--obi-nav-basis, auto);
	min-inline-size: 0;
	min-block-size: 0;
	overflow: hidden;
	padding: 4px;
	margin: -4px;
}

.obi-nav ul,
.oku-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
}

.obi-nav ul {
	font-family: sans-serif;
	font-size: 0.95rem;
	line-height: 1.6;
}

.obi-nav a {
	display: block;
	overflow-block: clip;
	text-decoration: none;
}

.obi-nav .sub-menu {
	display: none;
}

.obi-dogu {
	flex: 0 0 var(--obi-dogu-basis, auto);
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0.75rem;
}

.kensaku {
	display: flex;
	flex-direction: row;
	align-items: center;
	margin: 0;
}

.kensaku-ran,
.kensaku-botan,
.kurai-kirikae {
	font: inherit;
	font-family: sans-serif;
	font-size: 0.85rem;
	color: var(--sumi);
	background: var(--hikari);
	border: 1px solid var(--sen);
	border-radius: 3px;
	box-sizing: border-box;
}

.kensaku-ran {
	inline-size: 8em;
	block-size: 2em;
	padding-inline: 0.4em;
}

.kensaku-botan,
.kurai-kirikae {
	block-size: 2em;
	padding-inline: 0.5em;
	cursor: pointer;
}

/*
 * A low band. In one strip the menu has what the masthead (145px), the tools (206px; 220px while the
 * switch reads 明るく, one character longer than 暗く) and the band's padding and gaps leave of the
 * band's height, and wraps into more columns as that gets less. The band holds two: with three this
 * site's menu came out of the band on both sides (out of the window, and under the breadcrumbs), and
 * on a phone turned sideways (844×390) it was squeezed to a few pixels, the tools running out of the
 * window. On a low band it holds two strips: the masthead and the menu at the right (the menu takes
 * what the masthead leaves, 185px at 390px high, at least 155px down to 360px), the search box and
 * the switch in a strip of their own at their left (a second flex line; lines follow each other
 * right to left). The band is wider by that strip (--obi 7rem: the masthead's strip 37px, a gap of
 * 12px and the tools' strip 33px in the 96px between its padding, and the breadcrumbs' strip beyond),
 * and the scroll and the pictures' caps follow --obi.
 * Low is up to 42.5rem (680px). It was 35rem (560px) while the title shrank with the masthead: one
 * strip held this site's menu in two columns from a band 524px high, 538px on the dark scheme. Now
 * that the title keeps its length (226px, see .obi-daiji), one strip leaves the menu less: below a
 * band of about 680px it went into four columns and more (six at 600px, the band 185px wide), wider
 * than the two strips are (117px at 660px). From 680px one strip holds it in three columns (100px),
 * in two from about 750px (Chrome, 2026-10-16).
 * Lower still, the menu wraps into two columns in the masthead's strip too (below a band of about
 * 360px in Edge, 342px in Firefox), 53px wide (71px while the links were inline, see .obi-nav):
 * 53 + 12 + 33px take 98px, more than 7rem holds; at 71px the menu came out of the band, and in
 * Firefox its links out of the window (with the admin bar along the top, on a phone turned sideways).
 * Up to 23rem (368px) the band is 8.5rem (120px inside).
 * The band is the window less the admin bar along the top (--bar), which a media query cannot read:
 * with that bar the window may be higher by it. The queries set the switches (custom properties) on
 * the root, and on the body where the bar is; the lower band's come after, to win.
 */
@media screen and (max-height: 42.5rem) {
	:root {
		--obi: 7rem;
		--obi-wrap: wrap;
		--obi-nav-basis: 0px; /* in the masthead's strip, whatever its own length */
		--obi-dogu-basis: 100%; /* a strip of its own */
	}
}

@media screen and (max-height: calc(42.5rem + 32px)) {
	body.admin-bar:not(.ja-tate-adminbar-vertical) {
		--obi: 7rem;
		--obi-wrap: wrap;
		--obi-nav-basis: 0px;
		--obi-dogu-basis: 100%;
	}
}

@media screen and (max-width: 782px) and (max-height: calc(42.5rem + 46px)) {
	body.admin-bar:not(.ja-tate-adminbar-vertical) {
		--obi: 7rem;
		--obi-wrap: wrap;
		--obi-nav-basis: 0px;
		--obi-dogu-basis: 100%;
	}
}

@media screen and (max-height: 23rem) {
	:root {
		--obi: 8.5rem;
	}
}

@media screen and (max-height: calc(23rem + 32px)) {
	body.admin-bar:not(.ja-tate-adminbar-vertical) {
		--obi: 8.5rem;
	}
}

@media screen and (max-width: 782px) and (max-height: calc(23rem + 46px)) {
	body.admin-bar:not(.ja-tate-adminbar-vertical) {
		--obi: 8.5rem;
	}
}

/* ------------------------------------------------------------------
 * The scroll: everything else, unrolling to the left.
 * ------------------------------------------------------------------ */
.maki {
	position: fixed;
	inset-block-start: var(--bar-side);
	inset-block-end: 0;
	inset-inline-start: var(--bar);
	inset-inline-end: 0;
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: none;
	box-sizing: border-box;
	scroll-padding-block: var(--ma); /* a focused element is brought in clear of the edges */
	direction: ltr;
	outline-offset: -3px;
}

/* The scroll is the window's one scroller (it takes the focus for the arrow keys), and holds the band
   (.obi, its first block, at the right) and the content (main, after it): they roll together. The
   padding is the content's. main is only the skip link's target (tabindex -1, no ring). */
.maki-hon {
	box-sizing: border-box;
	padding-block: var(--ma);
	padding-inline: 1.5rem;
}

.maki-hon:focus {
	outline: none;
}

.maki-hon > * {
	margin-block-end: calc(var(--ma) * 1.5);
}

/* ------------------------------------------------------------------
 * List headings.
 * ------------------------------------------------------------------ */
.ichiran-mado {
	padding-block-end: 1rem;
	border-block-end: 1px solid var(--sen);
}

.ichiran-dai {
	margin: 0;
	font-family: sans-serif;
	font-size: 1.6rem;
}

.ichiran-setsumei {
	color: var(--usuzumi);
}

/* ------------------------------------------------------------------
 * The garden of cards: top to bottom, then the next column to the left.
 * ------------------------------------------------------------------ */
.niwa {
	display: flex;
	flex-direction: row; /* top to bottom, wrapping to the left */
	flex-wrap: wrap;
	align-content: flex-start;
	gap: 1.25rem;
	block-size: auto;
}

.fuda {
	flex: 0 0 auto;
	inline-size: min(25rem, 100%); /* the card's height */
	block-size: 15rem;             /* the card's width */
	box-sizing: border-box;
	background: var(--hikari);
	border: 1px solid var(--sen);
	overflow: hidden;
}

.fuda-ana {
	display: flex;
	flex-direction: row; /* row = top to bottom: the picture on top, the text below */
	inline-size: 100%;
	block-size: 100%;
	color: inherit;
	text-decoration: none;
}

/* The picture is not turned: a 4:3 landscape as wide as the card (its block size), on top. */
.fuda-e {
	flex: none;
	display: block;
	block-size: 100%;
	overflow: hidden;
}

.fuda-e img {
	display: block;
	block-size: 100%;
	inline-size: auto;
	max-inline-size: none;
}

.fuda-hon {
	flex: 1 1 auto;
	min-inline-size: 0;
	display: flex;
	flex-direction: column; /* column = right to left: title, date, excerpt */
	padding: 0.8rem;
	gap: 0.35rem;
	overflow: hidden;
}

.fuda-dai {
	font-family: sans-serif;
	font-weight: 700;
	font-size: 1.1rem;
	line-height: 1.4;
}

.fuda:hover .fuda-dai,
.fuda-ana:focus .fuda-dai {
	color: var(--shu);
}

/* The link fills the card, which clips its overflow: draw the focus outline inside. */
.fuda-ana:focus-visible {
	outline-offset: -4px;
}

.fuda-hi {
	font-size: 0.8rem;
	color: var(--usuzumi);
}

.fuda-yo {
	font-size: 0.9rem;
	color: var(--usuzumi);
	overflow: hidden;
}

.fuda-yo p {
	margin: 0;
}

/* ------------------------------------------------------------------
 * The article.
 * ------------------------------------------------------------------ */
.kiji {
	display: flow-root;
}

/*
 * The article and its comments: as long as the text's line (44em) and in the middle of the window's
 * height, with the same room above and below — as a scroll is held, and as a horizontal theme puts
 * its column in the middle of the width (ADR-66). A window lower than that: its whole height, as
 * before. The related posts and the post navigation, rows of cards and links, keep the whole height.
 */
.kiji,
.tayori {
	max-inline-size: 44em;
	margin-inline: auto;
}

.kiji-tobira {
	float: inline-start; /* start = top; the header occupies the first columns */
	block-size: auto;
	inline-size: 100%;
	margin-block-end: 2rem;
	padding-block-end: 1rem;
	border-block-end: 1px solid var(--sen);
}

.kiji-dai {
	margin: 0 0 0 0.5rem;
	font-family: serif;
	font-size: 2.1rem;
	font-weight: 700;
	line-height: 1.35;
	letter-spacing: 0.04em;
}

.meta {
	margin: 0;
	font-size: 0.85rem;
	color: var(--usuzumi);
	font-family: sans-serif;
}

.meta-koshin,
.meta-cats {
	margin-inline-start: 1em;
}

.kiji-e {
	margin: 0;
	margin-block-start: 1rem;
	inline-size: 100%;
}

.kiji-e img {
	inline-size: auto;
	max-inline-size: 100%;
	block-size: auto;
	max-block-size: 60vw;
}

.kiji-honbun {
	max-inline-size: 44em;
	text-align: justify;
}

.kiji-honbun p {
	margin-block: 0;
	margin-inline: 0;
	text-indent: 1em;
}

/* Chinese text (the site's language, or a paragraph's lang) indents a paragraph by two characters
   (首行缩进两字); :where() keeps the .jisage-N classes winning. */
.kiji-honbun p:where(:lang(zh)) {
	text-indent: 2em;
}

.kiji-honbun h2 {
	font-family: sans-serif;
	font-size: 1.35rem;
	line-height: 1.5;
	margin-block: 2rem 1rem;
	padding-block-start: 0.5rem;
	border-block-start: 3px solid var(--sumi);
	clear: both;
}

.kiji-honbun h3 {
	font-family: sans-serif;
	font-size: 1.1rem;
	margin-block: 1.5rem 0.5rem;
	clear: both;
}

/* The smallest heading (Aozora's 小見出し): as the others sans-serif and bold, a little smaller than h3. */
.kiji-honbun h4 {
	font-family: sans-serif;
	font-size: 1rem;
	margin-block: 1.25rem 0.5rem;
	clear: both;
}

.kiji-honbun ul,
.kiji-honbun ol {
	margin-block: 0.5rem;
	padding-inline-start: 1.5em;
}

.kiji-honbun blockquote {
	margin-block: 1rem;
	margin-inline: 1.5em 0;
	padding-block: 0.25rem;
	padding-inline: 1em;
	border-block-start: 3px solid var(--sen);
	color: var(--usuzumi);
}

.kiji-honbun ruby rt {
	font-size: 0.5em;
}

/*
 * 圏点 (傍点): <em class="kenten">, upright instead of italic, with a mark beside each character: to
 * the right of the column (text-emphasis-position: over right; in vertical text "over" is not used).
 * The plain class is the filled sesame (ゴマ), the others are named after the notes of Aozora Bunko
 * (白ゴマ・丸・白丸・黒三角・白三角・二重丸・蛇の目) and go with it: class="kenten kenten-shirogoma".
 * The marks take the text's colour (also on the dark scheme) and fit inside the line's leading.
 */
.kiji-honbun .kenten {
	font-style: normal;
	text-emphasis: filled sesame;
	text-emphasis-position: over right;
}

.kiji-honbun .kenten-shirogoma {
	text-emphasis-style: open sesame;
}

.kiji-honbun .kenten-maru {
	text-emphasis-style: filled circle;
}

.kiji-honbun .kenten-shiromaru {
	text-emphasis-style: open circle;
}

.kiji-honbun .kenten-kurosankaku {
	text-emphasis-style: filled triangle;
}

.kiji-honbun .kenten-shirosankaku {
	text-emphasis-style: open triangle;
}

.kiji-honbun .kenten-nijumaru {
	text-emphasis-style: open double-circle;
}

.kiji-honbun .kenten-janome {
	text-emphasis-style: filled double-circle;
}

/*
 * 字下げ: .jisage-N (N = 1–10) starts the paragraph or block N characters below the top of the
 * column, and so do its wrapped lines (Aozora's own HTML does the same with a margin). The space is
 * padding, so that a heading keeps its rule along the whole column. A paragraph gets no first-line
 * indent besides (the 1em above): the N characters are the whole indent. .jisage-0 is a paragraph that
 * starts flush with the top, as one that opens with 「 does. A block (div) holds paragraphs that keep
 * their own indent. Each class sets its own number, 0 too: a custom property is inherited, and a
 * paragraph in a block must not take the block's number again.
 */
.kiji-honbun :is(.jisage-0, .jisage-1, .jisage-2, .jisage-3, .jisage-4, .jisage-5, .jisage-6, .jisage-7, .jisage-8, .jisage-9, .jisage-10) {
	padding-inline-start: calc(var(--jisage, 0) * 1em);
	text-indent: 0;
}

.kiji-honbun .jisage-0 { --jisage: 0; }
.kiji-honbun .jisage-1 { --jisage: 1; }
.kiji-honbun .jisage-2 { --jisage: 2; }
.kiji-honbun .jisage-3 { --jisage: 3; }
.kiji-honbun .jisage-4 { --jisage: 4; }
.kiji-honbun .jisage-5 { --jisage: 5; }
.kiji-honbun .jisage-6 { --jisage: 6; }
.kiji-honbun .jisage-7 { --jisage: 7; }
.kiji-honbun .jisage-8 { --jisage: 8; }
.kiji-honbun .jisage-9 { --jisage: 9; }
.kiji-honbun .jisage-10 { --jisage: 10; }

/*
 * 地付き: .chitsuki ends the text at the bottom of the column (text-align: end; the lines run top to
 * bottom), .chiage-N (N = 1–10) N characters short of the bottom (「地から N 字上げ」). A paragraph has
 * no first-line indent then. The block's own end padding takes the N characters, and a block (div)
 * passes the alignment on to its paragraphs (and each class sets its own number, as above).
 */
.kiji-honbun :is(.chitsuki, .chiage-1, .chiage-2, .chiage-3, .chiage-4, .chiage-5, .chiage-6, .chiage-7, .chiage-8, .chiage-9, .chiage-10) {
	padding-inline-end: calc(var(--chiage, 0) * 1em);
	text-align: end;
	text-indent: 0;
}

.kiji-honbun .chitsuki { --chiage: 0; }
.kiji-honbun .chiage-1 { --chiage: 1; }
.kiji-honbun .chiage-2 { --chiage: 2; }
.kiji-honbun .chiage-3 { --chiage: 3; }
.kiji-honbun .chiage-4 { --chiage: 4; }
.kiji-honbun .chiage-5 { --chiage: 5; }
.kiji-honbun .chiage-6 { --chiage: 6; }
.kiji-honbun .chiage-7 { --chiage: 7; }
.kiji-honbun .chiage-8 { --chiage: 8; }
.kiji-honbun .chiage-9 { --chiage: 9; }
.kiji-honbun .chiage-10 { --chiage: 10; }

/*
 * Decorations (ADR-62), from the classic editor's Formats list and the Group block's styles
 * (inc/decorations.php); the same rules for the editor are in editor.css.
 * A box (囲み) stands in the text like a paragraph: as long as the line, as wide as its columns. The
 * caution and the note have a strip at their start, the right: a thick rule and, in a column of its
 * own, a mark (！ ※) at the top. The mark is decoration (its alternative text is empty): the kind is
 * also told by the colour of the rule.
 */
.kiji-honbun :is(.kakomi, .kakomi-chui, .kakomi-memo, .is-style-kakomi, .is-style-kakomi-chui, .is-style-kakomi-memo) {
	box-sizing: border-box;
	margin-block: 1rem;
	margin-inline: 0;
	padding-block: 0.75em;
	padding-inline: 1em;
	border: 1px solid var(--sen);
	background: var(--hikari);
	clear: both;
}

.kiji-honbun :is(.kakomi-chui, .kakomi-memo, .is-style-kakomi-chui, .is-style-kakomi-memo) {
	border-block-start: 4px solid var(--shu);
}

.kiji-honbun :is(.kakomi-memo, .is-style-kakomi-memo) {
	border-block-start-color: var(--usuzumi);
}

.kiji-honbun :is(.kakomi-chui, .kakomi-memo, .is-style-kakomi-chui, .is-style-kakomi-memo)::before {
	display: block;
	margin-block-end: 0.5em;
	font-family: sans-serif;
	font-weight: bold;
	line-height: 1.5;
	text-indent: 0;
	color: var(--shu);
}

.kiji-honbun :is(.kakomi-chui, .is-style-kakomi-chui)::before {
	content: "！";
	content: "！" / "";
}

.kiji-honbun :is(.kakomi-memo, .is-style-kakomi-memo)::before {
	content: "※";
	content: "※" / "";
	color: var(--usuzumi);
}

/* The first and the last thing in a box sit against its padding (a heading's own margin would double it). */
.kiji-honbun :is(.kakomi, .kakomi-chui, .kakomi-memo, .is-style-kakomi, .is-style-kakomi-chui, .is-style-kakomi-memo) > :first-child {
	margin-block-start: 0;
}

.kiji-honbun :is(.kakomi, .kakomi-chui, .kakomi-memo, .is-style-kakomi, .is-style-kakomi-chui, .is-style-kakomi-memo) > :last-child {
	margin-block-end: 0;
}

/*
 * Side lines (傍線): to the right of the column, where Japanese puts them (text-underline-position:
 * right; "under" when the same class is read in a horizontal editor). 傍線 a vermilion line, 波線 a
 * wavy one, 塗り the right half of the column tinted like a marker pen. Red letters: the masthead's
 * vermilion. A side line and ruby are both on the right: the line passes under the ruby.
 */
.kiji-honbun :is(.bosen, .bosen-nami) {
	text-decoration-line: underline;
	text-decoration-color: var(--shu);
	text-decoration-thickness: 0.1em;
	text-decoration-skip-ink: none;
	text-underline-position: under right;
	text-underline-offset: 0.2em;
}

.kiji-honbun .bosen-nami {
	text-decoration-style: wavy;
	text-decoration-thickness: 0.08em;
}

.kiji-honbun .bosen-nuri {
	background-image: linear-gradient(to left, color-mix(in srgb, var(--shu) 24%, transparent) 55%, transparent 55%);
}

.kiji-honbun .aka {
	color: var(--shu);
}

.kiji-honbun kbd {
	padding-block: 0.05em;
	padding-inline: 0.25em;
	border: 1px solid var(--sen);
	border-radius: 3px;
	background: var(--hikari);
	font-family: monospace;
	font-size: 0.85em;
}

/*
 * Core blocks drawn vertically (ADR-62).
 * Details: the marker is the browser's own and already turns with the text (closed ▼ down the line,
 * open ◀ toward the contents, Chrome and Firefox); the summary is set like a small heading.
 */
.kiji-honbun details {
	margin-block: 0.5rem;
}

.kiji-honbun summary {
	font-family: sans-serif;
	text-indent: 0;
	cursor: pointer;
}

.kiji-honbun details[open] > summary {
	margin-block-end: 0.25rem;
}

/* A citation is upright: Japanese has no italics (a slanted kana is a distorted one). */
.kiji-honbun cite {
	font-style: normal;
}

.kiji-honbun blockquote cite {
	display: block;
	font-size: 0.85em;
	text-align: end;
	text-indent: 0;
}

/*
 * Pullquote: core's rules above and below the quote (theme.css, not loaded) and its padding are
 * physical; here the rules run down the right and the left of it, the words larger and centred in the line.
 */
.kiji-honbun .wp-block-pullquote {
	margin-block: 1.5rem;
	margin-inline: 0;
	padding-block: 1rem;
	padding-inline: 2em;
	border-block: 3px solid var(--sumi);
	text-align: center;
	clear: both;
}

.kiji-honbun .wp-block-pullquote blockquote {
	margin: 0;
	padding: 0;
	border: 0;
	color: inherit;
}

.kiji-honbun .wp-block-pullquote p {
	font-size: 1.35rem;
	line-height: 1.6;
	text-indent: 0;
}

.kiji-honbun .wp-block-pullquote cite {
	margin-block-start: 0.5rem;
	text-align: center;
	color: var(--usuzumi);
}

/*
 * Buttons: core's dark grey (#32373c) and white become ink and paper (a colour the author picked is
 * kept: has-background, has-text-color, an inline style). The padding is turned with the text.
 */
.kiji-honbun .wp-block-buttons {
	margin-block: 1rem;
}

.kiji-honbun .wp-block-button__link {
	padding-block: 0.5em;
	padding-inline: 1.25em;
	font-family: sans-serif;
	font-size: 1rem;
	line-height: 1.5;
}

.kiji-honbun .wp-block-button:not(.is-style-outline) > .wp-block-button__link:not(.has-background) {
	background-color: var(--sumi);
}

.kiji-honbun .wp-block-button:not(.is-style-outline) > .wp-block-button__link:not(.has-text-color) {
	color: var(--kami);
}

.kiji-honbun .wp-block-button.is-style-outline > .wp-block-button__link {
	padding-block: calc(0.5em - 2px);
	padding-inline: calc(1.25em - 2px);
}

.kiji-honbun .wp-block-button__link:focus-visible {
	outline: 2px solid var(--shu);
	outline-offset: 2px;
}

/* Social icons: a list, but not indented as the text's lists are. */
.kiji-honbun .wp-block-social-links {
	margin-block: 1rem;
	margin-inline: 0;
	padding-inline-start: 0;
}

/*
 * Separator block: core draws it with border-top, a line across a horizontal page, which in a column
 * is as long as the block is wide: nothing. Here a short rule down the middle of the line, as core's
 * own theme styles make it short (the wide style: the whole line). With a background colour core
 * makes it a box 1–2px high instead. A plain <hr> (Aozora's 改ページ, hr.kaiheji) keeps the
 * browser's own rule, the whole line (docs/デモサイト設計.md, G3).
 */
.kiji-honbun .wp-block-separator {
	box-sizing: content-box;
	inline-size: 6em;
	block-size: 0;
	margin-block: 1.5rem;
	margin-inline: auto;
	border: 0;
	border-block-start: 2px solid;
	color: var(--sen);
	clear: both;
}

.kiji-honbun .wp-block-separator.is-style-wide {
	inline-size: auto;
}

.kiji-honbun .wp-block-separator.has-background:not(.is-style-dots):not(.is-style-wide) {
	inline-size: 6em;
	block-size: 2px;
	border: 0;
}

.kiji-honbun .wp-block-separator.has-background.is-style-wide:not(.is-style-dots) {
	inline-size: auto;
	block-size: 1px;
	border: 0;
}

.kiji-honbun .wp-block-separator.is-style-dots {
	inline-size: auto;
	block-size: auto;
	border: 0;
	color: var(--usuzumi); /* dots in the rules' colour are too faint (the dark scheme) */
	line-height: 1;
	text-align: center;
}

.kiji-honbun .wp-block-separator.is-style-dots::before {
	padding-left: 0;
	padding-inline-start: 2em;
}

/* Verse: a poem is text (not boxed, inc/html.php): its lines are columns, kept as the author broke them. */
.kiji-honbun .wp-block-verse {
	margin-block: 1rem;
	margin-inline: 0;
	padding: 0;
	padding-inline-start: 2em;
	overflow: visible;
	background: none;
	border: 0;
	font-family: inherit;
	font-size: inherit;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

/* Figures follow the author's alignment: right = the line's end (BOTTOM), left = TOP; center/none stay in the flow. */
.kiji-honbun figure,
.kiji-honbun .wp-caption {
	margin-block: 1rem;
	margin-inline: 0;
	max-inline-size: 100%;
}

.kiji-honbun .aligncenter {
	margin-inline: auto;
}

.kiji-honbun .alignright {
	float: right; /* line-right = bottom */
	margin-inline-start: 1.5rem;
	margin-block: 0.5rem 1rem;
}

.kiji-honbun .alignleft {
	float: left; /* line-left = top */
	margin-inline-end: 1.5rem;
	margin-block: 0.5rem 1rem;
}

/*
 * A picture in the text is never wider than the window (less the main padding; the band rolls away, so
 * it is not taken off), so that it is seen whole on a phone (the
 * `sizes` of inc/images.php say the same). Its height follows. --e-haba holds this cap for the rule
 * on aligned pictures below.
 */
/* Numbers beside the line (notes, 返り点): small, and the line keeps its width. */
.kiji-honbun :is(sup, sub) {
	font-size: 0.6em;
	line-height: 0;
}

.kiji-honbun img {
	--e-haba: calc(100vw - var(--bar-side) - 2 * var(--ma));
	max-block-size: var(--e-haba);
	inline-size: auto; /* the height attribute would stay when the width is capped */
}

/*
 * A picture with a caption leaves beside it room for a column of the caption (0.8rem at
 * line-height 1.5, and its padding: 1.8rem), so that on a narrow screen both are seen together.
 * Not the tiles of a gallery (their img is not a child of the figure).
 */
.kiji-honbun :is(figure, .wp-caption):has(> :is(figcaption, .wp-caption-text)) > img,
.kiji-honbun :is(figure, .wp-caption):has(> :is(figcaption, .wp-caption-text)) > a > img {
	--e-haba: calc(100vw - var(--bar-side) - 2 * var(--ma) - 1.8rem);
	max-block-size: var(--e-haba);
}

/*
 * A picture aligned left or right floats at the top or bottom of the line, with text beside it: on
 * screen it is at most half the line long, leaving the other half to the text. The medium size the
 * readme recommends (at most 384 px high) is that already where the line is at its longest (44em,
 * 792 px); on a lower window the picture is made smaller with the line. The line is at most 44em and
 * at most as long as the article, the container here (50cqi). The `sizes` of these pictures say the
 * same (tate_aligned_image_sizes(), inc/images.php). Not "Large", which does not float on screen
 * (below), nor the tiles of an aligned block gallery. On paper the line is as long as the page and
 * this is not needed (print.css keeps the picture's size).
 * The 44em is that of the text (.kiji-honbun), not of the picture: in a paragraph or a span set in
 * larger characters the line is no longer. Half of it is held in --gyo-han, set on .kiji-honbun and
 * registered as a length (below), so that it is computed there and inherited in px. (A browser that
 * does not register it takes 22em of the picture, as a plain custom property.)
 * A picture whose size the author set (the block editor's style="width:480px;height:auto", or a
 * width and a height) has a fixed width, and may have a fixed height: capping one of them alone would
 * squeeze the picture. Each cap then passes to the other by the ratio of that box (--tate-ratio,
 * which inc/images.php writes for such a picture only; for the others the fallbacks make these terms
 * too large to count, and the width follows the height).
 */
@property --gyo-han {
	syntax: "<length>";
	inherits: true;
	initial-value: 396px;
}

@media screen {
	.kiji {
		container-type: inline-size;
	}

	.kiji-honbun {
		--gyo-han: 22em;
	}

	.kiji-honbun img:is(.alignright, .alignleft):not(.size-large),
	.kiji-honbun :is(figure, .wp-caption):is(.alignright, .alignleft):not(.size-large, .wp-block-gallery) img:not(.size-large) {
		max-inline-size: min(var(--gyo-han), 50cqi, calc(var(--e-haba) / var(--tate-ratio, 0.001)));
		max-block-size: min(var(--e-haba), calc(min(var(--gyo-han), 50cqi) * var(--tate-ratio, 1000)));
	}
}

/*
 * A picture inserted as "Large" is as long as the line, or so nearly (inc/images.php) that, floated,
 * it would leave beside it columns of two or three characters. On screen it stands alone instead,
 * at the line's end (right) or start (left), as a large picture fills a horizontal column. On paper
 * the line is as long as the page, and the picture floats with text beside it.
 * In a paragraph, a large picture not aligned left or right stands alone too: inline, the
 * paragraph's 1em indent pushed it past the line's end.
 * A figure keeps its display: core makes an aligned block image (.wp-block-image) a table, with its
 * caption as a table-caption, which a block figure would leave in an anonymous table of no length.
 */
@media screen {
	.kiji-honbun p img.size-large,
	.kiji-honbun img.size-large:is(.alignright, .alignleft) {
		display: block;
		margin-block: 1rem;
	}

	.kiji-honbun img.size-large:is(.alignright, .alignleft),
	.kiji-honbun :is(figure, .wp-caption):is(.alignright, .alignleft):is(.size-large, :has(img.size-large)) {
		float: none;
		clear: both;
		margin-block: 1rem;
	}

	.kiji-honbun :is(figure, .wp-caption):is(.alignright, .alignleft):is(.size-large, :has(img.size-large)) {
		inline-size: fit-content;
	}

	.kiji-honbun img.size-large.alignright,
	.kiji-honbun :is(figure, .wp-caption).alignright:is(.size-large, :has(img.size-large)) {
		margin-inline: auto 0;
	}

	.kiji-honbun img.size-large.alignleft,
	.kiji-honbun :is(figure, .wp-caption).alignleft:is(.size-large, :has(img.size-large)) {
		margin-inline: 0 auto;
	}
}

.kiji-honbun .wp-caption img,
.kiji-honbun figure img {
	display: block;
}

.kiji-honbun .wp-caption-text,
.kiji-honbun figcaption {
	contain: inline-size;
	font-size: 0.8rem;
	color: var(--usuzumi);
	padding-block: 0.3rem;
	line-height: 1.5;
	text-align: center; /* centred along the picture's height, as the tiles' captions */
}

/* Galleries: pictures flow top to bottom and wrap to the left. */
.kiji-honbun .gallery {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-block: 1rem;
	clear: both;
}

.kiji-honbun .gallery-item {
	margin: 0;
}

.kiji-honbun .gallery-item img {
	max-inline-size: 12rem;
	max-block-size: 12rem;
	inline-size: auto;
	block-size: auto;
}

.kiji-honbun .gallery-caption {
	font-size: 0.75rem;
	color: var(--usuzumi);
	padding-block: 0.25rem;
}

/* A sticky post: a vermilion rule at the head (right) of its card or article. */
.fuda.sticky,
.kiji.sticky {
	border-block-start: 3px solid var(--shu);
}

/* Boxes (枡): code and embeds stay horizontal inside the vertical page; tables are vertical (.masu-hyo, below). */
.masu {
	writing-mode: horizontal-tb;
	width: max-content;
	max-width: min(40rem, 70vw);
	max-height: calc(100vh - var(--bar) - 3 * var(--ma));
	overflow: auto;
	margin: 0 1.5rem;
	clear: both;
	font-size: 0.9rem;
	line-height: 1.6;
}

.masu table {
	border-collapse: collapse;
}

.masu th,
.masu td {
	border: 1px solid var(--sen);
	padding-block: 0.3em;
	padding-inline: 0.6em;
}

/*
 * Tables are vertical too (.masu-hyo): each row is a column, read top to bottom, the rows from right
 * to left, and the cells' numbers are 縦中横 like the text's. The box stands in the line like a
 * paragraph: as long as the line, and as wide as its rows, so a long table lengthens the scroll
 * instead of scrolling inside a box. A cell too long for the line wraps, a long word (a URL) in a
 * data cell too, so the box does not scroll inside; it still can, for a table of more cells than fit
 * in the line. A header cell keeps its words whole (a short "URL" is not cut to "UR/L").
 * Code and embeds stay horizontal.
 */
.masu-hyo {
	writing-mode: vertical-rl;
	width: auto;
	max-width: none;
}

.masu-hyo table {
	width: auto;
}

.masu-hyo td {
	overflow-wrap: anywhere;
}

.masu pre {
	margin: 0;
	padding: 0.75rem;
	background: var(--hikari);
	border: 1px solid var(--sen);
	font-family: monospace;
	white-space: pre;
}

.masu-embed iframe {
	display: block;
	max-width: 100%;
}

/*
 * A post of this site embedded (its URL alone on a line, inc/embed.php): the garden's card printed in
 * the text (template-parts/card-naibu.php), in a vertical box in the line, with the site's name in
 * its last column (left). Where no card was made (a post the reader cannot see), core's link.
 */
.masu-fuda {
	writing-mode: vertical-rl;
	width: auto;
	max-width: none;
	max-height: none;
	overflow: visible;
	font-size: inherit;
	line-height: inherit;
}

.masu-fuda blockquote.wp-embedded-content {
	margin: 0;
}

.fuda-naibu .fuda-ana {
	text-decoration: none;
}

/* The picture at the bottom of the card (the Customizer, ADR-65). */
.fuda-naibu.fuda-e-sue .fuda-e {
	order: 1;
}

.fuda-naibu .fuda-moto {
	margin-block-start: auto; /* the last column, at the left */
	font-family: sans-serif;
	font-size: 0.75rem;
	color: var(--usuzumi);
}

/*
 * An embed with a fixed ratio (the block editor's YouTube, Vimeo …: figure.wp-has-aspect-ratio >
 * .wp-block-embed__wrapper, with core's .wp-embed-aspect-* class). Core keeps the ratio with a
 * ::before whose padding-top is a percentage of the wrapper's WIDTH, and lays the iframe over it
 * (position: absolute, 100% each way): a horizontal device. The wrapper stands in the vertical text,
 * so there the percentage was of the line's length and the width nothing (the .masu inside is empty:
 * the iframe leaves the flow), and the iframe came out a line long and as wide as the margins, a strip.
 * So the wrapper is itself the horizontal box (the 枡) of a definite width, and the ratio is kept
 * inside it by core's own device; the .masu of tate_embed_html() around the iframe is then only a
 * name (it opens, no box of its own). The width is that of the other boxes, 40rem or 70% of the
 * window's width, and no more than makes the box as high as the line (the window less the admin bar
 * and the margins above and below): --embed-ratio is the height over the width of the class.
 */
.wp-has-aspect-ratio {
	--embed-ratio: 0.5;
}

.wp-embed-aspect-21-9 {
	--embed-ratio: 0.4285;
}

.wp-embed-aspect-18-9 {
	--embed-ratio: 0.5;
}

.wp-embed-aspect-16-9 {
	--embed-ratio: 0.5625;
}

.wp-embed-aspect-4-3 {
	--embed-ratio: 0.75;
}

.wp-embed-aspect-1-1 {
	--embed-ratio: 1;
}

.wp-embed-aspect-9-16 {
	--embed-ratio: 1.7778;
}

.wp-embed-aspect-1-2 {
	--embed-ratio: 2;
}

.wp-has-aspect-ratio .wp-block-embed__wrapper {
	writing-mode: horizontal-tb;
	width: min(40rem, 70vw, calc((100vh - var(--bar) - 3 * var(--ma)) / var(--embed-ratio)));
	margin: 0 1.5rem;
}

.wp-has-aspect-ratio .masu-embed {
	display: contents;
}

/*
 * Audio and video players (MediaElement): a horizontal box of a FIXED width. The player is as wide as its
 * parent, and a box that is only as wide as its content (.masu's max-content) shrinks it to 65px.
 * When the 日本語縦 plugin draws the players vertically (body.ja-tate-mejs-vertical, set only when its
 * rotated stylesheets are in place, includes/mejs.php) the box is opened: it has no box of its own and
 * the players stand in the vertical text, as long as the line, the strip of buttons along their left edge.
 */
.masu-media {
	writing-mode: horizontal-tb;
	width: min(40rem, 70vw);
	max-height: calc(100vh - var(--bar) - 3 * var(--ma));
	overflow: auto;
	margin: 0 1.5rem;
	clear: both;
}

.ja-tate-mejs-vertical .masu-media {
	display: contents;
	writing-mode: vertical-rl;
}

.kiji-ato {
	margin-block-start: 1.5rem;
	font-size: 0.85rem;
	color: var(--usuzumi);
}

/* ------------------------------------------------------------------
 * Navigation between posts / pages: previous on the right, next on the left.
 * ------------------------------------------------------------------ */
.navigation .nav-links {
	display: flex;
	flex-direction: column; /* right to left */
	gap: 1.5rem;
	font-family: sans-serif;
}

.post-navigation .nav-label {
	display: block;
	font-size: 0.8rem;
	color: var(--usuzumi);
}

.pagination .page-numbers {
	padding-block: 0.25rem;
}

.pagination .current {
	color: var(--shu);
	font-weight: 700;
}

/* The pages of a post split with <!--nextpage-->: after the text, top to bottom, the page shown in red. */
.kiji-peji {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	margin-block-start: 2rem;
	padding-block-start: 1rem;
	border-block-start: 1px solid var(--sen);
	font-family: sans-serif;
}

.kiji-peji .post-page-numbers {
	padding-block: 0.25rem;
}

.kiji-peji .current {
	color: var(--shu);
	font-weight: 700;
}

/* ------------------------------------------------------------------
 * Related posts after a post: the garden's cards (.niwa .fuda), top to bottom, then to the left.
 * ------------------------------------------------------------------ */
.kanren {
	padding-block-start: 1.5rem;
	border-block-start: 1px solid var(--sen);
}

.kanren-dai {
	margin: 0;
	margin-block-end: 1rem;
	font-family: sans-serif;
	font-size: 1.2rem;
}

/* ------------------------------------------------------------------
 * Back to the head of the scroll (footer.php; tate.js shows it once the reader is a screen in).
 * At the window's end corner: the bottom (inline end) on the left (block end), where the scroll
 * goes on; clear of the text's edge by the scroll's own margins.
 * ------------------------------------------------------------------ */
.kanto {
	position: fixed;
	inset-inline-end: 1rem;
	inset-block-end: 1rem;
	z-index: 50; /* over the scroll, under the admin bar and a lightbox */
	padding-block: 0.4em;
	padding-inline: 0.6em;
	font: inherit;
	font-family: sans-serif;
	font-size: 0.85rem;
	color: var(--sumi);
	background: var(--hikari);
	border: 1px solid var(--sen);
	border-block-start: 2px solid var(--shu); /* the head (right) side, the way it goes */
	border-radius: 3px;
	box-shadow: 0 1px 4px rgb(0 0 0 / 15%);
	cursor: pointer;
}

.kanto:hover {
	color: var(--shu);
}

.kanto[hidden] {
	display: none;
}

/* ------------------------------------------------------------------
 * Comments.
 * ------------------------------------------------------------------ */
.tayori-dai {
	font-family: sans-serif;
	font-size: 1.2rem;
}

.tayori-list,
.tayori-list .children {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tayori-list .children {
	margin-block-start: 1rem;
	padding-block-start: 1rem;
	border-block-start: 1px dotted var(--sen);
}

.tayori-list .comment-body {
	margin-block-end: 1.5rem;
}

/* The post author's own comments: a vermilion line along the head (right) of the comment. */
.tayori-list .bypostauthor > .comment-body {
	border-block-start: 2px solid var(--shu);
	padding-block-start: 0.75rem;
}

.comment-meta {
	font-size: 0.8rem;
	color: var(--usuzumi);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	font: inherit;
	inline-size: min(100%, 24rem);
	box-sizing: border-box;
	background: var(--hikari);
	color: var(--sumi);
	border: 1px solid var(--sen);
}

.comment-form textarea {
	block-size: 10em;
}

/* ------------------------------------------------------------------
 * Not found / empty.
 * ------------------------------------------------------------------ */
.nashi h1 {
	font-family: sans-serif;
	font-size: 1.6rem;
}

/* ------------------------------------------------------------------
 * Colophon at the left end.
 * ------------------------------------------------------------------ */
.oku {
	padding-block-start: 1.5rem;
	border-block-start: 3px double var(--sumi);
	font-size: 0.85rem;
	color: var(--usuzumi);
}

.oku-mei {
	margin: 0;
}

/* Widgets in the colophon: each one a column group, right to left. */
.oku-widgets {
	display: flex;
	flex-direction: column; /* right to left */
	gap: 2rem;
	margin-block-end: 1.5rem;
}

.oku .widget {
	max-inline-size: 30em;
}

.oku .widget-title {
	margin: 0;
	margin-block-end: 0.5rem;
	font-family: sans-serif;
	font-size: 1rem;
	color: var(--sumi);
}

.oku .widget ul {
	margin: 0;
	padding-inline-start: 1.2em;
}

/* ------------------------------------------------------------------
 * The lightbox: PhotoSwipe 5 (the Lightbox with PhotoSwipe plugin, which appends .pswp to <body>).
 * Its window stays vertical like the page. PhotoSwipe places and moves everything with physical
 * top/left, width/height and translate, which do not depend on the writing mode, so the positions
 * below are physical too (they follow its arrows at the left and right edges). What does depend on it:
 *  - the img rule above caps the inline size, which is the HEIGHT here; PhotoSwipe lifts only
 *    max-width, and the picture was 0 px high (its box is the zoom wrapper, which has no size);
 *  - the tool bar is a flex row, which runs top to bottom here and squeezed the 60px-high buttons to
 *    9px. Laid along the block axis from left to right it is PhotoSwipe's bar again: the counter at
 *    the left, the buttons at the right. Its text is left as it is, vertical (a tool band, 掟三);
 *  - the caption (the "overlay" type) is a band across the bottom, with one short vertical column
 *    at its right end. It is set as a column at the top left instead, below the bar and right of
 *    the left arrow, and wraps to the right up to half the window. On a touch screen (no arrows)
 *    and for a single picture it starts at the left edge.
 * And the order: PhotoSwipe goes on to the right, the page to the left. The "next" arrow is moved to
 * the left edge (pointing left) and the "previous" one to the right (pointing right); each keeps its
 * function and its name. tate.js turns ← → to match. The strip of pictures is mirrored too, so that
 * the next picture lies at the left, comes in from the left, and a swipe to the right brings it
 * (the owner's decision, 2026-10-01): .pswp__container is flipped left to right about its middle,
 * each picture (and an HTML or error slide) is flipped back about its own middle, and tate.js
 * mirrors the pointer's and the wheel's x about the same line before PhotoSwipe reads them. Inside,
 * PhotoSwipe goes on to the right as before (its next() is index + 1, its arrows' functions and the
 * history's pid are untouched); only what is seen and felt is mirrored. The opening and closing are
 * a fade (Lightbox with PhotoSwipe sets showHideAnimationType 'fade'), not a zoom from the thumbnail,
 * so no thumbnail's place needs mirroring.
 * ------------------------------------------------------------------ */
/* Only on a PhotoSwipe whose pointer tate.js mirrors too (.tate-mirror: window.pswp is that one);
   another copy (PhotoSwipe 4, or 5 without window.pswp) keeps its strip as it is. */
.pswp.tate-mirror .pswp__container {
	scale: -1 1; /* outside its inline transform (PhotoSwipe's translate3d): the whole strip mirrored */
}

.pswp.tate-mirror .pswp__img,
.pswp.tate-mirror .pswp__content {
	scale: -1 1; /* each picture the right way round again, in its place */
}

.pswp img {
	max-inline-size: none;
	max-block-size: none;
}

.pswp__top-bar {
	flex-direction: column-reverse; /* the block axis, left to right */
}

.pswp__counter {
	inline-size: auto; /* PhotoSwipe's 30px high (a line) would break "1 / 2" into columns */
	white-space: nowrap;
}

/* PhotoSwipe's places of the two arrows and their icons, exchanged. */
.pswp .pswp__button--arrow--next {
	right: auto;
	left: 0;
}

.pswp .pswp__button--arrow--next .pswp__icn {
	right: auto;
	left: 9px;
	transform: none;
}

.pswp .pswp__button--arrow--prev {
	right: 0;
	left: auto;
}

.pswp .pswp__button--arrow--prev .pswp__icn {
	right: 14px;
	left: auto;
	transform: scale(-1, 1);
}

/* The caption is put in the picture's holder, inside the mirrored strip: it is flipped back about its
   own middle, and its place is written mirrored (right here is the left on the screen). */
.pswp.tate-mirror .pswp__dynamic-caption {
	scale: -1 1;
}

.pswp .pswp__dynamic-caption--overlay {
	top: 60px;
	right: auto;
	bottom: auto;
	left: 75px;
	inline-size: auto;
	block-size: auto;
	max-inline-size: calc(100% - 60px - 0.75rem);
	max-block-size: calc(50% - 75px);
	padding: 0.6em 0.5em;
	text-align: start;
}

.pswp.tate-mirror .pswp__dynamic-caption--overlay {
	right: 75px;
	left: auto;
}

.pswp--one-slide .pswp__dynamic-caption--overlay,
.pswp--touch:not(.pswp--has_mouse) .pswp__dynamic-caption--overlay {
	left: 0;
	max-block-size: 50%;
}

.pswp.tate-mirror.pswp--one-slide .pswp__dynamic-caption--overlay,
.pswp.tate-mirror.pswp--touch:not(.pswp--has_mouse) .pswp__dynamic-caption--overlay {
	right: 0;
	left: auto;
}

.pswp .pswp__caption,
.pswp .pswp__caption__exif {
	padding: 0;
}

@media (prefers-reduced-motion: reduce) {
	* {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}
