/*
Theme Name: Zen Karate
Description: A quiet ink-and-paper block theme for a karate blog. Serif headlines, generous whitespace, sand bands and a single seal-red accent.
Version: 1.23.0
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: zen-karate
Tags: blog, grid-layout, block-patterns, full-site-editing, style-variations, wide-blocks
*/

/* ---- Base --------------------------------------------------------- */

::selection {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--paper);
}

a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
	text-decoration-color: var(--wp--preset--color--mist);
	transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

a:hover {
	text-decoration-color: currentColor;
}

.zen-main {
	animation: zen-settle 1s ease-out both;
}

@keyframes zen-settle {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.zen-main { animation: none; }
	a { transition: none; }
}

/* ---- Shared type -------------------------------------------------- */

/* Small red spaced capitals above headings: "THE EMPTY HAND", "FEATURED · HISTORY". */
.zen-eyebrow {
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	margin-bottom: 0;
}

.zen-eyebrow a {
	color: inherit;
	text-decoration: none;
}

.zen-eyebrow + .wp-block-post-title,
.zen-eyebrow + .wp-block-heading,
.zen-eyebrow + .wp-block-query-title {
	margin-top: 0.75rem;
}

.zen-meta {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--stone);
}

.zen-meta a {
	color: var(--wp--preset--color--accent);
	text-decoration: none;
}

.zen-tagline {
	color: var(--wp--preset--color--stone);
}

.zen-readmore {
	font-weight: 500;
	text-decoration: none;
}

.zen-readmore::after {
	content: "→";
	margin-left: 0.6em;
	color: var(--wp--preset--color--accent);
	display: inline-block;
	transition: transform 0.3s ease;
}

.zen-readmore:hover::after {
	transform: translateX(4px);
}

/* ---- Header ------------------------------------------------------- */

.zen-header {
	padding-block: var(--wp--preset--spacing--30);
	border-bottom: 1px solid var(--wp--preset--color--mist);
}

.zen-brand {
	gap: 1rem;
}

/*
 * The theme's own mark: the transparent torii gate. Dark-background style
 * variations set settings.custom.logoLight to 1, which cross-fades to the
 * rice-paper version. The 初 text stays in the markup for screen readers.
 */
.zen-mark {
	position: relative;
	width: 56px;
	height: 56px;
	margin: 0;
	font-size: 0;
	color: transparent;
}

.zen-mark::before,
.zen-mark::after {
	content: "";
	position: absolute;
	inset: 0;
	background: url("assets/images/torii.png") center / contain no-repeat;
	opacity: calc(1 - var(--wp--custom--logo-light, 0));
}

.zen-mark::after {
	background-image: url("assets/images/torii-light.png");
	opacity: var(--wp--custom--logo-light, 0);
}

/* A Site Logo set in WordPress replaces the theme's mark. */
.zen-logo-mark {
	--s: 56px;
	margin: 0;
}

.zen-logo-mark a {
	position: relative;
	display: block;
	width: var(--s);
	height: var(--s);
	overflow: hidden;
}

.zen-logo-mark img {
	width: 100% !important;
	height: 100% !important;
	object-fit: contain;
}

/*
 * The original Nyuanshin logo JPG (500×284, gate at x 135–362, y 4–226):
 * crop to the gate, drop the wordmark, and blend the white background away.
 */
.zen-logo-mark img[src*="logo-2026"] {
	--k: calc(var(--s) * 0.92 / 227);
	position: absolute;
	max-width: none;
	width: calc(var(--k) * 500) !important;
	height: auto !important;
	left: calc(var(--s) * 0.04 - var(--k) * 135);
	top: calc((var(--s) - var(--k) * 222) / 2 - var(--k) * 4);
	mix-blend-mode: multiply;
}

.zen-brand:has(.zen-logo-mark img) .zen-mark {
	display: none;
}

.zen-header .wp-block-navigation-item__content {
	padding-block: 0.35em;
	border-bottom: 2px solid transparent;
}

/* The current page, and the item under the pointer, in seal red: one quiet red word, no underline. */
.zen-header .wp-block-navigation-item__content {
	transition: color 0.3s ease;
}

.zen-header .wp-block-navigation-item__content:hover,
.zen-header .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--accent);
}

/*
 * Search: a magnifier after the menu. Opened, the field takes the menu's
 * place on the same line (the menu comes back on Escape or a click
 * elsewhere), so nothing in the header moves or wraps. On phones it covers
 * the whole header row.
 */
.zen-header-end {
	position: relative;
	gap: 0.75rem 1.5rem;
}

.zen-header-search .wp-block-search__inside-wrapper {
	border: 0;
	padding: 0;
	background: none;
}

.zen-header-search .wp-block-search__button {
	margin: 0;
	padding: 0.35em;
	border: 0;
	background: none;
	color: var(--wp--preset--color--stone);
	box-shadow: none;
	transition: color 0.3s ease;
}

.zen-header-search .wp-block-search__button:hover,
.zen-header-search .wp-block-search__button:focus-visible {
	color: var(--wp--preset--color--accent);
}

.zen-header-search .wp-block-search__button svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.zen-header-search .wp-block-search__input {
	height: 2.2em;
	padding: 0 0.1em;
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--mist);
	border-radius: 0;
	background: transparent;
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--medium);
}

.zen-header-search .wp-block-search__input::placeholder {
	color: var(--wp--preset--color--stone);
	opacity: 0.8;
}

.zen-header-search .wp-block-search__input:focus {
	outline: none;
	border-bottom-color: var(--wp--preset--color--ink);
}

/* Facebook: a grey "f" beside the magnifier, seal red on hover, its label as a tooltip. */
.zen-header-social.wp-block-social-links {
	gap: 0;
	margin: 0;
	padding: 0;
}

.zen-header-social .wp-social-link {
	color: var(--wp--preset--color--stone);
	background: none !important;
	transition: color 0.3s ease;
}

.zen-header-social .wp-social-link:hover {
	color: var(--wp--preset--color--accent);
	transform: none;
}

.zen-header-social .wp-social-link a {
	padding: 0.35em !important;
	color: inherit;
}

.zen-header-social .wp-social-link svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* Open: lay the field over the menu, the magnifier staying where it was. */
.zen-header-search:not(.wp-block-search__searchfield-hidden) {
	position: absolute;
	inset: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	background: var(--wp--preset--color--paper);
}

.zen-header-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__inside-wrapper {
	width: 100% !important;
	min-width: 0;
	gap: 0.5rem;
}

.zen-header-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__input {
	width: auto;
	min-width: 0;
	flex: 1;
}

/*
 * Keep the site title and the menu on one line each at in-between widths.
 * Not on phones: there a long title must wrap, or it pushes the page wider
 * than the screen.
 */
@media (min-width: 1001px) {
	.zen-header .wp-block-site-title {
		white-space: nowrap;
	}
}

/* Phones and tablets: a smaller, tighter title so a long one sits on two lines beside the menu. */
@media (max-width: 1000px) {
	.zen-header .wp-block-site-title {
		font-size: 1.05rem;
		line-height: 1.25;
	}

	.zen-brand {
		gap: 0.65rem;
		min-width: 0;
	}

	.zen-brand .zen-mark,
	.zen-brand .zen-logo-mark {
		flex-shrink: 0;
	}

	.zen-header-end {
		gap: 0.25rem 0.75rem;
	}
}

@media (min-width: 600px) and (max-width: 1080px) {
	.zen-header .wp-block-navigation__container {
		gap: 0.5em 1.1em;
		flex-wrap: nowrap;
	}

	.zen-header .wp-block-navigation-item__label {
		white-space: nowrap;
	}
}

@media (min-width: 1001px) and (max-width: 1080px) {
	.zen-header .wp-block-navigation__container {
		gap: 0.5em 0.85em;
	}
}

/*
 * Tablets (600-1000px): the full six-item menu leaves a long title no room,
 * so use the menu button there too, as on phones (WordPress switches at 600px).
 */
@media (min-width: 600px) and (max-width: 1000px) {
	.zen-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.zen-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}

/* Phones and tablets: the header row is mostly the logo, so the open field covers all of it. */
@media (max-width: 1000px) {
	.zen-header {
		position: relative;
	}

	.zen-header-end {
		position: static;
	}

	.zen-header-search:not(.wp-block-search__searchfield-hidden) {
		inset: 0 var(--wp--style--root--padding-right, 1rem) 0 var(--wp--style--root--padding-left, 1rem);
	}
}

/* ---- Bands -------------------------------------------------------- */

.zen-main {
	padding-block: var(--wp--preset--spacing--50) var(--wp--preset--spacing--60);
}

.zen-front {
	padding-top: 0;
	margin-top: 0;
}

.zen-band {
	background: var(--wp--preset--color--sand);
	border-bottom: 1px solid var(--wp--preset--color--mist);
	padding-block: var(--wp--preset--spacing--60);
	margin-block-start: 0 !important;
}

/* Narrow measures stay aligned to the left edge of the wide column. */
.zen-intro .zen-display,
.zen-intro .zen-lede {
	margin-left: max(0px, calc((100% - var(--wp--style--global--wide-size)) / 2)) !important;
}

.zen-intro-grid {
	display: grid;
	gap: var(--wp--preset--spacing--50);
	align-items: center;
}

.zen-intro-text > :first-child {
	margin-top: 0;
}

.zen-intro-image {
	margin: 0;
}

.zen-intro-image img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	object-position: 62% 50%; /* Nishiyama Sensei sits right of centre in the 16:9 original */
	box-shadow: 0 1px 0 var(--wp--preset--color--mist);
}

@media (min-width: 900px) {
	.zen-intro-grid {
		grid-template-columns: 1.35fr 1fr;
		gap: var(--wp--preset--spacing--60);
	}

	.zen-intro-image img {
		aspect-ratio: 4 / 5;
	}
}

.zen-intro .zen-display {
	font-size: clamp(2.5rem, 7vw, 4.75rem);
	line-height: 1.08;
	max-width: 18ch;
	margin-top: 1.25rem;
}

.zen-intro .zen-lede {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.6;
	color: var(--wp--preset--color--stone);
	max-width: 34em;
}

.zen-actions {
	gap: 2rem;
	margin-top: var(--wp--preset--spacing--50);
}

.zen-textlink a {
	color: var(--wp--preset--color--stone);
	text-decoration: none;
}

.zen-textlink a:hover {
	color: var(--wp--preset--color--accent);
}

/* Featured essay: hidden entirely when there is no sticky post. */
.zen-featured:not(:has(.wp-block-post)) {
	display: none;
}

.zen-featured {
	padding-inline: var(--wp--style--root--padding-left) var(--wp--style--root--padding-right);
}

.zen-featured .wp-block-post-template {
	max-width: var(--wp--style--global--wide-size);
	margin: 0 auto;
}

.zen-feature-card {
	display: grid;
	gap: var(--wp--preset--spacing--40);
}

.zen-feature-card .wp-block-post-title {
	font-size: var(--wp--preset--font-size--x-large);
}

@media (min-width: 782px) {
	.zen-feature-card:has(.wp-block-post-featured-image) {
		grid-template-columns: 1.15fr 1fr;
		align-items: center;
		gap: var(--wp--preset--spacing--60);
	}
}

.zen-card-body > * + * {
	margin-top: 1rem;
}

/* ---- Essay grid --------------------------------------------------- */

.zen-essays {
	padding-top: var(--wp--preset--spacing--60);
}

.zen-section-head {
	margin-bottom: var(--wp--preset--spacing--50);
}

.zen-section-head > * {
	margin: 0;
}

/* ---- Browse by date (Blog page and archives) ----------------------- */

.zen-archive-nav {
	gap: 1rem 2rem;
	margin-block: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	padding-block: 0.9rem;
	border-block: 1px solid var(--wp--preset--color--mist);
}

.zen-archive-years {
	gap: 0.5rem 1.25rem;
}

.zen-archive-nav .zen-eyebrow {
	margin: 0;
}

.zen-years {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: var(--wp--preset--font-family--serif);
	color: var(--wp--preset--color--stone);
}

.zen-years a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	font-size: 1.0625rem;
}

.zen-years a:hover,
.zen-years a[aria-current] {
	color: var(--wp--preset--color--accent);
}

.zen-months select {
	min-height: 2.6rem;
	padding: 0.4em 2.25em 0.4em 0.8em;
	border: 1px solid var(--wp--preset--color--mist);
	border-radius: 0;
	background-color: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	cursor: pointer;
}

.zen-months select:focus {
	outline: none;
	border-color: var(--wp--preset--color--accent);
}

.zen-all-essays {
	margin-top: var(--wp--preset--spacing--50);
	text-align: center;
}

.zen-count {
	margin: 0;
	color: var(--wp--preset--color--stone);
	font-size: var(--wp--preset--font-size--medium);
}

.wp-block-post-template.is-layout-grid {
	gap: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50);
}

.zen-card > * {
	margin-block: 0;
}

.zen-card > * + * {
	margin-top: 0.85rem;
}

.zen-card .wp-block-post-featured-image {
	margin-bottom: 0.6rem;
}

.zen-card .wp-block-post-excerpt__excerpt {
	margin: 0;
}

/*
 * Even cards in a grid: every excerpt shows the same number of lines, and
 * each card fills its row so "Read essay" lines up along the bottom even
 * when a title or the category label takes an extra line.
 */
.wp-block-post-template.is-layout-grid > li {
	display: flex;
	flex-direction: column;
}

.wp-block-post-template.is-layout-grid .zen-card {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.wp-block-post-template.is-layout-grid .zen-card .wp-block-post-excerpt__excerpt {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
	line-clamp: 4;
	overflow: hidden;
}

.wp-block-post-template.is-layout-grid .zen-card > .zen-readmore {
	margin-top: auto;
	padding-top: 0.85rem;
}

.wp-block-post-featured-image img {
	filter: saturate(0.85);
	transition: filter 0.4s ease;
}

.wp-block-post-featured-image a:hover img {
	filter: saturate(1);
}

.wp-block-query-pagination {
	margin-top: var(--wp--preset--spacing--60);
}

/* ---- Front page sections ------------------------------------------ */

.zen-motto {
	padding-block: var(--wp--preset--spacing--60);
	border-bottom: 1px solid var(--wp--preset--color--mist);
	margin-block-start: 0 !important;
}

.zen-motto .wp-block-separator.is-style-zen {
	margin-block: var(--wp--preset--spacing--40);
}

.zen-motto-text {
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--large);
	font-style: italic;
	line-height: 1.6;
}

.zen-testimonials {
	border-top: 1px solid var(--wp--preset--color--mist);
	margin-top: var(--wp--preset--spacing--60);
}

.zen-testimonial-grid {
	gap: var(--wp--preset--spacing--40);
	margin-top: var(--wp--preset--spacing--50);
}

.zen-testimonial {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 1.25rem;
	background: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--mist);
	padding: var(--wp--preset--spacing--40);
}

.zen-testimonial > * {
	margin: 0;
}

.zen-testimonial-text {
	font-family: var(--wp--preset--font-family--serif);
	font-style: italic;
	line-height: 1.65;
}

.zen-testimonial-text::before {
	content: "“";
	display: block;
	font-size: 2.5rem;
	line-height: 1;
	height: 1.25rem;
	color: var(--wp--preset--color--accent);
	font-style: normal;
}

.zen-testimonial-by {
	gap: 0.85rem;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.4;
	color: var(--wp--preset--color--stone);
}

.zen-testimonial-by > * {
	margin: 0;
}

.zen-testimonial-by strong {
	color: var(--wp--preset--color--ink);
	font-weight: 500;
}

.zen-testimonial-by img {
	filter: grayscale(1);
}

.zen-begin {
	padding-block: var(--wp--preset--spacing--60);
	margin-block-start: 0 !important;
}

.zen-button-accent .wp-block-button__link {
	background: var(--wp--preset--color--accent);
}

.zen-button-accent .wp-block-button__link:hover {
	background: var(--wp--preset--color--ink);
}

/* ---- Article ------------------------------------------------------ */

.zen-prose {
	font-size: 1.1875rem;
}

/*
 * Classic-editor content (older posts): images aligned with the classic
 * .alignleft/.alignright classes, captions, and <pre> author's notes.
 */
.zen-prose {
	display: flow-root;
}

.zen-prose :where(h2, h3, h4, h5, h6, pre, hr) {
	clear: both;
}

.zen-prose img.alignleft,
.zen-prose .wp-caption.alignleft {
	float: left;
	margin: 0.35em 1.75em 1em 0;
}

.zen-prose img.alignright,
.zen-prose .wp-caption.alignright {
	float: right;
	margin: 0.35em 0 1em 1.75em;
}

.zen-prose img.aligncenter,
.zen-prose .wp-caption.aligncenter {
	display: block;
	margin-inline: auto;
}

.zen-prose img {
	max-width: 100%;
	height: auto;
}

.zen-prose .wp-caption {
	max-width: 100%;
}

.zen-prose .wp-caption-text {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--stone);
	margin-top: 0.5em;
}

@media (max-width: 600px) {
	.zen-prose img.alignleft,
	.zen-prose img.alignright,
	.zen-prose .wp-caption.alignleft,
	.zen-prose .wp-caption.alignright {
		float: none;
		display: block;
		margin: 1em auto;
	}
}

/*
 * Image blocks floated beside the text. On phones there is no room for
 * text beside them (it ran one word per line), so they sit on their own.
 */
@media (max-width: 600px) {
	.zen-prose .wp-block-image:is(.alignleft, .alignright) {
		float: none;
		margin: var(--wp--preset--spacing--40) 0;
	}

	.zen-prose .wp-block-image:is(.alignleft, .alignright) img {
		width: 100% !important;
		height: auto !important;
	}
}

/*
 * "Archive photo" image style: old prints shown as one set. Same width
 * when floated, one quiet black-and-white tone (sepia and grey prints
 * alike), a thin paper mat, and a small serif caption underneath.
 */
.wp-block-image.is-style-zen-archive {
	box-sizing: border-box;
	padding: 6px 6px 0;
	border: 1px solid var(--wp--preset--color--mist);
	background: #fff;
}

.wp-block-image.is-style-zen-archive:is(.alignleft, .alignright) {
	width: 18rem;
	max-width: 45%;
}

.wp-block-image.is-style-zen-archive.alignleft {
	margin: 0.35em var(--wp--preset--spacing--40) 1em 0;
}

.wp-block-image.is-style-zen-archive.alignright {
	margin: 0.35em 0 1em var(--wp--preset--spacing--40);
}

.wp-block-image.is-style-zen-archive img {
	display: block;
	width: 100% !important;
	height: auto !important;
	filter: grayscale(1) contrast(1.04);
}

.wp-block-image.is-style-zen-archive figcaption {
	margin: 0;
	padding: 0.5rem 0.25rem 0.6rem;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.4;
	color: var(--wp--preset--color--stone);
	text-align: left;
}

/* No caption: close the mat under the photo. */
.wp-block-image.is-style-zen-archive:not(:has(figcaption)) {
	padding-bottom: 6px;
}

@media (max-width: 600px) {
	.zen-prose .wp-block-image.is-style-zen-archive:is(.alignleft, .alignright) {
		width: 100%;
		max-width: 100%;
	}
}

/*
 * Author's note: the "Author's note" group style for new posts, and the
 * preformatted text older posts use for the same purpose. In those, the
 * first line ("Author's Note:") becomes the small red label.
 */
.is-style-zen-note,
.zen-prose pre:not(.wp-block-code),
.zen-prose p.zen-note-para {
	position: relative;
	margin-block: 0 var(--wp--preset--spacing--50);
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	background: var(--wp--preset--color--sand);
	border: 0;
	border-top: 2px solid var(--wp--preset--color--accent);
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.0625rem;
	font-style: italic;
	line-height: 1.75;
	color: var(--wp--preset--color--stone);
}

/* Notes written as a (Kadence) paragraph: override the plugin's own text styles. */
.zen-prose p.zen-note-para {
	box-sizing: border-box;
	font-family: var(--wp--preset--font-family--serif) !important;
	font-size: 1.0625rem !important;
	line-height: 1.75 !important;
	color: var(--wp--preset--color--stone) !important;
	text-align: left !important;
}

.zen-prose p.zen-note-para :is(em, i) {
	font-style: inherit;
}

.zen-prose pre:not(.wp-block-code) {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.zen-prose pre:not(.wp-block-code)::first-line,
.zen-prose p.zen-note-para::first-line,
.zen-note-label {
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--small);
	font-style: normal;
	font-weight: 400;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}

.zen-prose pre:not(.wp-block-code) :is(strong, b) {
	font-weight: 500;
}

.is-style-zen-note > * {
	margin-block: 0;
}

.is-style-zen-note > * + * {
	margin-top: 0.75rem;
}

.zen-note-signature {
	font-style: normal;
	color: var(--wp--preset--color--ink);
}

.zen-note-signature::before {
	content: "— ";
	color: var(--wp--preset--color--accent);
}

.zen-prose pre.wp-block-code,
.zen-prose pre.wp-block-code code {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

/*
 * Headings inside essays and pages come in two looks only, whatever tag
 * (h2/h3/h4), bold or Kadence styling the content used. The ranks are set
 * by inc/reading.php: zen-h-section for main sections, zen-h-sub for
 * subsections nested between them.
 */
.zen-prose :is(.zen-h-section, .zen-h-sub) {
	clear: both;
	font-family: var(--wp--preset--font-family--serif) !important;
	font-style: normal !important;
	font-weight: 500 !important;
	letter-spacing: -0.005em !important;
	text-transform: none !important;
	color: var(--wp--preset--color--ink) !important;
	margin-bottom: 0.6em;
}

.zen-prose .zen-h-section {
	font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem) !important;
	line-height: 1.25 !important;
	margin-top: var(--wp--preset--spacing--50);
}

.zen-prose .zen-h-sub {
	font-size: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem) !important;
	line-height: 1.35 !important;
	margin-top: var(--wp--preset--spacing--40);
}

/* Bold or italic added inside a heading does not change its weight. */
.zen-prose :is(.zen-h-section, .zen-h-sub) :is(b, strong, em, i) {
	font-weight: inherit;
	font-style: inherit;
}

.zen-prose :is(.zen-h-section, .zen-h-sub) a {
	text-decoration: none;
}

.zen-postnav a {
	text-decoration: none;
	font-weight: 500;
}

.wp-block-separator.is-style-zen {
	width: 48px;
	height: 2px;
	border: 0;
	background: var(--wp--preset--color--accent);
	margin-inline: auto;
	margin-block: var(--wp--preset--spacing--50);
	opacity: 1;
}

/* Drawn left to right as it scrolls into view (inc/motion.php). */
.zen-motion .wp-block-separator.is-style-zen {
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 1s cubic-bezier(0.6, 0.05, 0.25, 1);
}

.zen-motion .wp-block-separator.is-style-zen.is-seen {
	transform: none;
}

.wp-block-quote {
	border-left: 2px solid var(--wp--preset--color--accent);
	padding-left: var(--wp--preset--spacing--40);
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--large);
	font-style: italic;
}

.wp-block-quote cite {
	font-style: normal;
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--stone);
}

/*
 * Pullquote: a sensei's words set apart in an essay, styled like the quote
 * on the front page. Short red rule above, large upright serif, the name
 * underneath as "— Name". The Quote block keeps its red side line for
 * shorter quotations within the text.
 */
.wp-block-pullquote {
	border: 0;
	margin-block: var(--wp--preset--spacing--50);
	padding: 0;
	text-align: center;
	color: var(--wp--preset--color--ink);
}

.wp-block-pullquote::before {
	content: "";
	display: block;
	width: 48px;
	height: 2px;
	margin: 0 auto var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--accent);
}

.wp-block-pullquote blockquote {
	margin: 0 auto;
	max-width: 34em;
}

.wp-block-pullquote blockquote p,
.wp-block-pullquote p {
	margin: 0;
	font-family: var(--wp--preset--font-family--serif);
	font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
	font-style: normal;
	line-height: 1.35;
	text-wrap: balance;
}

.wp-block-pullquote cite {
	display: block;
	margin-top: 1.1rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	font-style: normal;
	text-transform: none;
	color: var(--wp--preset--color--stone);
}

.wp-block-pullquote cite::before {
	content: "— ";
}

/* Floated left or right beside the text: smaller, aligned to its side. */
.wp-block-pullquote.alignleft,
.wp-block-pullquote.alignright {
	max-width: 18rem;
	margin-block: 0.5rem 1.5rem;
}

.wp-block-pullquote.alignleft {
	margin-right: var(--wp--preset--spacing--40);
	text-align: left;
}

.wp-block-pullquote.alignright {
	margin-left: var(--wp--preset--spacing--40);
	text-align: right;
}

.wp-block-pullquote.alignleft::before {
	margin-left: 0;
}

.wp-block-pullquote.alignright::before {
	margin-right: 0;
}

.wp-block-pullquote:is(.alignleft, .alignright) p {
	font-size: var(--wp--preset--font-size--large);
}

/* No room to float on a phone: centre it like the default. */
@media (max-width: 600px) {
	.wp-block-pullquote.alignleft,
	.wp-block-pullquote.alignright {
		float: none;
		max-width: none;
		margin: var(--wp--preset--spacing--50) 0;
		text-align: center;
	}

	.wp-block-pullquote.alignleft::before,
	.wp-block-pullquote.alignright::before {
		margin-inline: auto;
	}
}

/* ---- Reading aids: meta line, contents, series --------------------- */

.zen-toc,
.zen-series,
.zen-newsletter,
.is-style-zen-note,
.zen-prose pre {
	box-sizing: border-box;
}

.zen-post-meta {
	gap: 0 0.75rem;
}

.zen-post-meta > * {
	margin: 0;
}

/* Short pages have no reading time, which leaves the meta row empty. */
.zen-post-meta:not(:has(*)) {
	display: none;
}

.zen-post-meta > * + *::before {
	content: "·";
	margin-right: 0.75rem;
	color: var(--wp--preset--color--mist);
}

.zen-series-label a {
	color: var(--wp--preset--color--accent);
	text-decoration: none;
}

.zen-toc {
	margin-block: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	border-block: 1px solid var(--wp--preset--color--mist);
	padding-block: 0.9rem;
}

.zen-toc summary {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	cursor: pointer;
	list-style: none;
}

.zen-toc summary::-webkit-details-marker {
	display: none;
}

.zen-toc summary::after {
	content: "+";
	font-family: var(--wp--preset--font-family--sans);
	color: var(--wp--preset--color--accent);
	transition: transform 0.3s ease;
}

.zen-toc[open] summary::after {
	transform: rotate(45deg);
}

.zen-toc .zen-eyebrow {
	margin: 0;
	flex: 1;
}

.zen-toc-count {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--stone);
}

.zen-toc ol {
	list-style: none;
	margin: 1rem 0 0.25rem;
	padding: 0;
	counter-reset: zen-toc;
	font-size: 1rem;
	line-height: 1.5;
}

.zen-toc li {
	margin-block: 0.45rem;
}

.zen-toc .zen-toc-level-1 {
	counter-increment: zen-toc;
}

.zen-toc .zen-toc-level-1::before {
	content: counter(zen-toc, decimal-leading-zero);
	display: inline-block;
	width: 2.25rem;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--accent);
}

.zen-toc .zen-toc-level-2 { padding-left: 2.25rem; }
.zen-toc .zen-toc-level-3 { padding-left: 3.5rem; font-size: 0.9375rem; }

.zen-toc a {
	text-decoration: none;
}

.zen-toc a:hover {
	text-decoration: underline;
}

.zen-series {
	margin-top: var(--wp--preset--spacing--60);
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	background: var(--wp--preset--color--sand);
	border-top: 2px solid var(--wp--preset--color--accent);
}

.zen-series > * {
	margin-block: 0;
}

.zen-series-title {
	margin-top: 0.5rem !important;
	font-size: var(--wp--preset--font-size--large);
}

.zen-series-title a {
	text-decoration: none;
}

.zen-series-desc {
	margin-top: 0.5rem !important;
	color: var(--wp--preset--color--stone);
	font-size: var(--wp--preset--font-size--small);
}

/* Unnumbered: a series can be open-ended, so no "3" that reads as "3 of N". */
.zen-series-list {
	list-style: none;
	margin-top: 1.25rem !important;
	padding: 0;
}

.zen-series-list li {
	display: flex;
	gap: 1rem;
	padding-block: 0.55rem;
	border-top: 1px solid var(--wp--preset--color--mist);
	line-height: 1.45;
}

.zen-series-list li::before {
	content: "–";
	flex: 0 0 1.5rem;
	font-family: var(--wp--preset--font-family--serif);
	color: var(--wp--preset--color--mist);
}

.zen-series-list li[aria-current]::before {
	content: "●";
	font-size: 0.7em;
	line-height: 2.1;
}

.zen-series-list li[aria-current]::before {
	color: var(--wp--preset--color--accent);
}

.zen-series-list li[aria-current] span {
	font-weight: 500;
}

.zen-series-list a {
	text-decoration: none;
	color: var(--wp--preset--color--stone);
}

.zen-series-list a:hover {
	color: var(--wp--preset--color--ink);
}

.zen-series-next {
	margin-top: 1.25rem !important;
}

/* ---- Author box ---------------------------------------------------- */

.zen-author {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: var(--wp--preset--spacing--40);
	align-items: start;
	margin-top: var(--wp--preset--spacing--60);
	padding-block: var(--wp--preset--spacing--50);
	border-block: 1px solid var(--wp--preset--color--mist);
}

.zen-author > *,
.zen-author-text > * {
	margin-block: 0;
}

.zen-author-photo img {
	display: block;
	width: 96px;
	height: 96px;
	object-fit: cover;
	border-radius: 50%;
	filter: grayscale(1);
}

.zen-author-name {
	margin-top: 0.4rem !important;
	font-size: var(--wp--preset--font-size--large);
}

.zen-author-bio {
	margin-top: 0.6rem !important;
	color: var(--wp--preset--color--stone);
	line-height: 1.65;
}

.zen-author-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.75rem;
	margin-top: 0.9rem !important;
}

.zen-author-links a {
	font-weight: 500;
	text-decoration: none;
}

.zen-author-links a::after {
	content: " →";
	color: var(--wp--preset--color--accent);
}

@media (max-width: 600px) {
	.zen-author {
		grid-template-columns: 1fr;
	}

	.zen-author-photo img {
		width: 72px;
		height: 72px;
	}
}

/* ---- Continue reading ---------------------------------------------- */

.zen-related {
	margin-top: var(--wp--preset--spacing--60);
}

.zen-related .zen-section-head h2 {
	margin-top: 0.5rem;
}

.zen-related-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	gap: var(--wp--preset--spacing--50);
}

.zen-related-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	filter: saturate(0.85);
	transition: filter 0.4s ease;
}

.zen-related-image:hover img {
	filter: saturate(1);
}

.zen-related-title {
	font-size: var(--wp--preset--font-size--large);
}

.zen-related-title a {
	text-decoration: none;
}

.zen-related-excerpt {
	color: var(--wp--preset--color--stone);
	font-size: 1rem;
}

.zen-related .zen-readmore {
	display: inline-block;
}

/* ---- Newsletter ---------------------------------------------------- */

.zen-newsletter {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	margin-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50);
	padding: var(--wp--preset--spacing--50);
	border: 1px solid var(--wp--preset--color--mist);
	text-align: center;
}

.zen-newsletter > * {
	margin: 0;
}

.zen-newsletter-copy > * {
	margin: 0;
}

.zen-newsletter-title {
	margin-top: 0.5rem !important;
	font-size: var(--wp--preset--font-size--x-large);
}

.zen-newsletter-text {
	margin: 0.75rem auto 0 !important;
	max-width: 32em;
	color: var(--wp--preset--color--stone);
}

/* Footer variant: one quiet row above the 礼 seal. */
.zen-newsletter.is-compact {
	max-width: var(--wp--style--global--wide-size);
	margin: 0 auto;
	padding: var(--wp--preset--spacing--50) var(--wp--style--root--padding-right) var(--wp--preset--spacing--50) var(--wp--style--root--padding-left);
	border: 0;
	border-top: 1px solid var(--wp--preset--color--mist);
	text-align: left;
	align-items: center;
}

.zen-newsletter.is-compact .zen-newsletter-title {
	font-size: var(--wp--preset--font-size--large);
}

.zen-newsletter.is-compact .zen-newsletter-text {
	margin-left: 0 !important;
	font-size: var(--wp--preset--font-size--small);
}

@media (min-width: 782px) {
	.zen-newsletter.is-compact {
		grid-template-columns: 1fr 1fr;
		gap: var(--wp--preset--spacing--60);
	}
}

/* The Newsletter plugin's minimal form, restyled to match. */
.zen-newsletter .tnp,
.zen-newsletter form {
	margin: 0;
	max-width: none;
}

.zen-newsletter form {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
}

.zen-newsletter.is-compact form {
	justify-content: flex-start;
}

.zen-newsletter .tnp input.tnp-email,
.zen-newsletter input[type="email"] {
	flex: 1 1 16rem;
	max-width: 24rem;
	min-height: 3.1rem;
	padding: 0.6em 0.9em;
	border: 1px solid var(--wp--preset--color--mist);
	border-radius: 0;
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	font: inherit;
	font-size: 1rem;
}

.zen-newsletter .tnp input.tnp-email:focus,
.zen-newsletter input[type="email"]:focus {
	outline: none;
	border-color: var(--wp--preset--color--accent);
}

.zen-newsletter .tnp input.tnp-submit,
.zen-newsletter input[type="submit"] {
	min-height: 3.1rem;
	padding: 0.6em 1.75em;
	border: 0;
	border-radius: 0;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
	font-family: var(--wp--preset--font-family--sans);
	font-size: 1rem;
	font-weight: 500;
	cursor: pointer;
	width: auto;
}

.zen-newsletter .tnp input.tnp-submit:hover,
.zen-newsletter input[type="submit"]:hover {
	background: var(--wp--preset--color--accent);
}

.zen-newsletter .tnp-privacy-field,
.zen-newsletter .tnp-field-privacy {
	flex-basis: 100%;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--stone);
}

/* ---- Ensō (404 page and "Ensō hero" pattern) ----------------------- */

.zen-hero {
	text-align: center;
	padding-block: var(--wp--preset--spacing--50);
}

.zen-kanji {
	position: relative;
	display: grid;
	place-items: center;
	width: 180px;
	height: 180px;
	margin-inline: auto !important;
	writing-mode: vertical-rl;
	font-family: var(--wp--preset--font-family--mincho);
	font-size: 1.6rem;
	letter-spacing: 0.35em;
	color: var(--wp--preset--color--ink);
}

/*
 * On the site the ensō is inline SVG (inc/motion.php), painted in one brush
 * stroke before the characters fade in. The editor has no SVG, so it keeps
 * the static mask.
 */
.zen-kanji svg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	color: var(--wp--preset--color--accent);
	opacity: 0.85;
	overflow: visible;
	pointer-events: none;
}

.zen-kanji path {
	stroke-dasharray: 1;
	stroke-dashoffset: 1;
	animation: zen-enso-draw 1.6s cubic-bezier(0.5, 0.05, 0.25, 1) 0.3s forwards;
}

.zen-kanji path:nth-child(2) {
	animation-delay: 0.45s;
}

.zen-kanji path:nth-child(3) {
	animation-duration: 0.9s;
	animation-delay: 1.1s;
}

.zen-kanji svg + span {
	opacity: 0;
	animation: zen-ink-in 1.2s ease-out 1.4s forwards;
}

@keyframes zen-enso-draw {
	to { stroke-dashoffset: 0; }
}

@keyframes zen-ink-in {
	to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.zen-kanji path,
	.zen-kanji svg + span {
		animation: none;
		stroke-dashoffset: 0;
		opacity: 1;
	}
}

.zen-kanji:not(:has(svg))::before {
	content: "";
	position: absolute;
	inset: 0;
	background-color: var(--wp--preset--color--accent);
	-webkit-mask: url("assets/images/enso.svg") center / contain no-repeat;
	mask: url("assets/images/enso.svg") center / contain no-repeat;
	opacity: 0.85;
	pointer-events: none;
}

/* ---- Kata card pattern -------------------------------------------- */

.zen-kata {
	background: var(--wp--preset--color--sand);
	border: 1px solid var(--wp--preset--color--mist);
	padding: var(--wp--preset--spacing--40);
}

.zen-kata .zen-kata-name {
	font-family: var(--wp--preset--font-family--mincho);
	font-size: var(--wp--preset--font-size--x-large);
	margin: 0;
}

.zen-kata dl {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.25rem 1.5rem;
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
}

.zen-kata dt {
	font-family: var(--wp--preset--font-family--serif);
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}

.zen-kata dd {
	margin: 0;
}

/* ---- Start Here reading path (pattern) ----------------------------- */

.zen-path {
	counter-reset: zen-path;
}

.zen-path-intro {
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.7;
}

.zen-path-stage {
	margin-top: var(--wp--preset--spacing--50);
}

.zen-path-stage > .wp-block-heading {
	margin-bottom: 0;
	padding-bottom: 0.6rem;
	border-bottom: 1px solid var(--wp--preset--color--mist);
	font-size: var(--wp--preset--font-size--large);
}

.zen-path-stage > .zen-tagline {
	margin-block: 0.9rem 0;
}

/* Numbered through the whole page, so the path reads 1 to N across stages. */
.zen-path-item {
	counter-increment: zen-path;
	position: relative;
	padding: var(--wp--preset--spacing--30) 0 var(--wp--preset--spacing--30) 3.5rem;
	border-bottom: 1px solid var(--wp--preset--color--mist);
}

.zen-path-item::before {
	content: counter(zen-path);
	position: absolute;
	left: 0;
	top: var(--wp--preset--spacing--30);
	width: 2.5rem;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.2;
	color: var(--wp--preset--color--accent);
	text-align: center;
}

.zen-path-item > * {
	margin-block: 0;
}

.zen-path-item > * + * {
	margin-top: 0.35rem;
}

.zen-path-title {
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.3;
}

.zen-path-title a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.zen-path-title a:hover {
	color: var(--wp--preset--color--accent);
}

.zen-path-text {
	color: var(--wp--preset--color--stone);
	font-size: 1.0625rem;
	line-height: 1.55;
}

.zen-path-meta:empty {
	display: none;
}

.zen-path-more {
	margin-top: var(--wp--preset--spacing--50);
}

/* "Go deeper": the series and guest pieces as compact boxes. */
.zen-deeper {
	margin-top: var(--wp--preset--spacing--60);
}

.zen-deeper > .wp-block-heading {
	margin-bottom: 0;
	padding-bottom: 0.6rem;
	border-bottom: 1px solid var(--wp--preset--color--mist);
	font-size: var(--wp--preset--font-size--large);
}

.zen-deeper-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
	gap: 1rem;
	margin-top: var(--wp--preset--spacing--40);
}

.zen-deeper-grid > .zen-deeper-box {
	margin: 0; /* the flow layout's sibling spacing would stagger the row */
}

.zen-deeper-box {
	padding: 1.25rem 1.25rem 1.4rem;
	border-top: 2px solid var(--wp--preset--color--accent);
	background: var(--wp--preset--color--sand);
}

.zen-deeper-box > * {
	margin-block: 0;
}

.zen-deeper-box > * + * {
	margin-top: 0.6rem;
}

.zen-deeper-title {
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.25;
}

.zen-deeper-text {
	color: var(--wp--preset--color--stone);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
}

.zen-deeper-links {
	font-family: var(--wp--preset--font-family--serif);
	line-height: 1.35;
}

.zen-deeper-links br {
	display: none;
}

/* One link per line, wrapped lines indented past the arrow. */
.zen-deeper-links a {
	display: block;
	padding-left: 1.4em;
	text-indent: -1.4em;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.zen-deeper-links a ~ a {
	margin-top: 0.5rem;
}

.zen-deeper-links a::before {
	content: "→";
	display: inline-block;
	width: 1.4em;
	text-indent: 0;
	color: var(--wp--preset--color--accent);
}

.zen-deeper-links a:hover {
	color: var(--wp--preset--color--accent);
}

@media (max-width: 600px) {
	.zen-path-item {
		padding-left: 2.5rem;
	}

	.zen-path-item::before {
		width: 1.75rem;
	}
}

/* ---- Gallery ------------------------------------------------------ */

/* Every Gallery block: even 3:2 photos, thin gaps; captions show in the viewer. */
.wp-block-gallery.has-nested-images {
	--wp--style--unstable-gallery-gap: 0.75rem;
	gap: 0.75rem;
	margin-block: var(--wp--preset--spacing--40);
}

.wp-block-gallery.has-nested-images figure.wp-block-image {
	flex-direction: column;
	justify-content: flex-start;
}

.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) img {
	aspect-ratio: 3 / 2;
	height: auto;
	flex: none;
	object-fit: cover;
}

.wp-block-gallery.has-nested-images figure.wp-block-image img {
	filter: saturate(0.85);
	transition: filter 0.4s ease;
	cursor: zoom-in;
}

.wp-block-gallery.has-nested-images figure.wp-block-image a img {
	cursor: pointer;
}

.wp-block-gallery.has-nested-images figure.wp-block-image:hover img {
	filter: saturate(1);
}

.wp-block-gallery.has-nested-images figure.wp-block-image img:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

/*
 * In the editor, captions sit below each photo so they can be written; core
 * lays them over the photo on a dark gradient.
 */
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption.wp-element-caption {
	position: static;
	max-height: none;
	overflow: visible;
	padding: 0.5rem 0.25rem 0.6rem;
	background: none;
	color: var(--wp--preset--color--stone);
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--small);
	text-align: left;
	text-shadow: none;
	line-height: 1.4;
}

.wp-block-gallery.has-nested-images figure.wp-block-image figcaption.wp-element-caption::before {
	content: none;
}

/*
 * On the site the grid is photos only: captions are kept for screen readers
 * and shown in the viewer (assets/js/gallery.js). The editor's body carries
 * .editor-styles-wrapper, so this leaves the editor alone.
 */
body:not(.editor-styles-wrapper) .wp-block-gallery.has-nested-images figure.wp-block-image figcaption.wp-element-caption {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.wp-block-gallery.has-nested-images > figcaption.blocks-gallery-caption {
	flex-basis: 100%;
	margin-top: 0.25rem;
	color: var(--wp--preset--color--stone);
	font-size: var(--wp--preset--font-size--small);
	text-align: left;
}

/* "Show more photos" (assets/js/gallery.js); core's flex display would override [hidden]. */
.wp-block-gallery.has-nested-images figure.wp-block-image[hidden] {
	display: none !important;
}

.zen-gallery-more {
	text-align: center;
	margin-block: var(--wp--preset--spacing--40);
}

.zen-gallery-more-button {
	padding: 0.75rem 1.5rem;
	border: 1px solid var(--wp--preset--color--ink);
	background: transparent;
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.3s ease, color 0.3s ease;
}

.zen-gallery-more-button:is(:hover, :focus-visible) {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
}

.zen-gallery-more-count {
	font-weight: 400;
	opacity: 0.75;
}

/*
 * Painted in with a dry brush as they scroll into view (inc/motion.php adds
 * .zen-motion and .is-seen). The mask is three times as wide as the photo:
 * solid, then bristle streaks, then clear; sliding it across paints the photo.
 */
.zen-motion :is(.wp-block-gallery .wp-block-image, .zen-ichigo-photo) img {
	-webkit-mask: url("assets/images/brush.svg") 100% 0 / 300% 100% no-repeat;
	mask: url("assets/images/brush.svg") 100% 0 / 300% 100% no-repeat;
	transition: filter 0.4s ease, -webkit-mask-position 1.4s cubic-bezier(0.55, 0.05, 0.25, 1), mask-position 1.4s cubic-bezier(0.55, 0.05, 0.25, 1);
}

.zen-motion :is(.wp-block-gallery .wp-block-image, .zen-ichigo-photo).is-seen img {
	-webkit-mask-position: 0 0;
	mask-position: 0 0;
}

/* Captions as "Sensei Avi – Austria 2019": the red label (after the dash) above the text. */
.zen-caption-label {
	display: block;
	font-family: var(--wp--preset--font-family--serif);
	font-size: 0.8125rem;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	margin-bottom: 0.2rem;
}

.zen-caption-label:empty {
	display: none;
}

.zen-caption-text {
	font-family: var(--wp--preset--font-family--serif);
	font-style: italic;
	font-size: 1.125rem;
	line-height: 1.45;
	color: var(--wp--preset--color--stone);
}

/* ---- Photo viewer (assets/js/gallery.js) --------------------------- */

.zen-viewer-open,
.zen-viewer-open body {
	overflow: hidden;
}

/* The language switcher floats above everything; step it aside while a photo is open. */
.zen-viewer-open #gt_float_wrapper {
	display: none;
}

.zen-viewer {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	background: var(--wp--preset--color--paper);
	opacity: 0;
	transition: opacity 0.4s ease;
}

.zen-viewer.is-open {
	opacity: 1;
}

.zen-viewer[hidden] {
	display: none;
}

.zen-viewer-stage {
	position: relative;
	overflow: hidden;
	margin: 3.5rem 4.5rem 1.5rem;
}

.zen-viewer-panel {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
}

.zen-viewer-panel figure {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 100%;
}

.zen-viewer-panel img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 14.5rem);
	max-height: calc(100dvh - 14.5rem);
	width: auto;
	height: auto;
	object-fit: contain;
}

.zen-viewer-caption {
	max-width: 40em;
	padding: 1rem 1rem 0;
	text-align: center;
}

.zen-viewer-count {
	display: block;
	margin-top: 0.4rem;
	font-size: 0.75rem;
	letter-spacing: 0.2em;
	color: var(--wp--preset--color--stone);
	opacity: 0.7;
}

/* "© Nyuanshin – please do not use without permission – ask us" under each photo. */
.zen-viewer-rights {
	display: block;
	margin-top: 0.6rem;
	font-family: var(--wp--preset--font-family--serif);
	font-size: 0.75rem;
	line-height: 1.5;
	color: var(--wp--preset--color--stone);
	opacity: 0.75;
}

.zen-viewer-rights a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.zen-viewer-rights a:is(:hover, :focus-visible) {
	color: var(--wp--preset--color--accent);
	opacity: 1;
}

/* The next photo is brushed in over the current one, whose caption steps aside first. */
.zen-viewer-panel.is-leaving .zen-viewer-caption {
	opacity: 0;
	transition: opacity 0.3s ease;
}

:is(.is-brush-next, .is-brush-prev).zen-viewer-panel {
	background: var(--wp--preset--color--paper);
	transition: -webkit-mask-position 1.1s cubic-bezier(0.55, 0.05, 0.25, 1), mask-position 1.1s cubic-bezier(0.55, 0.05, 0.25, 1);
}

.is-brush-next.zen-viewer-panel {
	-webkit-mask: url("assets/images/brush.svg") 100% 0 / 300% 100% no-repeat;
	mask: url("assets/images/brush.svg") 100% 0 / 300% 100% no-repeat;
}

.is-brush-prev.zen-viewer-panel {
	-webkit-mask: url("assets/images/brush-rev.svg") 0 0 / 300% 100% no-repeat;
	mask: url("assets/images/brush-rev.svg") 0 0 / 300% 100% no-repeat;
}

.is-brush-next.is-painted.zen-viewer-panel {
	-webkit-mask-position: 0 0;
	mask-position: 0 0;
}

.is-brush-prev.is-painted.zen-viewer-panel {
	-webkit-mask-position: 100% 0;
	mask-position: 100% 0;
}

.zen-viewer button {
	position: absolute;
	z-index: 2;
	padding: 1rem;
	border: 0;
	background: none;
	color: var(--wp--preset--color--stone);
	font: 400 2rem/1 var(--wp--preset--font-family--serif);
	cursor: pointer;
	transition: color 0.3s ease;
}

.zen-viewer button:is(:hover, :focus-visible) {
	color: var(--wp--preset--color--accent);
}

.zen-viewer button:focus-visible {
	outline: 1px solid currentColor;
	outline-offset: -0.5rem;
}

.zen-viewer-close {
	top: 0.5rem;
	right: 0.75rem;
}

.zen-viewer-prev,
.zen-viewer-next {
	top: 50%;
	transform: translateY(-50%);
}

.zen-viewer-prev {
	left: 0.5rem;
}

.zen-viewer-next {
	right: 0.5rem;
}

.zen-viewer.is-single :is(.zen-viewer-prev, .zen-viewer-next) {
	display: none;
}

@media (max-width: 600px) {
	.zen-viewer-stage {
		margin: 3.5rem 0 4rem;
	}

	.zen-viewer-prev,
	.zen-viewer-next {
		top: auto;
		bottom: 0.25rem;
		transform: none;
	}

	.zen-caption-text {
		font-size: 1rem;
	}
}

/* ---- From the gallery ([zen_ichigo], front page) ------------------- */

/* Centred and stacked: eyebrow, a wide 16:9 photo, then caption and link. */
.zen-ichigo {
	padding-top: var(--wp--preset--spacing--60);
	text-align: center;
}

.zen-ichigo > .zen-eyebrow {
	margin: 0 0 var(--wp--preset--spacing--40);
}

.zen-ichigo-photo {
	max-width: 820px;
	margin: 0 auto var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--sand);
}

.zen-ichigo-photo img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.zen-ichigo-copy > * {
	margin-block: 0 1rem;
}

.zen-ichigo-caption .zen-caption-label {
	display: block;
}

.zen-ichigo-caption .zen-caption-text {
	font-size: var(--wp--preset--font-size--large);
}

.zen-ichigo-note {
	color: var(--wp--preset--color--stone);
	font-size: var(--wp--preset--font-size--small);
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-gallery.has-nested-images figure.wp-block-image img,
	.zen-viewer {
		transition: none;
	}
}

/* ---- Events ------------------------------------------------------- */

/* The calendar plugin sets h1 on its archive pages to its own (sans) heading font. */
:is(.post-type-archive-mec-events, .tax-mec_category) .zen-main h1 {
	font-family: var(--wp--preset--font-family--serif);
}

.zen-events-section {
	margin-top: var(--wp--preset--spacing--50);
}

.zen-events-section > .zen-eyebrow {
	padding-bottom: 0.9rem;
	border-bottom: 1px solid var(--wp--preset--color--mist);
}

.zen-events-none {
	margin-block: var(--wp--preset--spacing--40) 0;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--stone);
}

/* Centred over the date column below it. */
.zen-events-year {
	width: 5.5rem;
	text-align: center;
	margin-block: var(--wp--preset--spacing--40) 0;
	font-size: var(--wp--preset--font-size--large);
	color: var(--wp--preset--color--stone);
}

.zen-event-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.zen-event {
	display: grid;
	grid-template-columns: 5.5rem 1fr;
	gap: 1.5rem;
	align-items: start;
	padding-block: var(--wp--preset--spacing--40);
	border-bottom: 1px solid var(--wp--preset--color--mist);
}

.zen-event-date {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding-block: 0.6rem 0.5rem;
	border-top: 2px solid var(--wp--preset--color--accent);
	background: var(--wp--preset--color--sand);
	font-family: var(--wp--preset--font-family--serif);
	line-height: 1.1;
	text-align: center;
}

.zen-event-days {
	font-size: var(--wp--preset--font-size--large);
	color: var(--wp--preset--color--ink);
	white-space: nowrap;
}

.zen-event-month {
	margin-top: 0.3rem;
	font-size: 0.75rem;
	letter-spacing: 0.25em;
	padding-left: 0.25em; /* balance the trailing letter-spacing */
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	white-space: nowrap;
}

.zen-event-body > * {
	margin-block: 0;
}

.zen-event-body > * + * {
	margin-top: 0.4rem;
}

.zen-event-kind {
	font-size: 0.75rem;
	letter-spacing: 0.25em;
	text-transform: uppercase;
	color: var(--wp--preset--color--stone);
}

.zen-event-title {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.3;
}

.zen-event-title a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.zen-event-title a:hover {
	color: var(--wp--preset--color--accent);
}

/* Past events: quieter and more compact than upcoming ones. */
.zen-events-past .zen-event {
	padding-block: var(--wp--preset--spacing--30);
}

.zen-events-past .zen-event-date {
	background: none;
	border-top-color: var(--wp--preset--color--mist);
}

.zen-events-past .zen-event-days,
.zen-events-past .zen-event-title {
	font-size: var(--wp--preset--font-size--medium);
}

.zen-events-past .zen-event-month {
	color: var(--wp--preset--color--stone);
}

@media (max-width: 600px) {
	.zen-event {
		grid-template-columns: 4.5rem 1fr;
		gap: 1rem;
	}

	.zen-events-year {
		width: 4.5rem;
	}
}

/* Single event: When / Where under the title. */
.zen-event-meta {
	display: grid;
	gap: 0.75rem;
	margin-block: var(--wp--preset--spacing--40);
	padding-block: 1rem;
	border-block: 1px solid var(--wp--preset--color--mist);
}

.zen-event-meta > div {
	display: grid;
	grid-template-columns: 6rem 1fr;
	gap: 1rem;
	align-items: baseline;
}

.zen-event-meta dt {
	margin: 0;
	font-size: 0.75rem;
}

.zen-event-meta dd {
	margin: 0;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--medium);
}

.zen-event-back {
	margin-top: var(--wp--preset--spacing--50);
}

.zen-event-back a {
	font-weight: 500;
	text-decoration: none;
}

.zen-event-back a::before {
	content: "←";
	margin-right: 0.6em;
	color: var(--wp--preset--color--accent);
}

/* ---- Footer ------------------------------------------------------- */

.zen-footer {
	border-top: 1px solid var(--wp--preset--color--mist);
	padding-block: var(--wp--preset--spacing--50);
	text-align: center;
	color: var(--wp--preset--color--stone);
	font-size: var(--wp--preset--font-size--small);
}

.zen-footer .zen-seal {
	font-family: var(--wp--preset--font-family--mincho);
	font-size: 1.5rem;
	letter-spacing: 0.08em; /* wider and 一 starts to read as a dash */
	padding-left: 0.08em; /* balance the trailing letter-spacing so it stays centred */
	color: var(--wp--preset--color--accent);
	margin-bottom: 0.25rem;
}

/*
 * Footer link under the motto: "↑ Back to top", in small spaced capitals
 * with the arrow in seal red.
 */
.zen-footer .zen-footer-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: baseline;
	gap: 0.5rem 1rem;
	margin-top: var(--wp--preset--spacing--40);
}

.zen-footer-links a {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 0.75rem;
	letter-spacing: 0.25em;
	text-transform: uppercase;
	color: var(--wp--preset--color--stone);
	text-decoration: none;
	transition: color 0.3s ease;
}

.zen-footer-links a:hover {
	color: var(--wp--preset--color--ink);
}

.zen-footer-links a::before,
.zen-footer-links a::after {
	display: inline-block;
	color: var(--wp--preset--color--accent);
	transition: transform 0.3s ease;
}

/*
 * Colophon under "Back to top": "© 2026 Nyuanshin · info@… · Facebook".
 * On phones the © part sits on its own line above the links.
 */
.zen-footer .zen-colophon {
	margin-top: var(--wp--preset--spacing--40);
	font-family: var(--wp--preset--font-family--serif);
	font-size: 0.8125rem;
	color: var(--wp--preset--color--stone);
}

.zen-colophon a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--mist);
	text-underline-offset: 0.2em;
	transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

.zen-colophon a:hover {
	color: var(--wp--preset--color--ink);
	text-decoration-color: var(--wp--preset--color--accent);
}

/* Keep the colophon clear of the floating language switcher at the bottom right. */
@media (max-width: 781px) {
	.zen-footer {
		padding-bottom: calc(var(--wp--preset--spacing--50) + 3.5rem);
	}
}

@media (max-width: 600px) {
	.zen-colophon-owner {
		display: block;
	}

	.zen-colophon-owner + .zen-colophon-sep {
		display: none;
	}
}

.zen-to-top::before {
	content: "↑";
	margin-right: 0.6em;
}

.zen-to-top:hover::before {
	transform: translateY(-3px);
}

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.zen-footer-links a, .zen-footer-links a::before, .zen-footer-links a::after { transition: none; }
}

/*
 * Language switcher (GTranslate floating widget), in the site's style: a
 * small paper tab with a thin border instead of a shadowed white box,
 * spaced serif capitals instead of Arial, small flags, a "Language" label,
 * sand instead of blue.
 */
#gt_float_wrapper .gt_float_switcher {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 0.8rem;
	line-height: 1.2;
	color: var(--wp--preset--color--stone);
	background: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--mist);
	border-radius: 0;
	box-shadow: none;
}

#gt_float_wrapper .gt_float_switcher img {
	display: inline-block;
	width: 18px;
	height: auto;
	margin: 0;
	border-radius: 2px;
	filter: saturate(0.85);
}

#gt_float_wrapper .gt_float_switcher .gt-selected {
	background: var(--wp--preset--color--paper);
}

#gt_float_wrapper .gt_float_switcher .gt-selected .gt-current-lang {
	display: flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.5rem 0.75rem;
	color: var(--wp--preset--color--stone);
	font-weight: normal;
	letter-spacing: 0.2em;
	transition: color 0.3s ease;
}

/* "LANGUAGE |" before the flag and code, so the tab says what it is. */
#gt_float_wrapper .gt_float_switcher .gt-selected .gt-current-lang::before {
	content: "Language";
	padding-right: 0.6em;
	margin-right: 0.1em;
	border-right: 1px solid var(--wp--preset--color--mist);
	font-size: 0.7rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

#gt_float_wrapper .gt_float_switcher .gt-selected .gt-current-lang:hover {
	color: var(--wp--preset--color--accent);
}

#gt_float_wrapper .gt_float_switcher .gt-selected .gt-current-lang span.gt-lang-code {
	top: 0;
}

#gt_float_wrapper .gt_float_switcher .gt_float_switcher-arrow {
	opacity: 0.5;
	transform-origin: center;
}

#gt_float_wrapper .gt_float_switcher .gt_options a {
	display: flex;
	align-items: center;
	gap: 0.6em;
	padding: 0.45rem 0.9rem;
	color: var(--wp--preset--color--ink);
	font-size: 0.85rem;
	letter-spacing: 0.02em;
}

#gt_float_wrapper .gt_float_switcher .gt_options a:hover {
	background: var(--wp--preset--color--sand);
	color: var(--wp--preset--color--ink);
}

#gt_float_wrapper .gt_float_switcher .gt_options::-webkit-scrollbar-track {
	background-color: var(--wp--preset--color--paper);
}

#gt_float_wrapper .gt_float_switcher .gt_options::-webkit-scrollbar-thumb {
	background-color: var(--wp--preset--color--mist);
}

@media (max-width: 600px) {
	#gt_float_wrapper {
		right: 12px !important;
		bottom: 12px !important;
	}
}

/* ---- Forms & comments --------------------------------------------- */

.zen-comments {
	margin-top: var(--wp--preset--spacing--60);
}

.wp-block-post-comments-form input:not([type="submit"]):not([type="checkbox"]),
.wp-block-post-comments-form textarea,
.wp-block-search__input {
	background: transparent;
	color: inherit;
	border: 1px solid var(--wp--preset--color--mist);
	border-radius: 0;
	padding: 0.6em 0.8em;
	font: inherit;
}

.wp-block-post-comments-form input:focus,
.wp-block-post-comments-form textarea:focus,
.wp-block-search__input:focus {
	outline: none;
	border-color: var(--wp--preset--color--accent);
}

.wp-block-comment-template li {
	border-top: 1px solid var(--wp--preset--color--mist);
	padding-block: var(--wp--preset--spacing--30);
}
