/*
 * Partners / Speakers / Events (see inc/legacy-pages.php).
 *
 * These pages are one-to-one rebuilds of the old standalone pages, each with
 * its own stylesheet. header.php prints the theme's global stylesheet first,
 * and a handful of its rules (written for the old homepage) reach into that
 * content: they set properties the old stylesheets never set, so the page
 * ends up looking different. Everything below is scoped to .fs-legacy — the
 * wrapper the three templates put around the content — so the site header
 * and footer are left exactly as they are.
 *
 * The resets use :where(.fs-legacy) so they add no specificity: they only
 * cancel what the theme added, and any rule from the old page's own
 * stylesheet (or its Tailwind classes) still wins over them.
 */

/* The old pages were plain white; the theme paints a grey gradient on <body>. */
body.fs-legacy-page {
	background: #fff !important;
}

/*
 * The old partners page had no Tailwind, so its stylesheet assumes the
 * browser defaults: content-box sizing, "normal" line height, inline images.
 * (The speakers/events pages had Tailwind's preflight, which is border-box /
 * 1.5 / block — the same as the theme — so they need none of this.)
 */
.fs-legacy--partners,
.fs-legacy--partners * {
	box-sizing: content-box;
}

.fs-legacy--partners {
	line-height: normal;
}

:where(.fs-legacy--partners) img {
	display: inline;
}

/* ---------- theme rules the old stylesheets never override (all widths) ---------- */

:where(.fs-legacy) .hero {
	position: static;
	overflow: visible;
}

:where(.fs-legacy) .hero h1 {
	letter-spacing: normal;
}

:where(.fs-legacy) .hero h1 span {
	padding: 0;
	border-radius: 0;
	box-decoration-break: slice;
}

/* (partners' own stylesheet sets the hero paragraph's margin; the Tailwind pages rely on preflight's 0) */
.fs-legacy--speakers .hero p,
.fs-legacy--events .hero p {
	margin-bottom: 0;
}

:where(.fs-legacy) section {
	border-top: 0;
}

:where(.fs-legacy) .section-head {
	max-width: none;
}

/*
 * Spacing the theme sets on the desktop layout that the old stylesheets
 * never set. On phones (<=772px) the old stylesheets carry their own copy of
 * these rules, identical to the theme's, so there's nothing to reset there —
 * resetting would wipe out the old page's values.
 */
@media (min-width: 773px) {
	:where(.fs-legacy) .hero {
		padding-bottom: 0;
	}

	/* The old speakers/events stylesheets don't pad the hero; only partners does (62px). */
	.fs-legacy--speakers .hero,
	.fs-legacy--events .hero {
		padding-top: 0;
	}

	:where(.fs-legacy) .hero h1 span {
		font-size: inherit;
	}

	:where(.fs-legacy) section {
		padding: 0;
	}

	:where(.fs-legacy) .section-head {
		margin-bottom: 0;
	}
}
