/**
 * UrIS-TKDV — Seite "Materialien & Links"
 *
 * Ergänzt static-page.css. Alle Farben stammen aus colors.css (Token).
 * Styles sind über die Body-Klasse .materialien-page gescoped, damit sie
 * keine anderen Info-Seiten beeinflussen (gemeinsame .page-content-Regeln).
 */

/* Sanftes Scrollen beim Anker-Sprung der Themen-Chips:
   Desktop scrollt innerhalb von .page-content, Mobil im Dokument. */
.materialien-page .page-content {
	scroll-behavior: smooth;
}

html:has(.materialien-page) {
	scroll-behavior: smooth;
}

/* Intro */
.materialien-page .page-intro {
	margin: 0 0 0.5rem;
	color: var(--color-text-muted);
	font-size: 0.95rem;
}

/* ============================================================
 * THEMEN-CHIP-LEISTE (Schnellsprung)
 * ============================================================ */
.topic-nav {
	position: sticky;
	top: 0;
	z-index: 5;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 -16px 1.25rem;
	padding: 9px 16px;
	background: var(--color-bg-surface);
	border-bottom: 1px solid var(--color-border);
}

/* Schließt die 9px-Lücke über der sticky Leiste (= padding-top von
   .page-content). Ohne diese Kappe scheinen scrollende Karten in diesem
   schmalen Streifen durch. Höhe = padding-top von .page-content (static-page.css). */
.materialien-page .topic-nav::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
	height: 9px;
	background: var(--color-bg-surface);
}

.topic-chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: var(--color-chip-bg);
	color: var(--color-primary-hover);
	border: 1px solid var(--color-chip-border);
	border-radius: 20px;
	padding: 5px 12px;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.topic-chip:hover,
.topic-chip:focus-visible {
	background: var(--color-primary);
	color: var(--color-white);
	border-color: var(--color-primary);
	outline: none;
}

/* ============================================================
 * THEMEN-ABSCHNITTE
 * ============================================================ */
.link-section {
	/* Offset, damit Anker-Sprünge nicht unter der Chip-Leiste landen */
	scroll-margin-top: 72px;
	margin-bottom: 1.75rem;
}

.link-section__title {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin: 0;
	min-width: 0;
	font-size: 0.92rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--color-brand-navy);
	overflow-wrap: anywhere;
	-webkit-hyphens: auto;
	hyphens: auto;
}

.link-section__title .bi {
	font-size: 1.05rem;
	color: var(--color-secondary);
}

.link-section__intro {
	margin: 3px 0 0.75rem;
	font-size: 0.88rem;
	color: var(--color-text-muted);
}

.link-subgroup__label {
	margin: 0.25rem 0 0.5rem 2px;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--color-text-muted);
}

/* ============================================================
 * LINK-KARTEN
 * ============================================================ */
.link-card {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	min-height: 44px;
	padding: 12px 14px;
	margin-bottom: 10px;
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: 0.65rem;
	color: var(--color-text);
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.link-card:hover {
	border-color: var(--color-primary);
	box-shadow: 0 4px 14px rgba(var(--rgb-slate-shadow), 0.18);
}

.link-card:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
}

.link-card:active {
	transform: translateY(1px);
}

.link-card__icon {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 0.5rem;
	background: var(--color-bg-surface-alt);
	color: var(--color-brand-navy);
	font-size: 1.15rem;
}

.link-card__body {
	flex: 1;
	min-width: 0;
}

.link-card__title {
	display: block;
	font-weight: 600;
	line-height: 1.3;
	color: var(--color-brand-navy);
	/* Deutsche Silbentrennung bei langen Wörtern (z. B. "Kriegsdienstverweigerung").
	   lang="de" ist im Template gesetzt; greift v. a. in schmaler (mobiler) Ansicht. */
	overflow-wrap: break-word;
	-webkit-hyphens: auto;
	hyphens: auto;
}

.link-card__desc {
	display: block;
	margin-top: 2px;
	font-size: 0.9rem;
	line-height: 1.45;
	color: var(--color-text-muted);
	overflow-wrap: break-word;
	-webkit-hyphens: auto;
	hyphens: auto;
}

.link-card__meta {
	flex-shrink: 0;
	align-self: center;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--color-text-muted);
}

.link-card__meta .bi {
	font-size: 0.95rem;
}

/* Typ-Badge (einheitliche, on-brand Optik; Typ-Cue zusätzlich über das Icon) */
.media-badge {
	padding: 2px 8px;
	border-radius: 20px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	white-space: nowrap;
	background: var(--color-bg-surface-alt);
	color: var(--color-text-muted);
	border: 1px solid var(--color-border);
}

/* ============================================================
 * MOBIL (≤ 1349px)
 * ============================================================ */
@media (max-width: 1349px) {
	.topic-nav {
		/* Chips umbrechen statt horizontal scrollen: kein horizontaler Überlauf,
		   konsistent mit den übrigen Info-Seiten (nur Hinein-, kein Herauszoomen) */
		position: static;
		flex-wrap: wrap;
		overflow: visible;
		margin: 0 0 1.25rem;
		padding: 9px 0;
		/* Anker-Sprung (Floating-Button) landet unter der sticky Navbar */
		scroll-margin-top: 72px;
	}

	/* Statische Leiste auf Mobil — keine Lücke, daher keine graue Kappe nötig. */
	.topic-nav::before {
		display: none;
	}

	.link-card__desc {
		font-size: 0.95rem;
	}
}

/* ============================================================
 * FLOATING "ZU DEN THEMEN" (nur Mobil)
 * Auf Desktop ausgeblendet — dort ist die Chip-Leiste sticky.
 * ============================================================ */
.mat-top-link {
	display: none;
}

@media (max-width: 1349px) {
	.mat-top-link {
		position: fixed;
		right: 16px;
		bottom: 16px;
		z-index: 1010;
		display: inline-flex;
		align-items: center;
		gap: 6px;
		padding: 9px 14px;
		border-radius: 999px;
		background: var(--color-brand-navy);
		color: var(--color-white);
		font-size: 0.85rem;
		font-weight: 600;
		text-decoration: none;
		box-shadow: 0 6px 18px rgba(var(--rgb-brand-navy), 0.35);
		transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
	}

	.mat-top-link .bi {
		font-size: 1rem;
	}

	.mat-top-link:active {
		transform: translateY(1px);
	}

	/* Nahe am Seitenanfang ausgeblendet (per JS body.at-top).
	   Ohne JS bleibt der Button sichtbar und voll funktionsfähig. */
	body.at-top .mat-top-link {
		opacity: 0;
		visibility: hidden;
		transform: translateY(8px);
		pointer-events: none;
	}
}
