/*
 * TechNavigator 3 – Grundlayout: Grundstile, Kopfzeile, Fußzeile, Seitenrahmen, Listen.
 * Vorlage: Header.dc.html, HeaderMitglied.dc.html, Footer.dc.html, Fehler404.dc.html.
 */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: 16px;
}

body {
	margin: 0;
	background: var(--tn-papier);
	color: var(--tn-tinte);
	font-family: var(--tn-sans);
	font-size: 17px;
	line-height: 1.6;
	overflow-wrap: break-word;
}

/* Das Attribut hidden gilt immer: Eine display-Regel einer Klasse (z. B. inline-flex an einem Knopf)
   darf ein verstecktes Element nicht wieder einblenden. */
[hidden] {
	display: none !important;
}

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

img {
	height: auto;
}

a {
	color: var(--tn-link);
	text-underline-offset: 4px;
}

a:hover {
	color: var(--tn-link-dunkel);
}

/* Sichtbarer Fokus für die Bedienung mit der Tastatur */
:focus-visible {
	outline: var(--tn-fokus);
	outline-offset: 2px;
}

#inhalt:focus {
	outline: 0;
}

h1,
h2,
h3,
h4 {
	color: var(--tn-tinte);
	font-family: var(--tn-serif);
	font-weight: 600;
}

/* Nur für Vorleseprogramme */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* Sprunglink: erst bei Fokus sichtbar */
.tn-sprunglink {
	position: absolute;
	left: 8px;
	top: -100px;
	z-index: 1000;
	padding: 12px 18px;
	background: var(--tn-navy);
	color: var(--tn-weiss);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	border-radius: var(--tn-radius);
}

.tn-sprunglink:focus {
	top: 8px;
	color: var(--tn-weiss);
	outline: 3px solid var(--tn-gold);
}

/* ---------- Rahmen: 1240 px für Kopf, Inhalt, Fuß ---------- */
.tn-rahmen {
	max-width: var(--tn-breite);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--tn-rand);
	padding-right: var(--tn-rand);
}

.tn-breit {
	max-width: var(--tn-breit);
	margin-left: auto;
	margin-right: auto;
}

.tn-lesespalte {
	max-width: var(--tn-lesespalte);
	margin-left: auto;
	margin-right: auto;
}

.tn-seite {
	min-height: 40vh;
}

/* ---------- Kopfzeile ---------- */
.tn-kopf {
	background: var(--tn-papier);
	border-bottom: 1px solid var(--tn-linie);
	color: var(--tn-tinte);
}

.tn-kopf__zeile {
	padding-top: 14px;
	padding-bottom: 12px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
}

.tn-kopf__logo {
	display: flex;
	align-items: center;
	min-height: 44px;
}

.tn-kopf__logo img {
	display: block;
	width: clamp(150px, 17vw, 216px);
	height: auto;
}

/* Seit 3.0.18: zwei Logos im Kopf. Hell zeigt das dunkle Logo (logo-dunkel.webp); die dunkle Ansicht setzt in
   dunkel.css die beiden Variablen um und zeigt das helle (logo-hell.webp). Ohne die Variablen: wie bisher. */
.tn-kopf__logo img.tn-kopf__logo-papier {
	display: var(--tn-logo-papier, block);
}

.tn-kopf__logo img.tn-kopf__logo-nacht {
	display: var(--tn-logo-nacht, none);
}

/* Sehr schmale Bildschirme: Logo und „Mein TechNavigator" bleiben in einer Zeile */
@media (max-width: 400px) {
	.tn-kopf__logo img {
		width: 128px;
	}

	.tn-kopf .tn-knopf--kopf {
		padding: 0 12px;
		font-size: 14px;
	}
}

.tn-kopf__navzeile {
	border-top: 1px solid var(--tn-linie-zart);
}

/*
 * Navigationszeile. Am Rechner eine Zeile: links die Menüpunkte, rechts „Suche" und „Anmelden". Passen die
 * Punkte nicht in eine Zeile, brechen sie um; seitlich gerollt wird nie. Unter 1080 px klappen die Menüpunkte
 * hinter „Menü" ein (Kontrollkästchen mit Beschriftung, ohne JavaScript); „Suche" und „Anmelden" bleiben sichtbar.
 */
.tn-hauptnav__innen {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	column-gap: 28px;
}

.tn-hauptnav__liste {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 28px;
	font-size: 15px;
	font-weight: 500;
}

.tn-hauptnav__liste > li {
	flex: 0 0 auto;
}

.tn-hauptnav__dienste {
	margin-left: auto;
	flex-wrap: nowrap;
}

.tn-hauptnav__liste a {
	display: flex;
	align-items: center;
	min-height: 46px;
	color: var(--tn-tinte);
	text-decoration: none;
}

.tn-hauptnav__liste a:hover {
	color: var(--tn-link);
	text-decoration: underline;
}

.tn-hauptnav__liste a:focus-visible {
	outline-offset: -3px;
}

.tn-hauptnav__liste .current-menu-item > a,
.tn-hauptnav__liste a[aria-current="page"] {
	font-weight: 600;
	box-shadow: inset 0 -2px 0 var(--tn-tinte);
}

.tn-hauptnav__liste a.tn-hauptnav__konto {
	color: var(--tn-link);
	text-decoration: underline;
}

/* Schalter „Menü": am Rechner nicht vorhanden */
.tn-hauptnav__schalter,
.tn-hauptnav__knopf {
	display: none;
}

@media (max-width: 1079px) {
	.tn-hauptnav__innen {
		column-gap: 16px;
	}

	/* Das Kästchen bleibt für Tastatur und Vorleseprogramme erreichbar, sichtbar ist nur die Beschriftung */
	.tn-hauptnav__schalter {
		display: block;
		position: absolute;
		width: 1px;
		height: 1px;
		margin: 0;
		opacity: 0;
		pointer-events: none;
	}

	.tn-hauptnav__knopf {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		min-height: 46px;
		padding: 0 4px 0 0;
		font-size: 15px;
		font-weight: 600;
		color: var(--tn-tinte);
		cursor: pointer;
		user-select: none;
	}

	.tn-hauptnav__knopf svg {
		flex: 0 0 auto;
		display: block;
	}

	.tn-hauptnav__schalter:focus-visible + .tn-hauptnav__knopf {
		outline: var(--tn-fokus);
		outline-offset: -3px;
	}

	.tn-hauptnav__schalter:checked + .tn-hauptnav__knopf {
		box-shadow: inset 0 -2px 0 var(--tn-tinte);
	}

	/* Die Menüpunkte: eingeklappt, aufgeklappt als Liste über die volle Breite */
	#tn-hauptmenue {
		display: none;
		order: 3;
		flex: 1 1 100%;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		border-top: 1px solid var(--tn-linie-zart);
		padding: 4px 0 10px;
		font-size: 16px;
	}

	.tn-hauptnav__schalter:checked ~ #tn-hauptmenue {
		display: flex;
	}

	#tn-hauptmenue > li {
		border-bottom: 1px solid var(--tn-linie-zart);
	}

	#tn-hauptmenue > li:last-child {
		border-bottom: 0;
	}

	#tn-hauptmenue a {
		min-height: 48px;
	}

	#tn-hauptmenue .current-menu-item > a,
	#tn-hauptmenue a[aria-current="page"] {
		box-shadow: none;
	}
}

/* ---------- Fußzeile (Navy) ---------- */
.tn-fuss {
	background: var(--tn-navy);
	color: var(--tn-auf-navy);
}

.tn-fuss :focus-visible {
	outline-color: var(--tn-weiss);
}

.tn-fuss__innen {
	padding-top: 56px;
	padding-bottom: 28px;
	display: flex;
	flex-direction: column;
	gap: 40px;
}

.tn-fuss__spalten {
	display: flex;
	flex-wrap: wrap;
	gap: 36px 56px;
}

.tn-fuss__marke {
	flex: 2 1 280px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.tn-fuss__marke img {
	display: block;
	width: 204px;
	height: auto;
}

.tn-fuss__marke p {
	margin: 0;
	max-width: 34ch;
	font-family: var(--tn-serif);
	font-size: 18px;
	line-height: 1.5;
	color: var(--tn-auf-navy-neben);
}

.tn-fuss__spalte {
	flex: 1 1 150px;
	font-size: 15px;
}

.tn-fuss__titel {
	margin: 0 0 10px;
	font-family: var(--tn-sans);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--tn-auf-navy-neben);
}

.tn-fuss__liste,
.tn-fuss__recht {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tn-fuss__liste {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tn-fuss a {
	color: var(--tn-auf-navy);
	text-decoration: none;
}

.tn-fuss a:hover {
	text-decoration: underline;
}

.tn-fuss__unten {
	border-top: 1px solid rgba(255, 255, 255, 0.25);
	padding-top: 20px;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 10px 32px;
	font-size: 13px;
	color: var(--tn-auf-navy-neben);
}

.tn-fuss__unten p {
	margin: 0;
}

.tn-fuss__recht {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
}

.tn-fuss__recht a {
	color: var(--tn-auf-navy-neben);
}

/* ---------- Übersichten und Suche (Rückfall, index.php) ---------- */
.tn-uebersicht {
	padding-top: clamp(36px, 5vw, 52px);
	padding-bottom: 72px;
}

.tn-eintraege {
	margin-top: 28px;
	border-top: 2px solid var(--tn-tinte);
}

.tn-eintrag {
	padding: 22px 0 24px;
	border-bottom: 1px solid var(--tn-linie);
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tn-eintrag__titel {
	margin: 0;
	font-size: clamp(22px, 2.4vw, 26px);
	line-height: 1.22;
}

.tn-eintrag__titel a {
	color: var(--tn-tinte);
	text-decoration: none;
}

.tn-eintrag__titel a:hover {
	text-decoration: underline;
}

.tn-eintrag__auszug {
	margin: 0;
	max-width: 46em;
	font-size: 16px;
	color: var(--tn-text);
}

.tn-leer {
	margin: 28px 0 0;
	color: var(--tn-text);
}

.tn-blaettern {
	margin-top: 32px;
	font-size: 15px;
	font-weight: 500;
}

.tn-blaettern .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 14px;
}

.tn-blaettern .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 8px;
}

.tn-blaettern .page-numbers.current {
	color: var(--tn-tinte);
	font-weight: 600;
	box-shadow: inset 0 -2px 0 var(--tn-tinte);
}

/* ---------- Suchformular ---------- */
.tn-suchformular {
	margin: 28px 0 0;
	border-top: 1px solid var(--tn-linie);
	border-bottom: 1px solid var(--tn-linie);
	padding: 18px 0 22px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tn-suchformular label {
	font-size: 15px;
	font-weight: 600;
}

.tn-suchformular__zeile {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.tn-suchformular__zeile .tn-feld {
	flex: 1 1 240px;
	min-width: 0;
}

/* ---------- 404: Einstiege ---------- */
.tn-einstiege {
	margin-top: 44px;
}

.tn-einstiege ul {
	list-style: none;
	margin: 6px 0 0;
	padding: 0;
}

.tn-einstiege li {
	border-bottom: 1px solid var(--tn-linie);
	padding: 8px 0 12px;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 24px;
}

.tn-einstiege a {
	flex: 0 0 200px;
	display: flex;
	align-items: center;
	min-height: 44px;
	font-family: var(--tn-serif);
	font-weight: 600;
	font-size: 21px;
}

.tn-einstiege__text {
	flex: 1 1 240px;
	min-width: 0;
	font-size: 15px;
	color: var(--tn-gedaempft);
}

/* 404: Kopf etwas dichter und mit mehr Luft nach oben als der Artikelkopf (Mockup Fehler404) */
.tn-artikel--fehler {
	padding-top: clamp(36px, 5vw, 64px);
	padding-bottom: 72px;
}

.tn-artikel--fehler .tn-artikelkopf {
	gap: 12px;
}

.tn-artikel--fehler .tn-artikelkopf h1 {
	letter-spacing: -0.015em;
}

.tn-artikel--fehler .tn-vorspann {
	font-size: clamp(19px, 2vw, 22px);
}

/* ---------- Inter nie fetter als 600 ----------
   Tabellenköpfe und Hervorhebungen stehen im Browser von Haus aus auf „bold" (700). Große Zahlen in DM Sans 700
   tragen eigene Klassen und bleiben davon unberührt. */
th,
strong,
b {
	font-weight: 600;
}

/* ---------- Tippziele am Handy: Links der Fußzeile mindestens 44 px hoch ----------
   Nur auf Geräten mit Fingerbedienung und in schmalen Fenstern; die Ansicht am Rechner bleibt, wie sie ist.
   Die Höhe entsteht durch die Fläche des Links, nicht durch größere Schrift. */
@media (pointer: coarse), (max-width: 782px) {
	.tn-fuss__liste {
		gap: 0;
	}

	.tn-fuss__recht {
		gap: 0 24px;
	}

	.tn-fuss__liste a,
	.tn-fuss__recht a,
	.tn-fuss__unten a {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
	}

	.tn-fuss__titel {
		margin-bottom: 2px;
	}

	.tn-kopf .tn-knopf--kopf,
	.tn-hauptnav__liste a,
	.tn-hauptnav__knopf {
		min-height: 46px;
	}
}
