html:has(body.has-hero-portfolio) {
	width: 100%;
	max-width: 100%;
}

html.hero-portfolio-is-exiting {
	overflow: hidden;
	overflow-anchor: none;
}

body.has-hero-portfolio {
	overflow-x: clip;
	width: 100%;
	max-width: 100%;
	overscroll-behavior-x: none;
}

body.has-hero-portfolio > .wp-site-blocks {
	position: relative;
	width: 100%;
	max-width: 100%;
	overflow-x: clip;
}

body.has-hero-portfolio > .wp-site-blocks > header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	width: 100%;
	background: transparent;
	transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

body.admin-bar.has-hero-portfolio > .wp-site-blocks > header {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar.has-hero-portfolio > .wp-site-blocks > header {
		top: 46px;
	}
}

body.has-hero-portfolio.hero-portfolio-header-clear:not(.hero-portfolio-scrolled) > .wp-site-blocks > header {
	color: #fff;
}

body.has-hero-portfolio.hero-portfolio-header-dark:not(.hero-portfolio-scrolled) > .wp-site-blocks > header {
	color: rgb(17, 17, 17);
}

body.has-hero-portfolio.hero-portfolio-scrolled > .wp-site-blocks > header {
	background-color: var(--wp--preset--color--base, #fff);
	color: inherit;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

body.has-hero-portfolio main {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/*
 * TT5 breakout chain: flatten margin/padding/max-width on wrappers that
 * contain the hero so it can go fullscreen. Use :has(.hero-portfolio) (not
 * only the direct-child form) so nested hero placements still break out.
 * Post-hero stacking/width is handled separately below.
 */
body.has-hero-portfolio main:has(.hero-portfolio),
body.has-hero-portfolio main .alignfull:has(.hero-portfolio),
body.has-hero-portfolio main .entry-content:has(.hero-portfolio),
body.has-hero-portfolio main .wp-block-post-content:has(.hero-portfolio),
body.has-hero-portfolio .hero-portfolio.alignfull {
	margin-inline: 0 !important;
	padding-inline: 0 !important;
	max-width: none !important;
	width: 100%;
	box-sizing: border-box;
}

body.has-hero-portfolio main > .wp-block-group:has(.hero-portfolio),
body.has-hero-portfolio main .wp-block-group.has-global-padding:has(.hero-portfolio) {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

body.has-hero-portfolio main .wp-block-post-title {
	display: none;
}

/*
 * Post-hero siblings: stacking above the hero + solid background.
 * Do NOT re-force content-size here — that fights core/theme
 * is-layout-constrained and breaks editor alignwide/alignfull.
 * Width alignment is left to the theme; we only reinforce full/wide.
 */
body.has-hero-portfolio main .entry-content:has(.hero-portfolio) > .hero-portfolio ~ *,
body.has-hero-portfolio main .wp-block-post-content:has(.hero-portfolio) > .hero-portfolio ~ *,
body.has-hero-portfolio main .entry-content:has(.hero-portfolio) > :has(.hero-portfolio) ~ *,
body.has-hero-portfolio main .wp-block-post-content:has(.hero-portfolio) > :has(.hero-portfolio) ~ * {
	position: relative;
	z-index: 2;
	background-color: var(--wp--preset--color--base, #fff);
}

body.has-hero-portfolio main .entry-content:has(.hero-portfolio) > .hero-portfolio ~ .has-global-padding:not(.alignfull),
body.has-hero-portfolio main .wp-block-post-content:has(.hero-portfolio) > .hero-portfolio ~ .has-global-padding:not(.alignfull),
body.has-hero-portfolio main .entry-content:has(.hero-portfolio) > :has(.hero-portfolio) ~ .has-global-padding:not(.alignfull),
body.has-hero-portfolio main .wp-block-post-content:has(.hero-portfolio) > :has(.hero-portfolio) ~ .has-global-padding:not(.alignfull) {
	padding-inline: var(--wp--style--root--padding-left, var(--wp--preset--spacing--50));
}

body.has-hero-portfolio main .entry-content:has(.hero-portfolio) > .alignwide,
body.has-hero-portfolio main .wp-block-post-content:has(.hero-portfolio) > .alignwide,
body.has-hero-portfolio main .entry-content:has(.hero-portfolio) > .hero-portfolio ~ .alignwide,
body.has-hero-portfolio main .wp-block-post-content:has(.hero-portfolio) > .hero-portfolio ~ .alignwide,
body.has-hero-portfolio main .entry-content:has(.hero-portfolio) > :has(.hero-portfolio) ~ .alignwide,
body.has-hero-portfolio main .wp-block-post-content:has(.hero-portfolio) > :has(.hero-portfolio) ~ .alignwide {
	max-width: var(--wp--style--global--wide-size) !important;
	margin-inline: auto !important;
	width: 100%;
}

body.has-hero-portfolio main .entry-content:has(.hero-portfolio) > .alignfull,
body.has-hero-portfolio main .wp-block-post-content:has(.hero-portfolio) > .alignfull,
body.has-hero-portfolio main .entry-content:has(.hero-portfolio) > .hero-portfolio ~ .alignfull,
body.has-hero-portfolio main .wp-block-post-content:has(.hero-portfolio) > .hero-portfolio ~ .alignfull,
body.has-hero-portfolio main .entry-content:has(.hero-portfolio) > :has(.hero-portfolio) ~ .alignfull,
body.has-hero-portfolio main .wp-block-post-content:has(.hero-portfolio) > :has(.hero-portfolio) ~ .alignfull {
	max-width: none !important;
	margin-inline: 0 !important;
	width: 100% !important;
}

body.has-hero-portfolio .is-layout-constrained > .hero-portfolio.alignfull {
	max-width: none !important;
}

.hero-portfolio {
	--hero-portfolio-arrow-size: 3rem;
	--hero-portfolio-title-max-width: 55rem;
	--hero-portfolio-text-shadow:
		0 1px 2px rgba(0, 0, 0, 0.9),
		0 2px 10px rgba(0, 0, 0, 0.7),
		0 4px 24px rgba(0, 0, 0, 0.45);
	--hero-portfolio-fade-duration: 1s;

	position: relative;
	z-index: 1;
	box-sizing: border-box;
	width: 100%;
	height: 100svh;
	min-height: 100svh;
	overflow: hidden;
	background-color: #000;
	color: #fff;
	isolation: isolate;
}

@supports (height: 100dvh) {
	@media (max-width: 782px) and (orientation: portrait) {
		.hero-portfolio {
			height: 100dvh;
			min-height: 100dvh;
		}
	}
}

.hero-portfolio__slides {
	position: relative;
	width: 100%;
	height: 100%;
}

.hero-portfolio__slide {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	pointer-events: none;
}

.hero-portfolio__slide.is-active {
	z-index: 1;
	opacity: 1;
	pointer-events: auto;
}

.hero-portfolio.is-fading .hero-portfolio__slide.is-active {
	pointer-events: none;
}

.hero-portfolio__image {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
	z-index: 0;
}

.hero-portfolio__video {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
	pointer-events: none;
	z-index: 0;
}

.hero-portfolio__caption {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	padding: 0 1.25rem;
	text-align: center;
	text-shadow: var(--hero-portfolio-text-shadow);
	pointer-events: none;
}

.hero-portfolio__caption-group {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35em;
	box-sizing: border-box;
	width: 100%;
	max-width: min(var(--hero-portfolio-title-max-width), 100%);
	opacity: 0.85;
	pointer-events: auto;
}

@media (hover: hover) and (min-width: 783px) {
	.hero-portfolio__caption-group {
		opacity: 0.5;
		transition: opacity 0.25s ease;
	}

	.hero-portfolio__caption-group:hover,
	.hero-portfolio__caption-group:focus-within {
		opacity: 1;
	}
}

.hero-portfolio__title {
	margin: 0 !important;
	font-size: clamp(1.75rem, 5vw, 3rem);
	font-weight: 400;
	line-height: 1.2;
}

.hero-portfolio__title-link {
	display: block;
	max-width: min(var(--hero-portfolio-title-max-width), 100%);
	color: inherit;
	text-decoration: none;
}

.hero-portfolio__author-link {
	display: inline-block;
	max-width: 100%;
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
}

.hero-portfolio__author {
	margin: 0;
	width: 100%;
	font-size: clamp(1rem, 2.75vw, 1.65rem);
	font-weight: 400;
	line-height: 1.3;
}

.hero-portfolio__title-link:hover,
.hero-portfolio__author-link:hover {
	text-decoration: underline;
}

.hero-portfolio__title-link:focus-visible,
.hero-portfolio__author-link:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 4px;
}

.hero-portfolio__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--hero-portfolio-arrow-size);
	height: var(--hero-portfolio-arrow-size);
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	transform: translateY(-50%);
}

.hero-portfolio__arrow--prev {
	left: 1.5rem;
}

.hero-portfolio__arrow--next {
	right: 1.5rem;
}

.hero-portfolio__arrow:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.hero-portfolio.is-fading .hero-portfolio__slide {
		transition: none !important;
	}
}

@media (max-width: 640px) {
	.hero-portfolio__arrow--prev {
		left: 0.75rem;
	}

	.hero-portfolio__arrow--next {
		right: 0.75rem;
	}
}
