/*
Theme Name: BlogTech Circuit
Theme URI: https://www.blogtech.pl/
Author: BlogTech.PL
Description: Lekki, czytelny motyw dla bloga o sieciach, elektronice i DIY. Tryb jasny/ciemny, bloki kodu w stylu terminala, obsługa Polylang. Bez jQuery i zewnętrznych zasobów.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: blogtech
*/

/* ---------- Fonty (self-hosted, OFL) ---------- */
@font-face { font-family: "Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(assets/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, 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: "Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(assets/fonts/ibm-plex-sans-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url(assets/fonts/ibm-plex-sans-latin-400-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, 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: "Plex Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url(assets/fonts/ibm-plex-sans-latin-ext-400-italic.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(assets/fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, 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: "Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(assets/fonts/ibm-plex-sans-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(assets/fonts/ibm-plex-sans-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, 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: "Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(assets/fonts/ibm-plex-sans-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(assets/fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, 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: "Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(assets/fonts/ibm-plex-mono-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url(assets/fonts/ibm-plex-mono-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, 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: "Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url(assets/fonts/ibm-plex-mono-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Tokeny ---------- */
:root {
	--font-sans: "Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

	/* Stałe "PCB" – nagłówek, hero, stopka, terminal */
	--pcb: #0b1416;
	--pcb-2: #10201f;
	--pcb-line: rgba(46, 230, 166, .14);
	--pcb-text: #d9e7e3;
	--pcb-muted: #8fa9a3;
	--led: #2ee6a6;
	--amber: #ffb547;
	--red: #ff4d4f;

	/* Jasny */
	--bg: #f3f6f5;
	--surface: #ffffff;
	--surface-2: #eaf0ee;
	--border: #d6e0dd;
	--text: #142321;
	--muted: #556866;
	--accent: #0a7f5c;
	--accent-ink: #ffffff;
	--accent-soft: rgba(10, 127, 92, .1);
	--focus: #0a7f5c;
	--shadow: 0 1px 2px rgba(11, 20, 22, .06), 0 4px 16px rgba(11, 20, 22, .05);

	--radius: 12px;
	--radius-sm: 8px;
	--wrap: 1180px;
	--narrow: 760px;
	--gutter: clamp(16px, 4vw, 32px);
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0d1618;
		--surface: #121e20;
		--surface-2: #172628;
		--border: #233638;
		--text: #dde9e6;
		--muted: #93aaa5;
		--accent: #3ee8ad;
		--accent-ink: #062018;
		--accent-soft: rgba(62, 232, 173, .12);
		--focus: #3ee8ad;
		--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
		color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--bg: #0d1618;
	--surface: #121e20;
	--surface-2: #172628;
	--border: #233638;
	--text: #dde9e6;
	--muted: #93aaa5;
	--accent: #3ee8ad;
	--accent-ink: #062018;
	--accent-soft: rgba(62, 232, 173, .12);
	--focus: #3ee8ad;
	--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
	color-scheme: dark;
}

/* ---------- Baza ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 400 1.0625rem/1.65 var(--font-sans);
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
img, svg, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4, h5, h6 { line-height: 1.25; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1.1em; }
code, kbd, samp, pre { font-family: var(--font-mono); }

.container { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.container.narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { clip: auto; width: auto; height: auto; z-index: 100; top: 8px; left: 8px; padding: 10px 14px; background: var(--surface); color: var(--text); border-radius: var(--radius-sm); }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Nagłówek ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--pcb) 92%, transparent);
	-webkit-backdrop-filter: saturate(140%) blur(10px);
	backdrop-filter: saturate(140%) blur(10px);
	color: var(--pcb-text);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; position: relative; } }
.header-bar { display: flex; align-items: center; gap: 20px; min-height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark {
	display: inline-grid; place-items: center; width: 34px; height: 34px;
	border: 1.5px solid var(--led); border-radius: 7px;
	font: 600 .85rem/1 var(--font-mono); color: var(--led);
	box-shadow: 0 0 12px rgba(46, 230, 166, .25), inset 0 0 8px rgba(46, 230, 166, .12);
}
.brand-dot { color: var(--red); }
.custom-logo-link img { max-height: 44px; width: auto; display: block; }

.site-nav { margin-left: auto; }
.site-nav .menu, .footer-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a {
	display: block; padding: 8px 12px; border-radius: var(--radius-sm);
	color: var(--pcb-text); text-decoration: none; font-size: .95rem; font-weight: 500;
}
.site-nav a:hover, .site-nav .current-menu-item > a, .site-nav .current-cat > a, .site-nav .current-post-ancestor > a {
	background: rgba(255, 255, 255, .06); color: #fff;
}
.site-nav .current-menu-item > a, .site-nav .current-post-ancestor > a { box-shadow: inset 0 -2px 0 var(--led); }
.site-nav .sub-menu { list-style: none; margin: 0; padding: 6px; }

.header-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn {
	display: inline-grid; place-items: center; width: 40px; height: 40px;
	border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--pcb-text); cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-toggle { display: none; }

.lang-switch { list-style: none; display: flex; margin: 0 4px 0 0; padding: 3px; gap: 2px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; }
.lang-switch a { display: block; padding: 3px 10px; border-radius: 999px; font: 600 .75rem/1.4 var(--font-mono); color: var(--pcb-muted); text-decoration: none; }
.lang-switch a:hover { color: #fff; }
.lang-switch .is-current { background: var(--led); color: var(--pcb); }

.header-search { border-top: 1px solid rgba(255, 255, 255, .08); padding: 14px 0; }
.header-search .search-form { max-width: 640px; }

/* ścieżka PCB pod nagłówkiem */
.trace {
	height: 3px;
	background:
		radial-gradient(circle at 12% 50%, var(--led) 0 3px, transparent 3.5px),
		radial-gradient(circle at 88% 50%, var(--amber) 0 3px, transparent 3.5px),
		linear-gradient(90deg, transparent, var(--led) 12%, rgba(46, 230, 166, .35) 50%, var(--amber) 88%, transparent);
	opacity: .85;
}

@media (max-width: 900px) {
	.nav-toggle { display: inline-grid; order: 3; }
	.header-tools { margin-left: auto; }
	.site-nav {
		order: 4; position: absolute; left: 0; right: 0; top: 100%;
		background: var(--pcb); border-top: 1px solid rgba(255, 255, 255, .08);
		padding: 10px var(--gutter) 16px; display: none; margin: 0;
	}
	.nav-open .site-nav { display: block; }
	.site-nav .menu { flex-direction: column; }
	.site-nav a { padding: 12px; font-size: 1.05rem; }
}
@media (max-width: 420px) {
	.brand-name { font-size: 1rem; }
	.lang-switch a { padding: 3px 7px; }
	.header-bar { gap: 8px; }
}

/* ---------- Hero / nagłówki stron ---------- */
.hero, .page-head {
	position: relative;
	background-color: var(--pcb-2);
	background-image:
		radial-gradient(var(--pcb-line) 1.2px, transparent 1.4px),
		linear-gradient(var(--pcb-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--pcb-line) 1px, transparent 1px);
	background-size: 24px 24px, 96px 96px, 96px 96px;
	background-position: 0 0, -1px -1px, -1px -1px;
	color: var(--pcb-text);
	overflow: hidden;
}
.hero::after, .page-head::after {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: radial-gradient(ellipse at 80% 0%, rgba(46, 230, 166, .14), transparent 55%),
		linear-gradient(180deg, transparent 60%, rgba(11, 20, 22, .55));
}
.hero .container, .page-head .container { position: relative; z-index: 1; }
.hero { padding: clamp(44px, 8vw, 88px) 0 clamp(40px, 6vw, 64px); }
.page-head { padding: 40px 0 36px; }

.prompt { font: 400 .95rem/1.5 var(--font-mono); color: var(--pcb-muted); margin: 0 0 14px; overflow-wrap: anywhere; }
.ps1 { color: var(--led); }
.cursor { display: inline-block; width: .6em; height: 1.1em; margin-left: 4px; vertical-align: -.2em; background: var(--led); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-title { font-size: clamp(2.2rem, 6vw, 3.8rem); color: #fff; margin: 0 0 14px; letter-spacing: -.03em; }
.hero-title .sep { color: var(--led); font-weight: 400; }
.hero-lead { max-width: 640px; font-size: clamp(1.05rem, 2vw, 1.2rem); color: var(--pcb-text); margin-bottom: 26px; }
.page-title { font-size: clamp(1.7rem, 4vw, 2.4rem); color: #fff; margin: 0; }
.page-desc { color: var(--pcb-muted); margin-top: 8px; }
.page-desc p { margin: 0; }

/* chipy */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.chips a {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 6px 12px; border-radius: 999px;
	font: 500 .85rem/1.3 var(--font-mono); text-decoration: none;
	background: var(--accent-soft); color: var(--accent); border: 1px solid transparent;
}
.chips a:hover { border-color: var(--accent); }
.hero .chips a { background: rgba(46, 230, 166, .08); color: var(--pcb-text); border-color: rgba(46, 230, 166, .25); }
.hero .chips a:hover { border-color: var(--led); color: #fff; }
.chips .count { color: var(--amber); font-size: .78rem; }
.chips-sm a { padding: 3px 9px; font-size: .78rem; }

/* ---------- Układ ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; padding-block: 40px 64px; }
.layout:not(:has(.layout-side)) { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 960px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.section-title {
	display: flex; align-items: center; gap: 12px;
	font: 600 .8rem/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .12em;
	color: var(--muted); margin: 0 0 18px;
}
.section-title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); flex: none; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Karty wpisów ---------- */
.cards { display: grid; gap: 16px; }
.card {
	position: relative;
	display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 20px;
	padding: 16px; background: var(--surface);
	border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
	transition: border-color .2s, transform .2s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); transform: translateY(-1px); }
.card-thumb {
	display: block; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden;
	background: var(--surface-2); align-self: start;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.card:hover .card-thumb img { transform: scale(1.04); }
.thumb-placeholder { width: 100%; height: 100%; padding: 26%; fill: none; stroke: var(--accent); stroke-width: 2; opacity: .7; display: block; }
.card-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.card-title { font-size: 1.22rem; margin: 0; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-title a:hover { color: var(--accent); }
.card-excerpt { color: var(--muted); margin: 0; font-size: .97rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .chips { position: relative; z-index: 1; margin-top: 4px; }
@media (max-width: 560px) {
	.card { grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding: 12px; }
	.card-title { font-size: 1.05rem; }
	.card-excerpt { -webkit-line-clamp: 2; font-size: .93rem; }
}
.cards-compact .card { grid-template-columns: 96px minmax(0, 1fr); }
.cards-compact .card-excerpt { -webkit-line-clamp: 2; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font: 400 .8rem/1.4 var(--font-mono); color: var(--muted); }
.meta > * + *::before { content: "//"; margin-right: 14px; color: var(--border); }
.meta a { color: inherit; position: relative; z-index: 1; }

/* paginacja */
.pagination { margin-top: 32px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.page-numbers {
	display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 12px;
	border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
	font: 500 .9rem/1 var(--font-mono); color: var(--text); text-decoration: none;
}
.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.page-numbers.current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.page-numbers.dots { border: 0; background: none; }

/* ---------- Panel boczny / widżety ---------- */
.layout-side { display: flex; flex-direction: column; gap: 20px; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.widget-title, .widget h2 { font: 600 .78rem/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 12px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: .95rem; line-height: 1.4; }
.widget li:last-child { border-bottom: 0; }
.widget li a { color: var(--text); text-decoration: none; }
.widget li a:hover { color: var(--accent); }
.widget_categories li, .widget_archive li { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-family: var(--font-mono); font-size: .85rem; }
.widget_categories li a, .widget_archive li a { font-family: var(--font-sans); font-size: .95rem; }
.widget_search { padding: 14px; }
.wp-block-tag-cloud, .tagcloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tagcloud a, .wp-block-tag-cloud a {
	font: 400 .78rem/1.3 var(--font-mono) !important; padding: 4px 9px; border-radius: 6px;
	background: var(--surface-2); color: var(--muted); text-decoration: none;
}
.tagcloud a:hover, .wp-block-tag-cloud a:hover { color: var(--accent); background: var(--accent-soft); }

/* wyszukiwarka */
.search-form { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.search-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-prompt { display: grid; place-items: center; padding: 0 0 0 12px; font: 500 .82rem/1 var(--font-mono); color: var(--accent); white-space: nowrap; }
.search-field { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); padding: 10px 12px; font: inherit; font-size: .95rem; }
.search-field:focus { outline: none; }
.search-submit, .btn, .comment-form .submit {
	border: 0; background: var(--accent); color: var(--accent-ink); font: 600 .9rem/1 var(--font-sans);
	padding: 0 16px; cursor: pointer; min-height: 40px;
}
.header-search .search-form { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .14); }
.header-search .search-field { color: #fff; }
.header-search .search-submit { background: var(--led); color: var(--pcb); }
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: var(--radius-sm); text-decoration: none; padding: 0 18px; }
.btn:hover { filter: brightness(1.08); }
.btn .icon { width: 18px; height: 18px; }

/* ---------- Wpis ---------- */
.entry-header { padding-top: clamp(32px, 6vw, 56px); }
.entry-header .chips { margin-bottom: 18px; }
.entry-title { font-size: clamp(1.9rem, 4.6vw, 2.8rem); letter-spacing: -.025em; margin-bottom: 16px; }
.entry-header .meta { padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.entry-hero { margin: 28px auto 8px; }
.entry-hero img { display: block; margin-inline: auto; max-height: 460px; width: auto; border-radius: var(--radius); box-shadow: var(--shadow); }

.entry-content { padding-block: 24px 8px; font-size: 1.1rem; line-height: 1.75; overflow-wrap: break-word; }
.entry-content > * { margin-block: 0 1.2em; }
.entry-content h2 { font-size: 1.6rem; margin-top: 1.8em; }
.entry-content h3 { font-size: 1.3rem; margin-top: 1.6em; }
.entry-content h4 { font-size: 1.1rem; margin-top: 1.4em; }
.entry-content h2::before { content: "## "; font-family: var(--font-mono); color: var(--accent); font-weight: 400; opacity: .7; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin-bottom: .35em; }
.entry-content li::marker { color: var(--accent); }
.entry-content blockquote {
	margin-inline: 0; padding: 14px 20px; border-left: 3px solid var(--accent);
	background: var(--accent-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text);
}
.entry-content blockquote p:last-child { margin: 0; }
.entry-content hr { border: 0; height: 1px; background: var(--border); margin-block: 2em; }
.entry-content img { border-radius: var(--radius-sm); }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.entry-content th { background: var(--surface-2); }
.entry-content iframe { width: 100%; border: 0; border-radius: var(--radius-sm); }
.entry-content :not(pre) > code {
	font-size: .88em; padding: .12em .4em; border-radius: 5px;
	background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}

/* obrazki WP (stare wpisy: alignleft/right/center, wp-caption) */
.alignleft { float: left; margin: .3em 1.4em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.4em; }
.aligncenter { display: block; margin-inline: auto; }
@media (max-width: 600px) { .alignleft, .alignright { float: none; margin: 0 auto 1em; display: block; } }
.wp-caption, figure.wp-block-image { max-width: 100%; }
.wp-caption img { display: block; }
.wp-caption-text, figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 8px; font-family: var(--font-mono); }
.entry-content::after { content: ""; display: table; clear: both; }

/* terminal */
.code-block { position: relative; margin-block: 0 1.4em; }
.entry-content pre, .terminal-static {
	position: relative; margin: 0; overflow-x: auto;
	padding: 44px 18px 18px;
	background: var(--pcb); color: #cdeee2;
	border: 1px solid #1e3433; border-radius: var(--radius);
	font-size: .86rem; line-height: 1.6; tab-size: 4; white-space: pre;
	box-shadow: var(--shadow);
	background-image: linear-gradient(#132625, #132625);
	background-size: 100% 30px; background-repeat: no-repeat;
}
.entry-content pre::before, .terminal-static::before {
	content: ""; position: absolute; top: 11px; left: 14px; width: 9px; height: 9px; border-radius: 50%;
	background: var(--red); box-shadow: 15px 0 0 var(--amber), 30px 0 0 var(--led);
}
.entry-content pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.entry-content pre::selection, .entry-content pre *::selection { background: rgba(46, 230, 166, .3); }
.code-copy {
	position: absolute; top: 4px; right: 8px; z-index: 1;
	border: 1px solid #2a4644; background: transparent; color: var(--pcb-muted);
	font: 500 .72rem/1 var(--font-mono); padding: 5px 9px; border-radius: 6px; cursor: pointer;
}
.code-copy:hover { color: var(--led); border-color: var(--led); }

/* stopka wpisu */
.entry-footer { padding-block: 16px 40px; }
.entry-footer .tags { margin-bottom: 28px; }
.entry-footer .tags a::before { content: "#"; opacity: .6; }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.post-navigation a {
	display: flex; flex-direction: column; gap: 4px; height: 100%;
	padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
	background: var(--surface); text-decoration: none; color: var(--text);
}
.post-navigation a:hover { border-color: var(--accent); }
.post-navigation .nav-next { text-align: right; grid-column: 2; }
.nav-label { font: 500 .75rem/1.3 var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.nav-title { font-weight: 600; line-height: 1.35; }
@media (max-width: 560px) { .post-navigation .nav-links { grid-template-columns: 1fr; } .post-navigation .nav-next { grid-column: 1; } }

@media (max-width: 560px) {
	.entry-content { font-size: 1.04rem; line-height: 1.7; }
	.entry-content pre, .terminal-static { font-size: .78rem; padding: 40px 14px 14px; }
}

.related { padding-bottom: 40px; }

/* ---------- Komentarze ---------- */
.comments { padding-bottom: 64px; }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { margin-left: clamp(12px, 4vw, 40px); border-left: 2px solid var(--border); padding-left: clamp(12px, 3vw, 20px); }
.comment-body { padding: 16px 18px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 8px; font-size: .9rem; }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.comment-author .avatar { border-radius: 50%; }
.comment-author .says { display: none; }
.comment-metadata { font: 400 .78rem/1.4 var(--font-mono); }
.comment-metadata a { color: var(--muted); text-decoration: none; }
.comment-content p:last-child { margin-bottom: 0; }
.reply { margin-top: 8px; font: 500 .8rem/1 var(--font-mono); }
.comment-respond { margin-top: 28px; }
.comment-form label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 4px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
	background: var(--surface); color: var(--text); font: inherit; font-size: 1rem;
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.comment-form .submit { border-radius: var(--radius-sm); }
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; }
.comment-form-cookies-consent label { font-weight: 400; }

/* ---------- 404 / pusty wynik ---------- */
.error-404 { padding-block: 56px 72px; }
.error-404 .terminal-static { margin-bottom: 28px; white-space: pre-wrap; overflow-wrap: anywhere; }
.error-404 .page-title { color: var(--text); margin-bottom: 12px; }
.error-404 .search-form { margin-bottom: 20px; max-width: 520px; }
.empty .prompt { color: var(--muted); }
.empty .search-form { max-width: 520px; }

/* ---------- Stopka ---------- */
.site-footer { background: var(--pcb); color: var(--pcb-muted); border-top: 3px solid; border-image: linear-gradient(90deg, var(--led), var(--amber)) 1; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 16px 32px; padding-block: 36px; align-items: start; }
.footer-tagline { margin: 12px 0 0; max-width: 460px; font-size: .92rem; }
.footer-nav a { color: var(--pcb-text); text-decoration: none; font-size: .92rem; padding: 4px 8px; }
.footer-nav a:hover { color: var(--led); }
.footer-status { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 8px 0 0; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .08); font: 400 .8rem/1.4 var(--font-mono); }
.footer-status .to-top { margin-left: auto; color: var(--pcb-muted); text-decoration: none; }
.footer-status .to-top:hover { color: var(--led); }
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--led); box-shadow: 0 0 8px var(--led); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
@media (max-width: 640px) { .footer-inner { grid-template-columns: 1fr; } }

/* ---------- Drobne WP ---------- */
.sticky .card-title::before { content: "📌 "; }
.bypostauthor > .comment-body { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.gallery-item { margin: 0; }
.wp-block-embed__wrapper iframe, .wp-embed-responsive .wp-has-aspect-ratio iframe { width: 100%; }

@media print {
	.site-header, .site-footer, .layout-side, .related, .comments, .post-navigation, .code-copy { display: none !important; }
	body { background: #fff; color: #000; }
	.entry-content pre { background: #f4f4f4; color: #000; border-color: #ccc; }
}
