/* ==========================================================================
   HIMPEL Highlight — a coloured panel with a picture on one side
   --------------------------------------------------------------------------
   The panel is the home page's global section, measure for measure: 20px of
   padding, a 24px radius, the brand green, a 460px picture at a 16px radius.
   Everything is scoped under .himpel-hl.
   ========================================================================== */

.himpel-hl {
	--himpel-primary: #0b7347;
	--himpel-primary-dark: #095c39;
	--himpel-secondary: #f3f4ea;
	--himpel-white: #ffffff;
	--himpel-dark: #121212;

	position: relative;
	z-index: 2;
	width: auto;

	/* Written by himpel-bleed.js when a theme container holds this section. */
	margin-left: var(--himpel-bleed-l, 0px);
	margin-right: var(--himpel-bleed-r, 0px);

	background-color: var(--hhl-bg, var(--himpel-secondary));
	box-sizing: border-box;
}

.himpel-hl *,
.himpel-hl *::before,
.himpel-hl *::after {
	box-sizing: border-box;
}

.himpel-hl__inner {
	width: 100%;
	max-width: var(--hhl-max, 1340px);
	margin: 0 auto;
	padding: var(--hhl-py-d, 80px) var(--hhl-px-d, 40px);
}

.himpel-hl__panel {
	padding: var(--hhl-panel-pad, 20px);
	border-radius: var(--hhl-panel-radius, 24px);
	background-color: var(--hhl-panel-bg, var(--himpel-primary));
}

/*
 * Named areas rather than plain columns, because the controls have two homes:
 * under the copy when the two sit side by side, and directly under the picture
 * once they stack. Areas move a child between those places with no change to
 * the markup, so the document keeps one order — picture, words, controls — and
 * only the layout differs.
 */
.himpel-hl__grid {
	display: grid;
	grid-template-columns: var(--hhl-cols, 1fr 1fr);
	grid-template-rows: 1fr auto;
	grid-template-areas:
		"media content"
		"media controls";
	gap: var(--hhl-gap, 20px);
	align-items: stretch;
}

.himpel-hl--image-right .himpel-hl__grid {
	grid-template-areas:
		"content media"
		"controls media";
}

.himpel-hl--words-only .himpel-hl__grid {
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"content"
		"controls";
}

.himpel-hl__media {
	grid-area: media;
}

.himpel-hl__content {
	grid-area: content;
}

.himpel-hl__controls {
	grid-area: controls;
}

/* ==========================================================================
   The picture, or the pictures
   ========================================================================== */

.himpel-hl__media {
	position: relative;
	min-height: var(--hhl-media-h, 460px);
	border-radius: var(--hhl-media-radius, 16px);
	background-color: var(--himpel-primary-dark);
	overflow: hidden;
}

.himpel-hl__frames {
	position: absolute;
	inset: 0;
	display: grid;
}

/*
 * Stacked in one cell and cross-faded — the same treatment as the spotlight
 * section, so a panel of several pictures behaves the way the reader has
 * already learned further up the page.
 */
.himpel-hl__frame {
	grid-area: 1 / 1;

	opacity: 0;
	visibility: hidden;
	transition: opacity 0.55s ease, visibility 0s linear 0.55s,
		transform 7s ease-out;
	transform: scale(1.04);
}

.himpel-hl__frame.is-active {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.55s ease, visibility 0s, transform 7s ease-out;
	transform: scale(1);
}

/*
 * The section class twice over, so this outweighs WooCommerce's
 * ".woocommerce-page img { height: auto }" on a product page — under that rule
 * a picture that has not loaded yet computes to no height at all.
 */
.himpel-hl .himpel-hl__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

/* --------------------------------------------------------------------------
   The controls, only ever printed when there is more than one picture
   -------------------------------------------------------------------------- */

/*
 * The controls sit on the panel, not on the photograph. Over the picture they
 * were lost against whatever happened to be behind them — a bright wall, a
 * shadow — and a reader had no reason to look there. On the panel's flat green
 * they are simply legible, and they sit where the copy ends, which is where the
 * eye already is.
 */
.himpel-hl__controls {
	display: flex;
	align-items: center;
	gap: 16px;

	padding: var(--hhl-controls-pad, 0 40px 40px);
}

.himpel-hl__count {
	flex: 0 0 auto;
	margin: 0;
	color: rgba(255, 255, 255, 0.75);
	font-size: var(--hhl-count-size, 13px);
	line-height: 1;

	/* Tabular figures, so the counter does not jog sideways at 01 → 02. */
	font-variant-numeric: tabular-nums;
}

.himpel-hl__current {
	color: var(--himpel-white);
	font-weight: 600;
}

.himpel-hl__sep {
	margin: 0 3px;
}

.himpel-hl__track {
	position: relative;
	flex: 1 1 auto;
	height: 2px;
	border-radius: 2px;
	background-color: rgba(255, 255, 255, 0.3);
	overflow: hidden;
}

.himpel-hl__fill {
	display: block;
	height: 100%;
	border-radius: inherit;
	background-color: var(--himpel-white);
	transition: width 0.45s ease;
}

.himpel-hl__arrows {
	display: flex;
	flex: 0 0 auto;
	gap: 8px;
}

/* White outlines, to read against the panel behind them. */
.himpel-hl__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	width: var(--hhl-arrow, 42px);
	height: var(--hhl-arrow, 42px);
	padding: 0;

	border: 1px solid rgba(255, 255, 255, 0.55);
	border-radius: 50%;
	background-color: transparent;
	color: var(--himpel-white);

	cursor: pointer;
	transition: background-color 0.25s ease, border-color 0.25s ease,
		color 0.25s ease;

	appearance: none;
	-webkit-appearance: none;
	box-shadow: none;
}

.himpel-hl__arrow:hover,
.himpel-hl__arrow:focus-visible {
	border-color: var(--himpel-white);
	background-color: var(--himpel-white);
	color: var(--hhl-panel-bg, var(--himpel-primary));
}

.himpel-hl__arrow:focus-visible {
	outline: 2px solid var(--himpel-white);
	outline-offset: 3px;
}

.himpel-hl__arrow svg {
	width: 17px;
	height: 17px;
}

/* ==========================================================================
   The words
   ========================================================================== */

.himpel-hl__content {
	display: flex;
	flex-direction: column;
	justify-content: center;

	padding: var(--hhl-content-pad, 40px);
	color: var(--hhl-text-color, var(--himpel-white));
}

/* The pill the home and about pages use, in its light form for a dark panel. */
.himpel-hl__eyebrow {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;

	margin: 0 0 var(--hhl-eyebrow-gap, 16px);
	padding: var(--hhl-pill-pad, 8px 18px);

	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 100px;

	color: var(--himpel-white);
	font-size: var(--hhl-pill-size, 14px);
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0.02em;
}

.himpel-hl__eyebrow::before {
	content: "";
	flex: 0 0 auto;
	width: 7px;
	height: 7px;
	margin-right: 9px;
	border-radius: 50%;
	background-color: var(--himpel-white);
}

.himpel-hl__title {
	margin: 0;
	color: inherit;
	font-size: var(--hhl-title-d, 34px);
	line-height: 1.2;
	letter-spacing: -0.01em;
	overflow-wrap: break-word;
}

.himpel-hl__desc {
	max-width: var(--hhl-desc-max, 46ch);
	margin: var(--hhl-desc-top, 16px) 0 0;

	color: inherit;
	font-size: var(--hhl-text-size, 15px);
	line-height: 1.75;
	opacity: 0.88;
}

.himpel-hl__desc p {
	margin: 0 0 1em;
}

.himpel-hl__desc p:last-child {
	margin-bottom: 0;
}

/* ==========================================================================
   Animation
   ========================================================================== */

.himpel-hl.is-revealing .himpel-hl__media,
.himpel-hl.is-revealing .himpel-hl__content {
	opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
	.himpel-hl.is-revealing .himpel-hl__media,
	.himpel-hl.is-revealing .himpel-hl__content {
		opacity: 1;
	}

	.himpel-hl__frame,
	.himpel-hl__frame.is-active {
		transition: opacity 0.2s ease;
		transform: none;
	}
}

/* Only ever seen by an editor. */
.himpel-hl__notice {
	margin: 0;
	padding: 16px 20px;
	border: 1px dashed #b9c2bd;
	border-radius: 8px;
	background-color: #f6f7f5;
	color: #55605a;
	font-size: 14px;
	line-height: 1.5;
}

/* ==========================================================================
   Responsive — breakpoints mirror Elementor's defaults
   ========================================================================== */

/* --- Tablet: up to 1024px --- */
@media (max-width: 1024px) {
	.himpel-hl__inner {
		padding: var(--hhl-py-t, 60px) var(--hhl-px-t, 20px);
	}
	/*
	 * Still side by side here — only the measurements tighten. The stacking
	 * starts at the mobile breakpoint below.
	 */
	.himpel-hl__controls {
		padding: var(--hhl-controls-pad-t, 0 28px 28px);
	}

	.himpel-hl__content {
		padding: var(--hhl-content-pad-t, 28px 28px 8px);
	}

	.himpel-hl__title {
		font-size: var(--hhl-title-t, 28px);
	}

	.himpel-hl__media {
		min-height: var(--hhl-media-h-t, 380px);
	}
}

/* --- Mobile: up to 767px --- */
@media (max-width: 767px) {
	.himpel-hl__inner {
		padding: var(--hhl-py-m, 40px) var(--hhl-px-m, 15px);
	}

	.himpel-hl__panel {
		padding: var(--hhl-panel-pad-m, 14px);
		border-radius: var(--hhl-panel-radius-m, 18px);
	}

	/*
	 * One column from here down: picture, its controls directly beneath it, then
	 * the words. Side by side on a phone the copy column would be about 150px
	 * across, which breaks a heading into single words.
	 */
	.himpel-hl__grid,
	.himpel-hl--image-right .himpel-hl__grid {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto auto auto;
		grid-template-areas:
			"media"
			"controls"
			"content";
	}

	.himpel-hl__media {
		min-height: var(--hhl-media-h-m, 230px);
		border-radius: var(--hhl-media-radius-m, 12px);
	}

	.himpel-hl__content {
		padding: var(--hhl-content-pad-m, 16px 12px 12px);
	}

	.himpel-hl__title {
		font-size: var(--hhl-title-m, 24px);
	}

	.himpel-hl__controls {
		padding: var(--hhl-controls-pad-m, 4px 2px 0);
		gap: 10px;
	}

	.himpel-hl__arrow {
		--hhl-arrow: 34px;
	}
}
