/*
 * Kaladorn: an illuminated chronicle.
 * Parchment and ember pages, copper "engraved plaque" controls, full-bleed art plates.
 * Colour tokens come from theme.json (--wp--preset--color--*); dark mode lives in color-modes.css.
 * Loaded on the front end and in the editor.
 */

/* ---------- Base ---------- */
body {
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, .wp-block-heading {
	text-wrap: balance;
}

img {
	height: auto;
}

:where(a, button, .wp-element-button):focus-visible {
	outline: 3px solid var(--wp--preset--color--sun);
	outline-offset: 2px;
}

.wp-element-button,
.wp-block-button__link {
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wp-element-button:hover,
.wp-block-button__link:hover {
	transform: translateY(-1px);
}

/* ---------- Layout helpers ---------- */
.kaladorn-section {
	padding-top: var(--wp--preset--spacing--70);
	padding-bottom: var(--wp--preset--spacing--70);
}

.kaladorn-section.is-flush-top {
	padding-top: 0;
}

.kaladorn-sec-head {
	max-width: 760px;
	margin-bottom: var(--wp--preset--spacing--50);
}

.kaladorn-sec-head > * + * {
	margin-block-start: 14px;
}

/* ---------- Header ---------- */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 20;
	margin-block: 0;
}

body.admin-bar .wp-site-blocks > header.wp-block-template-part {
	top: var(--wp-admin--admin-bar--height, 32px);
}

.kaladorn-header {
	background: color-mix(in srgb, var(--wp--preset--color--base) 88%, transparent);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.kaladorn-header > .wp-block-group {
	min-height: 60px;
}

.kaladorn-header .wp-block-navigation a {
	opacity: 0.8;
}

.kaladorn-header .wp-block-navigation a:hover {
	opacity: 1;
	color: var(--wp--preset--color--primary);
}

.kaladorn-brand .wp-block-site-title a {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.kaladorn-brand .wp-block-site-title a::before {
	content: "";
	width: 26px;
	height: 26px;
	flex: none;
	background: var(--wp--preset--color--primary);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 4 5v6c0 5 3.4 9.4 8 11 4.6-1.6 8-6 8-11V5l-8-3Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 4 5v6c0 5 3.4 9.4 8 11 4.6-1.6 8-6 8-11V5l-8-3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Colour mode toggle (kaladorn/theme-toggle) */
.kaladorn-mode-toggle {
	width: 40px;
	height: 40px;
	border-radius: var(--wp--custom--radius);
	border: 2px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	display: inline-grid;
	place-items: center;
	cursor: pointer;
	padding: 0;
}

.kaladorn-mode-toggle__icon {
	width: 18px;
	height: 18px;
	display: none;
}

.kaladorn-mode-toggle[data-mode="auto"] .is-auto,
.kaladorn-mode-toggle[data-mode="light"] .is-light,
.kaladorn-mode-toggle[data-mode="dark"] .is-dark {
	display: block;
}

/* ---------- Paragraph styles ---------- */
.is-style-eyebrow {
	font-family: var(--wp--preset--font-family--ui);
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
}

.is-style-lede {
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
	max-width: 62ch;
}

.is-style-fine {
	font-size: 0.78rem;
	color: var(--wp--preset--color--muted);
}

.kaladorn-muted {
	color: var(--wp--preset--color--muted);
}

/* ---------- Buttons ---------- */
.wp-block-button.is-style-ghost .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	box-shadow: none;
}

/* ---------- Group styles ---------- */
.wp-block-group.is-style-plate {
	background: var(--wp--preset--color--plate);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius);
	padding: 18px;
}

.wp-block-group.is-style-stat {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius);
	padding: 14px;
	gap: 2px;
}

.wp-block-group.is-style-stat > * {
	margin: 0;
}

.wp-block-group.is-style-stat > :first-child {
	font-family: var(--wp--preset--font-family--ui);
	font-weight: 700;
	font-size: 1.8rem;
	line-height: 1;
	color: var(--wp--preset--color--primary);
	font-variant-numeric: tabular-nums;
	margin-bottom: 4px;
}

.wp-block-group.is-style-stat > :not(:first-child) {
	font-size: 0.84rem;
}

.wp-block-group.is-style-stat > .is-style-fine,
.wp-block-group.is-style-stat > :nth-child(3) {
	font-size: 0.74rem;
	color: var(--wp--preset--color--muted);
}

.wp-block-group.is-style-surface {
	background: var(--wp--preset--color--surface);
}

/* Night section: always dark, in both colour modes. */
.wp-block-group.is-style-night {
	background: #17110c;
	color: #efe3c8;
	position: relative;
	overflow: hidden;
}

.is-style-night .is-style-eyebrow,
.is-style-night a {
	color: #e08a46;
}

.is-style-night h1,
.is-style-night h2,
.is-style-night h3,
.is-style-night .is-style-lede {
	color: #efe3c8;
}

.is-style-night p:not([class*="is-style-"]) {
	color: #d8c9a8;
}

.is-style-night .wp-block-group.is-style-stat {
	background: #211912;
	border-color: #4a3a26;
}

.is-style-night .wp-block-group.is-style-stat > :first-child {
	color: #e08a46;
}

.is-style-night .wp-block-group.is-style-stat > :not(:first-child) {
	color: #b9a684;
}

.is-style-night .wp-block-image img {
	border: 1px solid #4a3a26;
}

.is-style-night .wp-element-caption {
	color: #b9a684;
}

/* ---------- Image styles ---------- */
.wp-block-image.is-style-art-plate {
	position: relative;
}

.wp-block-image.is-style-art-plate img {
	border-radius: 6px;
	box-shadow: 0 30px 60px -20px var(--wp--custom--shadow), 0 0 0 1px var(--wp--preset--color--line);
}

.wp-block-image.is-style-art-plate .wp-element-caption {
	position: absolute;
	left: -14px;
	bottom: 24px;
	margin: 0;
	max-width: 260px;
	text-align: left;
	background: var(--wp--preset--color--plate);
	color: var(--wp--preset--color--contrast);
	border: 2px solid var(--wp--preset--color--accent);
	border-radius: var(--wp--custom--radius);
	padding: 10px 14px;
	font-size: 0.8rem;
	box-shadow: 0 10px 24px -10px var(--wp--custom--shadow);
}

.wp-block-image.is-style-art-plate .wp-element-caption strong {
	display: block;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	font-size: 1.1rem;
	color: var(--wp--preset--color--primary);
}

/* A transparent space scene (planet, rings, suns): shown whole, no frame. */
.wp-block-image.is-style-planet img {
	aspect-ratio: 1;
	object-fit: contain;
	border: 0;
	filter: drop-shadow(0 0 60px rgba(224, 138, 70, 0.12));
}

.is-style-night .wp-block-image.is-style-planet img {
	border: 0;
}

/*
 * Live planet (assets/js/planet.js): a canvas across the whole section, drawn behind the
 * content and centred on the planet image, which stays in place (invisible) for layout and alt text.
 */
.kaladorn-planet-canvas {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	max-width: none !important;
	margin: 0 !important;
	z-index: 0;
	pointer-events: none;
}

.has-live-planet > :not(.kaladorn-planet-canvas):not(.kaladorn-embers) {
	position: relative;
	z-index: 1;
}

.has-live-planet .wp-block-image.is-style-planet img {
	opacity: 0;
	animation: none;
}

.wp-block-image.is-style-planet.is-draggable {
	cursor: grab;
	touch-action: pan-y;
	-webkit-user-select: none;
	user-select: none;
}

.wp-block-image.is-style-planet.is-draggable:active {
	cursor: grabbing;
}

/* World: planet in the middle, text around it. */
.kaladorn-world-stage .wp-block-heading {
	font-size: clamp(1.9rem, 2.6vw, 2.6rem);
}

.has-live-planet .kaladorn-world-intro,
.has-live-planet .kaladorn-world-facts {
	text-shadow: 0 0 3px #17110c, 0 1px 16px #17110c, 0 0 32px #17110c;
}

.kaladorn-world-facts .wp-block-group.is-style-stat {
	background: rgb(33 25 18 / 0.78);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	text-shadow: none;
}

.kaladorn-world-facts .wp-block-group.is-style-stat > :not(:first-child) {
	font-size: 0.76rem;
	line-height: 1.35;
}

@media (max-width: 781px) {
	.kaladorn-world-stage .kaladorn-world-planet {
		order: -1;
	}

	.kaladorn-world-planet .wp-block-image.is-style-planet {
		max-width: 420px;
		margin-inline: auto;
	}
}

.wp-block-image.is-style-portrait img {
	aspect-ratio: 4 / 5;
	object-fit: cover;
	object-position: top;
	border-radius: 6px;
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--plate);
}

@media (max-width: 781px) {
	.wp-block-image.is-style-art-plate .wp-element-caption {
		left: 12px;
	}
}

/* ---------- List styles ---------- */
.wp-block-list.is-style-steps {
	list-style: none;
	padding: 0;
	margin: 0;
	counter-reset: kaladorn-step;
}

.wp-block-list.is-style-steps > li {
	counter-increment: kaladorn-step;
	position: relative;
	padding: 16px 0 16px 64px;
	min-height: 72px;
	border-bottom: 1px dashed var(--wp--preset--color--line);
	color: var(--wp--preset--color--muted);
	font-size: 0.93rem;
}

.wp-block-list.is-style-steps > li::before {
	content: counter(kaladorn-step);
	position: absolute;
	left: 0;
	top: 16px;
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	border-radius: var(--wp--custom--radius);
	border: 2px solid var(--wp--preset--color--accent);
	background: var(--wp--preset--color--plate);
	color: var(--wp--preset--color--primary);
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.3rem;
}

.wp-block-list.is-style-steps > li > strong:first-child {
	display: inline-block;
	color: var(--wp--preset--color--contrast);
	font-size: 1rem;
	margin-bottom: 2px;
}

.wp-block-list.is-style-steps mark,
.kaladorn-badge {
	display: inline-block;
	margin-left: 6px;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--on-primary);
	background: var(--wp--preset--color--primary);
	padding: 1px 7px;
	border-radius: 4px;
	vertical-align: 2px;
}

.wp-block-list.is-style-flow {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 14px;
}

.wp-block-list.is-style-flow > li {
	position: relative;
	padding-left: 118px;
	font-size: 0.95rem;
	min-height: 28px;
}

.wp-block-list.is-style-flow > li > strong:first-child {
	position: absolute;
	left: 0;
	top: 3px;
	width: 104px;
	box-sizing: border-box;
	text-align: center;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--on-primary);
	background: var(--wp--preset--color--accent);
	padding: 4px 8px;
	border-radius: 4px;
	line-height: 1.3;
}

.wp-block-list.is-style-chips {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 10px;
}

.wp-block-list.is-style-chips > li {
	display: inline-flex;
	align-items: center;
	font-size: 0.78rem;
	font-weight: 600;
	padding: 5px 12px;
	border-radius: 999px;
	border: 1.5px solid var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
	background: color-mix(in srgb, var(--wp--preset--color--primary) 10%, transparent);
	white-space: nowrap;
}

.wp-block-list.is-style-devlog {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 8px;
}

.wp-block-list.is-style-devlog > li {
	display: flex;
	gap: 10px;
	align-items: center;
	font-size: 0.92rem;
	padding: 10px 12px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius);
	background: var(--wp--preset--color--plate);
}

.wp-block-list.is-style-devlog > li::before {
	content: "";
	width: 18px;
	height: 18px;
	flex: none;
	background: var(--wp--preset--color--primary);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M10 8v8l6-4z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M10 8v8l6-4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Landing: hero ---------- */
.kaladorn-hero h1 {
	color: var(--wp--preset--color--accent);
	margin-bottom: 0;
}

.kaladorn-hero .kaladorn-subtitle {
	font-family: var(--wp--preset--font-family--serif);
	font-size: clamp(1.4rem, 3.4vw, 2.35rem);
	line-height: 1.1;
	margin-top: 6px;
}

@media (prefers-reduced-motion: no-preference) {
	.kaladorn-hero .wp-block-image img {
		animation: kaladorn-rise 0.9s ease-out both;
	}

	.wp-block-image.is-style-planet img {
		animation: kaladorn-drift 18s ease-in-out infinite alternate;
	}
}

@keyframes kaladorn-drift {
	from { transform: translateY(-6px) rotate(-0.6deg); }
	to { transform: translateY(6px) rotate(0.6deg); }
}

@keyframes kaladorn-rise {
	from { transform: translateY(14px); }
	to { transform: none; }
}


/* ---------- Landing: pillars ---------- */
.kaladorn-pillar {
	border-top: 2px solid var(--wp--preset--color--primary);
	padding-top: 18px;
	gap: 10px;
}

.kaladorn-pillar > * {
	margin: 0;
}

.kaladorn-pillar::before {
	content: "";
	display: block;
	width: 44px;
	height: 44px;
	border-radius: var(--wp--custom--radius);
	box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);
	background-color: var(--wp--preset--color--primary);
	background-image: var(--kaladorn-icon);
	background-repeat: no-repeat;
	background-position: center;
	background-size: 24px;
}

.kaladorn-pillar--map {
	--kaladorn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fffaf0' stroke-width='2' stroke-linejoin='round' d='M9 4 3 6v14l6-2 6 2 6-2V4l-6 2-6-2Zm0 0v14m6-12v14'/%3E%3C/svg%3E");
}

.kaladorn-pillar--crown {
	--kaladorn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fffaf0' stroke-width='2' stroke-linejoin='round' d='M3 8l4.5 4L12 5l4.5 7L21 8l-2 11H5L3 8Z'/%3E%3C/svg%3E");
}

.kaladorn-pillar--phone {
	--kaladorn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='6' y='2' width='12' height='20' rx='3' fill='none' stroke='%23fffaf0' stroke-width='2'/%3E%3Cpath stroke='%23fffaf0' stroke-width='2' d='M10 18h4'/%3E%3C/svg%3E");
}

.kaladorn-pillar p {
	color: var(--wp--preset--color--muted);
}

/* ---------- Cards from Query Loops ---------- */
.kaladorn-race-grid .wp-block-post {
	background: var(--wp--preset--color--plate);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.kaladorn-race-grid .wp-block-post-featured-image {
	margin: 0;
}

/*
 * Keep every card image at the block's aspect ratio. As a flex item the figure would
 * otherwise grow to the picture's own shape (e.g. a 3:4 portrait in a 4:5 slot).
 */
.kaladorn-race-grid .wp-block-post-featured-image,
.kaladorn-hero-grid .wp-block-post-featured-image {
	flex: none;
	min-height: 0;
	overflow: hidden;
}

.kaladorn-hero-grid .wp-block-post-featured-image {
	border-radius: 6px;
}

.kaladorn-race-grid .wp-block-post-featured-image img {
	object-position: top;
}

/* Front page races on phones: two columns of compact cards. */
@media (max-width: 781px) {
	#races .kaladorn-race-grid .wp-block-post-template.is-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	#races .kaladorn-card-body {
		padding: 10px 10px 12px;
		gap: 4px;
		border-top-width: 3px;
	}

	#races .kaladorn-card-body .wp-block-post-title {
		font-size: 1.05rem;
		line-height: 1.15;
	}

	#races .kaladorn-race-flag {
		font-size: 0.6rem;
		letter-spacing: 0.08em;
		gap: 6px;
	}

	#races .kaladorn-book {
		font-size: 0.82rem;
		line-height: 1.25;
	}

	#races .kaladorn-card-body .wp-block-post-excerpt {
		font-size: 0.78rem;
		line-height: 1.4;
		display: -webkit-box;
		-webkit-line-clamp: 3;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}
}

.kaladorn-card-body {
	padding: 16px 16px 18px;
	border-top: 4px solid var(--wp--preset--color--primary);
	gap: 8px;
	flex: 1;
}

.kaladorn-card-body > * {
	margin: 0;
}

.kaladorn-card-body .wp-block-post-excerpt {
	font-size: 0.92rem;
}

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

.kaladorn-book {
	font-family: var(--wp--preset--font-family--serif);
	font-style: italic;
	color: var(--wp--preset--color--primary);
}

.kaladorn-book:empty,
.kaladorn-role:empty {
	display: none;
}

.kaladorn-hero-grid .wp-block-post {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.kaladorn-hero-grid .wp-block-post > * {
	margin: 0;
}

.kaladorn-hero-grid .wp-block-post-featured-image img {
	border-radius: 6px;
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--plate);
	object-position: top;
}

.kaladorn-hero-grid .wp-block-post-title {
	font-size: 1.2rem;
}

/* Heroes without a portrait yet: a copper panel with the Kaladorn shield, same shape as a portrait. */
.kaladorn-hero-grid .wp-block-post:not(:has(.wp-block-post-featured-image))::before {
	content: "";
	display: block;
	aspect-ratio: 4 / 5;
	border-radius: 6px;
	border: 1px solid var(--wp--preset--color--line);
	background:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fffaf0' fill-opacity='.85' d='M12 2 4 5v6c0 5 3.4 9.4 8 11 4.6-1.6 8-6 8-11V5l-8-3Z'/%3E%3C/svg%3E") center / 22% no-repeat,
		repeating-linear-gradient(45deg, rgba(255, 250, 240, 0.08) 0 2px, transparent 2px 14px),
		repeating-linear-gradient(-45deg, rgba(255, 250, 240, 0.08) 0 2px, transparent 2px 14px),
		linear-gradient(135deg, #8a5d2e, #b87333 55%, #5a3819);
}

/* Front page heroes on phones: two columns of compact cards. */
@media (max-width: 781px) {
	#heroes .kaladorn-hero-grid .wp-block-post-template.is-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px 10px;
	}

	#heroes .kaladorn-hero-grid .wp-block-post {
		gap: 6px;
	}

	#heroes .kaladorn-hero-grid .wp-block-post-title {
		font-size: 1rem;
		line-height: 1.15;
	}

	#heroes .kaladorn-hero-grid .kaladorn-race-flag {
		font-size: 0.6rem;
		letter-spacing: 0.08em;
		gap: 6px;
	}
}

.kaladorn-role {
	font-size: 0.82rem;
	color: var(--wp--preset--color--muted);
}

.kaladorn-empty {
	border: 1px dashed var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius);
	padding: 18px;
	color: var(--wp--preset--color--muted);
	font-size: 0.92rem;
}

/* ---------- Footer ---------- */
.kaladorn-footer {
	border-top: 1px solid var(--wp--preset--color--line);
}

.kaladorn-footer .wp-block-site-title {
	font-size: 1.25rem;
}

/* ---------- Posts ---------- */
.kaladorn-post-meta {
	font-size: 0.85rem;
	color: var(--wp--preset--color--muted);
}

.kaladorn-post-list .wp-block-post {
	padding-bottom: var(--wp--preset--spacing--40);
	border-bottom: 1px dashed var(--wp--preset--color--line);
}

.kaladorn-post-list .wp-block-post:last-child {
	border-bottom: 0;
}

.wp-block-query-pagination {
	font-size: 0.9rem;
}

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

/* ---------- News ---------- */

/* Category chips (kaladorn/news-filter). */
.kaladorn-news-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 10px;
	margin-bottom: var(--wp--preset--spacing--50);
}

.kaladorn-news-filter a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	border-radius: 999px;
	border: 1.5px solid var(--wp--preset--color--line);
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--ui);
	font-size: 0.8rem;
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.kaladorn-news-filter a span {
	font-size: 0.7rem;
	color: var(--wp--preset--color--muted);
}

.kaladorn-news-filter a:hover {
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}

.kaladorn-news-filter a.is-current {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--on-primary, #fffaf0);
}

.kaladorn-news-filter a.is-current span {
	color: inherit;
	opacity: 0.8;
}

/* Cards. */
.kaladorn-news-grid.wp-block-post-template {
	gap: 22px;
}

.kaladorn-news-grid .wp-block-post {
	display: flex;
	flex-direction: column;
	background: var(--wp--preset--color--plate);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius);
	overflow: hidden;
}

.kaladorn-news-grid .wp-block-post-featured-image {
	margin: 0;
	overflow: hidden;
}

.kaladorn-news-grid .wp-block-post-featured-image img {
	transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.kaladorn-news-grid .wp-block-post:hover .wp-block-post-featured-image img {
	transform: scale(1.04);
}

/* No featured image: a copper knotwork panel with the Kaladorn shield instead. */
.kaladorn-news-grid .wp-block-post:not(:has(.wp-block-post-featured-image))::before,
.kaladorn-news-latest .wp-block-post:not(:has(.wp-block-post-featured-image))::before {
	content: "";
	display: block;
	aspect-ratio: 16 / 9;
	background:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fffaf0' fill-opacity='.85' d='M12 2 4 5v6c0 5 3.4 9.4 8 11 4.6-1.6 8-6 8-11V5l-8-3Z'/%3E%3C/svg%3E") center / 44px no-repeat,
		repeating-linear-gradient(45deg, rgba(255, 250, 240, 0.08) 0 2px, transparent 2px 14px),
		repeating-linear-gradient(-45deg, rgba(255, 250, 240, 0.08) 0 2px, transparent 2px 14px),
		linear-gradient(135deg, #8a5d2e, #b87333 55%, #5a3819);
}

.kaladorn-news-card__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 18px 20px 22px;
	flex: 1;
	border-top: 3px solid var(--wp--preset--color--primary);
}

.kaladorn-news-card__body > * {
	margin: 0;
}

.kaladorn-news-card__meta {
	gap: 6px 14px;
	font-family: var(--wp--preset--font-family--ui);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

.kaladorn-news-card__meta > * {
	margin: 0;
}

.kaladorn-news-card__meta .wp-block-post-terms a {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}

.kaladorn-news-card__meta .wp-block-post-date + .kaladorn-reading-time::before,
.kaladorn-news-card__meta .wp-block-post-terms + .wp-block-post-date::before {
	content: "·";
	margin-right: 14px;
	margin-left: -8px;
}

.kaladorn-news-grid .wp-block-post-title {
	font-size: 1.35rem;
	line-height: 1.2;
}

.kaladorn-news-grid .wp-block-post-title a,
.kaladorn-news-latest .wp-block-post-title a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.kaladorn-news-grid .wp-block-post-title a:hover,
.kaladorn-news-latest .wp-block-post-title a:hover {
	color: var(--wp--preset--color--primary);
}

.kaladorn-news-grid .wp-block-post-excerpt {
	font-size: 0.93rem;
	color: var(--wp--preset--color--muted);
}

.kaladorn-news-grid .wp-block-post-excerpt__excerpt {
	margin: 0;
}

.kaladorn-news-grid .wp-block-post-excerpt__more-text {
	display: none;
}

/* Page 1: the newest post is the featured story. */
@media (min-width: 782px) {
	body:not(.paged) .kaladorn-news-grid > .wp-block-post:first-child {
		grid-column: 1 / -1;
		display: grid;
		grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
	}

	body:not(.paged) .kaladorn-news-grid > .wp-block-post:first-child .wp-block-post-featured-image,
	body:not(.paged) .kaladorn-news-grid > .wp-block-post:first-child::before {
		height: 100%;
	}

	body:not(.paged) .kaladorn-news-grid > .wp-block-post:first-child .wp-block-post-featured-image img {
		height: 100%;
		min-height: 320px;
		aspect-ratio: auto !important;
		object-position: 50% 65%;
	}

	body:not(.paged) .kaladorn-news-grid > .wp-block-post:first-child .kaladorn-news-card__body {
		justify-content: center;
		padding: 32px 36px;
		border-top: 0;
		border-left: 3px solid var(--wp--preset--color--primary);
	}

	body:not(.paged) .kaladorn-news-grid > .wp-block-post:first-child .wp-block-post-title {
		font-size: clamp(1.8rem, 2.6vw, 2.4rem);
	}

	body:not(.paged) .kaladorn-news-grid > .wp-block-post:first-child .wp-block-post-excerpt {
		font-size: 1.02rem;
	}
}

@media (min-width: 600px) and (max-width: 1080px) {
	.kaladorn-news-grid.wp-block-post-template.is-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

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

/* Front page: latest news list. */
.kaladorn-news-latest .wp-block-post-template {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.kaladorn-news-latest .wp-block-post {
	display: grid;
	grid-template-columns: 84px minmax(0, 1fr);
	gap: 14px;
	align-items: center;
	padding: 10px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius);
	background: var(--wp--preset--color--plate);
}

.kaladorn-news-latest .wp-block-post-featured-image,
.kaladorn-news-latest .wp-block-post::before {
	margin: 0;
	width: 84px;
	border-radius: 6px;
	overflow: hidden;
}

.kaladorn-news-latest .wp-block-post::before {
	aspect-ratio: 1 !important;
	background-size: 26px, auto, auto, auto !important;
}

.kaladorn-news-latest__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.kaladorn-news-latest__body > * {
	margin: 0;
}

.kaladorn-news-latest .wp-block-post-title {
	font-size: 1.1rem;
	line-height: 1.25;
}

.kaladorn-news-latest .kaladorn-news-card__meta {
	font-size: 0.66rem;
}

/* Single post. */
.kaladorn-post-header > .wp-block-post-excerpt.is-style-lede {
	margin-left: 0 !important;
}

.kaladorn-post-header .kaladorn-post-meta a {
	text-decoration: none;
}

.kaladorn-back-link {
	font-size: 0.88rem;
	margin-bottom: 6px;
}

.kaladorn-back-link a {
	text-decoration: none;
}

.kaladorn-post-meta .kaladorn-reading-time {
	color: var(--wp--preset--color--muted);
}

.kaladorn-post-footer {
	align-items: center;
	gap: 14px 24px;
	padding-top: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--wp--preset--color--line);
}

.kaladorn-post-tags {
	font-size: 0.85rem;
	color: var(--wp--preset--color--muted);
}

.kaladorn-post-nav {
	margin-top: var(--wp--preset--spacing--40);
	gap: 20px;
	font-size: 0.92rem;
}

.kaladorn-post-nav .post-navigation-link-next {
	margin-left: auto;
	text-align: right;
}

/* Share links (kaladorn/share-links). */
.kaladorn-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.kaladorn-share__label {
	font-family: var(--wp--preset--font-family--ui);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	margin-right: 4px;
}

.kaladorn-share a,
.kaladorn-share button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border-radius: var(--wp--custom--radius);
	border: 1.5px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--plate);
	color: var(--wp--preset--color--contrast);
	font: 600 0.8rem var(--wp--preset--font-family--ui);
	text-decoration: none;
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.kaladorn-share a:hover,
.kaladorn-share button:hover {
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
	transform: translateY(-1px);
}

.kaladorn-share button.is-done {
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}

.kaladorn-share svg {
	width: 17px;
	height: 17px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ---------- Page frame ---------- */
.wp-site-blocks > main,
.wp-site-blocks > .kaladorn-main,
.wp-site-blocks > footer.wp-block-template-part {
	margin-block-start: 0;
}

.kaladorn-main > .kaladorn-section:first-child.is-flush-top {
	padding-top: var(--wp--preset--spacing--60);
}

.kaladorn-small {
	font-size: 0.88rem;
}

.kaladorn-back {
	margin-top: var(--wp--preset--spacing--50);
	font-size: 0.9rem;
}

.kaladorn-back a {
	text-decoration: none;
}

/* ---------- Landing details ---------- */
.kaladorn-board-plate {
	margin-top: var(--wp--preset--spacing--50);
}

.kaladorn-board-plate img {
	width: 100%;
	aspect-ratio: 16 / 8;
	object-fit: cover;
	object-position: center 55%;
}

.kaladorn-art-strip .wp-block-image img {
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 6px;
}

.kaladorn-art-strip .wp-element-caption {
	text-align: left;
	margin-top: 8px;
}

.kaladorn-split {
	margin-top: 18px;
}

.kaladorn-split .is-style-plate {
	height: 100%;
	padding: 14px;
	background: var(--wp--preset--color--base);
}

.kaladorn-split h4 {
	color: var(--wp--preset--color--primary);
	margin: 0 0 6px;
}

.kaladorn-split ul {
	margin: 0;
	padding-left: 18px;
	font-size: 0.88rem;
}

.kaladorn-phones {
	gap: clamp(12px, 2vw, 22px);
}

.kaladorn-core-stats > * {
	margin-block: 0 10px;
}

.kaladorn-core-stats h3 {
	font-size: 1.25rem;
	margin-bottom: 4px;
}

.kaladorn-core-stats .kaladorn-muted {
	font-size: 0.85rem;
}

.kaladorn-core-stats p:not(.kaladorn-muted) {
	display: grid;
	grid-template-columns: 54px 1fr;
	column-gap: 12px;
	font-size: 0.88rem;
}

.kaladorn-core-stats p:not(.kaladorn-muted) mark {
	grid-row: span 2;
	align-self: start;
	background: none;
	text-align: center;
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.3rem;
	color: var(--wp--preset--color--primary);
	border: 2px solid var(--wp--preset--color--accent);
	border-radius: var(--wp--custom--radius);
	padding: 2px 0;
	line-height: 1.3;
}

.kaladorn-box-art img {
	filter: drop-shadow(0 30px 40px var(--wp--custom--shadow));
}

.kaladorn-devlog {
	border-top: 1px solid var(--wp--preset--color--line);
}

/* Landing devlog is the last section, so the footer needs no extra rule above it. */
.wp-site-blocks > main:has(> .kaladorn-devlog:last-child) + footer .kaladorn-footer {
	border-top: 0;
}

@media (max-width: 781px) {
	.kaladorn-board-plate img {
		aspect-ratio: 4 / 3;
	}

	.kaladorn-art-strip {
		display: grid !important;
		grid-template-columns: 1fr 1fr;
	}

	.kaladorn-phones {
		flex-wrap: wrap !important;
	}
}

@media (max-width: 560px) {
	.kaladorn-phones > .kaladorn-phone:first-child {
		display: none;
	}
}

/* Editor: keep the hidden-on-mobile phone visible while editing. */
.editor-styles-wrapper .kaladorn-phones > .kaladorn-phone:first-child {
	display: block;
}

/* Single race/hero: lede-sized role and no gap when there is no portrait. */
.kaladorn-role.is-style-lede {
	font-size: var(--wp--preset--font-size--large);
	color: var(--wp--preset--color--contrast);
}

.wp-block-columns > .wp-block-column:not(:has(*)) {
	display: none;
}

/* ---------- Wiki ---------- */
.kaladorn-wiki-sidebar__inner {
	gap: 14px;
	/* WordPress flex groups wrap by default; with a max-height that would push the
	   navigation into a second column once a section gets long. */
	flex-wrap: nowrap !important;
}

.kaladorn-wiki-sidebar__inner > * {
	flex-shrink: 0;
	max-width: 100%;
}

@media (min-width: 782px) {
	.kaladorn-wiki-sidebar__inner {
		position: sticky;
		top: calc(76px + var(--wp-admin--admin-bar--height, 0px));
		max-height: calc(100vh - 96px - var(--wp-admin--admin-bar--height, 0px));
		overflow-y: auto;
		padding-right: 6px;
		scrollbar-width: thin;
	}
}

@media (max-width: 781px) {
	/* Content first on phones; the long section list follows it. */
	.kaladorn-wiki-layout > .kaladorn-wiki-sidebar {
		order: 2;
		border-top: 1px solid var(--wp--preset--color--line);
		padding-top: var(--wp--preset--spacing--40);
	}
}

.kaladorn-wiki-sidebar .kaladorn-wiki-search input[type="search"] {
	padding: 9px 12px;
	font-size: 0.9rem;
}

.kaladorn-wiki-sidebar .kaladorn-wiki-search button {
	padding: 9px 14px;
	font-size: 0.85rem;
}

.kaladorn-wiki-content > * + * {
	margin-block-start: var(--wp--preset--spacing--40);
}

.kaladorn-wiki-content .kaladorn-sec-head {
	margin-bottom: var(--wp--preset--spacing--40);
}

.kaladorn-entry-head .wp-block-post-title {
	margin-top: 6px;
}

.kaladorn-entry-head .kaladorn-stats {
	margin: 14px 0 18px;
}

.kaladorn-content > * + * {
	margin-block-start: 1em;
}

.kaladorn-content h2 {
	font-size: 1.7rem;
	margin-top: 1.4em;
}

.kaladorn-content h3 {
	font-size: 1.3rem;
	margin-top: 1.2em;
}

.kaladorn-entry-data {
	margin-top: var(--wp--preset--spacing--40);
}

.kaladorn-wiki-hub .kaladorn-sec-head .kaladorn-wiki-search {
	margin-top: 22px;
}

.kaladorn-hub-heading {
	font-size: 1.8rem;
	margin-top: var(--wp--preset--spacing--60);
	margin-bottom: var(--wp--preset--spacing--30);
}

.kaladorn-article-list .wp-block-post-terms {
	margin-bottom: 2px;
}

.kaladorn-article-list .wp-block-post-terms a {
	text-decoration: none;
}

.kaladorn-entry-grid .wp-block-post-featured-image:empty {
	display: none;
}

.kaladorn-entry-grid .wp-block-post-title {
	font-size: 1.25rem;
}

.kaladorn-nav-wiki > a {
	color: var(--wp--preset--color--primary) !important;
	opacity: 1 !important;
	font-weight: 700;
}
