/* ==========================================================================
   Mein Leben – Frontend
   ========================================================================== */

@font-face {
	font-family: "Inter";
	src: url("../fonts/inter-latin-wght.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Fraunces";
	src: url("../fonts/fraunces-latin-wght.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

/* Bengalisch (SIL Open Font License, lokal; nur bengalische Zeichen, Latein fällt auf Inter/Fraunces zurück) */
@font-face {
	font-family: "Noto Serif Bengali";
	src: url("../fonts/noto-serif-bengali-bengali-400-normal.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1;
}

@font-face {
	font-family: "Noto Serif Bengali";
	src: url("../fonts/noto-serif-bengali-bengali-700-normal.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1;
}

@font-face {
	font-family: "Noto Sans Bengali";
	src: url("../fonts/noto-sans-bengali-bengali-400-normal.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1;
}

@font-face {
	font-family: "Noto Sans Bengali";
	src: url("../fonts/noto-sans-bengali-bengali-700-normal.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1;
}

:root {
	--bg: #2e2e2e;
	--fg: #b9b9b9;
	--fg-muted: #8a8a8a;
	--fg-strong: #e6e6e6;
	--accent: #a8bf44; /* nur für Kacheln! */
	--glass-bg: rgba(40, 40, 40, 0.52);
	--glass-border: rgba(185, 185, 185, 0.25);
	--line: 1.5px;
	--ease: cubic-bezier(0.2, 0.8, 0.2, 1);
	--dur-glass: 380ms;
	--font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-serif: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
	color-scheme: dark;
}

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

html {
	background: var(--bg);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font-sans);
	font-size: 1rem;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

a {
	color: inherit;
}

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

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* --------------------------------------------------------------------------
   Sprachumschalter
   -------------------------------------------------------------------------- */

.ml-lang {
	position: absolute;
	top: 20px;
	right: 24px;
	z-index: 5;
	display: flex;
	gap: 6px;
	align-items: center;
	font-size: 0.8rem;
	letter-spacing: 0.06em;
	color: var(--fg-muted);
}

.ml-lang__link {
	text-decoration: none;
	color: var(--fg-muted);
	padding: 4px 2px;
	transition: color 0.2s;
}

.ml-lang__link:hover,
.ml-lang__link.is-active {
	color: var(--fg);
}

.ml-lang__link.is-active {
	font-weight: 600;
}

/* --------------------------------------------------------------------------
   Kopfbereich
   -------------------------------------------------------------------------- */

.ml-hero {
	padding: clamp(72px, 13vh, 140px) 16px clamp(40px, 7vh, 72px);
	text-align: center;
}

.ml-hero__title {
	margin: 0;
	font-family: var(--font-serif);
	font-weight: 400;
	font-size: clamp(3.5rem, 9vw, 6rem);
	line-height: 1;
	letter-spacing: -0.02em;
	color: var(--fg);
}

.ml-hero__sub {
	margin: 0.9em 0 0;
	font-size: clamp(1rem, 1.6vw, 1.15rem);
	letter-spacing: 0.02em;
	color: var(--fg-muted);
}

/* --------------------------------------------------------------------------
   Zeitstrahl – gemeinsame Elemente
   -------------------------------------------------------------------------- */

.ml-events {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ml-event__year {
	display: block;
	font-size: 0.8rem;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.04em;
	color: var(--fg-muted);
	white-space: nowrap;
}

.ml-event__year[hidden] {
	display: none;
}

.ml-event__when {
	margin: 0 0 3px;
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	color: var(--fg-muted);
}

.ml-event__title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.3;
	color: var(--fg);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
}

.ml-tile {
	display: flex;
	gap: 8px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 2px;
	background: transparent;
	cursor: pointer;
	font: inherit;
	color: inherit;
	-webkit-tap-highlight-color: transparent;
	transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), opacity 0.4s var(--ease), translate 0.4s var(--ease);
}

.ml-tile__cell {
	display: block;
	flex: none;
	height: 100%;
	border-radius: 2px;
	background: var(--accent);
	overflow: hidden;
}

.ml-tile__media {
	display: block;
	width: 100%;
	height: 100%;
	transition: filter var(--dur-glass) var(--ease), transform var(--dur-glass) var(--ease);
}

.ml-tile__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	/* Keine Tönung mehr: Die Bilder sind fertig gestaltete Collagen und erscheinen in Originalfarben. */
}

/* Platzhalter-Kachel: Akzentfläche mit dezentem Diagonalmuster */
.ml-tile__ph {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background:
		repeating-linear-gradient(135deg, rgba(31, 35, 20, 0.07) 0 2px, transparent 2px 14px),
		var(--accent);
	color: rgba(31, 35, 20, 0.5);
}

.ml-tile__ph .ml-icon {
	width: 34px;
	height: 34px;
}

/* Aufgeklappt: Foto unscharf */
.ml-tile.is-open .ml-tile__media {
	filter: blur(12px) brightness(0.85);
	transform: scale(1.08);
}

@media (hover: hover) {
	.ml-tile:not(.is-open):hover {
		transform: translateY(-3px);
		box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
	}

	.ml-tile:not(.is-open):hover .ml-tile__media {
		filter: blur(2px);
	}
}

/* --------------------------------------------------------------------------
   Zeitstrahl – JS-Layout (Positionen setzt timeline.js)
   -------------------------------------------------------------------------- */

.js .ml-timeline {
	position: relative;
	width: 100%;
	min-height: calc(var(--ml-count, 6) * 230px + 200px);
}

.js .ml-timeline:not(.is-ready) .ml-events,
.js .ml-timeline:not(.is-ready) .ml-lines {
	visibility: hidden;
}

.js .ml-lines {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 2;
	overflow: visible;
	pointer-events: none;
}

.ml-lines .ml-mainline,
.ml-lines .ml-branch {
	fill: none;
	stroke-width: var(--line);
	stroke-linecap: round;
}

.ml-lines .ml-branch {
	stroke: var(--fg);
	stroke-dasharray: 1 1;
	stroke-dashoffset: 1;
	transition: stroke-dashoffset 0.3s var(--ease);
}

.ml-lines .ml-branch.is-drawn {
	stroke-dashoffset: 0;
}

.js .ml-start {
	position: absolute;
	top: 0;
	left: 50%;
	z-index: 3;
	width: 10px;
	height: 10px;
	margin: -5px 0 0 -5px;
	border-radius: 50%;
	background: var(--fg);
}

/* Jedes <li> sitzt oben an seinem Ereignis (Höhe 0), die Kinder relativ dazu. */
.js .ml-event {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 0;
	scroll-margin-top: 20vh;
}

.js .ml-event__year,
.js .ml-event__head,
.js .ml-tile {
	position: absolute;
	top: 0;
	left: 0;
}

.js .ml-tile {
	z-index: 1;
}

.js .ml-event__head {
	z-index: 1;
}

.js .ml-event.is-left .ml-event__head {
	text-align: right;
}

.js .ml-event__year.is-repeat {
	display: none;
}

/* Einblenden beim Erreichen durch die Linie */
.js .ml-event .ml-event__year,
.js .ml-event .ml-event__head,
.js .ml-event .ml-tile {
	opacity: 0;
	translate: 0 12px;
}

.js .ml-event .ml-event__year,
.js .ml-event .ml-event__head {
	transition: opacity 0.4s var(--ease), translate 0.4s var(--ease);
}

.js .ml-event.is-visible .ml-event__year,
.js .ml-event.is-visible .ml-event__head,
.js .ml-event.is-visible .ml-tile {
	opacity: 1;
	translate: 0 0;
	transition-delay: calc(var(--ml-delay, 0ms) + 220ms);
}

.js .ml-event.is-visible .ml-tile:hover,
.js .ml-event.is-visible .ml-tile:focus-visible {
	transition-delay: 0ms;
}

/* Info-Text: mit JS nur für Screenreader/Suchmaschinen im DOM */
.js .ml-info {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Glas-Ebene
   -------------------------------------------------------------------------- */

.ml-glass {
	position: absolute;
	z-index: 10;
	overflow: hidden;
	border: 1px solid var(--glass-border);
	border-radius: 14px;
	background: var(--glass-bg);
	-webkit-backdrop-filter: blur(20px) saturate(120%);
	backdrop-filter: blur(20px) saturate(120%);
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
	color: var(--fg-strong);
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition:
		left var(--dur-glass) var(--ease),
		top var(--dur-glass) var(--ease),
		width var(--dur-glass) var(--ease),
		height var(--dur-glass) var(--ease),
		border-radius var(--dur-glass) var(--ease);
}

.ml-glass.is-collapsed {
	border-radius: 2px;
}

.ml-glass.no-anim {
	transition: none;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.ml-glass {
		background: rgba(46, 46, 46, 0.88);
	}
}

.ml-glass__inner {
	position: relative;
	padding: 22px 24px 24px;
	opacity: 0;
	transition: opacity 0.16s ease;
}

.ml-glass.is-expanded .ml-glass__inner {
	opacity: 1;
	transition: opacity 0.24s ease 0.16s;
}

.ml-glass__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 20px;
	height: 20px;
	color: var(--fg);
	opacity: 0.75;
}

.ml-glass__close .ml-icon {
	width: 20px;
	height: 20px;
}

.ml-glass__title {
	margin: 0 28px 4px 0;
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--fg-strong);
}

.ml-glass .ml-info__date {
	margin: 0 0 14px;
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fg);
}

.ml-glass .ml-info__text {
	font-size: 0.95rem;
	line-height: 1.6;
}

.ml-glass .ml-info__text p {
	margin: 0 0 0.8em;
}

.ml-glass .ml-info__text p:last-child {
	margin-bottom: 0;
}

.ml-glass a {
	color: var(--fg-strong);
	text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.ml-footer {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 28px;
	padding: 72px 16px 48px;
	text-align: center;
}

.ml-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 22px;
	border: 1px solid var(--fg);
	border-radius: 999px;
	color: var(--fg);
	text-decoration: none;
	font-size: 0.95rem;
	transition: background-color 0.2s, color 0.2s;
}

.ml-btn .ml-icon {
	width: 18px;
	height: 18px;
}

.ml-btn:hover {
	background: rgba(185, 185, 185, 0.1);
	color: var(--fg-strong);
}

.ml-social {
	display: flex;
	gap: 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ml-social a {
	display: block;
	padding: 4px;
	color: var(--fg);
	transition: color 0.2s, transform 0.2s var(--ease);
}

.ml-social a:hover {
	color: var(--fg-strong);
	transform: translateY(-2px);
}

.ml-social .ml-icon {
	display: block;
	width: 26px;
	height: 26px;
}

.ml-contact {
	margin: -8px 0 0;
	font-size: 0.9rem;
}

.ml-mail {
	color: var(--fg);
	text-decoration: none;
	transition: color 0.2s;
}

.ml-mail:hover {
	color: var(--fg-strong);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ml-legal-links {
	font-size: 0.8rem;
	color: var(--fg-muted);
}

.ml-legal-links a {
	color: var(--fg-muted);
	text-decoration: none;
}

.ml-legal-links a:hover {
	color: var(--fg);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Rechtsseiten
   -------------------------------------------------------------------------- */

.ml-legal {
	max-width: 720px;
	margin: 0 auto;
	padding: 88px 16px 64px;
}

.ml-legal__back {
	display: inline-block;
	margin-bottom: 40px;
	font-size: 0.9rem;
	color: var(--fg-muted);
	text-decoration: none;
}

.ml-legal__back:hover {
	color: var(--fg);
}

.ml-legal__body {
	margin-bottom: 56px;
	overflow-wrap: anywhere;
}

.ml-legal__body h1 {
	margin: 0 0 32px;
	font-family: var(--font-serif);
	font-weight: 400;
	font-size: clamp(2.2rem, 6vw, 3.2rem);
	line-height: 1.1;
	color: var(--fg);
}

.ml-legal__body h2 {
	margin: 2em 0 0.6em;
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--fg-strong);
}

.ml-legal__body a {
	text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Ohne JavaScript: lineare Liste
   -------------------------------------------------------------------------- */

.no-js .ml-timeline {
	position: relative;
	max-width: 560px;
	margin: 0 auto;
	padding: 24px 16px 40px 56px;
}

.no-js .ml-timeline::before {
	content: "";
	position: absolute;
	top: 24px;
	bottom: 0;
	left: 24px;
	width: var(--line);
	background: linear-gradient(var(--fg) calc(100% - 120px), transparent);
}

.no-js .ml-lines {
	display: none;
}

.no-js .ml-start {
	position: absolute;
	top: 19px;
	left: 20px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--fg);
}

.no-js .ml-event {
	position: relative;
	margin: 0 0 56px;
}

.no-js .ml-event::before {
	content: "";
	position: absolute;
	top: 0.7em;
	left: -32px;
	width: 24px;
	height: var(--line);
	background: var(--fg);
}

.no-js .ml-event__title {
	margin: 4px 0 10px;
	-webkit-line-clamp: unset;
}

.no-js .ml-tile {
	width: 100%;
	max-width: 420px;
	cursor: default;
}

.no-js .ml-tile__cell {
	flex: 1 1 0;
	height: auto;
}

.no-js .ml-info {
	margin-top: 14px;
}

.no-js .ml-info__date {
	margin: 0 0 6px;
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Mobil
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
	.ml-lang {
		top: 14px;
		right: 16px;
	}

	.ml-glass__inner {
		padding: 18px 18px 20px;
	}
}

/* --------------------------------------------------------------------------
   Bengalisch (bn)
   -------------------------------------------------------------------------- */

/* Rolle von Inter: Fließtext */
html:lang(bn) body,
html:lang(bn) button,
:lang(bn) {
	font-family: "Noto Sans Bengali", var(--font-sans);
}

/* Rolle von Fraunces: Überschriften und Kacheltitel */
html:lang(bn) .ml-hero__title,
html:lang(bn) .ml-event__title,
html:lang(bn) .ml-glass__title,
html:lang(bn) .ml-legal__body h1,
html:lang(bn) .ml-legal__body h2 {
	font-family: "Noto Serif Bengali", var(--font-serif);
}

/* Bengalische Zeichen brauchen mehr Zeilenhöhe; keine Sperrung, keine Versalien. */
:lang(bn),
:lang(bn) * {
	letter-spacing: 0 !important;
	text-transform: none !important;
	line-height: 1.75 !important;
}

/* --------------------------------------------------------------------------
   Reduzierte Bewegung
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		transition-delay: 0ms !important;
		animation: none !important;
		scroll-behavior: auto !important;
	}

	.ml-glass {
		transition: opacity 0.2s ease !important;
	}
}

/* --------------------------------------------------------------------------
   Druck: lineare Liste mit allen Texten
   -------------------------------------------------------------------------- */

@media print {
	body {
		background: #fff;
		color: #000;
	}

	.ml-lang,
	.ml-lines,
	.ml-start,
	.ml-glass,
	.ml-social,
	.ml-btn {
		display: none !important;
	}

	.ml-timeline {
		height: auto !important;
		min-height: 0 !important;
	}

	.ml-event {
		position: static !important;
		height: auto !important;
		break-inside: avoid;
		margin: 0 0 28px !important;
	}

	.ml-event__year,
	.ml-event__head,
	.ml-tile,
	.ml-info {
		position: static !important;
		opacity: 1 !important;
		translate: none !important;
		width: auto !important;
		height: auto !important;
		max-width: 60% !important;
		clip: auto !important;
		clip-path: none !important;
		margin: 0 0 6px !important;
		white-space: normal !important;
		overflow: visible !important;
		color: #000 !important;
	}

	.ml-tile {
		width: 240px !important;
	}

	.ml-tile__media {
		filter: none !important;
		transform: none !important;
	}
}
