/*!
 * Manpage — main stylesheet
 *
 * Visual reference: the standalone HTML mockup approved on 2026-05-02.
 * Light/Dark are controlled via the [data-theme] attribute on <html>;
 * the bootstrap snippet in inc/enqueue.php sets that attribute before
 * paint, so there is no FOUC.
 *
 * Layout: a centered 720 px column. The site header, section list,
 * entry rows and download box all live inside .wrap.
 */

/* =========================================================
   Local fonts — JetBrains Mono (latin + latin-ext, 400/500/700)
   Files live under /assets/fonts/. See assets/fonts/README.txt
   for filenames and download instructions.
   ========================================================= */

@font-face {
	font-family: 'JetBrains Mono';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/JetBrainsMono-Regular-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
	               U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
	               U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
	               U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'JetBrains Mono';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/JetBrainsMono-Regular-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
	               U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: 'JetBrains Mono';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url('../fonts/JetBrainsMono-Medium-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
	               U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
	               U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
	               U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'JetBrains Mono';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url('../fonts/JetBrainsMono-Medium-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
	               U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: 'JetBrains Mono';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('../fonts/JetBrainsMono-Bold-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
	               U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
	               U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
	               U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'JetBrains Mono';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('../fonts/JetBrainsMono-Bold-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
	               U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* =========================================================
   Custom properties — light is the fallback, dark overrides.
   ========================================================= */

:root {
	--bg:          #f5f4ed;
	--bg-code:     #ebe9df;
	--text:        #1c1c1a;
	--text-mute:   #5f5e5a;
	--text-dim:    #888780;
	--accent:      #185fa5;
	--border:      rgba(28, 28, 26, 0.15);
	--border-soft: rgba(28, 28, 26, 0.08);
	--font-mono:   'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, Consolas, monospace;
	--container:   720px;
}

[data-theme="dark"] {
	/* Amber phosphor monitor look — flat #0d1117 background everywhere,
	   text in classic CRT amber (DEC VT240 / IBM 3279). Code blocks and
	   form fields share the body background; their border alone draws
	   the frame, just like a monochrome terminal. */
	--bg:          #0d1117;
	--bg-code:     #0d1117;
	--text:        #ffb000;
	--text-mute:   #c08000;
	--text-dim:    #805500;
	--accent:      #ffd060;
	--border:      #4a3300;
	--border-soft: #2a1d00;
}

/* =========================================================
   Reset / base
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-mono);
	font-size: 14px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

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

a {
	color: var(--accent);
	text-decoration: none;
	border-bottom: 1px solid transparent;
}
a:hover, a:focus { border-bottom-color: var(--accent); outline: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

p { margin: 0 0 1em; }

strong, b { color: var(--text); font-weight: 700; }

.screen-reader-text {
	position: absolute !important;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	overflow: hidden;
	white-space: nowrap;
	word-wrap: normal !important;
}
.screen-reader-text:focus {
	clip: auto !important;
	clip-path: none;
	background: var(--bg);
	color: var(--text);
	display: block;
	padding: 8px 16px;
	left: 0;
	top: 0;
	z-index: 100000;
}

/* =========================================================
   Layout container
   ========================================================= */

.wrap {
	max-width: var(--container);
	margin: 0 auto;
	padding: 1.5rem 2rem 3rem;
}

@media (max-width: 480px) {
	.wrap { padding: 1rem 1rem 2rem; }
}

/* =========================================================
   Site header / navigation
   ========================================================= */

.site-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 12px;
	padding-bottom: 14px;
	border-bottom: 0.5px solid var(--border);
	margin-bottom: 24px;
}

.site-title {
	font-size: 14px;
	font-weight: 500;
	display: flex;
	align-items: baseline;
	gap: 10px;
	flex-wrap: wrap;
}
.site-title .custom-logo-link img {
	max-height: 24px;
	width: auto;
}
.site-title a.site-name {
	color: var(--text);
}
.site-title .tagline {
	display: inline-block;
	font-size: 11px;
	color: var(--text-mute);
	font-weight: 400;
}

.site-nav {
	font-size: 11px;
	color: var(--text-dim);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}
.site-nav a {
	color: var(--text-mute);
	margin: 0 2px;
}
.site-nav a:hover { color: var(--accent); }

.site-nav a.active,
.site-nav .lang.active {
	color: var(--text);
}
.site-nav a.active::before,
.site-nav .lang.active::before { content: "[ "; color: var(--text-dim); }
.site-nav a.active::after,
.site-nav .lang.active::after  { content: " ]"; color: var(--text-dim); }

.site-nav .lang-switcher {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	margin-left: 6px;
}
.site-nav .lang-switcher .lang { color: var(--text-mute); }
.site-nav .lang-switcher .lang:hover { color: var(--accent); }

.theme-toggle {
	background: none;
	border: 0.5px solid var(--border);
	color: var(--text-mute);
	font-family: inherit;
	font-size: 11px;
	padding: 3px 10px;
	border-radius: 3px;
	cursor: pointer;
	margin-left: 12px;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* =========================================================
   Manpage running header / footer frame
   ========================================================= */

.man-pageframe {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: var(--text-dim);
	padding: 14px 0;
	border-bottom: 0.5px solid var(--border);
	margin-bottom: 22px;
}
.man-pageframe.bottom {
	border-bottom: none;
	border-top: 0.5px solid var(--border);
	margin-top: 30px;
	margin-bottom: 0;
}

/* =========================================================
   Manpage sections
   ========================================================= */

.man-section { margin-bottom: 22px; }
.man-section h2 {
	font-size: 14px;
	font-weight: 500;
	margin: 0 0 6px 0;
	color: var(--text);
	letter-spacing: 0.5px;
}
.man-section .body {
	padding-left: 32px;
	color: var(--text-mute);
}
.man-section .body :where(strong, b) {
	color: var(--text);
	font-weight: 700;
}

@media (max-width: 480px) {
	.man-section .body { padding-left: 16px; }
}

/* =========================================================
   Description-style key/value lists
   ========================================================= */

.man-list {
	padding-left: 32px;
	list-style: none;
	margin: 0;
}
.man-list li {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 12px;
	padding: 4px 0;
}
.man-list li .key { color: var(--text); }
.man-list li .key a { color: var(--accent); }
.man-list li .val { color: var(--text-mute); }

@media (max-width: 480px) {
	.man-list { padding-left: 16px; }
	.man-list li { grid-template-columns: 1fr; gap: 2px; }
}

/* =========================================================
   Code blocks
   ========================================================= */

pre {
	background: var(--bg-code);
	border: 0.5px solid var(--border-soft);
	border-radius: 4px;
	padding: 12px 16px;
	font-size: 13px;
	line-height: 1.55;
	overflow-x: auto;
	color: var(--text);
}
code {
	font-family: var(--font-mono);
	background: var(--bg-code);
	padding: 1px 6px;
	border-radius: 3px;
	font-size: 13px;
}
pre code {
	background: transparent;
	padding: 0;
}

/* =========================================================
   Plugin / snippet entry index
   ========================================================= */

.entry-row {
	display: grid;
	grid-template-columns: 90px 1fr 70px;
	gap: 12px;
	align-items: baseline;
	padding: 6px 0;
	border-bottom: 0.5px dashed var(--border-soft);
	font-size: 13px;
}
.entry-row:last-child { border-bottom: none; }
.entry-row .date { color: var(--text-dim); font-size: 11px; }
.entry-row .name a { color: var(--text); }
.entry-row .name a:hover { color: var(--accent); }
.entry-row .name .desc {
	display: block;
	color: var(--text-mute);
	font-size: 12px;
	margin-top: 2px;
}
.entry-row .ver {
	color: var(--text-dim);
	font-size: 11px;
	text-align: right;
}

@media (max-width: 480px) {
	.entry-row {
		grid-template-columns: 1fr;
		gap: 2px;
	}
	.entry-row .ver { text-align: left; }
}

/* =========================================================
   Download box
   ========================================================= */

.download-box {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	background: var(--bg-code);
	border: 0.5px solid var(--border);
	border-radius: 4px;
	padding: 10px 14px;
	margin-left: 32px;
	font-size: 13px;
}
.download-box .btn {
	background: var(--accent);
	color: var(--bg);
	border: none;
	font-family: inherit;
	font-size: 12px;
	padding: 6px 14px;
	border-radius: 3px;
	cursor: pointer;
	text-decoration: none;
	border-bottom: none;
}
.download-box .btn:hover {
	filter: brightness(1.1);
	border-bottom: none;
}
.download-box .meta {
	color: var(--text-mute);
	font-size: 11px;
}

@media (max-width: 480px) {
	.download-box { margin-left: 16px; flex-wrap: wrap; }
}

/* =========================================================
   Tags
   ========================================================= */

.tag {
	display: inline-block;
	font-size: 11px;
	color: var(--accent);
	margin-right: 8px;
}
.tag::before { content: "#"; }
.tag:hover { border-bottom-color: var(--accent); }

/* =========================================================
   Search form
   ========================================================= */

.search-form {
	display: flex;
	align-items: center;
	gap: 6px;
	font-family: var(--font-mono);
	font-size: 13px;
}
.search-prompt { color: var(--text-dim); }
.search-field {
	background: var(--bg-code);
	border: 0.5px solid var(--border);
	border-radius: 3px;
	padding: 4px 8px;
	font-family: inherit;
	font-size: 13px;
	color: var(--text);
	flex: 1;
}
.search-field:focus { outline: none; border-color: var(--accent); }
.search-submit {
	background: none;
	border: 0.5px solid var(--border);
	color: var(--text-mute);
	font-family: inherit;
	font-size: 11px;
	padding: 4px 10px;
	border-radius: 3px;
	cursor: pointer;
}
.search-submit:hover { color: var(--accent); border-color: var(--accent); }

/* =========================================================
   Comments
   ========================================================= */

.man-comments__count {
	color: var(--text-dim);
	font-size: 12px;
	margin-bottom: 12px;
}
.man-comments__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.man-comment {
	border-bottom: 0.5px dashed var(--border-soft);
	padding: 10px 0;
}
.man-comment:last-child { border-bottom: none; }
.man-comment .children {
	list-style: none;
	margin-left: 32px;
	padding: 0;
	border-left: 0.5px solid var(--border-soft);
	padding-left: 12px;
}
.man-comment__head {
	font-size: 11px;
	color: var(--text-dim);
	display: flex;
	gap: 12px;
	align-items: baseline;
	margin-bottom: 4px;
}
.man-comment__author { color: var(--text); }
.man-comment__date { color: var(--text-dim); }
.man-comment__body { color: var(--text-mute); font-size: 13px; }
.man-comment__moderation {
	color: var(--text-dim);
	font-style: italic;
	display: block;
	margin-bottom: 6px;
}
.man-comment__reply { font-size: 11px; }

.man-comment-form {
	display: grid;
	gap: 8px;
	margin-top: 16px;
}
.man-comment-form label {
	display: block;
	font-size: 11px;
	color: var(--text-dim);
	margin-bottom: 2px;
}
.man-comment-form input[type="text"],
.man-comment-form input[type="email"],
.man-comment-form textarea {
	width: 100%;
	background: var(--bg-code);
	border: 0.5px solid var(--border);
	border-radius: 3px;
	padding: 6px 10px;
	color: var(--text);
	font-family: var(--font-mono);
	font-size: 13px;
}
.man-comment-form input:focus,
.man-comment-form textarea:focus {
	outline: none;
	border-color: var(--accent);
}
.man-comment-form .submit {
	background: var(--accent);
	color: var(--bg);
	border: none;
	font-family: inherit;
	font-size: 12px;
	padding: 6px 14px;
	border-radius: 3px;
	cursor: pointer;
}
.man-comment-form .submit:hover { filter: brightness(1.1); }

.man-comments__closed { color: var(--text-dim); font-style: italic; }

/* =========================================================
   Pagination
   ========================================================= */

.navigation.pagination {
	margin-top: 24px;
	font-size: 12px;
}
.navigation.pagination .nav-links {
	display: flex;
	gap: 8px;
	justify-content: center;
}
.navigation.pagination a,
.navigation.pagination .current {
	border: 0.5px solid var(--border);
	border-radius: 3px;
	padding: 3px 8px;
	color: var(--text-mute);
}
.navigation.pagination .current {
	color: var(--text);
	border-color: var(--accent);
}
.navigation.pagination a:hover { color: var(--accent); border-color: var(--accent); }

/* =========================================================
   Blinking terminal cursor
   ========================================================= */

.cursor {
	display: inline-block;
	width: 8px;
	height: 14px;
	background: var(--text);
	vertical-align: middle;
	margin-left: 2px;
	animation: manpage-blink 1s step-end infinite;
}
@keyframes manpage-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
	.cursor { animation: none; }
}

/* =========================================================
   GenerateBlocks — basic alignment so editor blocks behave
   inside the 720 px column without breaking it.
   ========================================================= */

.alignwide,
.alignfull {
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}

/* =========================================================
   Block editor preview alignment
   ========================================================= */

.editor-styles-wrapper {
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-mono);
	font-size: 14px;
	line-height: 1.7;
}
