/**
 * Humanitas home.
 *
 * Desktop (≥1500px) follows the 1920 artboard.
 * Tablet and narrow desktop (501–1499px) keep that layout, with type
 * that shrinks as the screen gets smaller.
 * Phones (≤500px) use the stacked portrait artboard.
 *
 * The hero photo is a light studio shot. The section behind it uses the
 * same floor color, so a sliver of background does not read as a gray band.
 */

:root {
	--hm-hero-floor: #f8f8f8;
	/* 95px tall and 30px type at a 1500px desktop, down to 36px tall
	   and 15px type on a 390px phone. One slope, no font breakpoints. */
	--hm-bar: clamp(36px, calc(36px + (100vw - 390px) * 59 / 1110), 95px);
	/* Firefox on a phone darkens a light page that never opts out:
	   pale hero text, and black behind any band with no background. */
	color-scheme: only light;
	background-color: #fff;
}

body.uwp-content-sections .uwp-main > .uwp-container--fluid {
	max-width: none;
	padding-inline: 0;
}

.uwp-entry-content--sections > .hm-band {
	margin-block: 0;
	max-width: none;
}

.editor-styles-wrapper .hm-band {
	margin-block: 0;
}

/* Hero
   The jug photo is one wide frame: the pot itself starts 53.7% across it.
   --hm-pot-x is where that edge should sit, just after the title, so the
   gap stays even while the left inset shrinks on narrower desktops.
   The handle must stay to the right of the title, and inside the viewport.
   On the front, the hero is also capped so the contact bar is in the first screen. */

.hm-hero.uwp-section {
	--hm-title-size: 40px;
	--hm-title-w: calc(15.2 * var(--hm-title-size));
	--hm-pot-gap: clamp(40px, 3vw, 64px);
	--hm-pad-top: clamp(72px, 12.5vh, 150px);
	--hm-pot-right: clamp(36px, 3vw, 72px);
	--hm-hero-h: min(45.52vw, 874px);
	/* The photo is a little taller than the hero so its floor meets the
	   contact bar, including on a tall window. */
	--hm-img-h: calc(var(--hm-hero-h) + 64px);
	--hm-pot-w: calc(var(--hm-img-h) * 0.78);
	--hm-pad-left: clamp(32px, 21.667vw, min(416px, 100vw - var(--hm-title-w) - var(--hm-pot-gap) - var(--hm-pot-w) - var(--hm-pot-right) - 16px));
	/* The copy sits in a centered 1920 frame. On 2K that frame is inset,
	   and the jug has to follow it or the handle lands on the title. */
	--hm-stage-offset: max(0px, calc((100% - 1920px) / 2));
	--hm-pot-x: calc(var(--hm-stage-offset) + var(--hm-pad-left) + var(--hm-title-w) + var(--hm-pot-gap));
	background-color: var(--hm-hero-floor);
	background-image: none;
	max-height: 874px;
	min-height: var(--hm-hero-h);
	padding-block: 0;
}

@media (min-width: 501px) {
	body.uwp-content-sections .hm-hero.uwp-section {
		--hm-hero-h: min(45.52vw, 874px, 100dvh - var(--hm-bar));
		max-height: var(--hm-hero-h);
	}
}

.hm-hero .uwp-section__media {
	aspect-ratio: 1920 / 856;
	height: calc(100% + 64px);
	inset: 0 auto 0 var(--hm-pot-x);
	/* 16.1% is the rim inside the photo, so the shift lines it up with the logo. */
	transform: translate(-53.7%, calc(var(--hm-pad-top) - 16.1%));
	width: auto;
}

/* On a wide screen the photo is narrower than the hero, and the theme
   clips anything past it, so the flat surface color shows as a seam.
   A thin slice of each edge is stretched outward, so the fill is the
   photo's own pixels rather than a flat gray. */
@media (min-width: 1025px) {
	.hm-hero .uwp-section__media {
		overflow: visible;
	}

	.hm-hero .uwp-section__media::before,
	.hm-hero .uwp-section__media::after {
		content: "";
		position: absolute;
		top: 0;
		bottom: 0;
		width: 8px;
		background-image: url("../images/jug.webp");
		background-repeat: no-repeat;
		background-size: auto 100%;
	}

	.hm-hero .uwp-section__media::before {
		right: 100%;
		background-position: left top;
		transform: scaleX(400);
		transform-origin: right center;
	}

	.hm-hero .uwp-section__media::after {
		left: 100%;
		background-position: right top;
		transform: scaleX(400);
		transform-origin: left center;
	}
}

.hm-hero .uwp-section__inner {
	inset: 0;
	position: absolute;
}

.hm-hero__stage.uwp-box {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
	height: 100%;
	justify-content: flex-start;
	max-width: 1920px;
	padding: var(--hm-pad-top) 24px clamp(20px, 2.5vh, 40px) var(--hm-pad-left);
}

.hm-hero__logo {
	margin: 0 0 24px;
	width: min(24.22vw, 465px);
}

.hm-hero__logo img {
	height: auto;
	width: 100%;
}

.hm-hero .hm-hero__title {
	margin: 0 0 11px;
	max-width: 100%;
}

.hm-hero__title .uwp-heading__title {
	color: var(--uwp-color-heading);
	font-size: var(--hm-title-size);
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.25;
	max-width: 15.2em;
	text-transform: uppercase;
	text-wrap: wrap;
}

.hm-hero__lead {
	color: var(--uwp-color-text);
	font-size: 24px;
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.375;
	margin: 0 0 11px;
	max-width: 21.2em;
}

.hm-hero .hm-pill {
	border-radius: 24px;
	border-width: 1px;
	box-sizing: border-box;
	font-size: 16px;
	font-weight: 600;
	height: 48px;
	letter-spacing: 0.04em;
	line-height: 1;
	min-height: 48px;
	padding: 0 24px;
	width: 200px;
}

.hm-hero .hm-pill__link,
.hm-hero .hm-pill__sep {
	min-height: 0;
}

/* Narrow desktop: the 1920 type does not fit yet. The pot still
   tracks the title, so a smaller size is what keeps the gap.
   Drop the tall artboard top padding — on a shorter hero it parks
   the logo and copy on the floor. Keep the side inset only. */

@media (min-width: 501px) and (max-width: 1499px) {
	.hm-hero.uwp-section {
		--hm-title-size: clamp(18px, 2.5vw, 36px);
		/* Between the artboard’s tall inset and a flush top edge. */
		--hm-pad-top: clamp(32px, 6vh, 64px);
	}

	.hm-hero__stage.uwp-box {
		padding: var(--hm-pad-top) 24px 24px var(--hm-pad-left);
	}

	.hm-hero__lead {
		font-size: clamp(14px, 1.5vw, 22px);
		max-width: min(22em, 100%);
	}

	.hm-hero .hm-pill {
		font-size: clamp(12px, 1.067vw, 16px);
		height: clamp(32px, 3.2vw, 48px);
		min-height: clamp(32px, 3.2vw, 48px);
		padding-inline: clamp(12px, 1.6vw, 24px);
		width: clamp(148px, 13.333vw, 200px);
	}

	.hm-split__copy {
		padding: 36px 28px 36px 6%;
	}

	.hm-split--parama .hm-split__copy {
		padding: 36px 6% 36px 28px;
	}
}

/* Just above the phone layout the title floor and the extra photo
   height would push the jug onto the heading. Keep the desktop
   arrangement, with a shorter pot and smaller type. */

@media (min-width: 501px) and (max-width: 699px) {
	.hm-hero.uwp-section {
		--hm-title-size: clamp(13px, 2.5vw, 18px);
		--hm-pot-gap: clamp(20px, 3vw, 40px);
		--hm-pot-right: clamp(12px, 2.5vw, 36px);
		--hm-pad-top: clamp(16px, 4vh, 28px);
		--hm-img-h: var(--hm-hero-h);
	}

	.hm-hero .uwp-section__media {
		height: 100%;
	}

	.hm-hero__stage.uwp-box {
		flex-wrap: nowrap;
		padding-block: var(--hm-pad-top) 8px;
	}

	.hm-hero .hm-hero__title,
	.hm-hero .hm-hero__lead {
		margin-block-end: 8px;
	}

	.hm-hero__logo {
		margin-block-end: 8px;
	}

	.hm-hero__lead {
		font-size: clamp(12px, 1.5vw, 14px);
		max-width: min(22em, var(--hm-title-w));
	}
}

/* Contact bar
   Height is fixed to --hm-bar so the hero can use 100dvh − that value
   and land flush on the viewport. Block padding is cleared so the bar
   does not grow past the shared token. */

.hm-contact.uwp-section {
	--uwp-pad: 0;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: var(--hm-bar);
	height: var(--hm-bar);
	padding-block: 0;
}

.hm-contact,
.hm-contact p {
	color: var(--wp--preset--color--white);
	font-size: clamp(15px, calc(15px + (100vw - 390px) * 15 / 1110), 30px);
	font-weight: 400;
	line-height: 1.2;
}

.hm-contact a {
	color: inherit;
	text-decoration: none;
}

.hm-contact a:hover {
	text-decoration: underline;
}

.hm-contact .uwp-box {
	padding-inline: 24px;
}

@media (min-width: 1500px) {
	.hm-hero .hm-hero__title {
		margin-block-end: 80px;
	}
}

/* Splits */

.hm-split.uwp-section {
	background-color: #fff;
	padding-block: 0;
}

/* Parent :target uses 2em scroll-margin, which leaves the Susiekime
   bar in view after the hero pill jumps here. Land flush on the section. */
.hm-split--veikla:target,
.hm-split--parama:target {
	scroll-margin-block-start: 0;
}

.hm-split .uwp-row {
	align-items: stretch;
}

.hm-split__copy {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 48px 24px 48px 70px;
}

.hm-split--parama .hm-split__copy {
	align-items: flex-end;
	padding: 48px 70px 48px 24px;
	text-align: end;
}

.hm-split .hm-split__title {
	margin-block-end: 14px;
	margin-inline-start: 38px;
}

.hm-split--parama .hm-split__title {
	margin-block-end: 6px;
	margin-inline-start: 0;
}

.hm-split__title .uwp-heading__title {
	font-size: clamp(36px, 2.6vw, 50px);
	font-weight: 400;
	line-height: 1.1;
	text-transform: uppercase;
}

.hm-split--veikla .hm-split__title .uwp-heading__title {
	color: var(--uwp-color-heading);
}

.hm-split--parama .hm-split__title .uwp-heading__title {
	color: var(--uwp-color-text);
}

.hm-list.uwp-list {
	color: var(--uwp-color-primary);
	font-size: 24px;
	font-weight: 400;
	gap: 0;
	line-height: 1.35;
}

.hm-rule {
	border-inline-start: 8px solid var(--uwp-color-border);
	padding-inline-start: 30px;
}

.hm-parama-text {
	color: var(--uwp-color-primary);
	font-size: 24px;
	font-weight: 400;
	line-height: 1.45;
	margin: 0;
	max-width: 380px;
}

.hm-split--parama .hm-rule {
	border-inline-start: 0;
	padding-inline-start: 0;
}

.hm-figure {
	font-size: 30px;
	font-weight: 700;
}

.hm-photo {
	min-height: 280px;
}

.hm-photo .uwp-image,
.hm-photo img {
	display: block;
	height: 100%;
	width: 100%;
}

.hm-photo img {
	max-height: 480px;
	min-height: 280px;
	object-fit: cover;
}

.hm-photo--right img {
	object-position: right center;
}

.hm-photo--left img {
	object-position: left center;
}

@media (min-width: 1025px) {
	.hm-split .uwp-row {
		min-height: 476px;
	}
}

/* Footer */

.uwp-footer {
	background: transparent;
	border: 0;
	padding: 0;
}

.hm-footer.uwp-section {
	color: var(--wp--preset--color--white);
	padding: 30px 24px 38px;
	text-align: center;
}

.hm-footer a {
	color: inherit;
	text-decoration: none;
}

.hm-footer a:hover {
	text-decoration: underline;
}

.hm-footer__title.uwp-heading {
	margin-block-end: 10px;
	text-align: center;
}

.hm-footer__title .uwp-heading__title {
	color: var(--wp--preset--color--white);
	font-size: 50px;
	font-weight: 400;
	letter-spacing: 0.08em;
	line-height: 1.2;
	text-transform: uppercase;
}

.hm-footer__text {
	color: var(--wp--preset--color--white);
	font-size: 24px;
	font-weight: 400;
	line-height: 1.4;
	margin: 0;
}

/* Phones only. Tablets keep the desktop arrangement. */

@media (max-width: 500px) {
	.hm-hero.uwp-section {
		aspect-ratio: auto;
		background-image: none;
		display: flex;
		flex-direction: column;
		max-height: none;
		min-height: 0;
	}

	.hm-hero .uwp-section__media {
		aspect-ratio: 360 / 736;
		height: auto;
		inset: auto;
		mask-image: none;
		-webkit-mask-image: none;
		position: relative;
		transform: none;
		width: 100%;
		z-index: 0;
	}

	.hm-hero .uwp-section__media img {
		aspect-ratio: 360 / 736;
		height: auto;
		object-fit: cover;
		object-position: center;
		width: 100%;
	}

	.hm-hero .uwp-section__inner {
		inset: 0 0 auto;
		position: absolute;
		z-index: 1;
	}

	.hm-hero__stage.uwp-box {
		gap: 14px;
		height: auto;
		padding: 36px 30px 20px;
	}

	.hm-hero__logo {
		margin-block-end: 32px;
		width: min(225px, 70%);
	}

	.hm-hero__title,
	.hm-hero__lead {
		max-width: 36rem;
	}

	.hm-hero__title .uwp-heading__title {
		font-size: 24px;
		line-height: 1.15;
		max-width: none;
	}

	.hm-hero__lead {
		font-size: 16px;
		font-weight: 400;
		line-height: 1.4;
	}

	.hm-hero .hm-pill {
		border-width: 1px;
		font-size: 16px;
		font-weight: 600;
		height: auto;
		letter-spacing: 0.04em;
		min-height: 44px;
		padding: 0 1.15em;
		width: max-content;
	}

	.hm-contact {
		font-size: 18px;
		line-height: 1.25;
	}

	.hm-contact__label,
	.hm-contact__sep {
		display: none;
	}

	.hm-split__copy,
	.hm-split--parama .hm-split__copy {
		align-items: stretch;
		padding: 20px 20px 24px 30px;
		text-align: start;
	}

	.hm-split .hm-split__title {
		margin-block-end: 6px;
		margin-inline-start: 23px;
	}

	.hm-split__title .uwp-heading__title {
		font-size: 24px;
		line-height: 1.25;
	}

	.hm-list.uwp-list,
	.hm-parama-text,
	.hm-figure {
		font-size: 16px;
		line-height: 1.35;
	}

	.hm-rule,
	.hm-split--parama .hm-rule {
		border-inline-start: 4px solid var(--uwp-color-border);
		padding-inline-start: 19px;
	}

	.hm-parama-text {
		max-width: none;
	}

	.hm-split--parama .uwp-row {
		flex-direction: column-reverse;
	}

	.hm-photo {
		min-height: 0;
	}

	.hm-photo img,
	.hm-photo--right img,
	.hm-photo--left img {
		height: min(64vw, 280px);
		max-height: 280px;
		min-height: 0;
		object-fit: cover;
		width: 100%;
	}

	.hm-photo--right img {
		object-position: 88% 58%;
	}

	.hm-photo--left img {
		object-position: 16% 78%;
	}

	.hm-footer.uwp-section {
		padding: 16px 20px 20px 30px;
		text-align: start;
	}

	.hm-footer__title.uwp-heading {
		text-align: start;
	}

	.hm-footer__title .uwp-heading__title {
		font-size: 18px;
		font-weight: 600;
		line-height: 1.3;
	}

	.hm-footer__text {
		font-size: 16px;
		line-height: 1.35;
	}
}

/* Phones: flat floor, the cropped pot on its own, and the contact line
   (number and email) inside the first screen. The pot takes whatever
   height is left and stays centered. */

@media (max-width: 500px) {
	.hm-hero.uwp-section {
		background-color: var(--hm-hero-floor);
		background-image: none;
		height: calc(100dvh - var(--hm-bar));
		max-height: calc(100dvh - var(--hm-bar));
		min-height: 0;
	}

	.hm-hero .uwp-section__inner {
		flex: 0 0 auto;
		inset: auto;
		order: 1;
		position: relative;
	}

	.hm-hero .uwp-section__media {
		aspect-ratio: auto;
		background: transparent;
		flex: 1 1 auto;
		height: auto;
		inset: auto;
		min-height: 0;
		order: 2;
		position: relative;
		transform: none;
		width: 100%;
	}

	/* The file is centered, but the jug body sits left of that because of
	   the handle and the shadow. Shift and scale so the body, not the
	   picture, lands in the middle and reads a little larger. */
	.hm-hero .uwp-section__media img {
		aspect-ratio: auto;
		height: 100%;
		left: 0;
		min-height: 0;
		object-fit: contain;
		object-position: center;
		position: absolute;
		top: 0;
		transform: translateX(7.2%) scale(1.06);
		transform-origin: center center;
		width: 100%;
	}

	.editor-styles-wrapper .hm-hero .uwp-section__media img {
		content: url("../images/jug-mobile.webp");
	}

	.hm-hero__stage.uwp-box {
		gap: 8px;
		padding: 32px 33px 0;
	}

	.hm-hero__logo {
		margin-block-end: 12px;
		width: min(190px, 58%);
	}

	.hm-hero .hm-hero__title,
	.hm-hero .hm-hero__lead {
		margin-block-end: 0;
	}

	.hm-hero__title .uwp-heading__title {
		font-size: 24px;
		font-weight: 600;
		line-height: 1.25;
	}

	.hm-hero__lead {
		font-size: 13px;
		line-height: 18px;
		max-width: 300px;
	}

	.hm-hero .hm-pill {
		border-color: #333;
		border-width: 1px;
		font-size: 11px;
		font-weight: 600;
		height: 29px;
		letter-spacing: 0.04em;
		min-height: 29px;
		padding: 0 14px;
	}

	.hm-hero .hm-pill__link {
		min-height: 0;
	}

	.hm-contact p {
		margin: 0;
	}

	.hm-contact__line.uwp-box {
		align-items: center;
		column-gap: 0.4em;
		flex-direction: row;
		flex-wrap: nowrap;
		padding-inline: 8px;
	}

	.hm-contact__line.uwp-box > * {
		flex: 0 0 auto;
		white-space: nowrap;
	}

	.hm-contact__sep {
		display: block;
	}

	.hm-footer__text .hm-footer__line {
		display: block;
	}

	.hm-footer__text br {
		display: none;
	}
}

/* The parent theme stacks the split columns and the contact line from
   1024 down. Above the phone breakpoint they stay side by side, like desktop.
   Type below 1500 sits after the base rules so these sizes win. */

@media (min-width: 501px) and (max-width: 1024px) {
	.hm-split .uwp-column {
		--uwp-col-n: 50;
	}

	.hm-contact__line.uwp-box {
		flex-direction: row;
		flex-wrap: nowrap;
		gap: 0.45em;
	}
}

@media (min-width: 501px) and (max-width: 1499px) {
	.hm-split__title .uwp-heading__title {
		font-size: clamp(26px, 3.2vw, 46px);
	}

	.hm-list.uwp-list,
	.hm-parama-text,
	.hm-footer__text {
		font-size: clamp(16px, 1.6vw, 24px);
	}

	.hm-figure {
		font-size: clamp(20px, 2vw, 30px);
	}

	.hm-footer__title .uwp-heading__title {
		font-size: clamp(28px, 3.2vw, 48px);
	}
}

/*
 * Editor canvas. The image block always renders a caption field, and the
 * heading always renders a subtitle field. Empty ones stay out of the layout
 * until that block is selected. Photos fill the column instead of using
 * their intrinsic width, which otherwise spills into the text column.
 */

.editor-styles-wrapper .hm-band .uwp-heading:not(.is-selected) > .uwp-heading__sub {
	display: none;
}

.editor-styles-wrapper .hm-photo {
	overflow: hidden;
}

@media (min-width: 1025px) {
	.editor-styles-wrapper .hm-photo {
		min-height: 476px;
		position: relative;
	}

	.editor-styles-wrapper .hm-photo .uwp-image {
		inset: 0;
		margin: 0;
		max-width: none;
		position: absolute;
	}

	.editor-styles-wrapper .hm-photo .uwp-image img {
		height: 100%;
		max-height: none;
		max-width: none;
		min-height: 0;
		object-fit: cover;
		width: 100%;
	}
}

.editor-styles-wrapper .hm-photo .uwp-image:not(.is-selected) > figcaption {
	display: none;
}

.editor-styles-wrapper .hm-photo .uwp-image.is-selected > figcaption {
	background: rgb(255 255 255 / 92%);
	inset-block-end: 0;
	inset-inline: 0;
	margin: 0;
	padding: 8px 12px;
	position: absolute;
}

