/* =========================================================
   PALFINGER UK – component styles
   (anything theme.json can't express)
   ========================================================= */

:root {
	--pf-header-inset: clamp(0.75rem, 2.9vw, 2.5rem);
	--pf-header-height: 72px;
	--pf-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath d='M3 12h17M14 5l7 7-7 7'/%3E%3C/svg%3E");
	--pf-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E");
	--pf-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* ---------- Header: floating white bar over the page ---------- */

.pf-header-wrap {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 100;
	height: 0;
	overflow: visible;
	padding-inline: var(--pf-header-inset) !important;
	margin-block: 0 !important;
}

.pf-header {
	margin-top: var(--pf-header-inset);
	min-height: var(--pf-header-height);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.pf-header .wp-block-site-logo img {
	height: 26px;
	width: auto;
}

.pf-header .wp-block-site-title {
	font-family: var(--wp--preset--font-family--headline);
	font-weight: 700;
	text-transform: uppercase;
	background: var(--wp--preset--color--yellow);
	border-radius: 999px;
	padding: 0.15rem 0.75rem;
	line-height: 1.4;
}

.pf-header .wp-block-site-title a {
	text-decoration: none;
	color: var(--wp--preset--color--black);
}

.pf-header .wp-block-navigation-item__content {
	padding-block: 0.5rem;
}

.pf-header .pf-lang a {
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.pf-header .wp-block-search__button {
	background: transparent;
	color: var(--wp--preset--color--black);
	padding: 0.25rem;
	margin: 0;
}

.pf-header .wp-block-search__button svg {
	width: 28px;
	height: 28px;
}

/* Pages without a full-bleed hero need room for the floating header. */
.pf-under-header {
	padding-top: calc(var(--pf-header-height) + var(--pf-header-inset) * 2 + 2rem) !important;
}

@media (max-width: 1100px) {
	.pf-header .pf-secondary-nav {
		display: none !important;
	}
}

/* ---------- Buttons: text + arrow ---------- */

.wp-block-button[class*="is-style-pf-arrow"] .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 1.25rem;
	transition: background-color 0.2s var(--pf-ease), color 0.2s var(--pf-ease);
}

.wp-block-button[class*="is-style-pf-arrow"] .wp-block-button__link::after {
	content: "";
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	background-color: currentColor;
	-webkit-mask: var(--pf-arrow) center / contain no-repeat;
	mask: var(--pf-arrow) center / contain no-repeat;
	transition: transform 0.2s var(--pf-ease);
}

.wp-block-button[class*="is-style-pf-arrow"] .wp-block-button__link:hover::after {
	transform: translateX(4px);
}

.wp-block-button.is-style-pf-arrow .wp-block-button__link {
	background-color: var(--wp--preset--color--black);
	color: var(--wp--preset--color--white);
}

.wp-block-button.is-style-pf-arrow-red .wp-block-button__link {
	background-color: var(--wp--preset--color--red);
	color: var(--wp--preset--color--white);
}

.wp-block-button.is-style-pf-arrow-red .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--red-dark);
}

.wp-block-button.is-style-pf-arrow-white .wp-block-button__link {
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--black);
}

.wp-block-button.is-style-pf-arrow-white .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--stone-100);
	color: var(--wp--preset--color--black);
}

/* Square, arrow-only button (product tiles, sliders). Label stays for screen readers. */
.wp-block-button.is-style-pf-arrow-square .wp-block-button__link {
	position: relative;
	width: 64px;
	height: 64px;
	padding: 0 !important;
	gap: 0;
	justify-content: center;
	font-size: 0 !important;
	line-height: 0;
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--black);
}

.wp-block-button.is-style-pf-arrow-square .wp-block-button__link::after {
	width: 28px;
	height: 28px;
}

.wp-block-button.is-style-pf-arrow-square .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--red);
	color: var(--wp--preset--color--white);
}

/* ---------- Eyebrow ---------- */

.is-style-pf-eyebrow {
	font-family: var(--wp--preset--font-family--text) !important;
	font-size: var(--wp--preset--font-size--xx-small) !important;
	font-weight: 400 !important;
	line-height: 1.5 !important;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

/* ---------- Cards ---------- */

.wp-block-group.is-style-pf-card {
	background-color: var(--wp--preset--color--stone-100);
}

.wp-block-group.is-style-pf-card-white {
	background-color: var(--wp--preset--color--white);
}

.is-style-pf-card,
.is-style-pf-card-white {
	height: 100%;
	transition: box-shadow 0.25s var(--pf-ease);
}

.is-style-pf-card .wp-block-image,
.is-style-pf-card-white .wp-block-image {
	overflow: hidden;
	margin: 0;
}

.is-style-pf-card .wp-block-image img,
.is-style-pf-card-white .wp-block-image img {
	transition: transform 0.5s var(--pf-ease);
}

.is-style-pf-card:hover .wp-block-image img,
.is-style-pf-card-white:hover .wp-block-image img {
	transform: scale(1.03);
}

/* Product tile (cover) */
.wp-block-cover.is-style-pf-tile {
	overflow: hidden;
	align-items: flex-end;
}

.wp-block-cover.is-style-pf-tile .wp-block-cover__image-background {
	transition: transform 0.6s var(--pf-ease);
}

.wp-block-cover.is-style-pf-tile:hover .wp-block-cover__image-background {
	transform: scale(1.04);
}

.wp-block-cover.is-style-pf-tile .wp-block-cover__inner-container {
	width: 100%;
}

/* ---------- Lists ---------- */

.wp-block-list.is-style-pf-checks {
	list-style: none;
	padding-left: 0;
}

.wp-block-list.is-style-pf-checks li {
	position: relative;
	padding-left: 1.75rem;
	margin-bottom: 0.4rem;
}

.wp-block-list.is-style-pf-checks li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.25em;
	width: 1em;
	height: 1em;
	background-color: var(--wp--preset--color--red);
	-webkit-mask: var(--pf-tick) center / contain no-repeat;
	mask: var(--pf-tick) center / contain no-repeat;
}

/* ---------- Scrolling row (slider look, no JS) ---------- */

.wp-block-columns.is-style-pf-scroller {
	flex-wrap: nowrap !important;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	scrollbar-color: var(--wp--preset--color--red) var(--wp--preset--color--stone-300);
	padding-bottom: 1.5rem;
}

.wp-block-columns.is-style-pf-scroller > .wp-block-column {
	flex: 0 0 min(80vw, 300px) !important;
	scroll-snap-align: start;
}

.wp-block-columns.is-style-pf-scroller::-webkit-scrollbar {
	height: 2px;
}

.wp-block-columns.is-style-pf-scroller::-webkit-scrollbar-track {
	background: var(--wp--preset--color--stone-300);
}

.wp-block-columns.is-style-pf-scroller::-webkit-scrollbar-thumb {
	background: var(--wp--preset--color--red);
}

/* ---------- Hero ---------- */

.wp-block-cover.pf-hero {
	padding-left: var(--wp--style--root--padding-left);
	padding-right: var(--wp--style--root--padding-right);
}

.wp-block-cover.pf-hero .wp-block-cover__inner-container {
	width: 100% !important;
}

.pf-hero h1 {
	text-wrap: balance;
}

.pf-hero .pf-hero-accent {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 8px;
	height: 120px;
	background: var(--wp--preset--color--red);
}

/* ---------- Media & text intro ---------- */

.wp-block-media-text.pf-intro .wp-block-media-text__content {
	padding: clamp(1.5rem, 4vw, 3rem);
}

/* Image always fills the full height of the stone panel (desktop). */
@media (min-width: 601px) {
	.wp-block-media-text.pf-intro {
		align-items: stretch;
	}

	.wp-block-media-text.pf-intro > .wp-block-media-text__media {
		align-self: stretch;
		position: relative;
		min-height: 320px;
	}

	.wp-block-media-text.pf-intro > .wp-block-media-text__media img {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		object-fit: cover;
	}
}

/* ---------- Footer ---------- */

.pf-footer a {
	text-decoration: none;
}

.pf-footer a:hover {
	text-decoration: underline;
	color: inherit;
}

.pf-footer .pf-footer-links {
	list-style: none;
	padding: 0;
	margin: 0;
}

.pf-footer .pf-footer-links li {
	margin-bottom: 0.35rem;
}

.pf-footer .pf-legal a {
	text-transform: uppercase;
	font-size: var(--wp--preset--font-size--xx-small);
	letter-spacing: 0.02em;
}

.pf-footer .wp-block-social-links .wp-social-link {
	border-radius: 0;
}

/* ---------- Misc ---------- */

.wp-block-post-featured-image img {
	object-fit: cover;
}

.wp-block-query-pagination a {
	text-decoration: none;
}

:where(.wp-block-search__input) {
	border: 1px solid var(--wp--preset--color--stone-300);
	border-radius: 0;
	padding: 0.75rem 1rem;
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}

/* Show the site title as a yellow pill only until a logo is uploaded. */
.wp-block-site-logo:has(img) + .wp-block-site-title {
	display: none;
}

.pf-footer .wp-block-site-title {
	font-family: var(--wp--preset--font-family--headline);
	font-weight: 700;
	text-transform: uppercase;
	background: var(--wp--preset--color--yellow);
	border-radius: 999px;
	padding: 0.4rem 2rem;
	display: inline-block;
}

.pf-footer .wp-block-site-logo img {
	width: 260px;
	height: auto;
}

/* Templates control their own vertical rhythm. */
.wp-site-blocks > * {
	margin-block-start: 0;
}

/* Card headings: no underline, whole card clickable. */
.is-style-pf-card,
.is-style-pf-card-white {
	position: relative;
}

.is-style-pf-card :where(h2, h3, h4) a,
.is-style-pf-card-white :where(h2, h3, h4) a {
	text-decoration: none;
	color: inherit;
}

.is-style-pf-card :where(h2, h3, h4) a::after,
.is-style-pf-card-white :where(h2, h3, h4) a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.is-style-pf-card:hover :where(h2, h3, h4) a,
.is-style-pf-card-white:hover :where(h2, h3, h4) a {
	color: var(--wp--preset--color--red);
}

/* Accessible hidden text (in case the host theme stack doesn't provide it). */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

/* Keep the footer at the bottom on short pages. */
.wp-site-blocks {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.wp-site-blocks > main {
	flex: 1 0 auto;
}
