/*
 * MediaMagiXX — design system (dark only).
 * The typography scale lives in theme.json; this file holds layout rhythm
 * and the reusable utility classes so patterns carry no inline styles.
 */

/* ---------------------------------------------------------------------------
   1. Base rhythm & headings
--------------------------------------------------------------------------- */
:root {
	--mmx-section-space: clamp(3.5rem, 7vw, 7rem);
	--mmx-measure: 62ch;
}

h1, h2, h3, h4 {
	text-wrap: balance;
}

p, li {
	text-wrap: pretty;
}

/* Readable measure for running text inside centered sections. */
.mmx-measure {
	max-width: var(--mmx-measure);
	margin-inline: auto;
}

/* ---------------------------------------------------------------------------
   2. Sections — one consistent vertical rhythm for the whole one-pager
--------------------------------------------------------------------------- */
.mmx-section {
	padding-block: var(--mmx-section-space);
}

.mmx-section > .wp-block-heading,
.mmx-section > .mmx-eyebrow {
	margin-bottom: 0;
}

/* Mehr Luft zwischen dem Intro (Eyebrow/Headline/Teaser) und dem Hauptinhalt. */
.mmx-box,
.mmx-logos {
	margin-block-start: clamp(2.5rem, 5vw, 4rem);
}

/* ---------------------------------------------------------------------------
   3. Eyebrow label + lead paragraph
--------------------------------------------------------------------------- */
.mmx-eyebrow {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-1);
	margin-bottom: 0.5rem;
}

.mmx-lead {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
	color: var(--wp--preset--color--accent-4);
}

/* Gerahmter Inhalts-Kasten im Hero-Format (abgerundet, dunkel, ohne Bild). */
.mmx-box {
	background-color: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 14px;
	padding: clamp(1.5rem, 4vw, 2.5rem);
}
.mmx-box > :first-child { margin-block-start: 0; }
.mmx-box > :last-child { margin-block-end: 0; }

/* In Sektionen ohne Panel (Hintergrundbild scheint durch): Kasten leicht
   transparent als Milchglas, damit das Bild dezent durchschimmert. */
.mmx-section:not(.has-background) .mmx-box {
	background-color: color-mix(in srgb, var(--wp--preset--color--base) 80%, transparent);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}

/* Kasten als alleiniger Seiteninhalt (z. B. Über mich): Abstand nach oben/unten
   herstellen (es gibt keine Headline) und – da der Seitenhintergrund
   durchscheint – ebenfalls die Milchglas-Variante. */
.wp-block-post-content > .mmx-box {
	/* Inhaltsbreite wie zuvor (Mess-Breite) trotz Kasten-Padding beibehalten. */
	max-width: calc(var(--mmx-measure) + 5rem);
	margin-block: clamp(3rem, 6vw, 5rem);
	margin-inline: auto;
	background-color: color-mix(in srgb, var(--wp--preset--color--base) 80%, transparent);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}

/* Abgesetzter Hinweis-/Statement-Kasten. */
.mmx-callout {
	margin-block-start: 2rem;
	padding: clamp(1.25rem, 3vw, 2rem);
	border-inline-start: 4px solid var(--wp--preset--color--accent-1);
	background-color: color-mix(in srgb, var(--wp--preset--color--contrast) 6%, transparent);
}

.mmx-callout > :first-child { margin-block-start: 0; }
.mmx-callout > :last-child { margin-block-end: 0; }

/* ---------------------------------------------------------------------------
   4. Inline highlight (replaces inline-coloured <mark>)
--------------------------------------------------------------------------- */
.mmx-mark {
	background: transparent;
	color: var(--wp--preset--color--accent-1);
	font-weight: 800;
}

/* ---------------------------------------------------------------------------
   5. Hero
--------------------------------------------------------------------------- */
.mmx-hero {
	min-height: clamp(28rem, 70vh, 44rem);
	margin-block: clamp(1.5rem, 4vw, 3rem);
	border-radius: 14px;
	overflow: hidden;
	background-image: url("../images/hero-bg.jpg");
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	/* Parallax: Bild bleibt beim Scrollen stehen, der Kasten wandert darueber. */
	background-attachment: fixed;
}

/* background-attachment: fixed wird auf Touch/iOS ignoriert und ruckelt –
   dort normales Mitscrollen. */
@media (max-width: 781px) {
	.mmx-hero {
		background-attachment: scroll;
	}
}

/* Dark cinematic veil over the keyboard photo, keeping hero text legible. */
.mmx-hero .wp-block-cover__background {
	background-color: #0d0d0d;
}

.mmx-hero :is(h1, p) {
	color: #fff;
}

/* ---------------------------------------------------------------------------
   6. Streaming logo grid (replaces per-image inline widths)
--------------------------------------------------------------------------- */
.mmx-logos {
	gap: clamp(1.25rem, 3vw, 2.5rem) clamp(1.5rem, 4vw, 3rem);
}

.mmx-logos figure {
	margin: 0;
}

.mmx-logos img {
	width: auto;
	max-width: 160px;
	height: auto;
	max-height: 2.6rem;
	object-fit: contain;
	filter: grayscale(1) brightness(0) invert(1);
	opacity: 0.7;
	transition: opacity 0.2s ease;
}

.mmx-logos a:hover img,
.mmx-logos a:focus-visible img {
	opacity: 1;
}

/* ---------------------------------------------------------------------------
   7. Header & footer
--------------------------------------------------------------------------- */
/* Logo bar: centered logo (max 700px), scrolls away with the page. */
.mmx-logobar {
	padding-block: clamp(1rem, 2.5vw, 1.75rem);
	text-align: center;
}
.mmx-logobar.has-base-background-color {
	background-color: var(--wp--preset--color--base);
}

.mmx-logo {
	margin-block: 0;
}
.mmx-logo img {
	width: min(700px, 88vw);
	height: auto;
}

/* Main menu bar: centered, pinned to the top on scroll (JS toggles .is-stuck). */
.mmx-navbar {
	padding-block: 0.6rem;
	border-block: 1px solid var(--wp--preset--color--accent-6);
	z-index: 30;
}
.mmx-navbar.has-base-background-color {
	background-color: var(--wp--preset--color--base);
}
.mmx-navbar.is-stuck {
	position: fixed;
	inset-block-start: 0;
	inset-inline: 0;
	border-top: 0;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

/* Keep anchor targets clear of the fixed menu bar. */
html {
	scroll-padding-top: 4.5rem;
}

/* Footer brand logo — centered, a touch larger than the header. */
.mmx-footer-logo img {
	width: clamp(220px, 26vw, 300px);
	height: auto;
}

/* Social icons in the contact card (monochrome, accent on hover). */
.mmx-social {
	margin-block-start: 1rem;
}
.mmx-social .wp-social-link {
	color: var(--wp--preset--color--contrast);
	transition: color 0.2s ease, transform 0.2s ease;
}
.mmx-social .wp-social-link:hover {
	color: var(--wp--preset--color--accent-1);
	transform: translateY(-2px);
}

/* Round contact portrait. */
.mmx-avatar img {
	width: 100%;
	max-width: 220px;
	aspect-ratio: 1;
	height: auto;
	object-fit: cover;
	border-radius: 50%;
	border: 3px solid var(--wp--preset--color--accent-6);
}

/* Footer two-column balance without inline flex-basis. */
.mmx-footer-grid > .wp-block-column:first-child {
	flex-basis: 38%;
}
.mmx-footer-grid > .wp-block-column:last-child {
	flex-basis: 62%;
}

/* ---------------------------------------------------------------------------
   8. Background veil over the fixed keyboard photo
--------------------------------------------------------------------------- */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	background-color: var(--wp--preset--color--base);
	opacity: 0.82;
	pointer-events: none;
}
