/* =============================================================================
   HAI Diensten Accordion — all-strips layout
   Every item is a flex strip. The active strip expands; others collapse.
   Elementor style-tab controls override the defaults defined here.
   ============================================================================= */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */

.hai-diensten-accordion {
	display: flex;
	flex-direction: column;
	width: 100%;
	box-sizing: border-box;
}

/* ── Navigation (above strips) ───────────────────────────────────────────── */

.hai-da-nav {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;   /* overridden by Elementor nav-spacing control */
	justify-content: flex-end; /* overridden by Elementor alignment control */
	flex-shrink: 0;
}

.hai-da-arrow {
	width: 36px;            /* overridden by Elementor arrow-size control */
	height: 36px;
	font-size: 14px;        /* icon size — scales with button if user overrides */
	border: 1px solid rgba(255, 255, 255, 0.35);
	background-color: rgba(0, 0, 0, 0.2);
	color: #ffffff;
	border-radius: 50%;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background-color 180ms ease, border-color 180ms ease, scale 150ms ease;
	flex-shrink: 0;
}

.hai-da-arrow:hover {
	background-color: rgba(0, 0, 0, 0.5);
	scale: 1.08;
}

.hai-da-arrow:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* Ensure icons rendered by Elementor Icons_Manager inherit button color/size */
.hai-da-arrow i {
	font-size: inherit;
	color: inherit;
	line-height: 1;
}
.hai-da-arrow svg {
	width: 1em;
	min-width: 1em;
	height: 1em;
	fill: currentColor;
	display: block;
}

/* ── Strips row ──────────────────────────────────────────────────────────── */

.hai-da-strips {
	display: flex;
	flex-direction: row;
	height: 500px;          /* overridden by Elementor strips-height control */
	overflow: hidden;
}

/* ── Individual strip ────────────────────────────────────────────────────── */

.hai-da-strip {
	position: relative;
	flex: 0 0 80px;         /* collapsed — overridden by collapsed-width control */
	overflow: hidden;
	cursor: pointer;
	transition: flex 400ms cubic-bezier(0.4, 0, 0.2, 1); /* overridden by transition control */
	user-select: none;
	-webkit-user-select: none;
	background-color: #1a1a1a; /* base fallback when no image */
	z-index: var(--hai-da-z-asc, 1); /* ascending on desktop: rightmost strip on top */
}

.hai-da-strip.is-active {
	flex: 4 0 auto;         /* overridden by expanded-flex-grow control */
}

.hai-da-strip:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.8);
	outline-offset: -2px;
}

/* ── Background layers ───────────────────────────────────────────────────── */

/*
 * Three stacked layers (z 0 → 2), all absolute:
 *   0  .hai-da-bg-image    — the photo (always visible unless covered)
 *   1  .hai-da-img-overlay — semi-transparent dark tint (shown when collapsed)
 *   2  .hai-da-panel-color — solid colour (shown when active)
 */

.hai-da-bg-image {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transition: transform 600ms ease;
}

.hai-da-strip.is-active .hai-da-bg-image {
	transform: scale(1.04); /* subtle zoom on expand */
}

.hai-da-img-overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	opacity: 1;
	transition: opacity 400ms ease;
	pointer-events: none;
}

.hai-da-strip.is-active .hai-da-img-overlay {
	opacity: 0; /* hide image overlay — panel colour takes over */
}

.hai-da-panel-color {
	position: absolute;
	inset: 0;
	z-index: 2;
	opacity: 0;
	background-color: #1a1a1a; /* overridden by global-panel-bg control or per-item inline style */
	transition: opacity 350ms ease;
	pointer-events: none;
}

.hai-da-strip.is-active .hai-da-panel-color {
	opacity: 1;
}

/* ── Content (title / description / CTA) ────────────────────────────────── */

.hai-da-content {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	flex-direction: column;
	justify-content: flex-end; /* overridden by content-v-align control */
	padding: 40px;             /* overridden by content-padding control */
	box-sizing: border-box;
	opacity: 0;
	pointer-events: none;
	/* Fade out instantly; fade in after the strip has had time to expand */
	transition: opacity 150ms ease;
}

.hai-da-strip.is-active .hai-da-content {
	opacity: 1;
	pointer-events: auto;
	transition: opacity 220ms ease 280ms; /* 280ms delay ≈ 70 % of 400ms expansion */
}

.hai-da-title {
	margin: 0 0 12px;
	font-size: 2rem;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: #ffffff;
	text-transform: uppercase;
}

.hai-da-desc {
	margin: 0 0 24px;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.8);
	max-width: 40ch;
}

.hai-da-cta {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	background-color: rgba(255, 255, 255, 0.15);
	color: #ffffff;
	text-decoration: none;
	padding: 10px 20px;
	border-radius: 3px;
	border-style: solid;
	border-width: 1px;
	border-color: rgba(255, 255, 255, 0.4);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, border-radius 180ms ease;
}

.hai-da-cta:hover {
	background-color: rgba(255, 255, 255, 0.25);
}

.hai-da-cta:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.8);
	outline-offset: 3px;
}

/* ── Vertical label (collapsed state) ────────────────────────────────────── */

.hai-da-label {
	position: absolute;
	bottom: 20px;
	top: auto;
	left: 50%;
	z-index: 3;
	writing-mode: vertical-lr;
	text-orientation: mixed;
	/* Individual transform properties so position (translate) and
	   direction (rotate) controls can be set independently without conflict. */
	translate: -50% 0;
	rotate: 0deg;
	white-space: nowrap;
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	pointer-events: none;
	opacity: 1;
	transition: opacity 200ms ease;
}

.hai-da-strip.is-active .hai-da-label {
	opacity: 0;
}

/* Each strip except the last has its right edge covered by the next strip.
   Shift the label left by half the overlap so it sits in the visible centre.
   Higher specificity (3 classes) than Elementor's {{WRAPPER}} .hai-da-label (2 classes),
   and only touches `left`, leaving the label_position control's `translate` intact. */
.hai-diensten-accordion .hai-da-strip:not(:last-child) .hai-da-label {
	left: calc(50% - var(--hai-da-overlap, 20px) / 2);
}

/* ── Tablet + Mobile: vertical accordion ─────────────────────────────────── */

@media (max-width: 1024px) {
	/* Switch strips to a vertical column */
	.hai-da-strips {
		flex-direction: column;
		height: auto !important;   /* override Elementor height control */
		overflow: visible;
		scroll-snap-type: none;
	}

	/* Active strip expands vertically — override desktop flex-grow.
	   Sizes to its content (the content switches to static flow below) with
	   300px as the floor: a fixed 300px basis clipped the title on strips
	   whose title + description + CTA run taller than that. */
	.hai-da-strip.is-active {
		flex: 0 0 auto !important;
		min-height: 300px;
		width: 100%;
	}

	/* In-flow content on mobile so the active strip grows with its text.
	   Relative, not static: the z-index that lifts the content above the
	   absolutely positioned background is ignored on static elements. */
	.hai-da-strip.is-active .hai-da-content {
		position: relative;
		inset: auto;
	}

	/* Collapsed strips keep their flex-basis as height via responsive control */
	.hai-da-strip {
		width: 100%;
		z-index: var(--hai-da-z-desc, 1); /* descending on mobile: first strip on top */
	}

	/* Vertical overlap — same value as desktop, applied as margin-top */
	.hai-da-strip + .hai-da-strip {
		margin-left: 0 !important;
		margin-top: calc(-1 * var(--hai-da-overlap, 20px));
	}

	/* Rotate nav arrows: ← → become ↑ ↓ */
	.hai-da-arrow-prev {
		rotate: -90deg;
	}
	.hai-da-arrow-next {
		rotate: 90deg;
	}

	/* Label: horizontal across the full-width strip.
	   !important overrides the Elementor label_position control selectors
	   which have higher specificity via {{WRAPPER}} class. */
	.hai-da-label {
		writing-mode: horizontal-tb !important;
		translate: 0% calc(50% + 10px) !important;
		rotate: 0deg !important;
		bottom: 50% !important;
		top: auto !important;
		left: 0 !important;
		right: 0;
		text-align: center;
	}

	/* No content fade delay — strip is already full-width */
	.hai-da-content {
		transition: opacity 150ms ease 0ms !important;
	}
}

/* ── Mobile-only: compact typography ────────────────────────────────────── */

@media (max-width: 767px) {
	.hai-da-content {
		padding: 16px;
	}

	.hai-da-title {
		font-size: 1.1rem;
		margin-bottom: 8px;
	}

	.hai-da-desc {
		font-size: 0.75rem;
		margin-bottom: 12px;
	}

	.hai-da-cta {
		font-size: 0.7rem;
		padding: 8px 14px;
	}

	.hai-da-label {
		font-size: 9px;
	}

	.hai-da-nav {
		margin-bottom: 8px;
	}
}
