:root {
	--iwut-page-hero-navy: #16295a;
	--iwut-page-hero-navy-deep: #0b1530;
	--iwut-page-hero-pattern-color: #3fc3ba;
	--iwut-page-hero-pattern-opacity: .06;
}

.iwut-page-template > .wp-block-post-content {
	box-sizing: border-box;
	width: 100%;
	margin-block-end: clamp(48px, 7vw, 96px);
	overflow-wrap: anywhere;
}

.iwut-page-template > .wp-block-post-content :where(img, video, iframe) {
	max-width: 100%;
	height: auto;
}

.iwut-page-template > .wp-block-post-content > :first-child {
	margin-block-start: 0;
}

.iwut-page-template > .wp-block-post-content > :last-child {
	margin-block-end: 0;
}

.iwut-page-hero {
	--iwut-page-hero-tile: clamp(56px, 6vw, 86px);
	--iwut-page-hero-pattern: url("svg/girih/girih-strap-interlace.svg");
	position: relative;
	display: grid;
	place-items: center;
	width: 100%;
	max-width: none !important;
	min-height: clamp(230px, 28vw, 330px);
	margin: 0 0 clamp(34px, 5vw, 58px);
	padding: 24px;
	overflow: hidden;
	isolation: isolate;
	background: linear-gradient(145deg, var(--iwut-page-hero-navy), var(--iwut-page-hero-navy-deep));
	color: #fff;
}

.iwut-page-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	background: var(--iwut-page-hero-pattern-color);
	-webkit-mask: var(--iwut-page-hero-pattern) center / var(--iwut-page-hero-tile) var(--iwut-page-hero-tile) repeat;
	mask: var(--iwut-page-hero-pattern) center / var(--iwut-page-hero-tile) var(--iwut-page-hero-tile) repeat;
	opacity: var(--iwut-page-hero-pattern-opacity);
	pointer-events: none;
}

.iwut-page-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(90deg, rgba(11, 21, 48, .9), rgba(22, 41, 90, .72));
	pointer-events: none;
}

.iwut-page-hero__media {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	margin: 0;
}

.iwut-page-hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.iwut-page-hero__content {
	position: relative;
	z-index: 3;
	width: 100%;
	margin: 0;
	text-align: center;
}

.iwut-page-hero .iwut-page-hero__title {
	margin: 0;
	color: inherit;
	font: 700 clamp(40px, 6vw, 72px)/1.06 "IWUT Source Serif", "Noto Serif", Georgia, serif;
	letter-spacing: -.025em;
	text-wrap: balance;
}

.iwut-page-hero__excerpt {
	max-width: 68ch;
	margin: 22px auto 0;
	color: rgba(255, 255, 255, .88);
	font-size: clamp(16px, 1.6vw, 20px);
	line-height: 1.65;
}

.iwut-page-hero__excerpt:empty {
	display: none;
}

.iwut-page-template--standard .iwut-page-hero {
	--iwut-page-hero-pattern: url("svg/girih/girih-khatim-8star.svg");
	--iwut-page-hero-tile: clamp(56px, 6vw, 84px);
}

.iwut-page-template--hub .iwut-page-hero {
	--iwut-page-hero-pattern: url("svg/girih/girih-octagon-star-tiling.svg");
	--iwut-page-hero-tile: clamp(64px, 7vw, 92px);
}

.iwut-page-template--landing .iwut-page-hero {
	--iwut-page-hero-pattern: url("svg/girih/girih-star-cross-tiling.svg");
	--iwut-page-hero-tile: clamp(68px, 7vw, 96px);
}

.iwut-page-template--form-guide .iwut-page-hero {
	--iwut-page-hero-pattern: url("svg/girih/girih-hexagon-rosette.svg");
	--iwut-page-hero-tile: clamp(58px, 6vw, 86px);
}

/* A Page-level choice overrides the template fallback without changing Hero content. */
.iwut-page-hero-pattern--strap-interlace .iwut-page-hero {
	--iwut-page-hero-pattern: url("svg/girih/girih-strap-interlace.svg");
}

.iwut-page-hero-pattern--khatim-8star .iwut-page-hero {
	--iwut-page-hero-pattern: url("svg/girih/girih-khatim-8star.svg");
}

.iwut-page-hero-pattern--octagon-star .iwut-page-hero {
	--iwut-page-hero-pattern: url("svg/girih/girih-octagon-star-tiling.svg");
}

.iwut-page-hero-pattern--star-cross .iwut-page-hero {
	--iwut-page-hero-pattern: url("svg/girih/girih-star-cross-tiling.svg");
}

.iwut-page-hero-pattern--hexagon-rosette .iwut-page-hero {
	--iwut-page-hero-pattern: url("svg/girih/girih-hexagon-rosette.svg");
}

body[class*="iwut-page-hero-pattern--"] .iwut-page-hero {
	--iwut-page-hero-tile: clamp(56px, 6vw, 86px);
}

.iwut-research-hero {
	--iwut-page-hero-pattern: url("svg/girih/girih-octagon-star-tiling.svg");
	--iwut-page-hero-tile: clamp(60px, 6vw, 86px);
}

@media (max-width: 700px) {
	.iwut-page-hero {
		min-height: 230px;
		padding: 24px;
	}

	.iwut-page-hero__excerpt {
		margin-top: 16px;
	}
}

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