/* IC Hero: Title (patterns/ic-hero-title.php). Figma "17 The Follow Through" 2854:105664.
 * The side rails are one background layer on ::before, so editors only ever see the title and the logo.
 * Content sits one gutter inside the rails (Figma: rail 120 + 69 = title x 189; logo right edge 1730 = 1800 - 70). */
.tt5c-ic-hero-title {
	--tt5c-ic-hero-title-rail: clamp(var(--wp--custom--layout--gutter), 8.333vw, 120px); /* approximate — from Figma 2854:105664 (120px at 1440+) */
	--tt5c-ic-hero-title-line: 1px; /* approximate — from Figma 2854:105664 */
	--tt5c-ic-hero-title-line-color: color-mix(in srgb, var(--ico-color-pure-white) 20%, transparent); /* approximate — from Figma 2854:105664 (white, 20% stroke opacity) */
	position: relative;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: max(32rem, min(100svh, 56.25vw)); /* approximate — from Figma 2854:105664 (1920×1080 frame) */
	padding-inline: calc(var(--tt5c-ic-hero-title-rail) + var(--wp--custom--layout--gutter));
	overflow: hidden;
}
.tt5c-ic-hero-title::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		linear-gradient(var(--tt5c-ic-hero-title-line-color), var(--tt5c-ic-hero-title-line-color)) var(--tt5c-ic-hero-title-rail) 0 / var(--tt5c-ic-hero-title-line) 100% no-repeat,
		linear-gradient(var(--tt5c-ic-hero-title-line-color), var(--tt5c-ic-hero-title-line-color)) calc(100% - var(--tt5c-ic-hero-title-rail)) 0 / var(--tt5c-ic-hero-title-line) 100% no-repeat,
		linear-gradient(var(--tt5c-ic-hero-title-line-color), var(--tt5c-ic-hero-title-line-color)) 0 var(--tt5c-ic-hero-title-rail) / var(--tt5c-ic-hero-title-rail) var(--tt5c-ic-hero-title-line) no-repeat;
}
.tt5c-ic-hero-title__inner {
	position: relative;
	width: 100%;
	gap: var(--wp--preset--spacing--40);
}
/* Colour and size come from the theme's h1 role (Headline/Hero) and tt5c-ic-on-dark. Figma is 128px (no token). */
.tt5c-ic-hero-title__title {
	margin: 0;
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: break-word;
}
.tt5c-ic-hero-title__logo {
	margin: 0;
	flex: 0 0 auto;
	line-height: 0;
}
.tt5c-ic-hero-title__logo img {
	display: block;
	width: clamp(160px, 13.8vw, 265px); /* approximate — from Figma 2854:105664 (265×24 at 1920) */
	height: auto;
}

/* Sunwave mark, centred in the rail × rail cell at top left (Schuler, 2026-11-05). Decorative: alt="". */
.tt5c-ic-hero-title__mark {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
	display: grid;
	place-items: center;
	width: var(--tt5c-ic-hero-title-rail);
	height: var(--tt5c-ic-hero-title-rail);
	margin: 0;
	line-height: 0;
}
.tt5c-ic-hero-title__mark a { display: grid; place-items: center; width: 100%; height: 100%; }
/* The cell sits in the page corner, so draw the focus ring inside it or two sides fall off-screen. */
@media (min-width: 901px) {
	.tt5c-ic-hero-title__mark a:focus-visible { outline-offset: calc(var(--ico-btn-focus-ring-width) * -2); }
}
.tt5c-ic-hero-title__mark img {
	display: block;
	width: 40%; /* derived — not Figma (the frame has no mark in this cell) */
	height: auto;
}

/* Phones and small tablets: rails collapse to the gutter, the logo moves above the title. */
@media (max-width: 900px) {
	.tt5c-ic-hero-title { --tt5c-ic-hero-title-rail: var(--wp--custom--layout--gutter); }
	.tt5c-ic-hero-title__inner { flex-direction: column; align-items: flex-start; }
	.tt5c-ic-hero-title__logo { order: -1; }
	/* The rail cell is only a gutter wide here: the mark sits in the top-left of the content area instead. */
	.tt5c-ic-hero-title__mark { top: var(--wp--custom--layout--gutter); left: calc(var(--tt5c-ic-hero-title-rail) + var(--wp--custom--layout--gutter)); width: auto; height: auto; }
	.tt5c-ic-hero-title__mark img { width: var(--wp--custom--layout--tap); }
}
@media (max-width: 600px) {
	.tt5c-ic-hero-title { min-height: 28rem; } /* derived — not Figma */
	.tt5c-ic-hero-title__logo img { width: 160px; } /* derived — not Figma */
}

/* Hero alone on the page (Home, hero-only by design, 2026-11-06): fill the screen so no page background shows below
 * it. Only when nothing follows the hero in the post content; pages with sections after it keep the 16:9 frame above.
 * After the ≤900px rule on purpose, so it wins there too. */
:where(.wp-block-post-content, .entry-content) > .tt5c-ic-hero-title:last-child {
	min-height: calc(100svh - var(--wp-admin--admin-bar--height, 0px));
}
