/*
 * Hero block. Loaded only on pages that use it (inc/assets.php). Mobile first;
 * desktop from 900px. Source: the builder's hero C, hero F, "image fade" and
 * "video background" CSS (docs/LOOKS-SPEC.md sections 1 and 4).
 *
 * Variables set inline on the section by hero.php:
 *   --hero-focal    object-position of the image (the editor's focal point)
 *   --hero-overlay  0 to 1, strength of the wash (fade) or shade (video)
 * and by the height option: --hero-h (desktop minimum height).
 */

/* ---------- Shared ---------- */

.hero { position: relative; }

/* Headline size (block field "Headline size"): every headline size below is multiplied by --hero-title-scale. */
.hero--title-small { --hero-title-scale: 0.85; }
.hero--title-large { --hero-title-scale: 1.15; }
.hero--title-xlarge { --hero-title-scale: 1.3; }

.hero__title { margin-top: 12px; font-size: calc(2.2rem * var(--hero-title-scale, 1)); line-height: 1.08; }

.hero__lede { max-width: 44ch; margin: 12px 0 0; color: var(--muted); font-size: 1.03rem; }

.hero__ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.hero__ctas .button { flex: 1 1 150px; }

.hero__img { width: 100%; height: 100%; object-fit: cover; object-position: var(--hero-focal, center); }

.hero__live,
.hero__kicker { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 14px; font-weight: 600; }

.hero__live { color: var(--live, var(--brand-text, var(--brand))); }

.hero .dot {
	flex: none;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--live, var(--accent));
	box-shadow: 0 0 0 0 color-mix(in srgb, var(--live, var(--accent)) 55%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
	.hero .dot { animation: hero-pulse 2.4s ease-out infinite; }
}

@keyframes hero-pulse {
	70%  { box-shadow: 0 0 0 9px transparent; }
	100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- Standard, look C: copy, status line and checks beside a photo ---------- */

.hero--standard { padding: 22px 0 28px; }
.hero--standard.hero--c { background: var(--surface); }

.hero__grid { display: grid; gap: 22px; }

.hero__checks { display: grid; gap: 7px; margin: 16px 0 0; padding: 0; list-style: none; font-size: 15px; font-weight: 500; }
.hero__checks li { display: flex; align-items: flex-start; gap: 10px; }
.hero__checks .ico { margin-top: 2px; color: var(--accent); stroke-width: 2.4; }

.hero--c .hero__media { aspect-ratio: 16 / 10; overflow: hidden; border-radius: 12px; background: var(--tint); }

/* ---------- Standard, look F: a soft photo with a ribbon and a handwritten note ---------- */

.hero--standard.hero--f { padding: 10px 0 26px; }
.hero--f .hero__grid { gap: 18px; }

.hero__script { margin: 0; color: var(--brand-text, var(--brand)); font-size: 25px; line-height: 1; }
.hero--f .hero__title { margin-top: 8px; font-size: calc(2.25rem * var(--hero-title-scale, 1)); line-height: 1.1; }
.hero--f .hero__lede { line-height: 1.6; }

.hero__art { position: relative; order: -1; height: 260px; }

.hero__photo {
	position: absolute;
	inset: 0 0 22px 8%;
	overflow: hidden;
	border-radius: 28px 28px 28px 110px;
	background: var(--tint);
}

.hero__photo .hero__img { position: absolute; inset: 0; }

.hero__ribbon {
	position: absolute;
	top: 18px;
	left: 0;
	z-index: 2;
	padding: 7px 14px 7px 12px;
	border-radius: 0 999px 999px 0;
	background: var(--brand);
	color: var(--on-brand);
	font-size: 12.5px;
	font-weight: 700;
	box-shadow: 0 8px 16px -10px rgb(0 0 0 / 0.4);
}

.hero__note {
	position: absolute;
	right: 4px;
	bottom: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: 76%;
	padding: 10px 14px 10px 10px;
	border-radius: 18px;
	background: var(--surface);
	color: var(--ink);
	box-shadow: 0 14px 30px -14px rgb(0 0 0 / 0.35);
	transform: rotate(-1.5deg);
}

.hero__note p { margin: 0; font-family: var(--fs); font-size: 17px; line-height: 1.15; }
.hero__note b { display: block; font-size: 19px; }

.hero__avatar { flex: none; width: 44px; height: 44px; overflow: hidden; border-radius: 50%; background: var(--accent-2); }
.hero__avatar img { width: 100%; height: 100%; object-fit: cover; }

.hero__doodle {
	position: absolute;
	bottom: 30px;
	left: -1%;
	z-index: 2;
	width: 54px;
	fill: none;
	stroke: var(--accent);
	stroke-width: 2.5;
	stroke-linecap: round;
}

/* ---------- Image fades into the page ---------- */

.hero--fade { overflow: hidden; padding: 0 0 26px; }

.hero--fade .hero__bg {
	position: relative;
	height: 250px;
	-webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
	mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
}

.hero__bg .hero__img { position: absolute; inset: 0; }

.hero--fade .hero__inner { position: relative; margin-top: -34px; }
.hero--fade .hero__title { margin-top: 12px; font-size: calc(2.4rem * var(--hero-title-scale, 1)); line-height: 1.06; }
.hero--fade .hero__lede { max-width: 40ch; margin-top: 10px; font-size: 1.06rem; }

.hero--fade .hero__kicker,
.hero--video .hero__kicker { display: inline-flex; padding: 6px 12px; border-radius: 999px; font-size: 13.5px; }

.hero--fade .hero__kicker { background: var(--surface); }

/* ---------- Background video ---------- */

.hero--video {
	display: flex;
	align-items: flex-end;
	min-height: 540px;
	overflow: hidden;
	background: #18201f;
	color: #fff;
}

.hero--video.hero--h-tall { min-height: 640px; }
.hero--video.hero--h-full { min-height: calc(100svh - 120px); }

.hero--video .hero__bg { position: absolute; inset: 0; }

.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--hero-focal, center); opacity: 0; transition: opacity 0.4s; }
.hero.has-video-playing .hero__video { opacity: 1; }

.hero__shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgb(0 0 0 / calc(var(--hero-overlay, 0.5) * 1.5)) 0%,
		rgb(0 0 0 / calc(var(--hero-overlay, 0.5) * 0.9)) 42%,
		rgb(0 0 0 / calc(var(--hero-overlay, 0.5) * 0.1)) 78%
	);
}

.hero--video .hero__inner { position: relative; padding-block: 28px 26px; }
.hero--video .hero__title { max-width: 18ch; font-size: calc(2.25rem * var(--hero-title-scale, 1)); line-height: 1.06; color: #fff; }
.hero--video .hero__lede { max-width: 40ch; margin-top: 10px; color: rgb(255 255 255 / 0.92); }
.hero--video .hero__kicker { background: rgb(255 255 255 / 0.16); }
.hero--video .button--secondary { background: transparent; border-color: rgb(255 255 255 / 0.85); color: #fff; }

.hero__vid-toggle {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 50%;
	background: rgb(0 0 0 / 0.5);
	color: #fff;
	cursor: pointer;
}

.hero__vid-toggle[hidden] { display: none; }
.hero__vid-toggle:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.hero__vid-play,
.hero.is-paused .hero__vid-pause { display: none; }
.hero.is-paused .hero__vid-play { display: block; }

/* ---------- Hero colour: the final word is the hero block's own colour ---------- */
/* Order: the hero block's colour (inline --hero-bg / --hero-ink, class hero--tinted), then the clinic's
   Hero colour (body.hero-tint, set under Look and feel → Element colours), then the look. */

body.hero-tint .hero:not(.hero--video),
.hero--tinted:not(.hero--video) { background: var(--hero-bg, transparent); color: var(--hero-ink, inherit); }

:is(body.hero-tint .hero, .hero--tinted):not(.hero--video) :is(.hero__title, .hero__lede, .hero__live, .hero__checks, .hero__script) { color: var(--hero-ink); }
:is(body.hero-tint .hero, .hero--tinted):not(.hero--video) .hero__lede { opacity: 0.9; }
:is(body.hero-tint .hero, .hero--tinted):not(.hero--video) .button--secondary { background: transparent; border-color: currentcolor; color: var(--hero-ink); }

/* The main button keeps the brand colour unless it would vanish into the hero colour. */
:is(body.hero-tint .hero, .hero--tinted):not(.hero--video) .button:not(.button--secondary):not(.button--alert) { background: var(--hero-btn, var(--primary)); color: var(--hero-on-btn, var(--on-primary)); }
:is(body.hero-tint .hero, .hero--tinted):not(.hero--video) .button:not(.button--secondary):not(.button--alert):hover { background: var(--hero-btn, var(--primary-hover, var(--primary))); filter: brightness(0.93); }

/* The clinic gradient (block field "Use the clinic gradient", standard style). hero.php also adds hero--tinted,
   so the text and button colours above apply; --hero-ink, --hero-btn and --hero-on-btn are set to the --grad-* ones. */
/* Beats the clinic-wide Hero colour (body.hero-tint) too: gradient on the block is more specific than a site default. */
.hero.hero--grad:not(.hero--video),
body.hero-tint .hero.hero--grad:not(.hero--video) { background: var(--grad); }
.hero--grad .hero__checks .ico { color: currentcolor; }

/* ---------- Desktop ---------- */

@media (min-width: 900px) {
	.hero__title { font-size: calc(3.5rem * var(--hero-title-scale, 1)); }
	.hero__lede { font-size: 1.15rem; }

	.hero__ctas .button { flex: 0 0 auto; min-height: 56px; padding: 0 26px; font-size: 17px; }

	.hero__grid { grid-template-columns: 1fr 1.05fr; align-items: center; gap: 56px; }

	.hero--standard.hero--c { padding: 48px 0 56px; }
	.hero--c .hero__media { aspect-ratio: 5 / 4; }

	.hero--standard.hero--f { padding: 18px 0 34px; }
	.hero--f .hero__grid { min-height: 470px; }
	.hero--f .hero__title { font-size: calc(3.6rem * var(--hero-title-scale, 1)); line-height: 1.06; }
	.hero--f .hero__lede { font-size: 1.15rem; }
	.hero__script { font-size: 32px; }
	.hero__art { order: 0; height: 470px; }
	.hero__photo { inset: 0 0 34px 0; border-radius: 36px 36px 36px 180px; }
	.hero__ribbon { top: 28px; left: -12px; padding: 9px 18px 9px 16px; font-size: 14px; }
	.hero__note { right: -10px; max-width: 62%; padding: 14px 18px 14px 14px; }
	.hero__note p { font-size: 20px; }
	.hero__note b { font-size: 23px; }
	.hero__avatar { width: 54px; height: 54px; }
	.hero__doodle { bottom: 60px; left: -40px; width: 70px; }

	/* Fade and video: the image fills the section and the copy sits over it. */
	.hero--fade,
	.hero--video { --hero-h: 560px; min-height: var(--hero-h); }
	.hero--h-compact { --hero-h: 280px; }
	.hero--h-tall { --hero-h: 700px; }
	.hero--h-full { --hero-h: calc(100svh - 88px); }

	.hero--fade { display: flex; align-items: center; padding: 60px 0 80px; }
	.hero--fade.hero--h-compact { padding: 34px 0 40px; }

	.hero--fade .hero__bg { position: absolute; inset: 0; height: auto; }

	/* A wash from the page colour on the copy's side, so dark text stays readable. */
	.hero--fade .hero__bg::after {
		content: "";
		position: absolute;
		inset: 0;
		background: linear-gradient(to right, var(--hero-bg, var(--bg)), transparent 75%);
		opacity: var(--hero-overlay, 0.5);
	}

	/* Fade from the right: the image sits on the right and fades out towards the
	   left. The copy stays on the plain page colour, so no wash is needed. */
	.hero--fade-right .hero__bg {
		left: auto;
		width: 62%;
		-webkit-mask-image: linear-gradient(to left, #000 45%, transparent 100%);
		mask-image: linear-gradient(to left, #000 45%, transparent 100%);
	}
	.hero--fade-right .hero__bg::after { display: none; }

	.hero--fade .hero__inner { margin-top: 0; }
	.hero--fade .hero__copy,
	.hero--video .hero__copy { max-width: 36rem; }
	.hero--fade .hero__title { font-size: calc(3.4rem * var(--hero-title-scale, 1)); }

	.hero--video { align-items: center; }
	.hero--video .hero__inner { padding-block: 80px; }
	.hero--video .hero__title { font-size: calc(3.4rem * var(--hero-title-scale, 1)); }
}

/* ---------- Compact (a slim page header) ---------- */

.hero--h-compact .hero__title { font-size: calc(1.9rem * var(--hero-title-scale, 1)); }
.hero--h-compact.hero--fade .hero__bg { height: 150px; }
.hero--h-compact .hero__ctas { margin-top: 14px; }
.hero--standard.hero--h-compact .hero__grid { padding-block: 8px; }

@media (min-width: 900px) {
	.hero--h-compact .hero__title { font-size: calc(2.6rem * var(--hero-title-scale, 1)); }
	.hero--standard.hero--h-compact .hero__grid { padding-block: 18px; }
	.hero--standard.hero--h-compact .hero__media { max-height: 280px; }
	.hero--standard.hero--h-compact .hero__lede { margin-top: 8px; }
}

/* ---------- Order of text and image (standard hero; block fields "Order on phones" and "Order on desktop") ---------- */
/* No class = the look's own order. Look C's photo and look F's art are the second grid item. */

@media (max-width: 899.98px) {
	.hero--m-image .hero__media,
	.hero--m-image .hero__art { order: -1; }

	.hero--m-text .hero__media,
	.hero--m-text .hero__art { order: 1; }
}

@media (min-width: 900px) {
	.hero--d-image .hero__media,
	.hero--d-image .hero__art { order: -1; }

	/* The wider column stays under the text. */
	.hero--d-image .hero__grid { grid-template-columns: 1.05fr 1fr; }

	.hero--d-text .hero__media,
	.hero--d-text .hero__art { order: 1; }
}

/* ---------- Picture style (standard hero; block fields Shape, Border and Shadow) ---------- */
/* Each choice sets the same variables the site's picture style uses (--pic-r, --pic-border, --pic-shadow) on the
   hero, then the rules at the end apply them to look C's photo (.hero__media) and look F's (.hero__photo).
   No class = "Default": the site's picture style, then the look. */

.hero--shape-square { --pic-r: 0; }
.hero--shape-soft   { --pic-r: 14px; }
.hero--shape-large  { --pic-r: 44px; }
.hero--shape-arch   { --pic-r: 50% 50% 20px 20px / 36% 36% 20px 20px; }
.hero--shape-cut-bl { --pic-r: 20px 20px 20px 140px; }
.hero--shape-cut-tr { --pic-r: 20px 140px 20px 20px; }
.hero--shape-leaf   { --pic-r: 140px 20px 140px 20px; }
.hero--shape-blob   { --pic-r: 63% 37% 54% 46% / 55% 48% 52% 45%; }

.hero--bdr-none   { --pic-border: 0; }
.hero--bdr-line   { --pic-border: 1px solid var(--line); }
.hero--bdr-brand  { --pic-border: 4px solid var(--brand); }
.hero--bdr-accent { --pic-border: 4px solid var(--accent); }
.hero--bdr-ink    { --pic-border: 4px solid var(--ink); }
.hero--bdr-frame  { --pic-border: 10px solid var(--surface); }

.hero--shd-none      { --pic-shadow: none; }
.hero--shd-soft      { --pic-shadow: 0 10px 24px -14px color-mix(in srgb, var(--ink) 55%, transparent); }
.hero--shd-lift      { --pic-shadow: 0 30px 60px -24px color-mix(in srgb, var(--ink) 70%, transparent); }
.hero--shd-hard      { --pic-shadow: 8px 8px 0 var(--ink); }
.hero--shd-brand-3d  { --pic-shadow: 10px 10px 0 var(--brand); }
.hero--shd-accent-3d { --pic-shadow: 10px 10px 0 var(--accent); }
.hero--shd-glow      { --pic-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 14%, transparent), 0 24px 60px -20px color-mix(in srgb, var(--brand) 60%, transparent); }

.hero:is([class*="hero--shape-"]) :is(.hero__media, .hero__photo) { border-radius: var(--pic-r); }
.hero:is([class*="hero--bdr-"]) :is(.hero__media, .hero__photo)   { border: var(--pic-border); }
.hero:is([class*="hero--shd-"]) :is(.hero__media, .hero__photo)   { box-shadow: var(--pic-shadow); }

/* The arch is tall and narrow, so the picture is not stretched into a wide strip. */
.hero--shape-arch .hero__media { width: 100%; max-width: 380px; margin-inline: auto; aspect-ratio: 4 / 5; }
.hero--shape-arch .hero__photo { left: 14%; right: 14%; }

@media (min-width: 900px) {
	.hero--shape-arch .hero__media { max-width: 440px; margin-inline: 0; justify-self: end; aspect-ratio: 4 / 5; }
	.hero--shape-arch.hero--d-image .hero__media { justify-self: start; }
	.hero--shape-arch .hero__photo { left: 12%; right: 12%; }
}

/* ---------- Standard hero: picture size and the slideshow ---------- */

/* Taller, larger picture (standard style; Compact height and the arch shape keep their own sizes). */
.hero--pic-large:not(.hero--h-compact):not(.hero--shape-arch).hero--c .hero__media { aspect-ratio: 4 / 3; }
.hero--pic-xlarge:not(.hero--h-compact):not(.hero--shape-arch).hero--c .hero__media { aspect-ratio: 1 / 1; }
.hero--pic-large:not(.hero--h-compact).hero--f .hero__art { height: 340px; }
.hero--pic-xlarge:not(.hero--h-compact).hero--f .hero__art { height: 430px; }

@media (min-width: 900px) {
	.hero--pic-large:not(.hero--h-compact):not(.hero--shape-arch).hero--c .hero__media { aspect-ratio: 1 / 1; }
	.hero--pic-xlarge:not(.hero--h-compact):not(.hero--shape-arch).hero--c .hero__media { aspect-ratio: 4 / 5; }
	.hero--pic-large:not(.hero--h-compact).hero--f .hero__art { height: 560px; }
	.hero--pic-xlarge:not(.hero--h-compact).hero--f .hero__art { height: 680px; }
}

.hero--c .hero__media { position: relative; }

/* The slides fill the picture frame and fade into one another. */
.hero__slides { position: absolute; inset: 0; touch-action: pan-y; }

.hero__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.9s ease, visibility 0s linear 0.9s;
}

.hero__slide.is-active { opacity: 1; visibility: visible; transition: opacity 0.9s ease, visibility 0s; }

/* Arrows and dots sit inside the picture, small and quiet. */
.hero__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	margin-top: -18px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgb(0 0 0 / 0.35);
	color: #fff;
	cursor: pointer;
	opacity: 0.85;
	transition: background-color 0.2s, opacity 0.2s;
}

.hero__arrow[hidden],
.hero__dots[hidden] { display: none; }
.hero__arrow:hover { background: rgb(0 0 0 / 0.6); opacity: 1; }
.hero__arrow:focus-visible,
.hero__dot:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.hero__arrow--prev { left: 10px; }
.hero__arrow--next { right: 10px; }
.hero__arrow--prev .ico { transform: rotate(90deg); }
.hero__arrow--next .ico { transform: rotate(-90deg); }

.hero__dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 12px;
	z-index: 2;
	display: flex;
	justify-content: center;
	gap: 2px;
}

/* A 24px tap target around a small 8px dot. */
.hero__dot {
	position: relative;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.hero__dot::after {
	content: "";
	position: absolute;
	inset: 8px;
	border-radius: 50%;
	background: rgb(255 255 255 / 0.55);
	box-shadow: 0 0 0 1px rgb(0 0 0 / 0.18);
	transition: background-color 0.2s;
}

.hero__dot[aria-current="true"]::after { background: #fff; }

@media (prefers-reduced-motion: reduce) {
	.hero__slide,
	.hero__slide.is-active { transition: none; }
}
