/* ==========================================================================
   tbx – Nachbau von tbx.me. Masse vom Original bei 1440 × 900 abgenommen.
   ========================================================================== */

:root {
	--tbx-footer-h: 51px;
	--tbx-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

body {
	-webkit-font-smoothing: antialiased;
}

/* Keine automatischen Blockabstände zwischen Header, Inhalt und Footer */
.wp-site-blocks > * + *,
.tbx-hero > *,
.tbx-stage > * {
	margin-block-start: 0;
}

.tbx-main {
	margin-block: 0;
}

.tbx-stage {
	z-index: 1;
}

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

.tbx-header {
	position: absolute;
	top: var(--wp-admin--admin-bar--height, 0px);
	left: 0;
	right: 0;
	z-index: 20;
	padding: 31px 20px 28px;
	mix-blend-mode: difference;
}

.tbx-header .wp-block-navigation {
	font-size: 14px;
}

.tbx-header .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--grey);
}


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

.tbx-hero {
	position: relative;
	min-height: calc(100svh - var(--tbx-footer-h) - var(--wp-admin--admin-bar--height, 0px));
	overflow: hidden;
	background-color: #000;
}

/* Hintergrund-Effekt (wiederverwendbar über die Klasse .tbx-bgfx):
   Bild 16:9 in Viewport-Breite, um −24° gedreht, 2,19-fach skaliert,
   schwarz-weiss und aufgehellt – darüber animiertes Filmkorn. */
.tbx-bgfx {
	position: relative;
	overflow: hidden;
	isolation: isolate;
}

.tbx-bgfx::before {
	content: "";
	position: absolute;
	top: 72.6vh;
	left: -49vw;
	width: 100vw;
	aspect-ratio: 16 / 9;
	background: url("../img/tbx-background.avif") no-repeat center / 100% 100%;
	/* Grundlage pro Seite über --bg-rot/--bg-scale, Bewegung (Maus/Scroll) über --bg-x/--bg-y/--bg-zoom aus theme.js */
	transform:
		translate3d(var(--bg-x, 0px), var(--bg-y, 0px), 0)
		rotate(var(--bg-rot, -24deg))
		scale(calc(var(--bg-scale, 2.19) * var(--bg-zoom, 1)));
	filter: grayscale(1) brightness(3);
	will-change: transform;
	pointer-events: none;
	z-index: -1;
}

/* Filmkorn (aus dem Original-CSS übernommen) */
.tbx-bgfx::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	opacity: 0.3;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
	background-size: 180px 180px;
	animation: tbx-grain 0.6s steps(6) infinite;
}

@keyframes tbx-grain {
	0%   { background-position: 0 0; }
	17%  { background-position: -40px 25px; }
	33%  { background-position: 30px -35px; }
	50%  { background-position: -25px -15px; }
	67%  { background-position: 45px 20px; }
	83%  { background-position: -15px 40px; }
	100% { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
	.tbx-bgfx::after { animation: none; }
}

.tbx-stage {
	--pt: clamp(72px, 12vh, 106px);  /* Abstand oben bis Unterschrift */
	--pl: clamp(0px, 6.3vw, 91px);   /* Einzug des Portraits */
	--photo-w: clamp(220px, 21vw, 300px);
	--overlap: 28px;

	position: relative;
	max-width: 1240px;
	margin-inline: auto;
	padding: var(--pt) 20px 56px calc(9px + var(--pl));
}

.tbx-signature {
	position: absolute;
	top: var(--pt);
	left: 9px;
	z-index: 3;
	width: min(58%, 720px);
	pointer-events: none;
	mix-blend-mode: difference;
}

.tbx-signature svg {
	display: block;
	width: 100%;
	height: auto;
	fill: #fff;
}

.tbx-signature__stacked {
	display: none;
}

.tbx-photo {
	position: relative;
	z-index: 1;
	width: var(--photo-w);
	margin: 50px 0 0 !important;
}

.tbx-photo img {
	display: block;
	width: 100%;
	aspect-ratio: 300 / 618;
	height: auto;
	object-fit: cover;
}

.tbx-card {
	position: absolute;
	z-index: 2;
	top: calc(var(--pt) + 125px);
	left: calc(9px + var(--pl) + var(--photo-w) - var(--overlap));
	width: min(768px, calc(100% - (9px + var(--pl) + var(--photo-w) - var(--overlap)) - 20px));
	margin: 0 !important;
	padding: 40px;
	background: #000;
}

/* Abstände wie im Original: Titel → Text 10px, danach je 20px */
.tbx-card > * {
	margin-block: 0 !important;
}

.tbx-card h1 {
	letter-spacing: 1.1px;
}

.tbx-card > * + * {
	margin-block-start: 20px !important;
}

.tbx-card > h1 + p {
	margin-block-start: 10px !important;
}

/* Button mit Pfeil (Icon als Maske, damit es die Textfarbe übernimmt) */
.tbx-btn-arrow .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	transition: background-color 0.25s ease, color 0.25s ease;
}

.tbx-btn-arrow .wp-block-button__link::before {
	content: "";
	width: 14px;
	height: 14px;
	background: currentColor;
	-webkit-mask: url("../svg/pfeil.svg") no-repeat center / contain;
	mask: url("../svg/pfeil.svg") no-repeat center / contain;
}

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

.tbx-footer {
	min-height: var(--tbx-footer-h);
	padding: 12px 20px;
	background: #000;
	font-size: 14px;
	font-weight: 500;
	gap: 12px;
}

.tbx-footer p {
	margin: 0;
}

.tbx-footer__left {
	gap: 8px 30px;
}

.tbx-footer a:hover {
	color: var(--wp--preset--color--grey);
}

.tbx-swiss {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.tbx-swiss svg {
	width: 14px;
	height: 14px;
}

/* Unterseiten ----------------------------------------------------------- */

.tbx-content {
	padding-top: 140px;
	padding-bottom: 80px;
	min-height: calc(100svh - var(--tbx-footer-h));
}

/* Tablet ---------------------------------------------------------------- */

@media (max-width: 1024px) {
	.tbx-card {
		padding: 32px;
	}
}

/* Mobil: Portrait wird zum Vollbild-Hintergrund ------------------------- */

@media (max-width: 781px) {
	.tbx-hero::before,
	.tbx-hero::after {
		display: none;
	}

	.tbx-stage {
		padding: 44svh 20px 48px;
	}

	.tbx-photo {
		position: absolute;
		inset: 0 0 auto 0;
		width: 100%;
		height: 92svh;
		margin: 0 !important;
	}

	.tbx-photo img {
		height: 100%;
		aspect-ratio: auto;
		object-position: 60% top;
	}

	.tbx-photo::after {
		content: "";
		position: absolute;
		inset: 0;
		background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.55) 60%, #000 96%);
	}

	.tbx-signature {
		position: relative;
		top: auto;
		left: auto;
		width: 88%;
		margin-bottom: 36px;
		mix-blend-mode: normal;
	}

	.tbx-signature__wide {
		display: none;
	}

	.tbx-signature__stacked {
		display: block;
	}

	.tbx-card {
		position: relative;
		top: auto;
		left: auto;
		width: auto;
		padding: 0;
		background: transparent;
	}

	.tbx-card h1 {
		font-size: 2.25rem;
		line-height: 1.25;
	}
}

/* Einblenden beim Laden ------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
	@keyframes tbx-fade-up {
		from { opacity: 0; transform: translateY(24px); }
	}

	@keyframes tbx-fade-left {
		from { opacity: 0; transform: translateX(32px); }
	}

}

/* Hover-Übergänge für Header- und Footer-Links (wie im Original: Farbe in 0.3s) */
.tbx-header .wp-block-navigation-item__content,
.tbx-burger,
.tbx-footer a,
.tbx-swiss {
	transition: color 0.3s ease, opacity 0.3s ease;
}

.tbx-logo {
	transition: opacity 0.3s ease;
}

.tbx-logo:hover {
	opacity: 0.7;
}

/* spezifischer als „.tbx-footer a:hover“ (grau), sonst gewinnt jene Regel */
.tbx-footer a.tbx-swiss:hover {
	color: #da291c;
}

/* Footer mobil: alles zentriert – Links oben, darunter ©, dann „Swiss hosted“ (wie im Original) */
@media (max-width: 781px) {
	.tbx-footer {
		flex-direction: column;
		justify-content: center;
		gap: 26px;
		padding: 24px 20px 28px;
		text-align: center;
	}

	.tbx-footer__left {
		justify-content: center;
		gap: 12px 28px;
	}

	/* © steht im Markup zuerst – mobil in eine eigene Zeile unter die Links */
	.tbx-footer__left > p:first-child {
		order: 1;
		flex-basis: 100%;
	}
}
