/* ==========================================================================
   HIMPEL Spotlight — one picture at a time, with its own heading
   --------------------------------------------------------------------------
   Everything is scoped under .himpel-spot. Nothing here targets the theme,
   WooCommerce, or any global element.
   ========================================================================== */

.himpel-spot {
	--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(--hsp-bg, var(--himpel-white));
	box-sizing: border-box;
}

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

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

/* ==========================================================================
   Top — the label and the slide's own words
   ========================================================================== */

.himpel-spot__head {
	text-align: center;
}

/* The pill the home and about pages use, to the pixel. */
.himpel-spot__eyebrow {
	display: inline-flex;
	align-items: center;

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

	border: 1px solid var(--hsp-pill-border, rgba(18, 18, 18, 0.18));
	border-radius: 100px;

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

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

/*
 * Every slide's words share one grid cell, so the block is as tall as the
 * longest of them and never changes height. Anything else moves the picture up
 * and down the page as the reader steps through — the one thing a slider must
 * not do.
 */
.himpel-spot__texts {
	display: grid;
}

.himpel-spot__text {
	grid-area: 1 / 1;

	opacity: 0;
	visibility: hidden;
	transition: opacity 0.45s ease, transform 0.45s ease,
		visibility 0s linear 0.45s;
	transform: translateY(10px);
}

.himpel-spot__text.is-active {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s;
	transform: translateY(0);
}

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

.himpel-spot__desc {
	/* A measure, centred: full-width centred prose is very hard to read back. */
	max-width: var(--hsp-desc-max, 820px);
	margin: var(--hsp-desc-top, 14px) auto 0;

	color: var(--hsp-text-color, #4f5a55);
	font-size: var(--hsp-text-size, 15px);
	line-height: 1.75;
}

/* ==========================================================================
   Bottom — the pictures
   ========================================================================== */

.himpel-spot__stage {
	position: relative;
	display: grid;
	margin-top: var(--hsp-stage-top, 40px);

	border-radius: var(--hsp-radius, 20px);
	background-color: var(--himpel-secondary);
	overflow: hidden;

	aspect-ratio: var(--hsp-ratio, 1.78);
}

/*
 * Stacked in one cell and cross-faded, so the picture never leaves a gap
 * mid-change and the stage keeps its exact size throughout.
 */
.himpel-spot__slide {
	grid-area: 1 / 1;

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

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

.himpel-spot__slide picture {
	display: block;
	width: 100%;
	height: 100%;
}

/*
 * 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-spot .himpel-spot__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

/* ==========================================================================
   The controls
   --------------------------------------------------------------------------
   A counter, a progress line and two arrows. Between them they answer the
   three questions a row of dots leaves open: where am I, how much is left, and
   what do I press.
   ========================================================================== */

.himpel-spot__controls {
	display: flex;
	align-items: center;
	gap: var(--hsp-controls-gap, 22px);
	margin-top: var(--hsp-controls-top, 24px);
}

.himpel-spot__count {
	flex: 0 0 auto;
	margin: 0;
	color: var(--hsp-text-color, #4f5a55);
	font-size: var(--hsp-count-size, 14px);
	line-height: 1;

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

.himpel-spot__current {
	color: var(--hsp-title-color, var(--himpel-dark));
	font-weight: 600;
}

.himpel-spot__sep {
	margin: 0 4px;
	opacity: 0.5;
}

.himpel-spot__track {
	position: relative;
	flex: 1 1 auto;
	height: var(--hsp-track-h, 2px);
	border-radius: 2px;
	background-color: var(--hsp-track-bg, rgba(18, 18, 18, 0.12));
	overflow: hidden;
}

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

.himpel-spot__arrows {
	display: flex;
	flex: 0 0 auto;
	gap: 10px;
}

.himpel-spot__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	width: var(--hsp-arrow, 46px);
	height: var(--hsp-arrow, 46px);
	padding: 0;

	border: 1px solid var(--hsp-arrow-border, rgba(18, 18, 18, 0.15));
	border-radius: 50%;
	background-color: transparent;
	color: var(--hsp-title-color, var(--himpel-dark));

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

	/* The theme styles buttons; these keep the arrow a plain circle. */
	appearance: none;
	-webkit-appearance: none;
	box-shadow: none;
}

.himpel-spot__arrow:hover,
.himpel-spot__arrow:focus-visible {
	border-color: var(--himpel-primary);
	background-color: var(--himpel-primary);
	color: var(--himpel-white);
}

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

.himpel-spot__arrow svg {
	width: 20px;
	height: 20px;
}

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

.himpel-spot.is-revealing .himpel-spot__eyebrow,
.himpel-spot.is-revealing .himpel-spot__texts,
.himpel-spot.is-revealing .himpel-spot__stage,
.himpel-spot.is-revealing .himpel-spot__controls {
	opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
	.himpel-spot.is-revealing .himpel-spot__eyebrow,
	.himpel-spot.is-revealing .himpel-spot__texts,
	.himpel-spot.is-revealing .himpel-spot__stage,
	.himpel-spot.is-revealing .himpel-spot__controls {
		opacity: 1;
	}

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

/* Only ever seen by an editor. */
.himpel-spot__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-spot__inner {
		padding: var(--hsp-py-t, 60px) var(--hsp-px-t, 20px);
	}

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

	.himpel-spot__stage {
		aspect-ratio: var(--hsp-ratio-t, 1.3);
		margin-top: var(--hsp-stage-top-t, 32px);
	}
}

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

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

	.himpel-spot__stage {
		aspect-ratio: var(--hsp-ratio-m, 0.95);
		margin-top: var(--hsp-stage-top-m, 24px);
		border-radius: var(--hsp-radius-m, 16px);
	}

	/*
	 * The counter and the line drop away and the arrows take the row. A 2px
	 * line is not worth a quarter of a phone's width, and the arrows are the
	 * part a thumb actually uses — the swipe covers the rest.
	 */
	.himpel-spot__controls {
		justify-content: space-between;
		gap: 12px;
	}

	.himpel-spot__track {
		display: none;
	}

	.himpel-spot__arrow {
		--hsp-arrow: 44px;
	}
}
