/* ============================================================
   historian-theme — main.css
   ============================================================ */


/* ============================================================
   CHUNK 2: CSS Custom Properties (Design-Variablen)
   Alle Farben, Schriften und Größen zentral an einem Ort.
   Will man die Hauptfarbe ändern, reicht es diese eine Zeile
   zu ändern — alles andere passt sich automatisch an.
   ============================================================ */

:root {
	/* Farben */
	--color-primary:    #1e3a5f; /* Dunkelblau — seriös, vertrauenswürdig */
	--color-accent:     #c17f24; /* Warmes Amber — Akzent, Buttons, Links */
	--color-bg:         #faf9f7; /* Warmes Off-White — wie altes Papier */
	--color-bg-alt:     #f0ede8; /* Etwas dunkleres Off-White — Abwechslung */
	--color-text:       #1a1a1a; /* Fast-Schwarz — Fließtext */
	--color-text-muted: #5a5a5a; /* Grau — Nebentexte */
	--color-white:      #ffffff;
	--color-shadow:     rgba(30, 58, 95, 0.10);

	/* Schriften */
	--font-heading: 'Playfair Display', Georgia, serif;
	--font-body:    'IBM Plex Sans', system-ui, sans-serif;

	/* Layout */
	--max-width:         1100px;
	--img-border-radius: 4px;
}


/* ============================================================
   CHUNK 3: Reset
   Setzt Browser-Standard-Styles auf Null, damit die Seite
   in Chrome, Firefox und Safari gleich aussieht.
   ============================================================ */

*, *::before, *::after {
	box-sizing: border-box; /* Abstände werden INNEN berechnet, nicht außen */
}

* {
	margin: 0;
	padding: 0;
}

html {
	font-size: 16px;
}

body {
	background-color: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	-webkit-font-smoothing: antialiased;     /* Schrift auf Mac/iOS weicher */
	-moz-osx-font-smoothing: grayscale;      /* Schrift auf Mac/Firefox weicher */
	text-rendering: optimizeLegibility;      /* Browser optimiert Lesbarkeit */
}

img {
	max-width: 100%;  /* Bilder niemals breiter als ihr Container */
	height: auto;
	display: block;
}

a, button {
	cursor: pointer;
}


/* ============================================================
   CHUNK 3: Typografie
   ============================================================ */

/* --- Überschriften (Playfair Display, Serifen-Schrift) --- */

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-heading);
	font-weight: 700;
	line-height: 1.15;        /* Wenig Zeilenabstand — Überschriften brauchen das */
	color: var(--color-primary);
	letter-spacing: -0.02em;  /* Buchstaben leicht enger — wirkt professioneller bei großen Größen */
}

h1 { font-size: 2.5rem; }   /* Haupttitel der Seite */
h2 { font-size: 2rem; }     /* Abschnitts-Überschriften */
h3 { font-size: 1.65rem; }
h4 { font-size: 1.35rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

/* Auf großen Bildschirmen dürfen Überschriften größer sein */
@media (min-width: 1025px) {
	h1 { font-size: 3.5rem; }
	h2 { font-size: 2.5rem; }
	h3 { font-size: 1.85rem; }
}


/* --- Fließtext (IBM Plex Sans, serifenlos) --- */

p {
	font-family: var(--font-body);
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.65;  /* Großzügiger Zeilenabstand — wichtig für lange Lesetexte */
	color: var(--color-text);
}

a {
	font-family: var(--font-body);
	color: var(--color-accent);
	text-decoration: underline;
}

a:hover {
	opacity: 0.75;
}

strong {
	font-weight: 600;
}

em {
	font-style: italic;
}


/* ============================================================
   CHUNK 3: Hilfsklassen (Utilities)
   ============================================================ */

/* Für Screenreader sichtbar, auf dem Bildschirm unsichtbar — Barrierefreiheit */
.visually-hidden {
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

/* Komplett verstecken */
.hidden {
	display: none;
	visibility: hidden;
}

/* Verhindert Scrollen im Hintergrund wenn Burger-Menü offen ist */
.no-scroll {
	overflow: hidden;
	height: 100%;
}


/* ============================================================
   CHUNK 3: Buttons
   ============================================================ */

.btn {
	display: inline-block;
	background-color: var(--color-accent);
	color: var(--color-white);
	font-family: var(--font-body);
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
	padding: 12px 22px;
	border-radius: 4px;
	border: none;
	cursor: pointer;
	align-self: flex-start;
	transition: opacity 0.15s ease;
}

.btn:hover {
	opacity: 0.85;
	color: var(--color-white);
}


/* ============================================================
   CHUNK 4: Header & Navigation
   ============================================================ */

/* --- Header-Leiste --- */

.site-header {
	width: 100%;
	background-color: var(--color-white);
	box-shadow: 0 1px 6px var(--color-shadow);
	position: sticky; /* Klebt oben wenn man runterscrollt */
	top: 0;
	z-index: 100;     /* Liegt über dem Seiteninhalt */
}

.site-header__inner {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 24px;
	height: 72px;
}

/* --- Logo / Seitenname --- */

.site-logo {
	font-family: var(--font-heading);
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--color-primary);
	text-decoration: none;
	letter-spacing: -0.01em;
	flex-shrink: 0; /* Logo darf nie kleiner werden */
}

.site-logo:hover {
	opacity: 0.8;
}

/* --- Navigation: gemeinsame Basis --- */

.site-nav ul {
	list-style: none;
}

.site-nav a {
	font-family: var(--font-body);
	font-weight: 600;
	font-size: 1.05rem;
	color: var(--color-text);
	text-decoration: none;
	border-radius: 4px;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.site-nav a.current {
	color: var(--color-accent); /* Aktuelle Seite in Amber hervorheben */
}

/* --- Burger-Button (☰) --- */

.burgerNavi {
	background: transparent;
	border: none;
	display: flex;
	align-items: center;
	padding: 8px;
	cursor: pointer;
}


/* ============================================================
   MOBIL (bis 1024px): Drawer-Menü von rechts
   ============================================================ */

@media (max-width: 1024px) {

	.burgerNavi {
		display: block;
	}

	/* Schließen-Button und Startseite-Link: nur im Drawer sichtbar */
	#closeNavi,
	#homeLink {
		background: transparent;
		border: none;
		cursor: pointer;
	}

	#homeLink {
		display: flex;
		align-items: center;
		gap: 8px;
		font-family: var(--font-body);
		font-size: 1.1rem;
		font-weight: 600;
		color: var(--color-primary);
		text-decoration: none;
		margin-bottom: 48px;
	}

	#closeNavi {
		position: absolute;
		top: 24px;
		right: 24px;
		display: block;
	}

	/* Menü standardmäßig versteckt */
	#mainNavi {
		position: fixed;
		top: 0;
		right: 0;
		height: 100vh;
		width: 85%;
		max-width: 360px;
		background-color: var(--color-white);
		padding: 48px 32px 32px;
		overflow-y: auto;
		box-shadow: -2px 0 16px var(--color-shadow);
		display: none;
		visibility: hidden;
		flex-direction: column;
		z-index: 150;
	}

	/* JS fügt .open hinzu wenn Burger geklickt wird */
	#mainNavi.open {
		display: flex;
		visibility: visible;
	}

	#mainNavi > div {
		display: flex;
		flex-direction: column;
	}

	/* Menü-Einträge (erste Ebene) */
	#mainNavi ul > li {
		margin-bottom: 24px;
	}

	#mainNavi ul > li > a,
	#mainNavi ul > li > .menu-item > a {
		font-size: 1.4rem;
		padding: 4px 0;
		display: block;
	}

	/* Unterseiten (zweite Ebene) */
	#mainNavi ul ul {
		margin-top: 8px;
		padding-left: 16px;
	}

	#mainNavi ul ul li {
		margin-bottom: 10px;
	}

	#mainNavi ul ul li a {
		font-size: 1.05rem;
		color: var(--color-text-muted);
	}

	/* Auf sehr kleinen Bildschirmen nimmt der Drawer die volle Breite */
	@media (max-width: 559px) {
		#mainNavi {
			width: 100%;
			max-width: 100%;
		}
	}
}


/* ============================================================
   DESKTOP (ab 1025px): Horizontale Navigationsleiste
   ============================================================ */

@media (min-width: 1025px) {

	/* Burger und Drawer-Elemente auf Desktop verstecken */
	.burgerNavi,
	#closeNavi,
	#homeLink {
		display: none;
		visibility: hidden;
	}

	#mainNavi {
		display: flex;
		align-items: center;
		height: 100%;
	}

	#mainNavi > div {
		display: flex;
		align-items: center;
		height: 100%;
	}

	/* Erste Ebene: horizontal nebeneinander */
	#mainNavi > div > ul {
		display: flex;
		align-items: center;
		height: 100%;
		gap: 2px;
	}

	#mainNavi > div > ul > li {
		position: relative; /* Anker für absolut-positioniertes Dropdown */
		display: flex;
		align-items: center;
		height: 100%;
	}

	/* .menu-item wird von naviDesktop.js dynamisch erzeugt */
	.menu-item {
		display: flex;
		align-items: center;
		height: 100%;
	}

	#mainNavi a {
		padding: 8px 14px;
		display: block;
		color: var(--color-text);
	}

	#mainNavi a:hover,
	#mainNavi a:focus {
		background-color: var(--color-bg-alt);
		color: var(--color-primary);
	}

	/* Dropdown-Toggle-Button (▾) — von naviDesktop.js erzeugt */
	.submenu-toggle {
		background: transparent;
		border: none;
		padding: 4px 4px 4px 0;
		cursor: pointer;
		color: var(--color-text-muted);
		font-size: 0.85rem;
		display: flex;
		align-items: center;
		height: 100%;
	}

	/* Dropdown-Untermenü */
	#mainNavi li.has-submenu > ul {
		position: absolute;
		top: 100%;
		left: 0;
		background-color: var(--color-white);
		box-shadow: 0 4px 16px var(--color-shadow);
		border-radius: 4px;
		min-width: 220px;
		padding: 8px 0;
		z-index: 200;
	}

	#mainNavi li.has-submenu > ul li {
		display: block;
	}

	#mainNavi li.has-submenu > ul li a {
		padding: 10px 18px;
		font-size: 0.95rem;
		font-weight: 500;
		width: 100%;
	}
}


/* --- Overlay-Hintergrund (wird von naviMobile.js als <div> erzeugt) --- */

#overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.30);
	z-index: 140; /* unter dem Menü (150), über dem Inhalt (100) */
}


/* ============================================================
   CHUNK 5: Inhaltsseite (page.php) + Footer
   ============================================================ */

/* --- Basis: <main> --- */

main {
	min-height: 60vh; /* Seite füllt mindestens 60% der Bildschirmhöhe */
}


/* --- Seiteneinleitung (.page-intro) --- */
/* Warm-beige Hintergrund mit dem Seitentitel — gibt sofort Orientierung */

.page-intro {
	background-color: var(--color-bg-alt);
	padding: 48px 24px;
}

.page-intro > div {
	max-width: var(--max-width);
	margin: 0 auto;
}

.page-intro h1 {
	color: var(--color-primary);
	/* Überschriften-Größe wird bereits global in Chunk 3 definiert */
}

@media (min-width: 1025px) {
	.page-intro {
		padding: 72px 0;
	}
}


/* --- Inhaltsbereich (.page-content) --- */
/* Schmaler als die volle Breite: 720px für optimale Lesbarkeit (≈ 70 Zeichen/Zeile) */

.page-content {
	padding: 48px 24px;
	background-color: var(--color-bg);
}

.page-content > div {
	max-width: 720px; /* Bewusst schmal — lange Forschungstexte brauchen das */
	margin: 0 auto;
}

@media (min-width: 1025px) {
	.page-content {
		padding: 64px 0;
	}
}

/* Abstand zwischen aufeinanderfolgenden Absätzen */
.page-content p + p {
	margin-top: 1.2rem;
}

/* Überschriften im Inhalt: Abstand nach oben (zum vorigen Abschnitt) */
.page-content h2,
.page-content h3,
.page-content h4,
.page-content h5 {
	margin-top: 2.5rem;
	margin-bottom: 0.75rem;
}

/* Erste Überschrift braucht keinen Abstand nach oben */
.page-content h2:first-child,
.page-content h3:first-child {
	margin-top: 0;
}

/* Listen (Aufzählung und Nummerierung) */
.page-content ul,
.page-content ol {
	padding-left: 1.5rem;
	margin: 1.2rem 0;
}

.page-content li {
	margin-bottom: 0.5rem;
	line-height: 1.65;
	font-family: var(--font-body);
	color: var(--color-text);
}

/* Blockquote — für historische Quellenangaben und Zitate */
/* Linker Amber-Balken + kursiv + leicht gedimmt — klassische Zitat-Gestaltung */
.page-content blockquote {
	border-left: 3px solid var(--color-accent);
	padding: 4px 0 4px 24px;
	margin: 2rem 0;
}

.page-content blockquote p {
	color: var(--color-text-muted);
	font-style: italic;
	font-size: 1.1rem;
	line-height: 1.7;
}

/* Horizontale Trennlinie */
.page-content hr {
	border: none;
	border-top: 1px solid var(--color-bg-alt);
	margin: 2.5rem 0;
}

/* Bilder im Inhalt */
.page-content figure {
	margin: 2rem 0;
}

.page-content figure img {
	border-radius: var(--img-border-radius);
	width: 100%;
}

/* Bildunterschrift */
.page-content figcaption {
	font-size: 0.875rem;
	color: var(--color-text-muted);
	margin-top: 8px;
	font-style: italic;
	font-family: var(--font-body);
}


/* ============================================================
   CHUNK 5: Footer (.site-footer)
   ============================================================ */

.site-footer {
	background-color: var(--color-white);
	box-shadow: 0 -1px 6px var(--color-shadow); /* Shadow zeigt nach OBEN */
}

.site-footer__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 32px 24px;
	text-align: center;
}

.site-footer nav a {
	font-family: var(--font-body);
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--color-text-muted);
	text-decoration: none;
}

.site-footer nav a:hover {
	color: var(--color-text);
	text-decoration: underline;
	opacity: 1;
}

.site-footer p {
	font-size: 0.875rem;
	color: var(--color-text-muted);
}


/* ============================================================
   CHUNK 6: Homepage — Hero + Teaser-Abschnitte
   ============================================================ */

/* --- Hero-Bereich --- */

.hero {
	background-color: var(--color-bg);
	padding: 48px 24px;
}

.hero__inner {
	display: flex;
	flex-direction: column; /* Handy: Text oben, Bild unten */
	gap: 40px;
	max-width: var(--max-width);
	margin: 0 auto;
}

@media (min-width: 1025px) {
	.hero {
		padding: 88px 0;
	}

	.hero__inner {
		flex-direction: row;  /* Desktop: Text links, Bild rechts */
		align-items: center;
		gap: 72px;
	}

	.hero__text,
	.hero__image {
		flex: 1; /* Beide nehmen je genau die Hälfte */
	}
}

/* Hero-Überschrift: größer als auf normalen Seiten */
.hero h1 {
	font-size: 2.75rem;
	margin-bottom: 16px;
	line-height: 1.1;
}

@media (min-width: 1025px) {
	.hero h1 {
		font-size: 4.5rem; /* Playfair Display bei dieser Größe: beeindruckend */
	}
}

.hero__text {
	display: flex;
	flex-direction: column;
}

/* Unterzeile (kleiner als h1, aber auffälliger als Fließtext) */
.hero__subline {
	font-family: var(--font-body);
	font-size: 1.2rem;
	font-weight: 600;
	color: var(--color-primary);
	margin-bottom: 20px;
	line-height: 1.4;
}

/* Einleitungstext */
.hero__intro {
	font-size: 1.05rem;
	color: var(--color-text-muted);
	line-height: 1.7;
	margin-bottom: 36px;
}

/* Bild im Hero */
.hero__image figure img {
	border-radius: var(--img-border-radius);
	width: 100%;
	height: auto;
}


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

.teaser-section {
	background-color: var(--color-bg);  /* Standard: warm Off-White */
	padding: 56px 24px;
}

.teaser-section--alt {
	background-color: var(--color-bg-alt); /* Abwechslung: etwas dunkler beige */
}

@media (min-width: 1025px) {
	.teaser-section {
		padding: 80px 0;
	}
}

/* Teaser-Container: zentriert, max-width */
.teaser {
	display: flex;
	flex-direction: column; /* Handy: Bild oben, Text unten */
	gap: 32px;
	max-width: var(--max-width);
	margin: 0 auto;
}

@media (min-width: 1025px) {
	.teaser {
		flex-direction: row;  /* Desktop: nebeneinander */
		align-items: center;
		gap: 72px;
	}

	/* Bild rechts: row-reverse dreht die Reihenfolge visuell um —
	   ohne das HTML anzufassen. DOM-Reihenfolge bleibt: Bild, Text. */
	.teaser--img-right {
		flex-direction: row-reverse;
	}

	.teaser__image {
		flex: 1;
		max-width: 46%;
	}

	.teaser__text {
		flex: 1;
	}
}

.teaser__text {
	display: flex;
	flex-direction: column;
}

.teaser h2 {
	margin-bottom: 16px;
}

.teaser p {
	font-size: 1.1rem;
	line-height: 1.65;
	margin-bottom: 28px;
	color: var(--color-text);
}

/* Bild im Teaser */
.teaser__image figure img {
	border-radius: var(--img-border-radius);
	width: 100%;
	height: auto;
}


/* ============================================================
   CHUNK 7: Politur — Fokus, Scroll, Druck, Feinheiten
   ============================================================ */

/* --- Smooth Scroll: eine Zeile, große Wirkung --- */

html {
	scroll-behavior: smooth;
}


/* --- Fokus-Ring: Tastatur-Navigation sichtbar machen --- */
/* :focus-visible zeigt den Ring NUR bei Tastatur, nicht bei Mausklick */

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


/* --- Textmarkierung in Amber (statt Browser-Standard-Blau) --- */

::selection {
	background-color: var(--color-accent);
	color: var(--color-white);
}


/* --- Kleiner Abstand vor Buttons in der Seiteneinleitung (404-Seite) --- */

.page-intro .btn {
	margin-top: 24px;
}


/* --- Druckstile: für ausgedruckte Forschungsseiten --- */

@media print {
	/* Navigation und Footer auf Papier nicht nötig */
	.site-header,
	.site-footer,
	.burgerNavi,
	#mainNavi {
		display: none !important;
	}

	body {
		background: white;
		color: black;
		font-size: 12pt;
	}

	/* Farbige Hintergründe entfernen — spart Tinte */
	.page-intro,
	.hero,
	.teaser-section,
	.teaser-section--alt {
		background: white !important;
	}

	/* Überschriften und Links schwarz */
	h1, h2, h3, h4, h5, h6 {
		color: black;
	}

	a {
		color: black;
		text-decoration: underline;
	}

	/* Seiteninhalt bekommt mehr Breite — kein Menü das Platz wegnimmt */
	.page-content > div {
		max-width: 100%;
	}
}
