/*
Theme Name: Klartext
Description: Schlichtes, schnelles Theme mit maximaler Lesbarkeit. Große Schrift, hoher Kontrast, keine Bilder nötig. Menüs über „Design → Menüs“ editierbar, Untermenüs klappen aus. Akzentfarben der Jugendfeuerwehr (Rot, Blau, Signalgelb).
Author: Jugendwarte-Portal
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: klartext
*/

:root {
	--bg: #ffffff;
	--bg-soft: #f4f5f7;
	--text: #14181f;
	--muted: #4a5260;
	--line: #cfd4dc;
	--red: #b3001b;       /* Feuerrot, Kontrast auf Weiß 7:1 */
	--red-dark: #8a0015;
	--blue: #0b3a75;      /* Jugendfeuerwehr-Blau */
	--yellow: #ffc800;    /* Signalgelb – nur als Fläche/Fokus, nie als Textfarbe auf Weiß */
	--link: #0b3a75;
	--link-hover: #b3001b;
	--on-dark: #ffffff;
	--measure: 68ch;
	--wrap: 72rem;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #12151b; --bg-soft: #1b2029; --text: #f2f4f7; --muted: #b9c0cc; --line: #3a4352;
		--red: #ff6b7d; --red-dark: #ff8d9b; --blue: #7fb2ff; --link: #8fbaff; --link-hover: #ff9aa8;
	}
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0; background: var(--bg); color: var(--text);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.7; font-size: 1rem; overflow-wrap: break-word; hyphens: auto;
}
.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
a { color: var(--link); text-decoration-thickness: .08em; text-underline-offset: .2em; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; box-shadow: 0 0 0 5px #000; }
.screen-reader-text, .skip-link:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: .5rem; left: .5rem; z-index: 100; background: var(--yellow); color: #000; padding: .6rem 1rem; font-weight: 700; }

/* Kopfbereich */
.site-header { background: var(--blue); color: var(--on-dark); border-bottom: .35rem solid var(--red); }
.header-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding-block: .6rem; }
.branding { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.site-title { margin: 0; font-size: 1.45rem; line-height: 1.2; font-weight: 800; letter-spacing: .01em; }
.site-title a { color: var(--on-dark); text-decoration: none; }
.site-title a:hover { text-decoration: underline; color: var(--on-dark); }
.site-tagline { margin: .1rem 0 0; font-size: .9rem; opacity: .9; }
.custom-logo { max-height: 3.2rem; width: auto; display: block; }
.custom-logo-link { display: block; flex: none; }

/* Navigation */
.menu-toggle { display: none; background: transparent; color: var(--on-dark); border: 2px solid var(--on-dark); border-radius: .3rem; width: 3rem; height: 3rem; padding: 0; cursor: pointer; align-items: center; justify-content: center; }
.menu-toggle-bars { display: block; position: relative; width: 1.6rem; height: 1.2rem; }
.menu-toggle-bars span { position: absolute; left: 0; width: 100%; height: .2rem; background: currentColor; border-radius: .1rem; transition: transform .15s, opacity .15s, top .15s; }
.menu-toggle-bars span:nth-child(1) { top: 0; }
.menu-toggle-bars span:nth-child(2) { top: .5rem; }
.menu-toggle-bars span:nth-child(3) { top: 1rem; }
.menu-toggle[aria-expanded="true"] { background: rgba(255,255,255,.18); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars span:nth-child(1) { top: .5rem; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars span:nth-child(3) { top: .5rem; transform: rotate(-45deg); }
.main-nav { background: transparent; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav > ul { display: flex; flex-wrap: wrap; gap: 0; }
.main-nav li { position: relative; }
.main-nav a { display: block; padding: .8rem 1rem; color: var(--on-dark); text-decoration: none; font-weight: 600; }
.main-nav a:hover, .main-nav a:focus-visible { background: rgba(255,255,255,.14); color: var(--on-dark); }
.main-nav .current-menu-item > a, .main-nav .current-menu-ancestor > a, .main-nav .current_page_item > a { box-shadow: inset 0 -.3rem 0 var(--yellow); }
.main-nav li.menu-item-has-children { display: flex; flex-wrap: wrap; align-items: stretch; }
.submenu-toggle { background: transparent; border: 0; color: var(--on-dark); cursor: pointer; padding: 0 .7rem; font-size: 1rem; line-height: 1; }
.submenu-toggle:hover { background: rgba(255,255,255,.14); }
.submenu-toggle::before { content: ""; display: inline-block; width: .55em; height: .55em; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: translateY(-.15em) rotate(45deg); transition: transform .15s; }
.submenu-toggle[aria-expanded="true"]::before { transform: translateY(.1em) rotate(-135deg); }
.main-nav .sub-menu { display: none; flex-basis: 100%; background: #fff; color: var(--text); border-top: .2rem solid var(--yellow); }
.main-nav .sub-menu a { color: #14181f; font-weight: 500; }
.main-nav .sub-menu a:hover, .main-nav .sub-menu a:focus-visible { background: #e9edf3; color: var(--red); }
.main-nav .sub-menu .current-menu-item > a { box-shadow: inset .3rem 0 0 var(--red); }
.main-nav .sub-menu.is-open { display: block; }
@media (min-width: 52em) {
	.main-nav > ul { justify-content: flex-end; }
	.main-nav .sub-menu { position: absolute; left: 0; top: 100%; min-width: 16rem; z-index: 50; box-shadow: 0 .5rem 1.2rem rgba(0,0,0,.25); }
	.main-nav .sub-menu .sub-menu { position: static; box-shadow: none; border-top: 0; padding-left: 1rem; }
	.main-nav li.menu-item-has-children { flex-wrap: nowrap; }
}
@media (max-width: 51.99em) {
	.js .menu-toggle { display: inline-flex; }
	.js .main-nav { display: none; flex: 0 0 calc(100% + 2rem); margin-inline: -1rem; }
	.js .main-nav.is-open { display: block; }
	.main-nav { flex: 0 0 calc(100% + 2rem); margin-inline: -1rem; background: var(--blue); }
	.main-nav > ul { flex-direction: column; }
	.main-nav a { padding: 1rem; border-top: 1px solid rgba(255,255,255,.2); }
	.main-nav li.menu-item-has-children > a { flex: 1; }
	.submenu-toggle { padding: 0 1.1rem; border-left: 1px solid rgba(255,255,255,.2); border-top: 1px solid rgba(255,255,255,.2); }
	.no-js .main-nav .sub-menu { display: block; }
	.main-nav .sub-menu a { padding-left: 2rem; }
}
.no-js .main-nav li:hover > .sub-menu, .no-js .main-nav li:focus-within > .sub-menu { display: block; }

/* Inhalt */
.site-main { padding-block: 2rem 3rem; }
.content { max-width: var(--measure); }
.layout-wide .content { max-width: none; }
h1, h2, h3, h4 { line-height: 1.25; margin: 2em 0 .5em; font-weight: 750; }
h1 { font-size: 2.1rem; margin-top: 0; }
h2 { font-size: 1.6rem; padding-top: .4rem; border-top: .2rem solid var(--red); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
p, ul, ol, dl, table, blockquote, pre, figure { margin: 0 0 1.2em; }
ul, ol { padding-left: 1.5em; }
li { margin-bottom: .35em; }
blockquote { border-left: .35rem solid var(--red); padding: .2em 1.2em; background: var(--bg-soft); }
hr { border: 0; border-top: 2px solid var(--line); margin: 2rem 0; }
img, video, iframe { max-width: 100%; height: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid var(--line); padding: .6rem .8rem; text-align: left; vertical-align: top; }
th { background: var(--bg-soft); }
code, pre { font-family: ui-monospace, Consolas, monospace; font-size: .92em; background: var(--bg-soft); }
pre { padding: 1rem; overflow-x: auto; }
.entry-meta { color: var(--muted); font-size: .95rem; margin: -.3rem 0 1.5rem; }
.entry-title a { color: var(--text); text-decoration: none; }
.entry-title a:hover { color: var(--red); text-decoration: underline; }
.post-list article { padding-block: 1.5rem; border-bottom: 2px solid var(--line); }
.post-list article:first-child { padding-top: 0; }
.post-list .entry-title { margin: 0 0 .3rem; font-size: 1.5rem; border: 0; }
.more-link, .button, button.button, input[type="submit"], .wp-block-button__link {
	display: inline-block; background: var(--red); color: #fff; border: 2px solid var(--red); border-radius: .3rem;
	padding: .65rem 1.2rem; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.more-link:hover, .button:hover, input[type="submit"]:hover, .wp-block-button__link:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
input[type="text"], input[type="search"], input[type="email"], input[type="url"], input[type="password"], textarea, select {
	width: 100%; max-width: 36rem; font: inherit; padding: .6rem .75rem; color: var(--text); background: var(--bg); border: 2px solid var(--muted); border-radius: .3rem;
}
label { font-weight: 600; display: block; margin-bottom: .2rem; }
.search-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.search-form label { flex: 1 1 14rem; margin: 0; }
.pagination, .post-navigation .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; margin-top: 2rem; }
.page-numbers { padding: .4rem .8rem; border: 2px solid var(--line); text-decoration: none; border-radius: .3rem; }
.page-numbers.current { background: var(--blue); color: #fff; border-color: var(--blue); }
.comment-list { list-style: none; padding: 0; }
.comment-body { border-left: .3rem solid var(--line); padding-left: 1rem; margin-bottom: 1.5rem; }

/* Fußbereich */
.site-footer { background: var(--bg-soft); border-top: .35rem solid var(--red); padding-block: 2rem; font-size: .95rem; }
.footer-nav ul { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; }
.footer-nav a { font-weight: 600; }
.footer-widgets { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-bottom: 1.5rem; }
.footer-widgets h2 { font-size: 1.1rem; border: 0; margin-top: 0; }

/* Wordpress-Kern */
.alignleft { float: left; margin: 0 1.5rem 1rem 0; } .alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption-text, figcaption { font-size: .9rem; color: var(--muted); }
.sticky .entry-title::before { content: "Wichtig: "; color: var(--red); }

/* Jugendwarte-Portal */
.jw-termine, .jw-wehr, .entry-content .jw-card { max-width: none; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
	.site-header, .main-nav, .site-footer, .skip-link { display: none; }
	body { font-size: 12pt; color: #000; background: #fff; }
	a { color: #000; text-decoration: underline; }
	a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
}
