/*
Theme Name: MRZ Studio
Theme URI: https://example.com/mrz-studio
Author: MRZ Studio
Description: A minimal, mobile-first theme whose front page is an ICAO Doc 9303 MRZ generator (TD1, TD2, TD3, MRV-A, MRV-B) with random data and reset, plus a clean blog that promotes the tool under every post. Use the [mrz_generator] shortcode to place the tool on any page.
Version: 1.3.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mrzstudio
Tags: blog, one-column, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* ---------- Tokens ---------- */
:root {
	color-scheme: light;
	--paper: #ffffff;
	--ink: #16202b;
	--muted: #5b6875;
	--line: #dde3e8;
	--mist: #f1f4f6;
	--accent: #1f5c7a;
	--accent-strong: #174861;
	--on-accent: #ffffff;
	--check: #a63d17;
	--check-bg: #fbe3d6;
	--strip: #eef3ef;
	--strip-ink: #111a14;
	--warn-bg: #fff6e0;
	--warn-ink: #6b4a00;

	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;

	--wrap: 1120px;
	--read: 700px;
	--r-sm: 6px;
	--r-md: 10px;
	--r-lg: 16px;
}

/* Dark tokens: used when the visitor picks dark, or when the system is dark and no choice was made. */
:root[data-theme="dark"] {
	color-scheme: dark;
		--paper: #10161c;
		--ink: #e6ecf1;
		--muted: #9aa8b4;
		--line: #26313b;
		--mist: #17212a;
		--accent: #6fb3d6;
		--accent-strong: #93c8e3;
		--on-accent: #0b1a22;
		--check: #ffb18f;
		--check-bg: #4a2314;
		--strip: #1a2420;
		--strip-ink: #e9f2ec;
		--warn-bg: #3a2e10;
		--warn-ink: #ffdf99;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		color-scheme: dark;
		--paper: #10161c;
		--ink: #e6ecf1;
		--muted: #9aa8b4;
		--line: #26313b;
		--mist: #17212a;
		--accent: #6fb3d6;
		--accent-strong: #93c8e3;
		--on-accent: #0b1a22;
		--check: #ffb18f;
		--check-bg: #4a2314;
		--strip: #1a2420;
		--strip-ink: #e9f2ec;
		--warn-bg: #3a2e10;
		--warn-ink: #ffdf99;
	}
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 17px/1.6 var(--font);
	text-rendering: optimizeLegibility;
}
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.015em; margin: 1.6em 0 .5em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); }
h3 { font-size: 1.2rem; }
p, ul, ol { margin: 0 0 1.1em; }
code, pre, kbd { font-family: var(--mono); font-size: .92em; }
pre { background: var(--mist); padding: 1rem; border-radius: var(--r-md); overflow-x: auto; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: .9rem; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: .5rem; left: .5rem; z-index: 100; width: auto; height: auto; clip: auto; background: var(--paper); padding: .6rem 1rem; border-radius: var(--r-sm); }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap--read { width: min(100% - 2.5rem, var(--read)); margin-inline: auto; }
.read { max-width: var(--read); }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
	min-height: 44px; padding: .55rem 1.1rem;
	font: 600 .95rem/1 var(--font);
	border-radius: var(--r-sm); border: 1px solid var(--line);
	background: var(--paper); color: var(--ink); cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn--ghost { background: transparent; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.site-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.site-brand img { max-height: 40px; width: auto; }
.brand-mark { font-family: var(--mono); font-size: .8rem; padding: .2rem .4rem; border-radius: 4px; background: var(--strip); color: var(--strip-ink); border: 1px solid var(--line); }
.nav-toggle { display: none; }
.header-tools { display: flex; align-items: center; gap: .5rem; }
.theme-toggle {
	display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none;
	border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--ink); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
	:root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
body { transition: background-color .2s, color .2s; }
.primary-nav { margin-left: auto; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.primary-nav a { display: block; padding: .5rem .75rem; color: var(--ink); text-decoration: none; border-radius: var(--r-sm); font-weight: 500; }
.primary-nav a:hover, .primary-nav .current-menu-item > a { background: var(--mist); }
.primary-nav .sub-menu { display: none; }

@media (max-width: 760px) {
	.nav-toggle { display: inline-flex; }
	.primary-nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--paper); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1rem; z-index: 50; }
	.primary-nav.is-open { display: block; }
	.primary-nav ul { flex-direction: column; }
	.primary-nav .sub-menu { display: block; padding-left: 1rem; }
	.site-header { position: relative; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: clamp(3.5rem, 8vw, 6rem); padding: 2.5rem 0; color: var(--muted); font-size: .92rem; }
.footer-widgets { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 2rem; }
.footer-widgets .widget-title { font-size: 1rem; color: var(--ink); margin-top: 0; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.footer-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1rem; margin: 0; padding: 0; }
.footer-nav a { color: var(--muted); }

/* ---------- Front page: hero ---------- */
.hero {
	position: relative;
	padding: clamp(2.25rem, 6vw, 4.5rem) 0 clamp(2.5rem, 5vw, 4rem);
	background-color: var(--mist);
	background-image:
		repeating-radial-gradient(circle at 100% 0%, transparent 0 14px, color-mix(in srgb, var(--accent) 6%, transparent) 14px 15px),
		repeating-radial-gradient(circle at 0% 100%, transparent 0 18px, color-mix(in srgb, var(--accent) 5%, transparent) 18px 19px);
	border-bottom: 1px solid var(--line);
}
.hero-copy { max-width: 720px; margin-bottom: clamp(1.5rem, 4vw, 2.25rem); }
.hero h1 { margin: 0 0 .75rem; font-size: clamp(2.2rem, 5.5vw, 3.4rem); letter-spacing: -0.03em; }
.hero-lede { color: var(--muted); font-size: clamp(1.02rem, 1.6vw, 1.15rem); margin: 0 0 1.25rem; max-width: 62ch; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .93rem; font-weight: 500; }
.hero-points li { display: flex; align-items: center; gap: .45rem; }
.hero-points li::before {
	content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%;
	background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 11px no-repeat;
}

/* ---------- Tool card ---------- */
.mrz-tool { scroll-margin-top: 1rem; }
.mrz-card {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 22px;
	padding: clamp(1.1rem, 3vw, 2rem);
	box-shadow: 0 1px 2px rgba(16, 32, 48, .05), 0 18px 40px -18px rgba(16, 32, 48, .22);
}

.mrz-formats { border: 0; padding: 0; margin: 0 0 1.5rem; min-width: 0; }
.mrz-formats legend { font-weight: 650; font-size: 1.02rem; margin-bottom: .75rem; padding: 0; }
.mrz-formats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: .5rem; }
.mrz-formats input { position: absolute; opacity: 0; pointer-events: none; }
.mrz-formats label {
	position: relative; display: flex; flex-direction: column; gap: .15rem;
	padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 14px;
	cursor: pointer; background: var(--paper); line-height: 1.25;
	transition: border-color .15s, background-color .15s;
}
.mrz-formats label:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.mrz-formats label strong { font-size: 1.05rem; }
.mrz-formats label span { font-size: .8rem; color: var(--muted); }
.mrz-formats label em { display: block; font-style: normal; font-family: var(--mono); font-size: .72rem; margin-top: .1rem; }
.mrz-formats label::after {
	content: ""; position: absolute; top: .8rem; right: .8rem; width: 14px; height: 14px; border-radius: 50%;
	border: 2px solid var(--line); background: var(--paper);
}
.mrz-formats input:checked + label { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--paper)); box-shadow: inset 0 0 0 1px var(--accent); }
.mrz-formats input:checked + label::after { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--paper); }
.mrz-formats input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 640px) { .mrz-formats label::after { display: none; } .mrz-formats label { padding: .65rem .7rem; } }

.mrz-groups { display: grid; gap: 1.1rem; }
@media (min-width: 720px) { .mrz-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .mrz-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mrz-group {
	margin: 0; min-width: 0;
	border: 1px solid var(--line); border-radius: 16px;
	padding: 1.1rem 1.1rem 1.2rem;
	display: flex; flex-direction: column; gap: .95rem;
	background: color-mix(in srgb, var(--mist) 45%, var(--paper));
}
.mrz-group legend { padding: 0 .45rem; margin-left: -.2rem; font-weight: 650; font-size: .92rem; color: var(--accent); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 420px) { .field-pair { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field label { font-weight: 600; font-size: .86rem; }
.field small { color: var(--muted); font-size: .78rem; }
.field[hidden] { display: none; }
.field input, .field select {
	width: 100%; min-height: 46px; padding: .6rem .8rem;
	font: 1rem/1.3 var(--font); color: var(--ink);
	background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
	transition: border-color .15s, box-shadow .15s;
	-webkit-appearance: none; appearance: none;
}
.field select {
	padding-right: 2.2rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6875' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right .7rem center; background-size: 16px;
}
.field input:hover, .field select:hover { border-color: color-mix(in srgb, var(--muted) 55%, var(--line)); }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); outline: none; }
.field input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.field input.upper { text-transform: uppercase; font-family: var(--mono); letter-spacing: .04em; }

/* Result */
.mrz-result { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px dashed var(--line); }
.mrz-result-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem 1rem; margin-bottom: .75rem; }
.mrz-result-head h2 { margin: 0; font-size: 1.15rem; }
.mrz-status { color: var(--muted); font-size: .85rem; }

.mrz-output {
	--mrz-chars: 44;
	container-type: inline-size;
	background-color: var(--strip);
	background-image:
		repeating-radial-gradient(circle at 12% 140%, transparent 0 9px, color-mix(in srgb, var(--accent) 7%, transparent) 9px 10px),
		repeating-radial-gradient(circle at 88% -40%, transparent 0 11px, color-mix(in srgb, var(--accent) 6%, transparent) 11px 12px);
	color: var(--strip-ink);
	border: 1px solid var(--line);
	border-radius: 16px;
	padding: clamp(1rem, 3vw, 1.6rem) clamp(.8rem, 3vw, 1.6rem);
}
.mrz-lines { font-family: var(--mono); font-size: 14px; overflow-x: auto; }
@supports (font-size: 1cqi) {
	.mrz-lines { font-size: max(11px, min(26px, calc(100cqi / (var(--mrz-chars) * 0.72)))); }
}
/* Fixed grid: every character gets an equal cell, so all lines are exactly the same width. */
.mrz-line {
	display: grid;
	grid-template-columns: repeat(var(--mrz-chars), minmax(0, 1fr));
	width: calc(var(--mrz-chars) * 0.72em);
	line-height: 1.35;
	margin: .25em 0;
}
.mrz-line span { text-align: center; font-variant-numeric: tabular-nums; }
.mrz-lines .cd { background: var(--check-bg); color: var(--check); border-radius: 3px; font-weight: 700; }

.mrz-checks { display: flex; flex-wrap: wrap; gap: .4rem; margin: .9rem 0 0; }
.mrz-checks div { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .4rem .3rem .75rem; border: 1px solid var(--line); border-radius: 999px; font-size: .82rem; }
.mrz-checks dt { color: var(--muted); }
.mrz-checks dd { margin: 0; min-width: 1.6em; text-align: center; font-family: var(--mono); font-weight: 700; color: var(--check); background: var(--check-bg); border-radius: 999px; padding: .05rem .4rem; }

.mrz-warnings { margin: 1rem 0 0; padding: .75rem 1rem .75rem 2rem; background: var(--warn-bg); color: var(--warn-ink); border-radius: 12px; font-size: .9rem; }
.mrz-warnings li { margin: .15rem 0; }

.mrz-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.btn--lg { min-height: 50px; padding: .7rem 1.25rem; border-radius: 12px; white-space: nowrap; }
@media (max-width: 640px) { .btn--lg { padding: .7rem .8rem; } }
.btn--quiet { border-color: transparent; background: transparent; color: var(--muted); margin-left: auto; }
.btn--quiet:hover { border-color: var(--line); color: var(--ink); }
.btn.is-done { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.is-empty .mrz-lines { opacity: .35; }
@media (max-width: 640px) {
	.mrz-actions { display: grid; grid-template-columns: 1fr 1fr; }
	.mrz-actions [data-action="random"] { grid-column: 1 / -1; }
	.btn--quiet { margin-left: 0; grid-column: 1 / -1; border-color: var(--line); }
}
.mrz-note { margin: 1rem auto 0; max-width: 70ch; text-align: center; color: var(--muted); font-size: .8rem; line-height: 1.5; }

/* ---------- Front page: sections ---------- */
.home-section { padding-top: clamp(3rem, 7vw, 5rem); }
.section-title { margin: 0 0 1rem; font-size: clamp(1.5rem, 3.2vw, 2rem); letter-spacing: -0.02em; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 1rem; margin-bottom: 1.5rem; }
.section-head .section-title { margin: 0; }
.section-head p { margin: 0; }
.muted { color: var(--muted); }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1rem; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }
.steps li { counter-increment: step; position: relative; padding: 1.25rem 1.25rem 1.25rem 4.1rem; border-radius: 16px; background: var(--mist); }
.steps li::before {
	content: counter(step); position: absolute; left: 1.2rem; top: 1.2rem;
	width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center;
	background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: .95rem;
}
.steps h3 { margin: .2rem 0 .35rem; font-size: 1.05rem; }
.steps p { margin: 0; color: var(--muted); font-size: .95rem; }

.format-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.format-card {
	display: flex; flex-direction: column; gap: .2rem;
	padding: 1.1rem; border: 1px solid var(--line); border-radius: 16px;
	text-decoration: none; color: var(--ink); background: var(--paper);
	transition: border-color .15s, transform .15s;
}
.format-card:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-2px); }
.format-card strong { font-size: 1.15rem; }
.format-kind { font-size: .88rem; font-weight: 600; color: var(--accent); }
.format-desc { font-size: .88rem; color: var(--muted); margin: .35rem 0 .6rem; }
.format-specs { margin-top: auto; font-family: var(--mono); font-size: .75rem; color: var(--muted); line-height: 1.6; }
.format-diagram {
	display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
	height: 64px; margin-bottom: .9rem; padding: .6rem .7rem;
	border-radius: 10px; background: var(--strip); border: 1px solid var(--line);
}
.format-diagram i { display: block; height: 5px; width: var(--w); border-radius: 3px; background: repeating-linear-gradient(90deg, var(--strip-ink) 0 3px, transparent 3px 5px); opacity: .55; }

.explain { display: grid; gap: 2rem; align-items: center; }
.explain > *, .faq-layout > *, .mrz-groups > * { min-width: 0; }
@media (min-width: 900px) { .explain { grid-template-columns: 1fr 1.1fr; gap: 3rem; } }
.explain-copy p { color: var(--muted); }
.calc { margin: 0; padding: clamp(1rem, 3vw, 1.5rem); border-radius: 18px; background: var(--mist); }
.calc-scroll { overflow-x: auto; }
.calc table { font-family: var(--mono); font-size: .92rem; min-width: 440px; }
.calc th { font-family: var(--font); font-weight: 600; font-size: .8rem; color: var(--muted); white-space: nowrap; padding-left: 0; }
.calc td { text-align: center; padding: .5rem .3rem; }
.calc tr:first-child td { font-weight: 700; font-size: 1.05rem; }
.calc tr:last-child td { color: var(--accent); font-weight: 700; }
.calc tr:last-child th, .calc tr:last-child td { border-bottom: 0; }
.calc figcaption { margin-top: .75rem; font-weight: 600; text-align: left; font-size: .95rem; color: var(--ink); }

.faq-layout { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .faq-layout { grid-template-columns: 1fr 2fr; gap: 3rem; } }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; padding: 1.05rem 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--accent); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 1.1rem; color: var(--muted); max-width: 65ch; }

/* ---------- Blog ---------- */
.archive-head { padding: clamp(2rem, 5vw, 3rem) 0 1.5rem; }
.archive-head h1 { margin: 0; }
.archive-head p { color: var(--muted); margin: .5rem 0 0; }

.post-grid { display: grid; gap: 2rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.post-card { display: flex; flex-direction: column; }
.post-card-thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--r-md); background: var(--mist); margin-bottom: .9rem; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-thumb--empty { display: flex; align-items: flex-end; padding: .9rem; font-family: var(--mono); font-size: .72rem; line-height: 1.5; color: var(--muted); background: var(--strip); word-break: break-all; }
.post-card h2 { font-size: 1.2rem; margin: 0 0 .4rem; }
.post-card h2 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover { color: var(--accent); }
.post-card p { color: var(--muted); font-size: .95rem; margin: 0 0 .6rem; }
.entry-meta { color: var(--muted); font-size: .85rem; display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.entry-meta a { color: inherit; }
.post-card--featured { grid-column: 1 / -1; }
@media (min-width: 820px) {
	.post-card--featured { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.75rem; align-items: center; }
	.post-card--featured .post-card-thumb { margin: 0; }
	.post-card--featured h2 { font-size: 1.7rem; }
}

.pagination { margin-top: 3rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.pagination .page-numbers { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; padding: 0 .75rem; border: 1px solid var(--line); border-radius: var(--r-sm); text-decoration: none; color: var(--ink); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Single */
.entry-header { padding: clamp(2rem, 5vw, 3.25rem) 0 1.25rem; }
.entry-header h1 { margin: .4rem 0 .8rem; }
.entry-cats a { font-size: .85rem; font-weight: 600; text-decoration: none; }
.entry-thumb { margin: 0 auto 2rem; width: min(100% - 2.5rem, 960px); }
.entry-thumb img { width: 100%; border-radius: var(--r-lg); }
.entry-content { font-size: 1.08rem; line-height: 1.75; }
.entry-content > * { max-width: 100%; }
.entry-content h2 { margin-top: 2em; }
.entry-content blockquote { margin: 1.5rem 0; padding: .25rem 0 .25rem 1.25rem; border-left: 3px solid var(--accent); color: var(--muted); }
.entry-content img { border-radius: var(--r-md); }
.entry-content .alignwide { width: min(100vw - 2.5rem, 960px); margin-left: 50%; transform: translateX(-50%); }
.entry-content .alignfull { width: 100vw; margin-left: 50%; transform: translateX(-50%); max-width: none; }
.entry-content .aligncenter { display: block; margin-inline: auto; }
.entry-content .alignleft { float: left; margin: .3rem 1.25rem 1rem 0; }
.entry-content .alignright { float: right; margin: .3rem 0 1rem 1.25rem; }
.wp-caption-text, figcaption { color: var(--muted); font-size: .85rem; text-align: center; }
.entry-content table { font-size: .95rem; }

.entry-footer { margin-top: 2.5rem; display: grid; gap: 1.25rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag-list a { font-size: .85rem; padding: .3rem .7rem; background: var(--mist); border-radius: 999px; text-decoration: none; color: var(--ink); }
.share { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.share span { color: var(--muted); font-size: .9rem; margin-right: .25rem; }
.share .btn { min-height: 38px; padding: .4rem .8rem; font-size: .85rem; }

/* Tool promo under posts */
.tool-promo {
	margin: 3rem 0 0; padding: clamp(1.25rem, 4vw, 2rem);
	border-radius: var(--r-lg); border: 1px solid var(--line);
	background: var(--mist);
	display: grid; gap: 1.25rem;
}
@media (min-width: 720px) { .tool-promo { grid-template-columns: 1fr auto; align-items: center; } }
.tool-promo h2 { margin: 0 0 .4rem; font-size: 1.35rem; }
.tool-promo p { margin: 0; color: var(--muted); }
.tool-promo-strip { grid-column: 1 / -1; container-type: inline-size; font-family: var(--mono); font-size: 13px; line-height: 1.7; overflow: hidden; background: var(--strip); color: var(--strip-ink); padding: .8rem 1rem; border-radius: var(--r-md); }
@supports (font-size: 1cqi) { .tool-promo-strip { font-size: min(17px, calc(100cqi / (44 * 0.72))); } }
.tool-promo-strip .mrz-line { --mrz-chars: 44; }
.tool-promo-strip .cd { background: var(--check-bg); color: var(--check); border-radius: 2px; font-weight: 700; }
.tool-promo-links { display: flex; flex-wrap: wrap; gap: .4rem; grid-column: 1 / -1; font-size: .88rem; }
.tool-promo-links a { padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: var(--paper); }

.related { margin-top: 4rem; }
.related h2 { margin-top: 0; }
.post-navigation .nav-links { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 3rem; }
.post-navigation a { display: block; padding: 1rem; border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: var(--ink); }
.post-navigation .nav-subtitle { display: block; color: var(--muted); font-size: .8rem; }
.post-navigation .nav-next { text-align: right; }

/* Comments */
.comments-area { margin-top: 4rem; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.25rem; border-left: 2px solid var(--line); }
.comment-body { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.comment-meta { font-size: .88rem; color: var(--muted); }
.comment-author img { border-radius: 50%; vertical-align: middle; margin-right: .4rem; }
.comment-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.comment-form textarea { min-height: 140px; }
.comment-form .submit { background: var(--accent); color: var(--on-accent); border: 0; border-radius: var(--r-sm); min-height: 44px; padding: .5rem 1.2rem; font-weight: 600; cursor: pointer; }

/* Search / 404 */
.search-form { display: flex; gap: .5rem; max-width: 480px; }
.search-form label { flex: 1; }
.empty-state { padding: 3rem 0; }

/* Widgets */
.widget ul { list-style: none; padding: 0; }
.widget li { margin: .35rem 0; }

@media print {
	.site-header, .site-footer, .mrz-actions, .mrz-formats, .mrz-groups, .tool-promo, .share, .comments-area { display: none !important; }
}

/* Form controls outside the tool */
.search-form input[type="search"], .comment-form input:not([type="checkbox"]):not([type="submit"]), .comment-form textarea {
	width: 100%; min-height: 46px; padding: .6rem .8rem;
	font: 1rem/1.4 var(--font); color: var(--ink);
	background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
}
.search-form input:focus, .comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); outline: none; }
