/*
 * Page title area of inner pages (title.php).
 *
 * With a banner image (Figma "About", "Services", "Projects", "Training", "Resources", "Contact"):
 *   steel band, title Red Hat Display Bold 150px (fluid 56 → 150) in Charcoal (9:1 on steel),
 *   its baseline on the top edge of a full-width photo (1728 x 780).
 * Without an image (Figma "Privacy Policy"): 234px steel band with the yellow corner shape at the bottom right,
 *   title Bold 60/70 at the start of the 1204px content column.
 *
 * 1. Band
 * 2. Title with a banner image
 * 3. Banner image
 * 4. Without an image: shape and title column
 * 5. Above title, description, button
 * 6. Smaller screens
 */

/* ------------------------------------------------------------------
 * 1. Band (continues the steel header)
 * ------------------------------------------------------------------ */
.page_title_box {
	position: relative;
}

.page_title_band {
	position: relative;
	background-color: var(--wp--preset--color--steel);
	color: var(--wp--preset--color--secondary);
}

.page_title_band .container {
	margin: 0 auto;
}

/* Title highlights ([text] in the Page Title field) keep the title colour: yellow is unreadable on steel and white. */
.page_title .textcolor-primary {
	color: inherit;
}

/* ------------------------------------------------------------------
 * 2. Title with a banner image
 *    line-height 0.9; the baseline is 0.093em above the bottom of the line box, so a -0.1em bottom margin
 *    puts the baseline on the photo's top edge (as in the design) and multi-line titles never overlap.
 * ------------------------------------------------------------------ */
.page_title--image .page_title_band .container {
	padding-top: clamp(40px, 6.63vw, 115px); /* title cap height starts 127px under the header at 1728px */
}

.page_title--image .page_title {
	position: relative;
	z-index: 1; /* letters with descenders (Projects) sit on top of the photo */
	max-width: 100%;
	margin: 0 0 -0.1em;
	color: var(--wp--preset--color--secondary);
	font-size: var(--wp--preset--font-size--display-150);
	font-weight: 700;
	line-height: 0.9;
	letter-spacing: 0;
	overflow-wrap: anywhere; /* very long words never cause sideways scrolling (WCAG 1.4.10) */
}

/* ------------------------------------------------------------------
 * 3. Banner image (full width, 1728 x 780 at 1728px)
 * ------------------------------------------------------------------ */
.page_title_image {
	aspect-ratio: 1728 / 780;
	background-color: var(--wp--preset--color--secondary);
	overflow: hidden;
}

.page_title_img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ------------------------------------------------------------------
 * 4. Without an image: short band with the corner shape, title in the content column
 * ------------------------------------------------------------------ */
.page_title--plain .page_title_band {
	min-height: clamp(96px, 13.54vw, 234px); /* 234px under the header at 1728px */
	overflow: hidden;
}

.page_title_shape {
	position: absolute;
	right: 0;
	bottom: 0;
	width: clamp(110px, 20.78vw, 359px); /* 359 x 223 at 1728px */
	height: auto;
	fill: var(--wp--preset--color--primary);
}

.page_title_body .container {
	max-width: calc(1204px + 40px); /* content column of the text pages (262px in at 1728px) */
	margin: 0 auto;
}

.page_title--plain .page_title_body .container {
	padding-top: clamp(40px, 6.42vw, 111px);
	padding-bottom: clamp(24px, 2.7vw, 46px);
}

.page_title--plain .page_title {
	margin: 0;
	color: var(--wp--preset--color--black);
	font-size: var(--wp--preset--font-size--large-60);
	font-weight: 700;
	line-height: 1.1667; /* 70px at 60px */
	letter-spacing: 0;
	overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------
 * 5. Above title, description, button
 * ------------------------------------------------------------------ */
.page_title_box .above_title {
	margin: 0 0 16px;
	color: var(--wp--preset--color--black);
	font-size: var(--wp--preset--font-size--small-16);
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.page_title_box .title_description {
	max-width: 760px;
	margin: 24px 0 0;
	color: var(--wp--preset--color--black);
	font-size: var(--wp--preset--font-size--small-20);
	line-height: 1.6;
}

.page_title_box .action_link {
	margin-top: 32px;
}

/* With an image, the description and button follow the photo, lined up with the title (175px at 1728px). */
.page_title--image .page_title_body .container {
	max-width: calc(var(--wp--style--global--content-size) + 40px);
	padding-top: clamp(32px, 3.5vw, 60px);
	padding-bottom: clamp(32px, 3.5vw, 60px);
}

.page_title--image .page_title_body .title_description {
	margin-top: 0;
}

/* ------------------------------------------------------------------
 * 6. Smaller screens
 * ------------------------------------------------------------------ */
@media screen and (max-width: 768px) {
	.page_title_image {
		aspect-ratio: 4 / 3;
	}
}

/* Contain the negative title margin so the steel band ends at the image edge.
 * Otherwise the positioned band paints over the top of a static banner image. */
body:not(.home) .page_title--image .page_title_band .container {
	display: flow-root;
}
