/* ==========================================================================
   HIMPEL Philosophy — boxed section with three image cards
   --------------------------------------------------------------------------
   Everything is scoped under .himpel-phil. Nothing targets the theme or any
   global element.
   ========================================================================== */

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

	position: relative;
	z-index: 2;
	width: 100%;
	background-color: var(--hph-bg, var(--himpel-secondary));
	box-sizing: border-box;
}

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

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

/* --------------------------------------------------------------------------
   Top block — pill eyebrow + heading
   -------------------------------------------------------------------------- */
.himpel-phil__head {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	margin-bottom: var(--hph-gap-head, 48px);
}

.himpel-phil--left .himpel-phil__head {
	align-items: flex-start;
	text-align: left;
}

/* The <h2> is the pill itself. */
.himpel-phil__eyebrow {
	display: inline-flex;
	align-items: center;
	margin: 0 0 var(--hph-gap-eyebrow, 22px);
	padding: 8px 18px;
	border: 1px solid var(--hph-pill-border, rgba(18, 18, 18, 0.18));
	border-radius: 100px;
	color: var(--hph-pill-color, var(--himpel-dark));
	font-size: var(--hph-eyebrow-d, 14px);
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0.02em;
}

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

.himpel-phil__title {
	margin: 0;
	padding: 0;
	/* Inherits the Liquid theme's H3 typography; only scale is ours. */
	color: var(--hph-title-color, var(--himpel-dark));
	font-size: var(--hph-title-d, 44px);
	font-weight: 600;
	line-height: 1.16;
	letter-spacing: -0.4px;
	max-width: var(--hph-title-mw, 18ch);
	text-wrap: balance;
}

/* --------------------------------------------------------------------------
   Middle block — three image cards
   -------------------------------------------------------------------------- */
.himpel-phil__grid {
	display: grid;
	grid-template-columns: repeat(var(--hph-cols, 3), minmax(0, 1fr));
	gap: var(--hph-gap, 24px);
}

.himpel-phil__card {
	position: relative;
	display: flex;
	min-height: var(--hph-card-h, 420px);
	border-radius: var(--hph-radius, 16px);
	overflow: hidden;
	background-color: var(--himpel-dark);
	isolation: isolate;
	text-decoration: none;
	transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
		box-shadow 0.45s ease;
}

.himpel-phil__media {
	position: absolute;
	inset: 0;
	z-index: 1;
	background-position: var(--hph-pos, center center);
	background-repeat: no-repeat;
	background-size: cover;
	/* Scaling the image rather than the card keeps the corners crisp and the
	   text perfectly still while the photo moves underneath. */
	transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Darker at the top and bottom where the copy sits, lighter through the
   middle so the photograph still reads. */
.himpel-phil__veil {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background-image: linear-gradient(
		to bottom,
		rgba(18, 18, 18, 0.62) 0%,
		rgba(18, 18, 18, 0.18) 38%,
		rgba(18, 18, 18, 0.28) 62%,
		rgba(18, 18, 18, 0.8) 100%
	);
	transition: opacity 0.45s ease;
}

.himpel-phil__body {
	position: relative;
	z-index: 3;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: 100%;
	padding: var(--hph-card-pad, 22px);
	color: var(--himpel-white);
}

/* --- Top row: number + title --- */
.himpel-phil__top {
	display: flex;
	align-items: flex-start;
	gap: var(--hph-num-gap, 14px);
}

.himpel-phil__num {
	position: relative;
	flex: 0 0 auto;
	color: var(--himpel-white);
	font-size: var(--hph-num-d, 42px);
	font-weight: 600;
	line-height: 1;
	letter-spacing: -1px;
	/* Room for the "No" marker that sits off its top-right corner. */
	padding-right: 16px;
}

.himpel-phil__no {
	position: absolute;
	top: 1px;
	right: 0;
	font-size: var(--hph-no-d, 11px);
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0;
	opacity: 0.75;
}

.himpel-phil__card-title {
	margin: 0;
	padding: 0;
	color: var(--himpel-white);
	font-size: var(--hph-card-title-d, 22px);
	font-weight: 600;
	line-height: 1.28;
}

/* --- Bottom row: description above a hairline --- */
.himpel-phil__bottom {
	margin-top: 24px;
	padding-top: var(--hph-rule-gap, 18px);
	border-top: 1px solid var(--hph-rule, rgba(255, 255, 255, 0.32));
}

.himpel-phil__card-desc {
	margin: 0;
	padding: 0;
	color: var(--himpel-white);
	font-size: var(--hph-card-desc-d, 14px);
	font-weight: 400;
	line-height: 1.6;
	opacity: 0.92;
}

/* --- Hover --- */
@media (hover: hover) {
	.himpel-phil__card:hover {
		transform: translateY(-6px);
		box-shadow: 0 18px 40px rgba(18, 18, 18, 0.22);
	}

	.himpel-phil__card:hover .himpel-phil__media {
		transform: scale(1.07);
	}

	.himpel-phil__card:hover .himpel-phil__veil {
		opacity: 0.82;
	}
}

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

/* --------------------------------------------------------------------------
   Bottom block — green button
   -------------------------------------------------------------------------- */
.himpel-phil__foot {
	display: flex;
	justify-content: center;
	margin-top: var(--hph-gap-foot, 48px);
}

.himpel-phil--left .himpel-phil__foot {
	justify-content: flex-start;
}

.himpel-phil__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 8px 8px 8px 26px;
	border: 1px solid var(--himpel-primary);
	border-radius: 100px;
	background-color: var(--himpel-primary);
	color: var(--himpel-white);
	font-size: var(--hph-btn-d, 16px);
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.25s ease, border-color 0.25s ease,
		transform 0.25s ease;
}

.himpel-phil__btn:hover,
.himpel-phil__btn:focus-visible {
	background-color: var(--himpel-primary-dark);
	border-color: var(--himpel-primary-dark);
	color: var(--himpel-white);
	text-decoration: none;
	transform: translateY(-2px);
}

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

.himpel-phil__btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: var(--hph-icon, 34px);
	height: var(--hph-icon, 34px);
	border-radius: 50%;
	background-color: var(--himpel-white);
	color: var(--himpel-primary);
	transition: transform 0.25s ease;
}

.himpel-phil__btn-icon svg {
	display: block;
	width: 56%;
	height: 56%;
	stroke: currentColor;
	fill: none;
}

.himpel-phil__btn:hover .himpel-phil__btn-icon,
.himpel-phil__btn:focus-visible .himpel-phil__btn-icon {
	transform: translate(2px, -2px);
}

/* ==========================================================================
   Scroll-in animation
   .is-revealing is printed server-side so the pre-animation state exists in
   the first paint; the script removes it once GSAP has seeded the tween.
   ========================================================================== */
.himpel-phil.is-revealing .himpel-phil__eyebrow,
.himpel-phil.is-revealing .himpel-phil__title,
.himpel-phil.is-revealing .himpel-phil__card,
.himpel-phil.is-revealing .himpel-phil__foot {
	opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
	.himpel-phil.is-revealing .himpel-phil__eyebrow,
	.himpel-phil.is-revealing .himpel-phil__title,
	.himpel-phil.is-revealing .himpel-phil__card,
	.himpel-phil.is-revealing .himpel-phil__foot {
		opacity: 1;
	}

	.himpel-phil__card,
	.himpel-phil__media,
	.himpel-phil__veil,
	.himpel-phil__btn,
	.himpel-phil__btn-icon {
		transition: none;
	}

	.himpel-phil__card:hover,
	.himpel-phil__btn:hover {
		transform: none;
	}

	.himpel-phil__card:hover .himpel-phil__media {
		transform: none;
	}
}

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

/* --- Tablet: up to 1024px. Three columns would leave each card near 230px
       wide, too narrow for the title beside the number, so they stack. --- */
@media (max-width: 1024px) {
	.himpel-phil__inner {
		padding: var(--hph-py-t, 60px) var(--hph-px-t, 20px);
	}

	.himpel-phil__head {
		margin-bottom: var(--hph-gap-head-t, 36px);
	}

	.himpel-phil__title {
		font-size: var(--hph-title-t, 34px);
		max-width: 22ch;
	}

	.himpel-phil__grid {
		grid-template-columns: repeat(var(--hph-cols-t, 1), minmax(0, 1fr));
		gap: var(--hph-gap-t, 20px);
	}

	.himpel-phil__card {
		min-height: var(--hph-card-h-t, 320px);
	}

	/*
	 * Stacked cards are wide and short here, so a centred crop takes a band
	 * from the middle of the photo and cuts the subject's head off. Anchoring
	 * to the top keeps faces in frame.
	 */
	.himpel-phil__media {
		background-position: var(--hph-pos-t, center top);
	}

	.himpel-phil__foot {
		margin-top: var(--hph-gap-foot-t, 36px);
	}
}

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

	.himpel-phil__head {
		margin-bottom: var(--hph-gap-head-m, 28px);
	}

	.himpel-phil__eyebrow {
		margin-bottom: var(--hph-gap-eyebrow-m, 16px);
		font-size: var(--hph-eyebrow-m, 13px);
	}

	.himpel-phil__title {
		font-size: var(--hph-title-m, 27px);
		max-width: 100%;
	}

	.himpel-phil__grid {
		gap: var(--hph-gap-m, 16px);
	}

	.himpel-phil__card {
		min-height: var(--hph-card-h-m, 290px);
		border-radius: var(--hph-radius-m, 14px);
	}

	/* Mobile cards are near square, so the centred crop holds up. */
	.himpel-phil__media {
		background-position: var(--hph-pos-m, center center);
	}

	.himpel-phil__body {
		padding: var(--hph-card-pad-m, 18px);
	}

	.himpel-phil__num {
		font-size: var(--hph-num-m, 34px);
	}

	.himpel-phil__card-title {
		font-size: var(--hph-card-title-m, 20px);
	}

	.himpel-phil__card-desc {
		font-size: var(--hph-card-desc-m, 13px);
	}

	.himpel-phil__bottom {
		margin-top: 18px;
		padding-top: var(--hph-rule-gap-m, 14px);
	}

	.himpel-phil__foot {
		margin-top: var(--hph-gap-foot-m, 28px);
	}

	.himpel-phil__btn {
		gap: 10px;
		padding: 7px 7px 7px 20px;
		font-size: var(--hph-btn-m, 14px);
		--hph-icon: 30px;
		white-space: normal;
		text-align: left;
	}
}
