/* Hairtec Related Posts
   Tokens measured from hairtec.nl (Hello Elementor child theme). Font is inherited from the theme (Europa).
   Every rule is scoped under .htrp so it outranks Elementor's kit typography (.elementor-kit-N h2/h3/a). */

.htrp {
	--htrp-navy: #223558;
	--htrp-muted: #767676; /* kicker; hairtec's #adadad meta grey is 2.2:1 on white, this is 4.5:1 (WCAG AA) */
	--htrp-line: #e3e5ea;
	--htrp-placeholder: #eeeff2;
	--htrp-card-bg: #ffffff;
	--htrp-radius: 20px;
	--htrp-gap: 20px;

	/* On tablet/phone the swipe row bleeds into the side padding of the Elementor container it sits in.
	   .e-con exposes its padding as --padding-inline-start/end and custom properties inherit, so the row
	   ends exactly at that container's edge (0px outside Elementor). A theme can force a fixed bleed by
	   setting --htrp-bleed (both sides) or --htrp-bleed-start / --htrp-bleed-end (per side); --htrp-bleed
	   is deliberately left undeclared here so the var() falls through to the Elementor value. */
	--htrp-bleed-start: var(--htrp-bleed, var(--padding-inline-start, 0px));
	--htrp-bleed-end: var(--htrp-bleed, var(--padding-inline-end, 0px));

	display: block;
	max-width: 100%;
	min-width: 0; /* as a flex/grid item the 100vw intrinsic size below must never widen the track */
	padding: 48px 0 8px;
	font-family: inherit;

	/* Container queries drive the 4 / 2 column choice. Inline-size containment makes the block report 0
	   intrinsic width, so a shrink-to-fit parent (Elementor Items alignment Start/Center/End, a row
	   container or Width: Inline) would collapse it; report a huge intrinsic width instead, max-width
	   clamps it. */
	container-type: inline-size;
	contain-intrinsic-inline-size: 100vw;
}

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

.htrp .htrp__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin: 0 0 22px;
}

.htrp .htrp__kicker {
	margin: 0 0 6px;
	padding: 0;
	font-size: 12px;
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--htrp-muted);
}

.htrp .htrp__title {
	margin: 0;
	padding: 0;
	font-size: 32px;
	line-height: 1.15;
	font-weight: 400;
	color: var(--htrp-navy);
}

.htrp .htrp__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--htrp-gap);
	list-style: none;
	margin: 0;
	padding: 0;
}

.htrp .htrp__card {
	margin: 0;
	padding: 0;
	min-width: 0;
	list-style: none;
	background: var(--htrp-card-bg);
	border: 1px solid var(--htrp-line);
	border-radius: var(--htrp-radius);
	overflow: hidden;
}

.htrp .htrp__link,
.htrp .htrp__link:hover,
.htrp .htrp__link:focus {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

.htrp .htrp__media {
	position: relative;
	aspect-ratio: 3 / 2;
	max-width: 100%;
	overflow: hidden;
	background: var(--htrp-placeholder);
}

.htrp .htrp__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	transition: transform 0.45s ease;
}

.htrp .htrp__body {
	padding: 16px 18px 18px;
}

.htrp .htrp__name {
	margin: 0;
	padding: 0;
	font-size: 17px;
	line-height: 1.3;
	font-weight: 600;
	color: var(--htrp-navy);
	text-wrap: balance;
	-webkit-hyphens: auto;
	hyphens: auto;
	hyphenate-limit-chars: 16 5 5; /* Chromium / Firefox: only long Dutch compounds get a hyphen; ordinary words wrap whole */
	-webkit-hyphenate-limit-before: 5; /* Safari / iOS ignore hyphenate-limit-chars and would break at 2 letters ("te-/gen") */
	-webkit-hyphenate-limit-after: 5;
	overflow-wrap: anywhere; /* last resort for words no dictionary can break */
}

/* Focus ring drawn inside the card so the rounded, clipped card does not cut it off. */
.htrp .htrp__link:focus-visible {
	outline: 3px solid var(--htrp-navy);
	outline-offset: -3px;
	border-radius: var(--htrp-radius);
}

@media (hover: hover) {
	.htrp .htrp__card:hover .htrp__media img {
		transform: scale(1.05);
	}
}

/* Placed in a narrow column on a desktop viewport (e.g. the 2/3 article column next to the sidebar):
   four cards would be ~140px wide, so fall back to two columns. Viewport rules below still win on phones. */
@container (max-width: 840px) {
	.htrp .htrp__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Tablet and phone: one horizontal swipe row, next card peeks in as the scroll hint. */
@media (max-width: 900px) {
	.htrp .htrp__grid {
		display: flex;
		flex-wrap: nowrap;
		gap: 16px;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		margin-inline: calc(-1 * var(--htrp-bleed-start)) calc(-1 * var(--htrp-bleed-end));
		padding-inline: var(--htrp-bleed-start) var(--htrp-bleed-end);
		scroll-padding-inline: var(--htrp-bleed-start) var(--htrp-bleed-end);
		padding-bottom: 14px;
	}

	.htrp .htrp__card {
		flex: 0 0 44%;
		scroll-snap-align: start;
	}
}

/* Touch: the peeking next card is the scroll cue, so hide the bar. */
@media (max-width: 900px) and (pointer: coarse) {
	.htrp .htrp__grid {
		scrollbar-width: none;
	}

	.htrp .htrp__grid::-webkit-scrollbar {
		display: none;
	}
}

/* Mouse at a narrow width (browser zoom, split screen): a vertical wheel does not move a horizontal
   row, so a thin bar is the only discoverable way to reach cards 3 and 4. */
@media (max-width: 900px) and (pointer: fine) {
	.htrp .htrp__grid {
		scrollbar-width: thin;
		scrollbar-color: var(--htrp-muted) transparent;
	}
}

@media (max-width: 480px) {
	.htrp .htrp__card {
		flex-basis: 72%;
	}

	.htrp .htrp__body {
		padding: 12px 14px 16px;
	}

	.htrp .htrp__name {
		font-size: 15px;
	}

	.htrp .htrp__title {
		font-size: 26px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.htrp .htrp__media img {
		transition: none;
	}

	.htrp .htrp__card:hover .htrp__media img {
		transform: none;
	}
}

/* Product pages ([hairtec_product_blogs]): typography follows the WooCommerce single product template
   on hairtec.nl ("Gerelateerde producten" heading 32px/600, 24px on phones; loop titles 16px/400). */
.htrp.htrp--product .htrp__title {
	font-size: 32px;
	line-height: 1;
	font-weight: 600;
}

.htrp.htrp--product .htrp__name {
	font-size: 16px;
	line-height: 1.2;
	font-weight: 400;
}

@media (max-width: 767px) {
	.htrp.htrp--product .htrp__title {
		font-size: 24px;
	}
}

/* box="1": grey rounded panel drawn by the plugin itself. Use this instead of styling the Elementor
   widget when WP Rocket "Remove Unused CSS" drops freshly added Elementor rules; this file is excluded
   from that optimisation. The swipe row bleeds to the panel edge. */
.htrp.htrp--box {
	--htrp-bleed: 30px;
	padding: 30px;
	background: var(--htrp-placeholder);
	border-radius: var(--htrp-radius);
	overflow: hidden;
}

@media (max-width: 480px) {
	.htrp.htrp--box {
		--htrp-bleed: 20px;
		padding: 24px 20px 20px;
	}
}
