/*
 * P10 page hero system — shared geometry, page-specific dense motifs.
 * Home intentionally excluded by the enqueue and body-class filter.
 */
:root {
	--iwut-shell-max: 1760px;
	--iwut-shell-gutter: clamp(24px, 6vw, 112px);
	--iwut-hero-navy: #16295A;
	--iwut-hero-navy-deep: #0B1530;
	--iwut-hero-turquoise: #3FC3BA;
	--iwut-hero-gold: #C0A165;
	--iwut-hero-pattern-size: 96px 96px;
	--iwut-hero-pattern-opacity: .075;
}

/* Standard page, single, archive, search and 404 title surfaces. */
body.iwut-page-hero-system :is(
	main#wp--skip-link--target > h1.wp-block-post-title,
	main#wp--skip-link--target > h1.wp-block-query-title,
	main#wp--skip-link--target > h1.wp-block-heading,
	main.wp-block-group > h1.wp-block-post-title,
	main.wp-block-group > h1.wp-block-query-title
) {
	box-sizing: border-box;
	position: relative;
	display: grid;
	place-items: center;
	width: 100%;
	max-width: none;
	min-height: clamp(240px, 25vw, 300px);
	margin: 0 auto clamp(38px, 5vw, 60px);
	padding: clamp(52px, 6vw, 72px) clamp(18px, 4vw, 44px) clamp(70px, 7vw, 84px);
	overflow: hidden;
	isolation: isolate;
	background: linear-gradient(145deg, var(--iwut-hero-navy) 0%, var(--iwut-hero-navy-deep) 100%);
	border-radius: 0;
	box-shadow: inset 0 0 0 1px rgba(192, 161, 101, .22);
	color: #FFFFFF;
	font: 700 clamp(42px, 6.3vw, 72px)/1.06 "IWUT Source Serif", "Source Serif 4", Georgia, serif;
	letter-spacing: -.025em;
	text-align: center;
	text-wrap: balance;
}

body.iwut-page-hero-system :is(
	main#wp--skip-link--target > h1.wp-block-post-title,
	main#wp--skip-link--target > h1.wp-block-query-title,
	main#wp--skip-link--target > h1.wp-block-heading,
	main.wp-block-group > h1.wp-block-post-title,
	main.wp-block-group > h1.wp-block-query-title
)::before,
body.iwut-page-hero-system .staff-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	display: block;
	background: var(--iwut-hero-turquoise);
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-repeat: repeat;
	mask-repeat: repeat;
	-webkit-mask-size: var(--iwut-hero-pattern-size);
	mask-size: var(--iwut-hero-pattern-size);
	opacity: var(--iwut-hero-pattern-opacity);
	pointer-events: none;
}

body.iwut-page-hero-system :is(
	main#wp--skip-link--target > h1.wp-block-post-title,
	main#wp--skip-link--target > h1.wp-block-query-title,
	main#wp--skip-link--target > h1.wp-block-heading,
	main.wp-block-group > h1.wp-block-post-title,
	main.wp-block-group > h1.wp-block-query-title
)::after,
body.iwut-page-hero-system .staff-hero::after {
	content: "";
	position: absolute;
	top: auto;
	bottom: 38px;
	left: 50%;
	width: 110px;
	height: 3px;
	margin: 0;
	background: var(--iwut-hero-gold);
	box-shadow: none;
	transform: translateX(-50%);
	transform-origin: center;
	pointer-events: none;
}

/* Staff archive owns a separate hero wrapper rather than a title inside main. */
body.iwut-page-hero-system .staff-hero {
	box-sizing: border-box;
	position: relative;
	display: grid;
	place-items: center;
	width: min(calc(100vw - var(--iwut-shell-gutter)), var(--iwut-shell-max));
	max-width: var(--iwut-shell-max);
	min-height: clamp(240px, 25vw, 300px);
	margin: 132px auto clamp(38px, 5vw, 60px);
	padding: clamp(52px, 6vw, 72px) clamp(18px, 4vw, 44px) clamp(70px, 7vw, 84px);
	overflow: hidden;
	isolation: isolate;
	background: linear-gradient(145deg, var(--iwut-hero-navy) 0%, var(--iwut-hero-navy-deep) 100%);
	border-radius: 0 !important;
	box-shadow: inset 0 0 0 1px rgba(192, 161, 101, .22);
	text-align: center;
}

body.iwut-page-hero-system .staff-hero .staff-hero-title {
	position: relative;
	z-index: 1;
	margin: 0;
	color: #FFFFFF;
	font: 700 clamp(42px, 6.3vw, 72px)/1.06 "IWUT Source Serif", "Source Serif 4", Georgia, serif;
	letter-spacing: -.025em;
	text-wrap: balance;
}

/* Default / unknown page: restrained algorithmic grid. */
body.iwut-page-hero-system :is(main h1, .staff-hero)::before {
	-webkit-mask-image: url("svg/girih/girih-octagon-star-tiling.svg");
	mask-image: url("svg/girih/girih-octagon-star-tiling.svg");
}

/*
 * News: an editorial tile panel rather than a field of loose ornaments.
 * One continuous star/cross register spans the surface; the inset architectural
 * rule, title and centre hairline share the same measured 24px module.
 */
body.iwut-hero-news {
	--iwut-hero-pattern-size: 96px 96px;
	--iwut-hero-pattern-opacity: .105;
}

/* The legacy News layout resets main padding; reserve the fixed header again. */
body.iwut-page-hero-system.iwut-hero-news main#wp--skip-link--target {
	padding-top: 132px;
}

body.iwut-hero-news :is(
	main#wp--skip-link--target > h1.wp-block-post-title,
	main#wp--skip-link--target > h1.wp-block-query-title,
	main#wp--skip-link--target > h1.wp-block-heading,
	main.wp-block-group > h1.wp-block-post-title,
	main.wp-block-group > h1.wp-block-query-title
) {
	width: 100%;
	max-width: none;
	min-height: clamp(228px, 22vw, 276px);
	padding-block: clamp(54px, 5vw, 68px) clamp(68px, 6vw, 80px);
	background:
		linear-gradient(90deg, transparent 0 8%, rgba(63, 195, 186, .055) 8% 8.15%, transparent 8.15% 91.85%, rgba(63, 195, 186, .055) 91.85% 92%, transparent 92%),
		linear-gradient(145deg, #16295A 0%, #0B1530 100%);
	box-shadow: none;
	font-size: clamp(44px, 5.4vw, 68px);
}

body.iwut-hero-news :is(main h1, .staff-hero)::before {
	inset: 0;
	background: var(--iwut-hero-turquoise);
	-webkit-mask-image: url("svg/girih/girih-star-cross-tiling.svg") !important;
	mask-image: url("svg/girih/girih-star-cross-tiling.svg") !important;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: var(--iwut-hero-pattern-size);
	mask-size: var(--iwut-hero-pattern-size);
	opacity: var(--iwut-hero-pattern-opacity);
}

body.iwut-hero-news :is(main h1, .staff-hero)::after {
	bottom: 44px;
	width: 144px;
	height: 13px;
	background:
		linear-gradient(var(--iwut-hero-gold), var(--iwut-hero-gold)) center / 100% 1px no-repeat,
		linear-gradient(135deg, transparent 43%, var(--iwut-hero-gold) 44% 56%, transparent 57%) center / 13px 13px no-repeat,
		linear-gradient(45deg, transparent 43%, var(--iwut-hero-gold) 44% 56%, transparent 57%) center / 13px 13px no-repeat;
	opacity: .92;
}

/*
 * A News landing page is an index; a single post is an editorial frontispiece.
 * Keep the same publication palette while changing axis, density and hierarchy.
 */
body.single:not(.single-stm_staff).iwut-page-hero-system main#wp--skip-link--target > h1.wp-block-post-title {
	display: flex;
	align-items: flex-end;
	justify-content: flex-start;
	min-height: clamp(330px, 36vw, 430px);
	padding: clamp(86px, 9vw, 118px) clamp(28px, 5vw, 70px) clamp(54px, 6vw, 72px) clamp(48px, 7vw, 96px);
	background: linear-gradient(118deg, #0B1530 0%, #16295A 68%, #101F45 100%);
	font-size: clamp(40px, 5vw, 64px);
	line-height: 1.04;
	letter-spacing: -.035em;
	text-align: start;
	text-wrap: balance;
}

body.single:not(.single-stm_staff).iwut-page-hero-system main#wp--skip-link--target > h1.wp-block-post-title::before {
	inset: 0;
	-webkit-mask-position: right center;
	mask-position: right center;
	-webkit-mask-size: 88px 88px;
	mask-size: 88px 88px;
	-webkit-clip-path: inset(0 0 0 62%);
	clip-path: inset(0 0 0 62%);
	opacity: .14;
}

body.single:not(.single-stm_staff).iwut-page-hero-system main#wp--skip-link--target > h1.wp-block-post-title::after {
	top: clamp(86px, 9vw, 118px);
	bottom: clamp(54px, 6vw, 72px);
	left: clamp(24px, 4vw, 54px);
	width: 2px;
	height: auto;
	margin: 0;
	background: var(--iwut-hero-gold);
	transform: none;
	opacity: .9;
}

body.single:not(.single-stm_staff).iwut-page-hero-system .news-post-meta {
	width: min(calc(100vw - clamp(40px, 6vw, 112px)), 1760px);
	margin: calc(clamp(38px, 5vw, 60px) * -.48) auto clamp(26px, 4vw, 42px);
	padding-block: 14px;
	border-block-end: 1px solid rgba(192, 161, 101, .42);
}

@media (max-width: 700px) {
	body.single:not(.single-stm_staff).iwut-page-hero-system main#wp--skip-link--target > h1.wp-block-post-title {
		min-height: 320px;
		padding: 82px 24px 48px 42px;
		font-size: clamp(34px, 10.5vw, 46px);
		line-height: 1.08;
	}
	body.single:not(.single-stm_staff).iwut-page-hero-system main#wp--skip-link--target > h1.wp-block-post-title::before {
		-webkit-clip-path: inset(0 0 50% 46%);
		clip-path: inset(0 0 50% 46%);
		opacity: .11;
	}
	body.single:not(.single-stm_staff).iwut-page-hero-system main#wp--skip-link--target > h1.wp-block-post-title::after {
		top: 82px;
		bottom: 48px;
		left: 24px;
	}
	body.single:not(.single-stm_staff).iwut-page-hero-system .news-post-meta {
		width: min(calc(100vw - 24px), 1180px);
		margin-top: -12px;
	}
}

/* About: a sequence of academic gateways, not a generic geometric tile. */
body.iwut-hero-about { --iwut-hero-pattern-size: 104px 138px; }
body.iwut-hero-about :is(main h1, .staff-hero)::before {
	-webkit-mask-image: url("svg/arch/arch-horseshoe.svg") !important;
	mask-image: url("svg/arch/arch-horseshoe.svg") !important;
}

/* Admissions: the pointed arch acts as the entrance to study. */
body.iwut-hero-admissions { --iwut-hero-pattern-size: 92px 122px; }
body.iwut-hero-admissions :is(main h1, .staff-hero)::before {
	-webkit-mask-image: url("svg/arch/arch-mihrab-pointed.svg") !important;
	mask-image: url("svg/arch/arch-mihrab-pointed.svg") !important;
}

/* Academic programmes: algorithmic tessellation. */
body.iwut-hero-academics { --iwut-hero-pattern-size: 92px 92px; }
body.iwut-hero-academics :is(main h1, .staff-hero)::before {
	-webkit-mask-image: url("svg/girih/girih-octagon-star-tiling.svg") !important;
	mask-image: url("svg/girih/girih-octagon-star-tiling.svg") !important;
}

/* People: repeated architectural panels establish a collegiate rhythm. */
body.iwut-hero-people { --iwut-hero-pattern-size: 126px 148px; }
body.iwut-hero-people :is(main h1, .staff-hero)::before {
	-webkit-mask-image: url("svg/frame/frame-arch-panel.svg") !important;
	mask-image: url("svg/frame/frame-arch-panel.svg") !important;
}

/* Courses/events: connected units across the whole hero. */
body.iwut-hero-courses { --iwut-hero-pattern-size: 94px 94px; }
body.iwut-hero-courses :is(main h1, .staff-hero)::before {
	-webkit-mask-image: url("svg/girih/girih-star-cross-tiling.svg") !important;
	mask-image: url("svg/girih/girih-star-cross-tiling.svg") !important;
}

/* Research: dense star-and-cross tessellation = rules producing a larger system. */
body.iwut-hero-research { --iwut-hero-pattern-size: 86px 86px; }
body.iwut-hero-research :is(main h1, .staff-hero)::before {
	-webkit-mask-image: url("svg/girih/girih-star-cross-tiling.svg") !important;
	mask-image: url("svg/girih/girih-star-cross-tiling.svg") !important;
}

/* Student life: palmettes suggest growth and an active community. */
body.iwut-hero-student-life { --iwut-hero-pattern-size: 90px 116px; }
body.iwut-hero-student-life :is(main h1, .staff-hero)::before {
	-webkit-mask-image: url("svg/motif/motif-palmette.svg") !important;
	mask-image: url("svg/motif/motif-palmette.svg") !important;
}

/* Cooperation: interlaced paths express institutional networks. */
body.iwut-hero-cooperation { --iwut-hero-pattern-size: 90px 90px; }
body.iwut-hero-cooperation :is(main h1, .staff-hero)::before {
	-webkit-mask-image: url("svg/girih/girih-strap-interlace.svg") !important;
	mask-image: url("svg/girih/girih-strap-interlace.svg") !important;
}

/* Keep the cooperation content from inheriting legacy intrinsic image widths. */
body.iwut-hero-cooperation .entry-content > .loop-cards {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 28px;
	padding: 0;
}
body.iwut-hero-cooperation .entry-content > .loop-cards > .loop-card { min-width: 0; }
body.iwut-hero-cooperation .loop-card-image,
body.iwut-hero-cooperation .loop-card-image img {
	display: block;
	width: 100%;
	max-width: 100%;
}
body.iwut-hero-cooperation .loop-card-image img { height: 210px; object-fit: cover; }

/* Contact: a repeating cartouche evokes correspondence and dialogue. */
body.iwut-hero-contact { --iwut-hero-pattern-size: 132px 88px; }
body.iwut-hero-contact :is(main h1, .staff-hero)::before {
	-webkit-mask-image: url("svg/frame/frame-cartouche-scroll.svg") !important;
	mask-image: url("svg/frame/frame-cartouche-scroll.svg") !important;
}

/* Scholarship: the toranj is reserved for achievement and recognition. */
body.iwut-hero-award { --iwut-hero-pattern-size: 98px 98px; }
body.iwut-hero-award :is(main h1, .staff-hero)::before {
	-webkit-mask-image: url("svg/medallion/medallion-toranj-8lobe.svg") !important;
	mask-image: url("svg/medallion/medallion-toranj-8lobe.svg") !important;
}

/* FAQ: repeated labels reference indexed knowledge. */
body.iwut-hero-guide { --iwut-hero-pattern-size: 132px 86px; }
body.iwut-hero-guide :is(main h1, .staff-hero)::before {
	-webkit-mask-image: url("svg/frame/frame-lobed-label.svg") !important;
	mask-image: url("svg/frame/frame-lobed-label.svg") !important;
}

/* Authentication: a technical diamond rule, separate from public content. */
body.iwut-hero-access { --iwut-hero-pattern-size: 104px 52px; }
body.iwut-hero-access :is(main h1, .staff-hero)::before {
	-webkit-mask-image: url("svg/border/border-diamond-star.svg") !important;
	mask-image: url("svg/border/border-diamond-star.svg") !important;
}

/* Search and generic archives: a quiet index-like rosette field. */
body:is(.iwut-hero-search, .iwut-hero-archive) { --iwut-hero-pattern-size: 72px 72px; }
body:is(.iwut-hero-search, .iwut-hero-archive) :is(main h1, .staff-hero)::before {
	-webkit-mask-image: url("svg/motif/motif-rosette-small.svg") !important;
	mask-image: url("svg/motif/motif-rosette-small.svg") !important;
}

/* 404: an intentionally unresolved interlace. */
body.iwut-hero-not-found { --iwut-hero-pattern-size: 108px 108px; }
body.iwut-hero-not-found :is(main h1, .staff-hero)::before {
	-webkit-mask-image: url("svg/girih/girih-strap-interlace.svg") !important;
	mask-image: url("svg/girih/girih-strap-interlace.svg") !important;
}

/*
 * One responsive shell for every internal template. Page-specific styles may
 * still constrain reading columns, but the page canvas and hero share gutters.
 */
body.iwut-page-hero-system > .wp-site-blocks > main.wp-block-group {
	box-sizing: border-box;
	width: min(calc(100% - var(--iwut-shell-gutter)), var(--iwut-shell-max));
	max-width: var(--iwut-shell-max) !important;
	margin-inline: auto;
}

/*
 * Page templates need a wider, proportional canvas on TVs and projectors.
 * The Hero and content keep a measured inset instead of remaining fixed at
 * the core 1200px/1040px reading widths. Prose inside sections may still use
 * its own readable measure.
 */
body.page.iwut-page-hero-system > .wp-site-blocks > main.iwut-page-template {
	--iwut-page-shell-gutter: clamp(32px, 8vw, 160px);
	--iwut-page-content-inset: clamp(48px, 8vw, 160px);
	box-sizing: border-box;
	width: min(calc(100% - var(--iwut-page-shell-gutter)), 2200px);
	max-width: 2200px !important;
}

body.page.iwut-page-hero-system main.iwut-page-template > .wp-block-template-part {
	width: 100%;
	max-width: none !important;
}

body.page.iwut-page-hero-system main.iwut-page-template > .wp-block-post-content {
	width: min(calc(100% - var(--iwut-page-content-inset)), 2040px);
	max-width: 2040px !important;
	margin-inline: auto;
}

body.page.iwut-page-hero-system .iwut-page-hero {
	min-height: clamp(210px, 22vw, 300px);
}

@media (min-width: 1800px) {
	body.page.iwut-page-hero-system .iwut-page-hero {
		--iwut-page-hero-tile: clamp(64px, 4vw, 96px);
		min-height: clamp(300px, 18vw, 400px);
	}

	body.page.iwut-page-hero-system .iwut-page-hero .iwut-page-hero__title {
		font-size: clamp(56px, 4vw, 76px);
	}

	body.page.iwut-page-hero-system .iwut-page-hero__excerpt {
		font-size: clamp(18px, 1.15vw, 22px);
	}
}

@media (max-width: 1200px) {
	body.page.iwut-page-hero-system > .wp-site-blocks > main.iwut-page-template {
		--iwut-page-shell-gutter: clamp(24px, 4vw, 48px);
	}

	body.page.iwut-page-hero-system main.iwut-page-template > .wp-block-post-content {
		width: 100%;
	}
}

@media (max-width: 700px) {
	body.iwut-page-hero-system :is(
		main#wp--skip-link--target > h1.wp-block-post-title,
		main#wp--skip-link--target > h1.wp-block-query-title,
		main#wp--skip-link--target > h1.wp-block-heading,
		main.wp-block-group > h1.wp-block-post-title,
		main.wp-block-group > h1.wp-block-query-title
	),
	body.iwut-page-hero-system .staff-hero {
		width: 100%;
		min-height: 210px;
		margin-bottom: 38px;
		padding: 38px 18px 62px;
		font-size: clamp(36px, 12vw, 54px);
	}

	body.iwut-page-hero-system .staff-hero { width: calc(100% - var(--iwut-shell-gutter)); margin-top: 132px; }
	body.iwut-page-hero-system .staff-hero .staff-hero-title { font-size: clamp(36px, 12vw, 54px); }
	body.iwut-page-hero-system :is(main h1, .staff-hero)::after { bottom: 28px; width: 82px; }
	body.iwut-hero-cooperation .entry-content > .loop-cards { grid-template-columns: 1fr; gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
	body.iwut-page-hero-system :is(main h1, .staff-hero)::before,
	body.iwut-page-hero-system :is(main h1, .staff-hero)::after { transition: none !important; }
}
