/*
Theme Name: Shiza
Theme URI: https://junpeitakeya.com/
Author: Junpei Takeya
Author URI: https://junpeitakeya.com/
Description: 竹谷純平 / 視座 のための、静かな活字中心テーマ。一段組みの記事ページ、明暗切替（Dark / Light / Auto）、JA / EN 切替、日本語の読了時間表示。
Version: 0.6.5
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: shiza
*/

/* ------------------------------------------------------------
   1. Tokens
------------------------------------------------------------ */
:root {
	--bg: #FBFBF9;
	--ink: #171715;
	--muted: #53524D;
	--rule: #E3E1DB;
	--soft: #F0EFEB;
	--accent: #2E4C7D;

	--font-ja: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
	--font-en: "Newsreader", Georgia, serif;
	--font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

	--measure: 680px;
	--wide: 1080px;
	--gutter: 24px;

	color-scheme: light;
}

:root[data-theme="dark"] {
	--bg: #121211;
	--ink: #E9E7E1;
	--muted: #A3A19A;
	--rule: #2C2C29;
	--soft: #1D1D1B;
	--accent: #9DB6E0;
	color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
	:root[data-theme="auto"] {
		--bg: #121211;
		--ink: #E9E7E1;
		--muted: #A3A19A;
		--rule: #2C2C29;
		--soft: #1D1D1B;
		--accent: #9DB6E0;
		color-scheme: dark;
	}
}

/* ------------------------------------------------------------
   2. Base
------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-ja);
	font-size: 17px;
	line-height: 2;
	letter-spacing: .02em;
	font-weight: var(--body-weight, 400);
	-webkit-font-smoothing: var(--font-smooth, antialiased);
	transition: background-color .25s ease, color .25s ease;
}

:lang(en) body, body:lang(en) { font-family: var(--font-en), var(--font-ja); }

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

a {
	color: var(--ink);
	text-decoration-line: underline;
	text-decoration-color: var(--rule);
	text-decoration-thickness: 1px;
	text-underline-offset: .22em;
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mono {
	font-family: var(--font-mono);
	font-size: 12px;
	font-weight: 400;
	letter-spacing: .08em;
	text-transform: uppercase;
	line-height: 1.6;
}
.mono-plain { text-transform: none; letter-spacing: .02em; }
.muted { color: var(--muted); }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link:focus {
	position: fixed; top: 8px; left: 8px; z-index: 100;
	width: auto; height: auto; clip: auto;
	padding: 10px 14px; background: var(--ink); color: var(--bg);
}

.container { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }

/* ------------------------------------------------------------
   3. Header
------------------------------------------------------------ */
.site-header { border-bottom: 1px solid var(--rule); background: var(--bg); }
/* Follow the reader: stick to the top (below the admin bar when logged in). */
.site-header[data-header="smart"], .site-header[data-header="always"] {
	position: sticky; top: var(--wp-admin--admin-bar--height, 0px); z-index: 50;
	transition: transform .28s ease, box-shadow .28s ease;
}
.site-header.is-stuck { box-shadow: 0 6px 18px -14px rgba(0, 0, 0, .35); }
.site-header.is-hidden { transform: translateY(calc(-100% - var(--wp-admin--admin-bar--height, 0px))); box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .site-header { transition: none; } }
html { scroll-padding-top: var(--shiza-header-h, 0px); }
.site-header__inner {
	max-width: var(--wide);
	margin: 0 auto;
	padding: 14px var(--gutter);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 4px 24px;
}
.site-title {
	font-size: 19px;
	font-weight: 600;
	letter-spacing: .01em;
	text-decoration: none;
	line-height: 1.4;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 22px; }
.site-nav a { text-decoration: none; color: var(--muted); display: inline-block; padding: 10px 0; }
.site-nav a:hover, .site-nav .current-menu-item > a, .site-nav .current_page_item > a { color: var(--ink); }

.switches { display: flex; align-items: center; gap: 12px; }
.switches__sep { width: 1px; height: 18px; background: var(--rule); }
.seg { display: flex; gap: 2px; }
.seg button, .seg a, .seg span {
	font-family: var(--font-mono);
	font-size: 11px;
	letter-spacing: .1em;
	text-transform: uppercase;
	background: transparent;
	color: var(--muted);
	border: 0;
	border-radius: 3px;
	min-height: 44px;
	min-width: 44px;
	padding: 0 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	cursor: pointer;
}
.seg button:hover, .seg a:hover { color: var(--ink); }
.seg [aria-pressed="true"], .seg [aria-current="true"] { color: var(--ink); background: var(--soft); cursor: default; }
.no-js .theme-switch { display: none; }

/* ------------------------------------------------------------
   4. Single article
------------------------------------------------------------ */
.entry { padding: 56px 0 0; }
.entry__top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; color: var(--muted); }
.entry__back { text-decoration: none; color: var(--muted); }
.entry__keys { color: var(--muted); opacity: .8; }
@media (hover: none), (max-width: 640px) { .entry__keys { display: none; } }
.entry__kicker a { color: var(--muted); text-decoration: none; }
.entry__kicker a:hover { color: var(--ink); }
.entry__kicker { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); }
.entry__title {
	margin: 18px 0 0;
	font-size: 40px;
	line-height: 1.45;
	font-weight: 600;
	letter-spacing: .01em;
	font-feature-settings: "palt" 1;
}
.entry__subtitle { display: block; font-size: 22px; font-weight: var(--body-weight, 400); margin-top: 10px; color: var(--muted); }
:lang(en) .entry__title { line-height: 1.15; letter-spacing: -.01em; font-size: 46px; }

.entry__meta {
	margin: 40px 0 0;
	padding: 20px 0;
	border-top: 1px solid var(--rule);
	border-bottom: 1px solid var(--rule);
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
	gap: 16px;
}
.entry__meta dt { color: var(--muted); }
.entry__meta dd { margin: 4px 0 0; text-transform: none; letter-spacing: .02em; }
.entry__meta a { text-decoration: none; }
.entry__meta a:hover { text-decoration: underline; }

.entry__hero { margin: 40px 0 0; }
.entry__hero img { display: block; width: 100%; height: auto; }
.entry__hero figcaption { margin-top: 10px; color: var(--muted); }

.entry__lang-note {
	margin: 32px 0 0;
	padding: 14px 0;
	border-bottom: 1px solid var(--rule);
	color: var(--muted);
}

.entry__end { text-align: center; margin: 72px 0 0; color: var(--muted); }

/* ------------------------------------------------------------
   5. Prose (post content)
------------------------------------------------------------ */
.prose { margin-top: 48px; font-size: 17px; line-height: 2.05; letter-spacing: .02em; overflow-wrap: anywhere; }
:lang(en) .prose { font-size: 20px; line-height: 1.65; letter-spacing: 0; overflow-wrap: break-word; }

.prose > * { margin-top: 0; margin-bottom: 1.5em; }
.prose p { margin-top: 0; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { font-weight: 600; line-height: 1.5; letter-spacing: .01em; }
.prose h2 { font-size: 1.35em; margin: 3em 0 1.1em; }
.prose h3 { font-size: 1.15em; margin: 2.4em 0 .9em; }
.prose h4 { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; margin: 2.4em 0 .8em; color: var(--muted); }
.prose h5, .prose h6 { font-size: 1em; margin: 2em 0 .8em; }

.prose blockquote, .prose .wp-block-quote {
	margin: 2em 0 2em 1.6em;
	padding: 0;
	border: 0;
	font-size: 1.08em;
	line-height: 1.85;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote cite, .prose .wp-block-quote cite {
	display: block; margin-top: .8em;
	font-family: var(--font-mono); font-size: 12px; font-style: normal; color: var(--muted);
	letter-spacing: .04em;
}
.prose .wp-block-pullquote { border: 0; padding: 1.5em 0; text-align: left; }
.prose .wp-block-pullquote blockquote { margin: 0; font-size: 1.3em; }

.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--muted); }

.prose hr, .prose .wp-block-separator {
	border: 0; height: auto; margin: 3em 0; text-align: center; background: none; color: var(--muted);
}
.prose hr::after, .prose .wp-block-separator::after { content: "＊"; font-size: 14px; letter-spacing: 1em; }

.prose figure { margin: 2.4em 0; }
.prose figure img { display: block; }
.prose figcaption, .prose .wp-element-caption {
	margin-top: 10px;
	font-family: var(--font-mono); font-size: 12px; line-height: 1.6; color: var(--muted);
	letter-spacing: .02em; text-align: left;
}
.prose .alignwide { width: min(var(--wide) - 2 * var(--gutter), 100vw - 2 * var(--gutter)); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.prose .alignfull { width: 100vw; max-width: none; margin-left: 50%; transform: translateX(-50%); }
.prose .aligncenter { margin-left: auto; margin-right: auto; }
.prose .alignleft { float: left; margin: .4em 1.6em 1em 0; max-width: 50%; }
.prose .alignright { float: right; margin: .4em 0 1em 1.6em; max-width: 50%; }

.prose table { width: 100%; border-collapse: collapse; font-size: .9em; line-height: 1.7; }
.prose .wp-block-table { overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: .6em .5em; text-align: left; vertical-align: top; }
.prose th { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .06em; color: var(--muted); }

.prose code, .prose kbd { font-family: var(--font-mono); font-size: .86em; background: var(--soft); padding: .1em .35em; border-radius: 3px; }
.prose pre { font-family: var(--font-mono); font-size: 14px; line-height: 1.7; background: var(--soft); padding: 1.2em; overflow-x: auto; border-radius: 4px; letter-spacing: 0; }
.prose pre code { background: none; padding: 0; }

.prose mark { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 22%, transparent) 62%); color: inherit; padding: 0 .05em; }

.prose .wp-block-embed__wrapper { position: relative; }
.prose .wp-embed-aspect-16-9 .wp-block-embed__wrapper { aspect-ratio: 16 / 9; }
.prose .wp-embed-aspect-16-9 iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

.prose .wp-block-button__link, .prose .wp-element-button {
	font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
	background: var(--ink); color: var(--bg); border-radius: 3px; padding: 14px 20px; text-decoration: none;
	display: inline-block;
}
.prose .wp-block-button__link:hover { background: var(--accent); color: var(--bg); }
.prose .is-style-outline .wp-block-button__link { background: transparent; color: var(--ink); border: 1px solid var(--rule); }

.prose details { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: .8em 0; }
.prose details + details { border-top: 0; }
.prose details > :last-child { margin-bottom: .4em; }

/* Media & text (e.g. a profile photo beside a name) */
.prose .wp-block-media-text { gap: 0 32px; margin: 0 0 2.6em; }
.prose .wp-block-media-text__content { padding: 0; }
.prose .wp-block-media-text__content > :last-child { margin-bottom: 0; }
.prose .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content { padding: 0; }
@media (max-width: 600px) { .prose .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content { padding-top: 20px; } }

/* Profile lines: add these as "追加CSSクラス" on paragraphs */
.prose .profile-role { margin: 0; color: var(--muted); font-size: 14px; letter-spacing: .12em; }
.prose .profile-name { margin: .35em 0 0; font-size: 30px; line-height: 1.4; font-weight: 600; letter-spacing: .04em; }
.prose .profile-name-en { margin: .5em 0 0; font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* A plain list of services: title on one line, description below, hairlines between */
.prose .service-list { list-style: none; padding-left: 0; border-top: 1px solid var(--rule); }
.prose .service-list > li { margin: 0; padding: .9em 0; border-bottom: 1px solid var(--rule); font-size: .94em; line-height: 1.9; }
.prose .service-list > li > strong:first-child { display: block; font-size: 1.06em; margin-bottom: .15em; }

/* A passage in English inside a Japanese page: add "lang-en" as 追加CSSクラス on a group */
.prose .lang-en { font-family: var(--font-en), var(--font-ja); font-size: 1.12em; line-height: 1.7; letter-spacing: 0; overflow-wrap: break-word; }
.prose .lang-en .service-list > li { font-size: .92em; }
.prose summary { cursor: pointer; font-weight: 600; }

.prose .wp-block-footnotes { font-size: 14px; line-height: 1.8; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 1.5em; }

.prose::after { content: ""; display: table; clear: both; }

/* ------------------------------------------------------------
   6. SWELL compatibility (best effort, for posts written under SWELL)
------------------------------------------------------------ */
.prose .swl-marker, .prose [class*="mark_"] { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 22%, transparent) 62%); color: inherit; }
.prose .cap_box, .prose .swell-block-capbox { border: 1px solid var(--rule); padding: 0; margin: 2em 0; }
.prose .cap_box_ttl { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 18px; border-bottom: 1px solid var(--rule); background: none; }
.prose .cap_box_content { padding: 18px; }
.prose .cap_box_content > :last-child { margin-bottom: 0; }
.prose .c-balloon { display: flex; gap: 14px; align-items: flex-start; margin: 2em 0; }
.prose .c-balloon__icon { flex: 0 0 56px; text-align: center; font-size: 11px; color: var(--muted); }
.prose .c-balloon__icon img { border-radius: 50%; width: 56px; height: 56px; object-fit: cover; }
.prose .c-balloon__body { background: var(--soft); padding: 14px 18px; border-radius: 4px; flex: 1; }
.prose .swell-block-fullWide { padding: 2em 0; }
.prose [class*="has-swl-"][class*="-background-color"] { background-color: var(--soft) !important; }
.prose [class*="has-swl-"][class*="-color"]:not([class*="-background-color"]) { color: inherit !important; }
.prose .is-style-big_icon_point, .prose .is-style-big_icon_caution,
.prose .is-style-big_icon_good, .prose .is-style-big_icon_bad,
.prose .is-style-icon_info, .prose .is-style-icon_announce,
.prose .is-style-icon_pen, .prose .is-style-icon_book,
.prose .is-style-bg_gray, .prose .is-style-bg_stripe,
.prose .is-style-crease, .prose .is-style-border_sg, .prose .is-style-border_dg {
	background: var(--soft); border: 0; padding: 16px 20px;
}
.prose .p-toc, .prose .p-toc__ttl { display: none; }

/* ------------------------------------------------------------
   7. Author box / post nav / comments
------------------------------------------------------------ */
.author-box {
	margin-top: 64px;
	padding: 28px 0;
	border-top: 1px solid var(--rule);
	display: flex;
	gap: 20px;
	align-items: flex-start;
	font-size: 16px;
	line-height: 1.75;
}
.author-box__avatar img { border-radius: 50%; display: block; width: 56px; height: 56px; object-fit: cover; }
.author-box p { margin: 0; }

.post-nav {
	margin-top: 8px;
	padding: 24px 0 0;
	border-top: 1px solid var(--rule);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 16px;
}
.post-nav a { text-decoration: none; }
.post-nav a:hover { text-decoration: underline; }
.post-nav__title { text-transform: none; letter-spacing: .02em; }

.comments { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--rule); font-size: 15px; line-height: 1.8; }
.comments__title { margin: 0 0 24px; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.comment-meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.comment-author img { border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.comment-respond { margin-top: 32px; }
.comment-form label { display: block; font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; font: inherit; color: var(--ink); background: var(--bg);
	border: 1px solid var(--rule); border-radius: 3px; padding: 10px 12px;
}
.comment-form .submit {
	font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
	background: var(--ink); color: var(--bg); border: 0; border-radius: 3px; padding: 14px 20px; cursor: pointer; min-height: 44px;
}

/* ------------------------------------------------------------
   8. Front page & archives
------------------------------------------------------------ */
.home-hero { padding: 88px 0 0; }
.home-hero__name { margin: 0; font-size: 44px; line-height: 1.35; font-weight: 600; letter-spacing: .02em; }
.home-hero__name-en { display: block; margin-top: 10px; color: var(--muted); }
.home-hero__lead { margin: 28px 0 0; font-size: 19px; line-height: 1.95; }
.home-hero__links { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 4px 22px; }
.home-hero__links a { text-decoration: none; color: var(--muted); display: inline-block; padding: 8px 0; }
.home-hero__links a:hover { color: var(--ink); }

.home-section { margin-top: 80px; }
.section-label {
	display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
	padding-bottom: 12px; border-bottom: 1px solid var(--rule); margin: 0;
	color: var(--muted);
}
.section-label a { text-decoration: none; color: var(--muted); }
.free-slot__body > :first-child { margin-top: 0; }
.free-slot__body > :last-child { margin-bottom: 0; }
.home-section__h { margin: 20px 0 0; font-size: 24px; line-height: 1.5; font-weight: 600; letter-spacing: .03em; }
.home-section__lead { margin: 6px 0 20px; color: var(--muted); font-size: 15px; line-height: 1.9; }
:lang(en).home-section__h, :lang(en) .home-section__h { font-family: var(--font-en), var(--font-ja); }
.section-label a:hover { color: var(--ink); }

.post-list { list-style: none; margin: 0; padding: 0; counter-reset: post; }
.post-list__item { border-bottom: 1px solid var(--rule); }
.post-list__link {
	display: grid;
	grid-template-columns: 2.6em minmax(0, 1fr) auto;
	gap: 4px 16px;
	align-items: baseline;
	padding: 18px 0;
	text-decoration: none;
}
.post-list__num { color: var(--muted); }
.post-list__title { font-size: 18px; line-height: 1.6; font-weight: 600; letter-spacing: .01em; }
.post-list__link:hover .post-list__title { color: var(--accent); }
.post-list__date { color: var(--muted); white-space: nowrap; }
.post-list__cat { grid-column: 2 / 3; color: var(--muted); }

.feature-list { list-style: none; margin: 0; padding: 0; }
.feature-list li { border-bottom: 1px solid var(--rule); }
.feature-list a { display: block; padding: 18px 0; text-decoration: none; }
.feature-list__title { font-size: 18px; font-weight: 600; line-height: 1.6; }
.feature-list a:hover .feature-list__title { color: var(--accent); }
.feature-list__desc { display: block; margin-top: 4px; font-size: 15px; line-height: 1.8; color: var(--muted); }

.home-page-content { margin-top: 80px; }

.archive-head { padding: 56px 0 0; }
.archive-head__title { margin: 18px 0 0; font-size: 32px; line-height: 1.5; font-weight: 600; }
.archive-head__desc { margin-top: 16px; color: var(--muted); font-size: 16px; line-height: 1.9; }
.archive-list { margin-top: 40px; }

.pagination { margin-top: 32px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers {
	font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em;
	min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
	text-decoration: none; color: var(--muted); border-radius: 3px;
}
.pagination .page-numbers.current { background: var(--soft); color: var(--ink); }

.search-form { display: flex; gap: 8px; margin-top: 24px; }
.search-form input[type="search"] { flex: 1; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--rule); border-radius: 3px; padding: 10px 12px; min-height: 44px; }
.search-form button { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--bg); border: 0; border-radius: 3px; padding: 0 18px; min-height: 44px; cursor: pointer; }

/* ------------------------------------------------------------
   9. Footer
------------------------------------------------------------ */
.site-footer { margin-top: 96px; border-top: 1px solid var(--rule); }
.site-footer__inner {
	max-width: var(--wide); margin: 0 auto; padding: 28px var(--gutter) 40px;
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; color: var(--muted);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 20px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ------------------------------------------------------------
   9b. Features (v0.4)
------------------------------------------------------------ */

/* Audio player */
.player {
	margin-top: 24px;
	display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
	color: var(--muted);
}
.player__btn {
	font: inherit; letter-spacing: inherit; text-transform: inherit;
	background: var(--soft); color: var(--ink); border: 0; border-radius: 3px;
	min-height: 44px; padding: 0 16px; cursor: pointer;
}
.player__btn:hover { color: var(--accent); }
.player__time { font-variant-numeric: tabular-nums; }
.player__bar { flex: 1 1 120px; height: 2px; background: var(--rule); position: relative; cursor: pointer; min-width: 80px; }
.player__bar::before { content: ""; position: absolute; inset: -12px 0; }
.player__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--ink); }

/* Table of contents */
.toc { margin-top: 40px; padding: 18px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.toc__label { margin: 0 0 10px; color: var(--muted); }
.toc__list { list-style: none; margin: 0; padding: 0; counter-reset: toc; font-size: 15px; line-height: 1.8; }
.toc__list > li { counter-increment: toc; display: grid; grid-template-columns: 2.4em minmax(0, 1fr); }
.toc__list > li::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding-top: .3em; }
.toc__list a { text-decoration: none; }
.toc__list a:hover { text-decoration: underline; }
.toc__sub { list-style: none; margin: 0; padding: 0; grid-column: 2; font-size: 14px; color: var(--muted); }
.toc__sub:empty { display: none; }
.toc__sub a { color: var(--muted); }

/* Ruby */
ruby rt { font-size: .5em; letter-spacing: 0; color: inherit; }

/* Series */
.series { margin-top: 56px; padding: 22px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.series__label { margin: 0 0 12px; color: var(--muted); }
.series__label a { color: var(--muted); }
.series__list { margin: 0; padding-left: 2em; font-size: 15px; line-height: 1.9; }
.series__list li::marker { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.series__list a { text-decoration: none; }
.series__list a:hover { text-decoration: underline; }
.series__list [aria-current] { font-weight: 600; }

/* End-of-post notes */
.cta { margin-top: 48px; display: grid; gap: 16px; }
.cta__box { border: 1px solid var(--rule); padding: 22px 24px; }
.cta__title { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.6; }
.cta__text { margin: 6px 0 14px; font-size: 15px; line-height: 1.85; color: var(--muted); }
.cta__link { text-decoration: none; display: inline-block; padding: 10px 0; }
.cta__link:hover { color: var(--accent); }

/* Sidenotes (from core Footnotes) */
.sidenote { display: none; }
@media (min-width: 1240px) {
	.has-sidenotes .sidenote {
		display: block;
		float: right;
		clear: right;
		width: 220px;
		margin: .3em -260px 1em 0;
		font-size: 13px;
		line-height: 1.75;
		letter-spacing: .01em;
		color: var(--muted);
		text-indent: 0;
	}
	.has-sidenotes .sidenote__num { font-family: var(--font-mono); font-size: 11px; }
	.has-sidenotes .wp-block-footnotes { display: none; }
	.has-sidenotes sup.fn a, .has-sidenotes sup[data-fn] a { pointer-events: none; text-decoration: none; }
}

/* Photo essay */
.is-photo-essay .entry__hero,
.is-photo-essay .prose .wp-block-image:not(.alignleft):not(.alignright):not(.is-style-inline),
.is-photo-essay .prose .wp-block-gallery {
	width: min(var(--wide) - 2 * var(--gutter), 100vw - 2 * var(--gutter));
	max-width: none;
	margin-left: 50%;
	transform: translateX(-50%);
}
.is-photo-essay .prose .wp-block-image { margin-top: 3em; margin-bottom: 3em; }
.is-photo-essay .prose .wp-block-image img { width: 100%; height: auto; }
.is-photo-essay .prose figcaption { max-width: var(--measure); padding: 0 var(--gutter); margin-left: auto; margin-right: auto; }

/* Vertical writing */
.vert-switch { margin-top: 40px; justify-content: flex-end; }
.prose--vertical.is-vertical {
	writing-mode: vertical-rl;
	-webkit-writing-mode: vertical-rl;
	width: 100%;
	max-width: 100%;
	height: min(78vh, 760px);
	overflow-x: auto;
	overflow-y: hidden;
	margin-top: 16px;
	padding: 8px 0 16px;
	line-height: 2;
	letter-spacing: .06em;
	font-feature-settings: normal;
	overscroll-behavior-x: contain;
	scrollbar-color: var(--rule) transparent;
}
.prose--vertical.is-vertical > * { margin: 0 0 0 0; margin-block: 0 1em; }
.prose--vertical.is-vertical h2 { margin-block: 2.2em 1em; }
.prose--vertical.is-vertical h3 { margin-block: 1.6em .8em; }
.prose--vertical.is-vertical blockquote { margin-inline: 2em 0; margin-block: 1em 1.4em; }
.prose--vertical.is-vertical figure,
.prose--vertical.is-vertical img { max-height: 100%; width: auto; }
.prose--vertical.is-vertical figcaption { writing-mode: vertical-rl; }
.prose--vertical.is-vertical ul, .prose--vertical.is-vertical ol { padding-left: 0; padding-top: 1.4em; }

/* Front-page cover */
.cover { position: relative; max-width: var(--wide); margin: 0 auto; padding: 32px var(--gutter) 0; }
.cover__media { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--soft); }
.cover__frame { position: relative; overflow: hidden; }
.cover--vista .cover__media { aspect-ratio: 1.85 / 1; }
.cover--scope .cover__media { aspect-ratio: 2.39 / 1; }
.cover--focus-top .cover__media { object-position: 50% 15%; }
.cover--focus-bottom .cover__media { object-position: 50% 85%; }
.cover__shade { position: absolute; inset: 0; pointer-events: none; background: #0d0d0c; }
.cover__shade--accent { background: #12213b; }
.cover__text {
	position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center;
	text-align: center; padding: 6% 8%; color: #f6f3ea; pointer-events: none;
	text-shadow: 0 1px 18px rgba(0, 0, 0, .28);
}
.cover--bottom .cover__text { justify-content: flex-end; align-items: flex-start; text-align: left; }
.cover__title {
	margin: 0; font-family: var(--font-en), var(--font-ja); font-weight: 400;
	font-size: clamp(28px, 5.2vw, 64px); line-height: 1.15; letter-spacing: .02em; overflow-wrap: anywhere;
}
.cover__sub { margin: 14px 0 0; font-size: clamp(11px, 1.3vw, 14px); letter-spacing: .14em; opacity: .9; }
.cover--text .cover__toggle { z-index: 2; }
.cover__caption { margin-top: 10px; color: var(--muted); }
.cover__toggle {
	position: absolute; right: calc(var(--gutter) + 12px); top: 44px;
	background: color-mix(in srgb, var(--bg) 80%, transparent); color: var(--ink);
	border: 0; border-radius: 3px; min-height: 44px; min-width: 64px; padding: 0 12px; cursor: pointer;
}
.cover + .container .home-hero { padding-top: 56px; }
.cover + .mandala { padding-top: 72px; }

/* Notes */
.note-mini { list-style: none; margin: 0; padding: 0; }
.note-mini li { border-bottom: 1px solid var(--rule); }
.note-mini a { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 4px 16px; padding: 16px 0; text-decoration: none; align-items: baseline; }
.note-mini__text { font-size: 16px; line-height: 1.8; }
.note-mini a:hover .note-mini__text { color: var(--accent); }
.note-stream { margin-top: 40px; }
.note-item { padding: 28px 0; border-bottom: 1px solid var(--rule); }
.note-item__date { color: var(--muted); text-decoration: none; }
.note-item__title { margin: 10px 0 0; font-size: 20px; line-height: 1.6; font-weight: 600; }
.note-item__title a { text-decoration: none; }
.note-item__body { margin-top: 14px; }
.note-item__body > :last-child { margin-bottom: 0; }
.entry__title--note { font-size: 28px; }
.entry--note .prose { margin-top: 32px; }

/* ------------------------------------------------------------
   9c. Bilingual front page + mandala (v0.5)
------------------------------------------------------------ */
[hidden] { display: none !important; }
[data-l="en"] { display: none; }
:root[data-view-lang="en"] [data-l="ja"] { display: none; }
:root[data-view-lang="en"] [data-l="en"] { display: revert; }
.no-js .lang-switch { display: none; }
.home-hero--after { padding-top: 72px; }
.home-hero__lead--en { font-family: var(--font-en), var(--font-ja); font-size: 21px; line-height: 1.7; }
.en-note { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }

:root { --shu: #A8432A; }
:root[data-theme="dark"] { --shu: #E08A6E; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] { --shu: #E08A6E; } }

.mandala { max-width: var(--wide); margin: 0 auto; padding: 48px var(--gutter) 0; --mac: var(--shu); }
.mandala__head { max-width: 720px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 4px 12px; flex-wrap: wrap; color: var(--muted); }
.mandala__num { margin: 0; font: inherit; color: var(--muted); }
.mandala__crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.mandala__crumbbtn { background: none; border: 0; padding: 0 2px; min-height: 44px; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--muted); }
.mandala__crumbbtn:hover { color: var(--ink); }
.mandala__here { color: var(--ink); }

.mandala__stage { position: relative; width: 100%; max-width: 720px; aspect-ratio: 1 / 1; margin: 8px auto 0; }
.mandala__frame, .mandala__layer { position: absolute; inset: 0; }
.mandala__frame { pointer-events: none; }
.mandala__sq { position: absolute; inset: 3%; border: 1px solid var(--rule); }
.mandala__gate { position: absolute; background: var(--bg); }
.mandala__gate--t, .mandala__gate--b { left: 44%; width: 12%; height: 3px; }
.mandala__gate--t { top: calc(3% - 1px); }
.mandala__gate--b { bottom: calc(3% - 1px); }
.mandala__gate--l, .mandala__gate--r { top: 44%; height: 12%; width: 3px; }
.mandala__gate--l { left: calc(3% - 1px); }
.mandala__gate--r { right: calc(3% - 1px); }
.mandala__ring { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 1px solid var(--rule); border-radius: 50%; }
.mandala__ring--outer { width: 88%; height: 88%; }
.mandala__ring--inner { width: 58%; height: 58%; border-style: dashed; }
.mandala__ringsvg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mandala__ringtext { fill: var(--muted); font-family: var(--font-mono), var(--font-ja); font-size: 2.05px; letter-spacing: .12px; transition: fill .25s ease; }
.ring-on .mandala__ringtext { fill: var(--mac); }

.mandala__ray { position: absolute; left: 50%; top: 50%; height: 1px; background: var(--rule); transform-origin: 0 50%; }
.mandala__layer.is-blooming { animation: shiza-bloom .55s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes shiza-bloom { from { opacity: 0; transform: scale(.9) rotate(-8deg); } to { opacity: 1; transform: none; } }

.mandala__node {
	position: absolute; transform: translate(-50%, -50%);
	border-radius: 50%; border: 1px solid var(--ink); background: var(--bg); color: var(--ink);
	font-family: var(--font-ja); cursor: pointer; padding: 4px;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
	text-align: center; line-height: 1.3; overflow-wrap: anywhere;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.mandala__node:hover, .mandala__node:focus-visible { border-color: var(--mac); color: var(--mac); outline: none; }
.mandala__node:focus-visible { box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--mac); }
.mandala__node.is-on { background: var(--mac); border-color: var(--mac); color: var(--bg); }
.mandala__node.has-children { border-width: 1.5px; }
.mandala__node.is-petal .mandala__label { font-size: clamp(15px, 3.1vw, 24px); font-weight: 600; }
.mandala__node.is-leaf .mandala__label { font-size: clamp(11px, 1.9vw, 15px); font-weight: 600; }
.mandala__node.is-core { left: 50%; top: 50%; width: 27%; height: 27%; border-color: var(--mac); color: var(--mac); }
.mandala__node.is-core .mandala__label { font-size: clamp(17px, 3.6vw, 28px); font-weight: 600; }
.mandala__sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }

.mandala__ringbtn {
	position: absolute; z-index: 2; left: 50%; top: 95.4%; transform: translate(-50%, -50%);
	background: var(--bg); color: var(--ink); border: 1px solid var(--rule); border-radius: 22px;
	min-height: 44px; padding: 0 18px; cursor: pointer; font-family: var(--font-ja); font-size: 15px; font-weight: 600;
	display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.mandala__ringbtn:hover, .mandala__ringbtn:focus-visible { border-color: var(--mac); color: var(--mac); outline: none; }
.mandala__ringbtn.is-on { background: var(--mac); border-color: var(--mac); color: var(--bg); }

.mandala__panel { max-width: var(--measure); margin: 24px auto 0; padding: 20px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.mandala__kicker { margin: 0; color: var(--muted); }
.mandala__title { margin: 8px 0 0; font-size: 22px; font-weight: 600; line-height: 1.5; }
.mandala__text { margin: 8px 0 0; font-size: 16px; line-height: 1.95; color: var(--muted); }
.mandala__link { display: inline-block; margin-top: 12px; padding: 8px 0; text-decoration: none; }

.mandala__list { max-width: var(--measure); margin: 8px auto 0; }
.mandala__items { list-style: none; margin: 0; padding: 0; }
.mandala__item {
	all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
	display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 4px 16px;
	padding: 14px 0; border-bottom: 1px solid var(--rule);
}
.mandala__item:hover .mandala__itemlabel, .mandala__item:focus-visible .mandala__itemlabel { color: var(--mac); }
.mandala__item:focus-visible { outline: 2px solid var(--mac); outline-offset: 2px; }
.mandala__item[aria-pressed="true"] .mandala__itemlabel { color: var(--mac); }
.mandala__itemnum { color: var(--muted); }
.mandala__itemlabel { display: block; font-size: 17px; font-weight: 600; }
.mandala__itemshort { display: block; font-size: 14px; line-height: 1.8; color: var(--muted); }

.mandala-index { max-width: var(--measure); margin: 24px auto 0; font-size: 15px; line-height: 1.8; }
.mandala-index__list { list-style: none; margin: 0; padding: 0; }
.mandala-index__list--d1, .mandala-index__list--d2 { padding-left: 1.4em; }
.mandala-index__item { margin: 8px 0; }

.manifesto__h { margin: 28px 0 0; font-size: 30px; line-height: 1.5; font-weight: 600; letter-spacing: .02em; }
.manifesto__quote { margin: 24px 0 0 1.4em; font-size: 20px; line-height: 1.9; }
.manifesto__body { margin: 24px 0 0; font-size: 17px; line-height: 2.05; }
.manifesto__foot { margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 4px 24px; }
.manifesto__foot a { text-decoration: none; padding: 8px 0; }
.manifesto__closing { color: var(--muted); padding: 8px 0; text-transform: none; letter-spacing: .02em; }
:lang(en) .manifesto__quote, :lang(en).manifesto__quote { font-family: var(--font-en); }

/* ------------------------------------------------------------
   10. Small screens
------------------------------------------------------------ */
@media (max-width: 640px) {
	.site-header__inner { padding-top: 10px; padding-bottom: 8px; }
	body { font-size: 16px; }
	.prose { font-size: 16px; line-height: 2; }
	:lang(en) .prose { font-size: 18px; }
	.entry { padding-top: 36px; }
	.entry__kicker { margin-top: 32px; }
	.entry__title { font-size: 28px; }
	:lang(en) .entry__title { font-size: 34px; }
	.entry__subtitle { font-size: 18px; }
	.prose blockquote, .prose .wp-block-quote { margin-left: 1em; }
	.prose .alignleft, .prose .alignright { float: none; max-width: 100%; margin: 2em 0; }
	.home-hero { padding-top: 56px; }
	.home-hero__name { font-size: 34px; }
	.home-hero__lead { font-size: 17px; }
	.post-list__link { grid-template-columns: 2.2em minmax(0, 1fr); }
	.post-list__date { grid-column: 2 / 3; }
	.post-list__title { font-size: 17px; }
	.cover { padding-top: 0; padding-left: 0; padding-right: 0; }
	.cover__media { aspect-ratio: 4 / 3; }
	.cover--vista .cover__media, .cover--scope .cover__media { aspect-ratio: 16 / 9; }
	.cover__caption { padding: 0 var(--gutter); }
	.cover__toggle { top: 12px; right: 12px; }
	.note-mini a { grid-template-columns: minmax(0, 1fr); }
	.prose--vertical.is-vertical { height: 72vh; }
	.mandala { padding-left: 12px; padding-right: 12px; }
	.mandala__sub { display: none; }
	.mandala__ringbtn { font-size: 13px; padding: 0 14px; top: calc(100% + 30px); }
	.mandala__stage { margin-bottom: 60px; }
	.mandala__panel, .mandala__list { padding-left: 12px; padding-right: 12px; }
	.mandala__item { grid-template-columns: minmax(0, 1fr); }
	.mandala__ringtext { font-size: 2.6px; }
}

@media print {
	.site-header, .site-footer, .post-nav, .comments, .switches { display: none; }
	body { background: #fff; color: #000; }
}

@media (prefers-reduced-motion: reduce) {
	body { transition: none; }
}
