/* ==========================================================================
   DB0KOE Funkstation
   Farben: Petrol (Gehäuse), Display-Amber (Anzeige), kühles Papier, Tinte
   ========================================================================== */

:root {
	--petrol: #0f3440;
	--petrol-deep: #0a2530;
	--petrol-line: #1d4a58;
	--amber: #f4b42a;
	--amber-dim: rgba(244, 180, 42, 0.2);
	--on-petrol: #e6eef0;
	--on-petrol-muted: #9db4ba;

	--bg: #edf1f2;
	--surface: #ffffff;
	--text: #16262d;
	--text-muted: #4f6168;
	--line: #c5d0d3;
	--link: #0f5568;
	--link-hover: #0a2530;
	--focus: #c98a00;

	--ok: #5bd08a;
	--warn: #f4b42a;
	--off: #ff6b5e;

	--font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
	--font-body: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;

	--measure: 42rem;
	--wide: 72rem;
	--gutter: clamp(1.25rem, 4vw, 2.5rem);

	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0c1e25;
		--surface: #12303a;
		--text: #e3ecee;
		--text-muted: #9fb3b9;
		--line: #23434e;
		--link: #f4c65a;
		--link-hover: #ffe3a3;
		--focus: #f4b42a;
		color-scheme: dark;
	}
}

/* --- Grundlagen ---------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 1.125rem;
	line-height: 1.6;
	font-variant-numeric: tabular-nums;
}

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

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: 0.005em;
	margin: 2em 0 0.5em;
}
h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); font-weight: 700; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.skip-link {
	position: absolute; left: 1rem; top: -4rem; z-index: 100;
	padding: 0.6rem 1rem;
	background: var(--amber); color: var(--petrol-deep);
	font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }

/* --- Kopfzeile ----------------------------------------------------------- */

.site-header { background: var(--petrol-deep); color: var(--on-petrol); }

.site-header__inner {
	max-width: var(--wide); margin: 0 auto;
	padding: 0.85rem var(--gutter);
	display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
	flex-wrap: wrap;
}

.site-branding { display: flex; align-items: center; gap: 0.75rem; }
.site-branding .custom-logo { display: block; max-height: 2.75rem; width: auto; }

.site-callsign {
	font-family: var(--font-display); font-weight: 700;
	font-size: 1.6rem; letter-spacing: 0.04em; line-height: 1;
	color: var(--amber); text-decoration: none;
}
.site-callsign:hover { color: #ffd277; }

.site-name { color: var(--on-petrol-muted); font-size: 0.95rem; }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.main-nav li { position: relative; }
.main-nav a {
	display: block; padding: 0.35rem 0;
	color: var(--on-petrol); text-decoration: none; font-weight: 500;
	border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a { border-bottom-color: var(--amber); color: #fff; }

.main-nav .sub-menu {
	display: none; position: absolute; top: 100%; left: -1rem; z-index: 20;
	min-width: 13rem; padding: 0.5rem 1rem;
	background: var(--petrol-deep); border: 1px solid var(--petrol-line);
	flex-direction: column; gap: 0;
}
.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu { display: flex; }

.nav-toggle { display: none; }

@media (max-width: 52rem) {
	.js .nav-toggle {
		display: inline-flex; align-items: center; gap: 0.6rem;
		padding: 0.5rem 0.85rem;
		background: transparent; color: var(--on-petrol);
		border: 1px solid var(--petrol-line); border-radius: 4px;
		font: 500 1rem var(--font-body); cursor: pointer;
	}
	.nav-toggle__bars,
	.nav-toggle__bars::before,
	.nav-toggle__bars::after {
		display: block; width: 18px; height: 2px; background: currentColor; position: relative;
	}
	.nav-toggle__bars::before,
	.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
	.nav-toggle__bars::before { top: -6px; }
	.nav-toggle__bars::after { top: 6px; }

	.js .main-nav { display: none; flex-basis: 100%; }
	.js .main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; gap: 0; }
	.main-nav a { padding: 0.65rem 0; border-bottom: 1px solid var(--petrol-line); }
	.main-nav .sub-menu { display: flex; position: static; border: 0; padding: 0 0 0 1rem; min-width: 0; }
}

/* --- Startseite: Rufzeichen ---------------------------------------------- */

.hero {
	background: var(--petrol);
	color: var(--on-petrol);
	border-bottom: 6px solid var(--petrol-deep);
}

.hero__inner {
	max-width: var(--wide); margin: 0 auto;
	padding: clamp(3rem, 9vw, 6.5rem) var(--gutter) clamp(2.5rem, 6vw, 4rem);
}

.hero__call {
	margin: 0;
	font-family: var(--font-display); font-weight: 700;
	font-size: clamp(4.5rem, 22vw, 15rem);
	line-height: 0.82;
	letter-spacing: 0.02em;
	color: #fff;
}

.hero__signal { margin: clamp(1.25rem, 3vw, 2rem) 0 0; max-width: 44rem; }

.morse { display: block; width: 100%; height: auto; overflow: visible; }
.morse-el { fill: var(--amber); }
.morse-char {
	fill: var(--on-petrol-muted);
	font-family: var(--font-display); font-weight: 600; font-size: 15px;
}

@media (prefers-reduced-motion: no-preference) {
	.morse-el {
		opacity: 0.16;
		animation: key 0.12s steps(1, end) forwards;
	}
	@keyframes key { to { opacity: 1; } }
}

.hero__lead {
	max-width: 36rem;
	margin: 2rem 0 0;
	font-size: clamp(1.15rem, 2vw, 1.35rem); line-height: 1.5;
	color: var(--on-petrol);
}

/* Foto neben dem Rufzeichen */
.hero__inner--photo { display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: minmax(0, 1fr); }
.hero__text { min-width: 0; }
.hero__photo { margin: 0; }
.hero__photo img {
	display: block; width: 100%; height: auto;
	aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 45%;
	border: 6px solid var(--petrol-deep); border-radius: 4px;
	background: var(--petrol-deep);
}
.hero__photo figcaption { margin-top: 0.75rem; font-size: 0.95rem; line-height: 1.45; color: var(--on-petrol-muted); }
.hero__credit { display: block; font-size: 0.85rem; }
.hero__credit a { color: var(--on-petrol-muted); }
.hero__credit a:hover { color: var(--amber); }

@media (min-width: 60rem) {
	.hero__inner--photo { grid-template-columns: minmax(0, 1.7fr) minmax(16rem, 1fr); align-items: end; }
	.hero__inner--photo .hero__call { font-size: clamp(4.5rem, 13.5vw, 12rem); }
	.hero__photo img { aspect-ratio: 3 / 4; max-height: 34rem; }
}

/* Null mit Schrägstrich im Rufzeichen */
.zero { position: relative; display: inline-block; }
.zero::after {
	content: "";
	position: absolute; left: 50%; top: 50%;
	width: 0.11em; height: 0.92em;
	background: currentColor;
	transform: translate(-50%, -50%) rotate(28deg);
	border-radius: 0.02em;
}
.hero__call .zero::after { width: 0.095em; height: 0.6em; }

/* Status-LED */
.status {
	display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0.35rem 0.7rem;
	margin: 1.75rem 0 0; padding: 0.5rem 0.9rem 0.5rem 0.75rem;
	background: var(--petrol-deep); border: 1px solid var(--petrol-line); border-radius: 999px;
	font-size: 1rem;
}
.status__led {
	width: 0.7rem; height: 0.7rem; border-radius: 50%;
	background: var(--ok); box-shadow: 0 0 0 3px rgba(91, 208, 138, 0.22), 0 0 10px var(--ok);
}
.status--limited .status__led,
.status--maint .status__led { background: var(--warn); box-shadow: 0 0 0 3px var(--amber-dim), 0 0 10px var(--warn); }
.status--off .status__led { background: var(--off); box-shadow: 0 0 0 3px rgba(255, 107, 94, 0.22), 0 0 10px var(--off); }
.status__label { font-weight: 600; color: #fff; }
.status__note { color: var(--on-petrol-muted); }

/* --- Abschnitte ---------------------------------------------------------- */

.band { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.band + .band { border-top: 1px solid var(--line); }
.band__title { margin-top: 0; }

/* --- Datenblatt (Transceiver-Display) ------------------------------------ */

.datasheet {
	display: grid; gap: 2rem;
	grid-template-columns: minmax(0, 1fr);
	align-items: start;
}
@media (min-width: 60rem) {
	.datasheet { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); }
}

.display {
	background: var(--petrol-deep);
	color: var(--amber);
	border: 10px solid #1a2a30;
	border-radius: 10px;
	box-shadow: inset 0 0 0 1px #000, inset 0 0 28px rgba(0, 0, 0, 0.55);
	padding: 0.75rem 1rem 0.6rem;
	overflow-x: auto;
}

.display__table {
	width: 100%; min-width: 22rem;
	border-collapse: collapse;
	font-family: var(--font-display); font-weight: 600;
	font-variant-numeric: tabular-nums lining-nums;
}
.display__table th,
.display__table td { padding: 0.55rem 0.75rem; text-align: left; white-space: nowrap; }
.display__table thead th {
	color: var(--on-petrol-muted); font-weight: 600; font-size: 0.95rem;
	border-bottom: 1px solid var(--petrol-line);
}
.display__table tbody th { color: #fff; font-size: 1.2rem; }
.display__table tbody td { font-size: 1.2rem; }
.display__table .freq { font-size: 1.6rem; letter-spacing: 0.02em; text-shadow: 0 0 12px rgba(244, 180, 42, 0.35); }
.display__table tbody tr + tr > * { border-top: 1px dashed var(--petrol-line); }
.display__table .num { text-align: right; padding-right: 2rem; }
.display__table .service { color: var(--on-petrol); font-weight: 600; font-size: 1.25rem; }

/* Ampel je Frequenz */
.display__table .lamp { width: 100%; font-family: var(--font-body); font-weight: 500; font-size: 0.95rem; color: var(--on-petrol-muted); }
.lamp__led {
	display: inline-block; vertical-align: -0.05em; margin-right: 0.55rem;
	width: 0.75rem; height: 0.75rem; border-radius: 50%;
	background: var(--ok); box-shadow: 0 0 0 3px rgba(91, 208, 138, 0.2), 0 0 10px var(--ok);
}
.ch--maint .lamp__led { background: var(--warn); box-shadow: 0 0 0 3px var(--amber-dim), 0 0 10px var(--warn); }
.ch--off .lamp__led { background: var(--off); box-shadow: 0 0 0 3px rgba(255, 107, 94, 0.2), 0 0 10px var(--off); }
.ch--off .lamp__label { color: #ffb3ab; }
/* Abgeschaltete Frequenz: Ziffern gedimmt wie ein ausgeschaltetes Display */
.ch--off .freq { color: rgba(244, 180, 42, 0.38); text-shadow: none; }
.ch--off .service { color: var(--on-petrol-muted); }
@media print { .lamp__led { box-shadow: none; border: 1px solid #000; } }
/* Band nur zeigen, wenn es wechselt */
.display__table tbody tr.same-band > th { color: transparent; }

.display__unit { margin: 0.4rem 0.75rem 0; font-size: 0.85rem; color: var(--on-petrol-muted); }

.facts { margin: 0; }
.facts__row { padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.facts__row:first-child { padding-top: 0; }
.facts dt { font-size: 0.9rem; color: var(--text-muted); }
.facts dd { margin: 0.1rem 0 0; font-family: var(--font-display); font-weight: 600; font-size: 1.45rem; line-height: 1.2; }

.datasheet-empty { color: var(--text-muted); }

/* --- Beitragsliste (Logbuch) --------------------------------------------- */

.log { list-style: none; margin: 0; padding: 0; max-width: 52rem; }
.log__entry {
	display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.25rem 1.5rem;
	padding: 1.4rem 0; border-top: 1px solid var(--line);
}
.log__entry:last-child { border-bottom: 1px solid var(--line); }
.log__date { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--text-muted); padding-top: 0.15rem; }
.log__title { margin: 0; font-size: 1.5rem; }
.log__title a { color: var(--text); text-decoration: none; }
.log__title a:hover { color: var(--link); text-decoration: underline; }
.log__excerpt { margin: 0.4rem 0 0; color: var(--text-muted); max-width: var(--measure); }

@media (max-width: 36rem) {
	.log__entry { grid-template-columns: 1fr; }
}

.more { margin: 1.5rem 0 0; font-weight: 600; }

/* --- Seiten & Beiträge --------------------------------------------------- */

.page-wrap { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.page-header { max-width: var(--measure); margin: 0 auto 2rem; }
.page-title { margin: 0; }
.entry-meta { margin: 0.75rem 0 0; color: var(--text-muted); font-size: 1rem; }
.entry-meta__author::before { content: ", "; }
.archive-description { color: var(--text-muted); margin-top: 0.75rem; }

.page-wrap > .log { margin: 0 auto; max-width: var(--measure); }

.entry-thumb { margin: 0 auto 2rem; max-width: 56rem; }
.entry-thumb img { display: block; width: 100%; border-radius: 4px; }

.entry-content { max-width: var(--measure); margin: 0 auto; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content > h2:first-child,
.entry-content > h3:first-child { margin-top: 0; }
.entry-content p,
.entry-content li { max-width: 68ch; }
.entry-content blockquote {
	margin-left: 0; padding-left: 1.25rem;
	border-left: 4px solid var(--amber);
	font-style: italic;
}
.entry-content pre,
.entry-content code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.92em; }
.entry-content pre { padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; overflow-x: auto; }
.entry-content table { border-collapse: collapse; width: 100%; }
.entry-content th,
.entry-content td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line); text-align: left; }
.entry-content .wp-block-table { overflow-x: auto; }
.entry-content .alignwide { max-width: var(--wide); margin-left: calc(50% - min(50vw, var(--wide) / 2) + var(--gutter)); margin-right: calc(50% - min(50vw, var(--wide) / 2) + var(--gutter)); }
.entry-content .alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; }
.entry-content img { border-radius: 3px; }
.entry-content figcaption,
.wp-element-caption { font-size: 0.95rem; color: var(--text-muted); margin-top: 0.5rem; }
.entry-content .datasheet { max-width: none; }

.wp-block-button__link,
.search-submit,
.comment-form .submit {
	display: inline-block; padding: 0.65rem 1.2rem;
	background: var(--petrol); color: #fff;
	border: 0; border-radius: 4px;
	font: 600 1rem var(--font-body); text-decoration: none; cursor: pointer;
}
.wp-block-button__link:hover,
.search-submit:hover,
.comment-form .submit:hover { background: var(--petrol-deep); color: var(--amber); }

.entry-footer { max-width: var(--measure); margin: 2.5rem auto 0; font-size: 1rem; color: var(--text-muted); }
.entry-footer p { margin: 0.25rem 0; }

.post-navigation,
.pagination { max-width: var(--measure); margin: 0 auto 3rem; padding: 0 var(--gutter); }
.post-navigation .nav-links { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); border-top: 1px solid var(--line); padding-top: 1.5rem; }
.post-navigation .nav-next { text-align: right; }
.post-navigation .nav-label { display: block; font-size: 0.9rem; color: var(--text-muted); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; }
.pagination .page-numbers { padding: 0.35rem 0.7rem; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; }
.pagination .current { background: var(--petrol); color: #fff; border-color: var(--petrol); }

/* --- Formulare ----------------------------------------------------------- */

input[type="text"], input[type="email"], input[type="url"], input[type="search"], textarea {
	width: 100%; padding: 0.6rem 0.75rem;
	background: var(--surface); color: var(--text);
	border: 1px solid var(--line); border-radius: 4px;
	font: inherit;
}
.search-form { display: flex; gap: 0.5rem; max-width: 30rem; }
.search-form .search-field { flex: 1; }

/* --- Kommentare ---------------------------------------------------------- */

.comments { max-width: calc(var(--measure) + 2 * var(--gutter)); padding-bottom: 4rem; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.5rem; border-left: 2px solid var(--line); }
.comment-body { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.comment-meta { font-size: 0.95rem; color: var(--text-muted); }
.comment-author .avatar { float: left; margin-right: 0.75rem; border-radius: 50%; }

/* --- Impressum / Datenschutz ------------------------------------------- */

.legal h2 { font-size: 1.5rem; margin-top: 2.25rem; }
.legal h2:first-child { margin-top: 0; }
.legal-missing { background: #ffe08a; color: #3a2a00; padding: 0.05em 0.35em; border-radius: 2px; }
.legal-date { color: var(--text-muted); font-size: 1rem; margin-top: 2.5rem; }

/* --- 404 ----------------------------------------------------------------- */

.not-found__code {
	margin: 0 0 0.5rem;
	font-family: var(--font-display); font-weight: 700;
	font-size: clamp(4rem, 14vw, 8rem); line-height: 0.9;
	color: var(--amber);
	-webkit-text-stroke: 1px var(--petrol);
}

/* --- Fußzeile ------------------------------------------------------------ */

.site-footer { background: var(--petrol-deep); color: var(--on-petrol-muted); margin-top: auto; }
.site-footer a { color: var(--on-petrol); }
.site-footer a:hover { color: var(--amber); }
.site-footer__inner { max-width: var(--wide); margin: 0 auto; padding: 3rem var(--gutter) 2rem; }

.footer-widgets { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); padding-bottom: 2.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--petrol-line); }
.widget-title { margin: 0 0 0.75rem; font-size: 1.3rem; color: #fff; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 0.25rem 0; }

.site-footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.sign-off { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; color: var(--amber); }
.legal-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 0.95rem; }
.legal-hint { margin: 0; font-size: 0.95rem; }

body { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1 0 auto; }

/* --- Druck --------------------------------------------------------------- */

@media print {
	.site-header, .site-footer, .nav-toggle, .post-navigation, .comments { display: none; }
	.hero { background: none; color: #000; border: 0; }
	.hero__call, .status__label { color: #000; }
	.morse-el { fill: #000; opacity: 1 !important; animation: none !important; }
	.display { background: none; color: #000; border: 1px solid #000; box-shadow: none; }
	.display__table .freq { text-shadow: none; }
}
