/*
Theme Name: KLND picolight
Theme URI: https://anb030.de
Description: Modernisiertes Kindtheme für "picolight" (Valentin, picomol.de). Gleicher Look, aber mit HTML5, besserem Kontrast, lesbarer Typografie, Tastatur-Fokus, schnellerem Laden, Tag-Chips und Kopieren-Button an Code-Blöcken. Das Original-Theme "picolight" muss installiert bleiben. Zurück zum Original: unter Design → Themes "picolight" aktivieren.
Template: picolight
Version: 2.0.1
Requires at least: 6.3
Requires PHP: 8.3
Author: André K.
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: klnd-picolight
*/

/* =====================================================================
   FARBEN, EINE STELLE ZUM ANPASSEN
   --kp-accent : deine Akzentfarbe (Überschriften, Lupe, Chips-Rahmen, Fokus)
   --kp-link   : etwas dunkleres Türkis NUR für kleine Textlinks
                   (Kontrast 5,3:1 statt 2,6:1). Gleiche Farbe wie accent
                   eintragen, um den Original-Look der Links zu behalten.
   --kp-muted  : Grau für Nebentexte (vorher #808080 = zu schwach)
   ===================================================================== */
:root {
	--kp-accent: #00b0ba;
	--kp-link: #00777f;
	--kp-text: #292929;
	--kp-muted: #6b6b6b;
	--kp-soft: #eef7f8;
	--kp-radius: 12px;
	--kp-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
	--kp-bar-1: #00c4cf;
	--kp-bar-2: #00b0ba;
	--kp-bar-3: #00939c;
	--kp-wordmark-filter: none;
}

/* ---------- Grundlagen ---------- */
html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}
body,
#wrapper #header,
#wrapper #footer,
button, input, select, textarea {
	font-family: var(--kp-font);
}
body {
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.skip-link:focus {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 100000;
	width: auto;
	height: auto;
	margin: 0;
	padding: 12px 18px;
	clip: auto;
	overflow: visible;
	background: #fff;
	color: var(--kp-text);
	font-weight: 600;
	border-radius: 8px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

/* ---------- Tastatur-Fokus (das Original unterdrückt ihn komplett) ---------- */
a:focus {
	text-shadow: none;
}
:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 3px solid var(--kp-accent);
	outline-offset: 2px;
	border-radius: 3px;
}
a:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
	outline: none;
}

/* ---------- Kontrast: Grau und kleine Links ---------- */
#wrapper #header h1,
#wrapper #header h1 a,
#wrapper #header .description,
#mainnav ul li a,
#wrapper #footer,
.widget h4,
.post .meta,
.pages .meta,
.pagelinks,
.post table th,
.pages table th {
	color: var(--kp-muted);
}
#wrapper #header h1 a:hover,
#mainnav ul li a:hover {
	color: var(--kp-text);
}
#wrapper #footer a:link,
#wrapper #footer a:visited {
	color: var(--kp-link);
}
.entry a,
.post .meta a,
.pages .meta a,
.widget a,
.comment a {
	color: var(--kp-link);
}
.entry a:hover,
.post .meta a:hover,
.widget a:hover {
	color: #000;
}

/* ---------- Kopf ---------- */
#headerimage {
	display: block;
	height: auto;
	max-width: 100%;
}
#mainnav li:focus-within > ul {
	display: block;
}
#mainnav ul li a {
	min-height: 44px;
	box-sizing: border-box;
}

/* ---------- Artikeltext: lesbar statt Blocksatz ---------- */
.post .entry,
.pages .entry {
	font-size: 1.0625rem; /* 17px */
	line-height: 1.65;
	text-align: left; /* behebt den Blocksatz im Original */
	hyphens: manual; /* bei linksbündigem Text ist automatische Trennung nur unruhig */
	overflow-wrap: break-word;
}
.post .meta,
.pages .meta {
	font-size: 0.875rem;
	line-height: 1.7;
}
.post .title h1,
.pages .title h1,
.post .title h2,
.pages .title h2 {
	font-size: clamp(1.375rem, 1.15rem + 0.9vw, 1.75rem);
	line-height: 1.25;
}
.post .entry h2,
.pages .entry h2 {
	font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem);
	line-height: 1.3;
	margin-top: 1.6em;
}
.post .entry h3,
.pages .entry h3 {
	font-size: 1.15rem;
	line-height: 1.35;
	margin-top: 1.4em;
}
.post .entry h4,
.pages .entry h4 {
	font-size: 1rem;
	font-weight: bold;
	margin-top: 1.2em;
}
.post p,
.pages p {
	padding: 0.4em 0;
}
.post ul li,
.pages ul li,
.post ol li,
.pages ol li {
	line-height: 1.6;
}
.post ul li,
.pages ul li {
	background-position: 5px 0.6em;
}
.post ol,
.pages ol {
	padding-left: 2em;
}
.post blockquote,
.pages blockquote {
	margin-left: 0;
	margin-right: 0;
}
.post ul.split3cols,
.post ul.split2cols,
.pages ul.split3cols,
.pages ul.split2cols {
	max-width: 100%;
}

/* ---------- Bilder, Videos, Tabellen ---------- */
#content img {
	max-width: 100%;
	height: auto;
}
.entry img[class*="wp-image-"],
.entry figure img,
.entry .wp-caption img {
	border-radius: var(--kp-radius);
}
.entry figure {
	margin: 1em 0;
}
.entry figcaption,
.entry .wp-caption-text {
	font-size: 0.875rem;
	color: var(--kp-muted);
	text-align: center;
	margin-top: 0.4em;
}
.entry .wp-block-embed.is-type-video iframe,
.entry .wp-block-embed.is-type-video video {
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border-radius: var(--kp-radius);
}
.entry iframe,
.entry video {
	max-width: 100%;
}
.wp-block-table {
	overflow-x: auto;
}
.entry hr,
.entry .wp-block-separator {
	border: 0;
	border-top: 1px solid #ccc;
	margin: 2em 0;
}

/* ---------- Buttons (Core-Block) ---------- */
.entry .wp-block-button__link {
	display: inline-block;
	text-decoration: none;
	cursor: pointer;
	transition: filter 0.15s ease;
}
/* Textlink-Farbe darf die Schrift in Buttons nicht überschreiben (Buttons mit eigener Textfarbe bleiben unberührt) */
.entry .wp-block-button__link:not(.has-text-color):link,
.entry .wp-block-button__link:not(.has-text-color):visited,
.entry .wp-block-button__link:not(.has-text-color):hover {
	color: #fff;
}
.entry .wp-block-button__link:hover {
	filter: brightness(0.93);
}

/* ---------- Code ---------- */
.entry pre {
	background: #f6f8fa;
	border: 1px solid #e1e4e8;
	border-radius: var(--kp-radius);
	padding: 14px 16px;
	margin: 1em 0;
	overflow: auto;
	font: 0.875rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	tab-size: 2;
	text-align: left;
	hyphens: none;
	-webkit-hyphens: none;
	-webkit-overflow-scrolling: touch;
}
.entry :not(pre) > code {
	background: #f0f0f0;
	border-radius: 6px;
	padding: 0.1em 0.35em;
	font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	hyphens: none;
}
.klnd-code {
	position: relative;
}
.klnd-code pre {
	padding-right: 84px; /* Platz für den Kopieren-Button */
}
.klnd-copy {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 1;
	margin: 0;
	padding: 6px 12px;
	border: 1px solid #c9ced3;
	border-radius: 8px;
	background: #fff;
	color: var(--kp-text);
	font: 600 0.8125rem/1.2 Arial, sans-serif;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.klnd-copy:hover {
	border-color: var(--kp-accent);
}
.klnd-copy.is-done {
	background: var(--kp-accent);
	border-color: var(--kp-accent);
	color: #00363c;
}

/* ---------- Kategorien und Tags als Chips ---------- */
.klnd-chips {
	display: inline;
}
.klnd-chip {
	display: inline-block;
	margin: 2px 4px 2px 0;
	padding: 1px 10px;
	border-radius: 999px;
	background: var(--kp-soft);
	color: var(--kp-link);
	line-height: 1.6;
	text-decoration: none;
	white-space: nowrap;
}
.post .meta a.klnd-chip:hover {
	background: var(--kp-accent);
	color: #00363c;
}

/* ---------- Sonstiges ---------- */
#author-box {
	border-radius: var(--kp-radius);
}
#footer .left p {
	margin: 0 0 4px;
}

/* =====================================================================
   v2: schmale Kopfleiste, wischbares Menü, Fußzeile
   ===================================================================== */
#wrapper #header.klnd-bar {
	background: linear-gradient(135deg, var(--kp-bar-1), var(--kp-bar-2) 45%, var(--kp-bar-3));
	border: 0;
	margin: 0;
	padding: env(safe-area-inset-top, 0) 0 0;
	position: relative;
}
.klnd-bar__inner {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 8px;
	min-height: 56px;
	padding: 8px 12px;
	box-sizing: border-box;
}
.klnd-bar__side { display: flex; align-items: center; min-width: 0; }
.klnd-bar__side--right { justify-content: flex-end; position: relative; min-height: 40px; min-width: 40px; }
.klnd-bar__brand { display: flex; justify-content: center; min-width: 0; max-width: 100%; }
.klnd-brand { display: block; line-height: 0; }
.klnd-brand--text,
#wrapper #header a.klnd-brand--text {
	color: #fff;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	text-shadow: 0 1px 2px rgba(0, 54, 60, 0.35);
}
.klnd-wordmark {
	display: block;
	height: 28px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
	/* Dein Schriftzug wird unverändert gezeigt. Weiß einfärben? Unter "Zusätzliches CSS": :root{--kp-wordmark-filter:brightness(0) invert(1);} */
	filter: var(--kp-wordmark-filter);
}
.klnd-glass {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.22);
	border: 1px solid rgba(255, 255, 255, 0.55);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 1px 4px rgba(0, 54, 60, 0.25);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	overflow: hidden;
	line-height: 0;
}
.klnd-glass .custom-logo-link { display: flex; line-height: 0; }
.klnd-glass img,
.klnd-glass .custom-logo {
	display: block;
	width: 32px;
	height: 32px;
	object-fit: cover;
	border-radius: 8px;
}
/* Lupe aus dem Plugin: weiß mit Glasrahmen, rechts in der Leiste */
#klnd-tools .klndsearch-btn {
	position: static;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	color: #fff;
	background: rgba(255, 255, 255, 0.22);
	border: 1px solid rgba(255, 255, 255, 0.55);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 1px 4px rgba(0, 54, 60, 0.25);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}
#klnd-tools .klndsearch-btn svg { color: #fff; stroke: currentColor; }
.klnd-bar a:focus-visible,
.klnd-bar button:focus-visible { outline-color: #fff; }

/* Menüleiste: seitlich wischbar */
.klnd-navwrap {
	position: relative;
	background: #fff;
	border-bottom: 1px solid #e3e8ea;
	margin-bottom: 20px;
}
#klnd-nav {
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x proximity;
	scroll-padding: 0 12px;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}
#klnd-nav::-webkit-scrollbar { display: none; }
#klnd-nav ul.klnd-menu {
	display: flex;
	flex-wrap: nowrap;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0 12px;
	width: max-content;
	min-width: 100%;
	box-sizing: border-box;
}
#klnd-nav ul.klnd-menu li { flex: 0 0 auto; margin: 0; padding: 0; width: auto; height: auto; overflow: visible; background: none; scroll-snap-align: start; }
#klnd-nav ul.klnd-menu a {
	display: block;
	box-sizing: border-box;
	min-height: 48px;
	padding: 12px 14px 10px;
	font-size: 1rem;
	font-weight: 600;
	line-height: 24px;
	color: var(--kp-text);
	text-decoration: none;
	white-space: nowrap;
	border-bottom: 3px solid transparent;
}
#klnd-nav ul.klnd-menu a:hover { color: var(--kp-link); }
#klnd-nav ul.klnd-menu .current-menu-item > a,
#klnd-nav ul.klnd-menu .current_page_item > a,
#klnd-nav ul.klnd-menu .current-menu-ancestor > a,
#klnd-nav ul.klnd-menu .current-menu-parent > a {
	color: var(--kp-link);
	border-bottom-color: var(--kp-accent);
}
.klnd-navarrow {
	position: absolute;
	top: 0;
	bottom: 1px;
	width: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	font: 700 1.6rem/1 var(--kp-font);
	color: var(--kp-link);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	z-index: 2;
}
.klnd-navarrow[hidden] { display: none; }
.klnd-navarrow--prev { left: 0; background: linear-gradient(90deg, #fff 55%, rgba(255, 255, 255, 0)); text-align: left; padding-left: 10px; }
.klnd-navarrow--next { right: 0; background: linear-gradient(270deg, #fff 55%, rgba(255, 255, 255, 0)); text-align: right; padding-right: 10px; }

@media screen and (min-width: 851px) {
	#wrapper { padding: 0 0 0 0; }
	#wrapper #header.klnd-bar { border-radius: 0 0 var(--kp-radius) var(--kp-radius); }
	.klnd-bar__inner { min-height: 64px; padding: 10px 20px; }
	.klnd-wordmark { height: 34px; }
	#klnd-nav ul.klnd-menu { padding: 0 20px; }
	#main { padding: 0 25px; }
}
@media screen and (max-width: 360px) {
	.klnd-wordmark { height: 24px; }
	.klnd-bar__inner { padding: 8px; gap: 4px; }
}

/* Fußzeile */
#wrapper #footer {
	text-align: center;
	padding: 24px 15px 28px;
	margin-top: 24px;
	border-top: 1px solid #e3e8ea;
	background: #f6f8f9;
}
#wrapper #footer p { margin: 0; }
ul.klnd-footmenu {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 6px;
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
}
ul.klnd-footmenu li { margin: 0; padding: 0; background: none; }
ul.klnd-footmenu a { display: inline-block; padding: 10px 14px; font-weight: 600; text-decoration: none; }
.klnd-tagline { font-style: italic; margin-bottom: 4px !important; }
.klnd-copy-line, .klnd-credit { font-size: 0.875rem; }

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		animation: none !important;
		scroll-behavior: auto !important;
	}
}

@media print {
	#klnd-nav, .klnd-navwrap, #sidebar, .klnd-copy, .klndsearch-btn { display: none !important; }
	.post .entry, .pages .entry { font-size: 11pt; }
}
