/* =========================================================================
   Base — Resets, Typo, Links, Container
   Mobile-first. Desktop-Anpassungen unten.
   ========================================================================= */

/* Reset / Normalize (minimal) -------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

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

/* Bulletproof Scroll Margin for Sticky Navbars on Desktop and Mobile */
:target,
section[id],
article[id],
div[id],
main > section {
	scroll-margin-top: calc(75px + env(safe-area-inset-top, 0px));
}

@media (max-width: 767px) {
	:target,
	section[id],
	article[id],
	div[id],
	main > section {
		scroll-margin-top: calc(65px + env(safe-area-inset-top, 0px));
	}
}

body {
	font-family: var(--ff-sans);
	font-size: var(--fs-body);
	font-weight: var(--fw-regular);
	line-height: var(--lh);
	color: var(--c-fg);
	background: var(--c-bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	min-height: 100vh;
	min-height: 100dvh;
}

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

ul,
ol {
	list-style: none;
}

/* Typografie ------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
	font-family: var(--ff-sans);
	font-weight: var(--fw-bold);
	line-height: var(--lh-tight);
	color: var(--c-fg);
	letter-spacing: -0.02em;
}

h1 {
	font-size: var(--fs-hero);
	line-height: var(--lh-tight);
}

h2 {
	font-size: var(--fs-h2);
	line-height: var(--lh-snug);
}

h3 {
	font-size: var(--fs-h3);
	line-height: var(--lh-snug);
}

p {
	max-width: 65ch;
}

/* Links ------------------------------------------------------------------ */
a {
	color: var(--c-fg);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition:
		color var(--t-hover),
		text-decoration-color var(--t-hover);
}

a:hover,
a:focus-visible {
	color: var(--c-accent);
	text-decoration-color: var(--c-accent);
}

a:focus-visible {
	outline: 2px solid var(--c-accent);
	outline-offset: 3px;
}

/* Akzent — Inline-Bold mit Akzentfarbe ----------------------------------- */
mark,
.accent {
	color: var(--c-accent);
	background: transparent;
}

/* Container -------------------------------------------------------------- */
.container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: var(--space-sm);
}

.container--narrow {
	max-width: var(--container-narrow);
}

/* Section-Rhythm --------------------------------------------------------- */
section {
	padding-block: var(--space-xl);
}

section + section {
	border-top: var(--border-w) solid var(--c-border-soft);
}

/* Section-Header (Nummer + Eyebrow) -------------------------------------- */
.section-header {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
	margin-bottom: var(--space-lg);
}

.section-header__eyebrow {
	font-size: var(--fs-small);
	font-weight: var(--fw-bold);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--c-accent);
}

.section-header__title {
	font-size: var(--fs-h2);
	font-weight: var(--fw-bold);
}

.section-header__intro {
	color: var(--c-muted);
	max-width: 60ch;
}

/* Schriftauswahl-Block (für Klarheit im HTML) --------------------------- */
.font-mono {
	font-family: var(--ff-mono);
}

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

.text-small {
	font-size: var(--fs-small);
}

/* Visually-hidden (für a11y-Labels) ------------------------------------ */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Skip-Link ------------------------------------------------------------- */
.skip-link {
	position: fixed;
	top: 0;
	left: var(--space-sm);
	z-index: 1000;
	padding: var(--space-sm) var(--space-md);
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	background: var(--c-fg);
	color: var(--c-bg);
	text-decoration: none;
	font-weight: var(--fw-bold);
	/* Standard: unsichtbar nach oben verschoben */
	transform: translateY(-150%);
	transition: transform var(--t-hover);
}

.skip-link:focus,
.skip-link:focus-visible {
	transform: translateY(0);
	outline: 2px solid var(--c-accent);
	outline-offset: 2px;
}

/* Footer ----------------------------------------------------------------- */
.site-footer {
	border-top: var(--border-w) solid var(--c-border-soft);
	padding-block: var(--space-lg);
	font-size: var(--fs-small);
	color: var(--c-muted);
}

.site-footer__inner {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
}

.site-footer__links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-md);
}

.site-footer__links a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding-block: var(--space-xs);
}

/* Touch-Targets: alle interaktiven Elemente mind. 44x44 px (WCAG 2.5.5) */
a,
button,
input[type="submit"],
input[type="button"],
[role="button"] {
	min-height: 44px;
}

/* Inline-Links ohne Button-Form brauchen das min-height nicht,
   betrifft nur Block- und Listen-Links. */
.site-footer__links a,
.tag-list .tag,
.card__cta {
	/* Inline-Listen-Links dürfen kleiner sein, da padding schon
     Klickfläche schafft. */
	min-height: auto;
}

/* Desktop ab 768px ------------------------------------------------------ */
@media (min-width: 768px) {
	.container {
		padding-inline: var(--space-lg);
	}

	section {
		padding-block: var(--space-2xl);
	}

	.site-footer__inner {
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}
}
