/* =========================================================
   Maestro VR — SEO & Mobile add-on
   Loads AFTER main.css. Never edit main.css: keep all
   custom rules here so the template stays updatable.
   ========================================================= */

/* ---------- 1. Global anti-overflow (portrait fix) ---------- */

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

body {
	overflow-x: hidden;
}

img,
iframe,
video,
table {
	max-width: 100%;
}

img {
	height: auto;
}

/* Real mobile viewport height (avoids the jump caused by the
   browser toolbar showing/hiding on phones). */
#wrapper {
	min-height: 100vh;
	min-height: 100svh;
	padding-left: max(1rem, env(safe-area-inset-left));
	padding-right: max(1rem, env(safe-area-inset-right));
}

#bg {
	height: 100vh;
	height: 100svh;
}

/* ---------- 2. Header / logo ---------- */

.sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

#header h1.brand {
	margin: 0 0 1rem 0;
	line-height: 1;
}

#header .logo-img {
	display: inline-block;
	width: auto;
	max-height: 120px;
	max-width: 100%;
	vertical-align: middle;
}

#header .tagline-sub {
	font-size: 0.75em;
	opacity: 0.8;
	margin-top: 0.5rem;
	margin-bottom: 0;
}

/* ---------- 3. Responsive embeds (YouTube + Steam) ---------- */

.embed {
	position: relative;
	width: 100%;
	max-width: 640px;
	margin: 0 auto 1.5rem auto;
	background: #000;
	border-radius: 4px;
	overflow: hidden;
}

.embed-video {
	aspect-ratio: 16 / 9;
}

.embed iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Fallback for very old browsers without aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
	.embed-video {
		padding-top: 56.25%;
	}
}

.steam-widget {
	width: 100%;
	max-width: 646px;
	margin: 0 auto 1.5rem auto;
	text-align: center;
}

.steam-widget iframe {
	display: block;
	width: 646px;
	max-width: 100%;
	height: 190px;
	border: 0;
	margin: 0 auto;
}

/* On phones the Steam widget doesn't fit: show a real link button
   instead (better UX and a crawlable link for Google). */
.steam-buttons {
	display: none;
}

/* ---------- 4. Articles & typography on mobile ---------- */

#main article {
	width: 42rem;
}

#main article ul {
	padding-left: 1.25em;
}

#footer .footer-links {
	font-size: 0.7rem;
	letter-spacing: 0.05rem;
	margin-bottom: 0.5rem;
	opacity: 0.85;
}

#footer .footer-links a {
	border-bottom: 0;
}

/* ---------- 5. Phones / portrait ---------- */

@media screen and (max-width: 736px) {

	/* Vertical nav so 4 items never overflow, with big tap targets */
	#header nav ul {
		-moz-flex-direction: column;
		-webkit-flex-direction: column;
		-ms-flex-direction: column;
		flex-direction: column;
		min-width: 12rem;
		max-width: 100%;
	}

	#header nav ul li {
		border-left: 0;
		border-top: solid 1px #ffffff;
	}

	#header nav ul li:first-child {
		border-top: 0;
	}

	#header nav ul li a {
		height: 3.25rem;
		line-height: 3.25rem;
		min-width: 0;
		width: 100%;
	}

	#header nav.use-middle:after {
		display: none;
	}

	#header .logo-img {
		max-height: 84px;
	}

	#header .tagline br {
		display: none;
	}

	/* Steam widget out, real buttons in */
	.steam-widget {
		display: none;
	}

	.steam-buttons {
		display: block;
		text-align: center;
		margin-bottom: 1.5rem;
	}

	.steam-buttons .button {
		width: 100%;
		max-width: 22rem;
	}

	/* Performance: blur on a full-screen fixed layer is very
	   expensive on mobile GPUs. */
	body.is-article-visible #bg:after {
		-webkit-filter: none;
		filter: none;
	}

	body.is-article-visible #header,
	body.is-article-visible #footer {
		-webkit-filter: none;
		filter: none;
	}
}

@media screen and (max-width: 480px) {

	#header .logo-img {
		max-height: 64px;
	}

	#header .tagline-sub {
		font-size: 0.7em;
	}

	#main article {
		padding: 3rem 1.25rem 1rem 1.25rem;
	}

	#main article h2.major {
		font-size: 1.35rem;
	}
}

/* Landscape phones: keep the article readable instead of squashed */
@media screen and (max-height: 500px) and (orientation: landscape) {

	#wrapper {
		padding: 1rem;
	}

	#header .logo-img {
		max-height: 56px;
	}

	#header .tagline-sub {
		display: none;
	}
}

/* ---------- 6. Accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*:before,
	*:after {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}
}

a:focus-visible,
.button:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}
