/* Bailleul Hero Revolution widget */

.subul-hero-rev {
	--subul-hero-anim-duration: 0.9s;
	--subul-hero-corner: #987B43;
	--subul-hero-ripple: rgba(255, 255, 255, 0.5);
	position: relative;
	overflow: hidden;
	width: 100%;
	min-height: 700px;
	background-color: #0b0b0b;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	color: #fff;
	isolation: isolate;
}

.subul-hero-rev__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	z-index: 1;
	pointer-events: none;
}

.subul-hero-rev__watermark {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: "Dancing Script", cursive;
	font-weight: 700;
	font-size: 158px;
	line-height: 1;
	color: #987B43;
	opacity: 0.5;
	white-space: nowrap;
	pointer-events: none;
	user-select: none;
	z-index: 2;
}

.subul-hero-rev__inner {
	position: relative;
	z-index: 3;
	display: flex;
	flex-direction: row;
	align-items: stretch;
	justify-content: space-between;
	gap: 24px;
	width: 100%;
	min-height: inherit;
	padding: 40px 32px;
	box-sizing: border-box;
}

.subul-hero-rev__col {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.subul-hero-rev__col--name {
	flex: 0 1 28%;
	align-self: flex-start;
	justify-content: flex-start;
	align-items: flex-start;
	text-align: start;
}

.subul-hero-rev__col--portrait {
	flex: 1 1 44%;
	align-self: stretch;
	justify-content: flex-end;
	align-items: center;
}

.subul-hero-rev__col--desc {
	flex: 0 1 28%;
	align-self: flex-end;
	justify-content: flex-end;
	align-items: flex-end;
	text-align: start;
}

/* Pretitle + title share one wrapper so the accent bar is ONE continuous element
   spanning both lines (no breaks between them). */
.subul-hero-rev__name-stack {
	--subul-hero-title-bar: #987B43;
	--subul-hero-title-bar-width: 4px;
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.subul-hero-rev__name-stack--bar {
	padding-inline-start: 14px;
}

.subul-hero-rev__name-stack--bar::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: 0.12em;
	bottom: 0.12em;
	width: var(--subul-hero-title-bar-width);
	background: var(--subul-hero-title-bar);
	border-radius: 2px;
}

.subul-hero-rev__pretitle {
	font-size: 32px;
	line-height: 1.2;
	margin: 0;
}

.subul-hero-rev__title {
	font-size: 48px;
	font-weight: 600;
	line-height: 1.2;
	margin: 0;
}

.subul-hero-rev__col--portrait,
.subul-hero-rev__portrait {
	background: transparent !important;
}

.subul-hero-rev__portrait {
	display: block;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	align-self: end;
}

.subul-hero-rev__desc {
	position: relative;
	width: 100%;
	max-width: 360px;
	padding: 22px 24px;
	background: rgba(0, 0, 0, 0.55);
	border-radius: 4px;
	font-size: 15px;
	line-height: 1.7;
	color: #fff;
	box-sizing: border-box;
}

/* Corner-frame brackets framing the description box.
   --ts = top + inline-start corner   (top-right in RTL, top-left in LTR)
   --be = bottom + inline-end corner  (bottom-left in RTL, bottom-right in LTR) */
.subul-hero-rev__desc-corner {
	position: absolute;
	width: 32px;
	height: 32px;
	border: 2px solid var(--subul-hero-corner);
	pointer-events: none;
	display: block;
}

.subul-hero-rev__desc-corner--ts {
	top: -8px;
	inset-inline-start: -8px;
	border-inline-end: 0;
	border-block-end: 0;
}

.subul-hero-rev__desc-corner--be {
	bottom: -8px;
	inset-inline-end: -8px;
	border-inline-start: 0;
	border-block-start: 0;
}

/* Video block - physical bottom-right on desktop (same in LTR & RTL).
   Lives inside .__inner; absolute on desktop so it floats over portrait,
   becomes a normal flex item on mobile so it stacks under the description. */
.subul-hero-rev__col--video {
	position: absolute;
	bottom: 28px;
	right: 32px;
	left: auto;
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 12px;
	flex-direction: row-reverse; /* button on the right, label on the left */
	flex: 0 0 auto;
}

/* Force inline-flex (Hello/Elementor reset can set <a> to display:block) */
.subul-hero-rev__video-btn,
a.subul-hero-rev__video-btn {
	position: relative;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	padding: 0;
	border-radius: 50%;
	background: #fff;
	color: #0b0b0b;
	text-decoration: none;
	box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
	transition: transform 0.25s ease;
	z-index: 1;
	box-sizing: border-box;
}

.subul-hero-rev__video-btn:hover {
	transform: scale(1.06);
}

/* Geometrically-centered triangle so it sits dead center inside the circle.
   Vertices (8.34, 4) (8.34, 20) (19.66, 12) → centroid (12.11, 12) ≈ viewBox center. */
.subul-hero-rev__video-icon {
	position: relative;
	display: block;
	width: 38%;
	height: 38%;
	fill: currentColor;
	margin: 0;
	z-index: 2;
	pointer-events: none;
}

.subul-hero-rev__ripple {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid var(--subul-hero-ripple);
	opacity: 0;
	pointer-events: none;
	animation: subul-hero-ripple 2s ease-out infinite;
	z-index: 0;
}

.subul-hero-rev__ripple--2 {
	animation-delay: 1s;
}

@keyframes subul-hero-ripple {
	0% {
		transform: scale(1);
		opacity: 0.7;
	}
	80% {
		opacity: 0;
	}
	100% {
		transform: scale(2);
		opacity: 0;
	}
}

.subul-hero-rev__video-label {
	font-size: 14px;
	font-weight: 500;
	color: #fff;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
	white-space: nowrap;
}

/* ===== Reveal Animations ===== */
.subul-hero-rev--anim .subul-hero-rev__watermark,
.subul-hero-rev--anim .subul-hero-rev__pretitle,
.subul-hero-rev--anim .subul-hero-rev__title,
.subul-hero-rev--anim .subul-hero-rev__portrait,
.subul-hero-rev--anim .subul-hero-rev__desc,
.subul-hero-rev--anim .subul-hero-rev__col--video {
	opacity: 0;
	will-change: transform, opacity;
}

.subul-hero-rev--anim.is-visible .subul-hero-rev__watermark {
	animation: subul-hero-fade-scale var(--subul-hero-anim-duration) ease-out 0.05s both;
}

.subul-hero-rev--anim.is-visible .subul-hero-rev__portrait {
	animation: subul-hero-fade-up var(--subul-hero-anim-duration) ease-out 0.15s both;
}

.subul-hero-rev--anim.is-visible .subul-hero-rev__pretitle {
	animation: subul-hero-slide-from-top var(--subul-hero-anim-duration) ease-out 0.35s both;
}

.subul-hero-rev--anim.is-visible .subul-hero-rev__title {
	animation: subul-hero-slide-from-top var(--subul-hero-anim-duration) ease-out 0.5s both;
}

.subul-hero-rev--anim.is-visible .subul-hero-rev__desc {
	animation: subul-hero-slide-from-bottom var(--subul-hero-anim-duration) ease-out 0.65s both;
}

.subul-hero-rev--anim.is-visible .subul-hero-rev__col--video {
	animation: subul-hero-fade-up var(--subul-hero-anim-duration) ease-out 0.85s both;
}

@keyframes subul-hero-fade-scale {
	from {
		opacity: 0;
		transform: scale(0.92);
	}
	to {
		opacity: var(--target-opacity, 0.5);
		transform: scale(1);
	}
}

.subul-hero-rev--anim.is-visible .subul-hero-rev__watermark {
	--target-opacity: 0.5;
}

@keyframes subul-hero-fade-up {
	from {
		opacity: 0;
		transform: translateY(40px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes subul-hero-slide-from-top {
	from {
		opacity: 0;
		transform: translateY(-30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes subul-hero-slide-from-bottom {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.subul-hero-rev--anim .subul-hero-rev__watermark,
	.subul-hero-rev--anim .subul-hero-rev__pretitle,
	.subul-hero-rev--anim .subul-hero-rev__title,
	.subul-hero-rev--anim .subul-hero-rev__portrait,
	.subul-hero-rev--anim .subul-hero-rev__desc,
	.subul-hero-rev--anim .subul-hero-rev__col--video {
		opacity: 1;
		animation: none !important;
	}
	.subul-hero-rev__ripple {
		animation: none;
		opacity: 0;
	}
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
	.subul-hero-rev__watermark {
		font-size: 110px;
	}
	.subul-hero-rev__title {
		font-size: 36px;
	}
	.subul-hero-rev__pretitle {
		font-size: 26px;
	}
}

@media (max-width: 767px) {
	.subul-hero-rev {
		min-height: 520px;
	}
	/* Mobile layout: TRUE two-column grid.
	   - "name" "portrait"
	   - "desc" "portrait"   (portrait spans all rows in column 2)
	   - "video" "portrait"
	   In RTL, CSS Grid flips columns automatically so the FIRST grid column appears on the
	   physical RIGHT. That gives us: text+video stacked on the right, portrait on the left.
	   In LTR it mirrors. No flex-wrap quirks. */
	.subul-hero-rev__inner {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		grid-template-areas:
			"name    portrait"
			"desc    portrait"
			"video   portrait";
		grid-template-rows: auto auto auto;
		align-items: start;
		gap: 12px 14px;
		padding: 20px 16px 28px;
	}
	.subul-hero-rev__col--name {
		grid-area: name;
		flex: unset;
		align-self: start;
		align-items: flex-start;
		text-align: start;
	}
	.subul-hero-rev__col--desc {
		grid-area: desc;
		flex: unset;
		align-self: start;
		align-items: flex-start;
		justify-content: flex-start;
	}
	/* Video flows under description in the text column */
	.subul-hero-rev__col--video {
		grid-area: video;
		position: static;
		flex: unset;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
		gap: 10px;
		top: auto;
		right: auto;
		bottom: auto;
		left: auto;
		transform: none;
	}
	.subul-hero-rev__col--portrait {
		grid-area: portrait;
		flex: unset;
		align-self: stretch;
		justify-content: center;
		align-items: stretch;
	}

	.subul-hero-rev__desc {
		max-width: 100%;
		font-size: 13px;
		line-height: 1.6;
		padding: 14px 16px;
	}
	.subul-hero-rev__desc-corner {
		width: 22px;
		height: 22px;
	}
	.subul-hero-rev__watermark {
		font-size: 72px;
	}
	.subul-hero-rev__title {
		font-size: 26px;
	}
	.subul-hero-rev__pretitle {
		font-size: 20px;
	}
	.subul-hero-rev__portrait {
		width: 100%;
		max-height: 70vh;
		object-fit: contain;
		object-position: center bottom;
	}
	.subul-hero-rev__video-btn {
		width: 48px;
		height: 48px;
	}
	.subul-hero-rev__video-label {
		font-size: 13px;
	}
}

/* ===== Bailleul Service Card widget — depth reveal =====
   Idle: text panel ON TOP, semi-transparent, image dims through it.
   Hover/active/focus (DEPTH effect — NOT 3D rotateY):
     - Text panel translates partially toward inline-end (right in LTR, left in RTL),
     - Slight 2D rotate (~7°), scale-down, dim/blur — reads as "behind",
     - Drops to z-index 0 so the image-part covers it.
     - Image-part scales up slightly + strong shadow → feels "above".

   Auto-counter fallback (used only when JS is disabled). JS overrides in normal use. */
.subul-service-card--num-auto {
	counter-increment: subul-card-counter;
}

/* Card root — NO overflow:hidden so the tilted text panel can extend past the card
   boundary without being clipped. Each inner layer carries its own border-radius. */
.subul-service-card {
	--subul-card-trans: 0.55s;
	--subul-card-tilt: 7deg;
	--subul-card-shift-x: 32%;
	--subul-card-scale: 0.86;
	--subul-card-img-zoom: 1.04;
	--subul-card-radius: 8px;
	position: relative;
	display: block;
	width: 100%;
	min-height: 326px;
	color: inherit;
	text-decoration: none;
	box-sizing: border-box;
	z-index: 1;
	transition: z-index 0s linear var(--subul-card-trans);
}

/* Hovered / active / focused card jumps above siblings so the tilted text panel
   is never clipped by neighbour cards in a Loop Grid / Loop Carousel. */
.subul-service-card:hover,
.subul-service-card.is-active,
.subul-service-card:focus-within {
	z-index: 50;
	transition-delay: 0s;
}

a.subul-service-card { text-decoration: none; color: inherit; }
.subul-service-card:focus-visible { outline: 2px solid #987B43; outline-offset: 2px; }

/* Image part — fills card area, sits underneath the text panel.
   Carries its OWN border-radius + overflow so the image is clipped to a rounded box. */
.subul-service-card__image-part {
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: var(--subul-card-radius);
	overflow: hidden;
}

.subul-service-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--subul-card-trans) ease;
}

/* Text part — translucent dark overlay sitting on top of the image */
.subul-service-card__text-part {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 12px;
	padding: 24px 18px;
	border: 1px solid #987B43;
	border-radius: var(--subul-card-radius);
	background: rgba(0, 0, 0, 0.55);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	box-sizing: border-box;
	transform-origin: center center;
	transition: transform var(--subul-card-trans) cubic-bezier(0.4, 0.1, 0.2, 1),
		opacity var(--subul-card-trans) ease,
		filter var(--subul-card-trans) ease;
	will-change: transform, filter;
}

/* Hover / Active / Focus  →  DEPTH effect (2D — no perspective).
   Text panel partially translates toward inline-end, slightly rotates, scales down,
   dims & blurs slightly, drops to z-index 0. The image-part rises with shadow + zoom.

   Defaults (LTR):
     - --subul-card-shift-x  (translateX, positive = toward inline-end / right)
     - --subul-card-tilt     (rotate degrees, positive = clockwise)
     - --subul-card-scale    (scale factor of text panel when "behind") */

.subul-service-card.subul-service-card--3d:hover .subul-service-card__text-part,
.subul-service-card.subul-service-card--3d.is-active .subul-service-card__text-part,
.subul-service-card.subul-service-card--3d:focus-within .subul-service-card__text-part {
	transform:
		translateX(var(--subul-card-shift-x, 32%))
		rotate(var(--subul-card-tilt, 7deg))
		scale(var(--subul-card-scale, 0.86));
	filter: brightness(0.7) blur(0.5px);
	z-index: 0;
}

/* RTL: mirror translation + rotation so the panel tilts to the LEFT */
.subul-service-card[dir="rtl"].subul-service-card--3d:hover .subul-service-card__text-part,
.subul-service-card[dir="rtl"].subul-service-card--3d.is-active .subul-service-card__text-part,
.subul-service-card[dir="rtl"].subul-service-card--3d:focus-within .subul-service-card__text-part {
	transform:
		translateX(calc(var(--subul-card-shift-x, 32%) * -1))
		rotate(calc(var(--subul-card-tilt, 7deg) * -1))
		scale(var(--subul-card-scale, 0.86));
}

/* Image part — pops on top with a soft zoom and a real shadow so it visually rises above. */
.subul-service-card__image-part {
	transition: transform var(--subul-card-trans) ease,
		box-shadow var(--subul-card-trans) ease;
	will-change: transform, box-shadow;
}

.subul-service-card.subul-service-card--3d:hover .subul-service-card__image-part,
.subul-service-card.subul-service-card--3d.is-active .subul-service-card__image-part,
.subul-service-card.subul-service-card--3d:focus-within .subul-service-card__image-part {
	transform: scale(var(--subul-card-img-zoom, 1.04));
	box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
	z-index: 3;
}

/* Image inside the part — kept simple, no extra zoom (the image-part already scales). */
.subul-service-card__image {
	transition: filter var(--subul-card-trans) ease;
}

/* Fallback (no flip effect) — text panel just fades on hover */
.subul-service-card:not(.subul-service-card--3d):hover .subul-service-card__text-part,
.subul-service-card:not(.subul-service-card--3d).is-active .subul-service-card__text-part,
.subul-service-card:not(.subul-service-card--3d):focus-within .subul-service-card__text-part {
	opacity: 0;
	pointer-events: none;
}

/* Number */
.subul-service-card__number {
	margin: 0;
	font-family: Cairo, sans-serif;
	font-size: 60px;
	font-weight: 700;
	line-height: 1;
	color: #987B43;
	text-align: center;
	min-height: 1em;
	transition: color var(--subul-card-trans) ease, transform var(--subul-card-trans) ease;
}

/* CSS-counter fallback — only used when JS hasn't filled the element yet (pre-hydration)
   AND when no [data-num] override has been applied. JS sets data-num for accuracy inside
   loop carousels (where Swiper duplicates would otherwise break the counter). */
.subul-service-card__number--auto:empty:not([data-num])::before {
	content: counter(subul-card-counter, decimal-leading-zero);
}

.subul-service-card__number--auto[data-num]::before {
	content: attr(data-num);
}

.subul-service-card:hover .subul-service-card__number,
.subul-service-card.is-active .subul-service-card__number,
.subul-service-card:focus-within .subul-service-card__number {
	transform: translateY(-2px);
}

.subul-service-card__title {
	margin: 0;
	font-family: Cairo, sans-serif;
	font-size: 32px;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
	text-align: center;
}

.subul-service-card__desc {
	margin: 0;
	font-family: Cairo, sans-serif;
	font-size: 15px;
	line-height: 1.6;
	color: #fff;
	text-align: center;
}

/* Reveal animation on scroll */
.subul-service-card--anim {
	opacity: 0;
	transform: translateY(30px);
	transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.subul-service-card--anim.is-visible {
	opacity: 1;
	transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
	.subul-service-card,
	.subul-service-card__image,
	.subul-service-card__text-part,
	.subul-service-card__number,
	.subul-service-card--anim {
		transition: none !important;
		animation: none !important;
	}
	.subul-service-card--anim {
		opacity: 1;
		transform: none;
	}
	.subul-service-card.subul-service-card--3d:hover .subul-service-card__text-part,
	.subul-service-card.subul-service-card--3d.is-active .subul-service-card__text-part,
	.subul-service-card[dir="rtl"].subul-service-card--3d:hover .subul-service-card__text-part,
	.subul-service-card[dir="rtl"].subul-service-card--3d.is-active .subul-service-card__text-part {
		transform: none;
		opacity: 0;
	}
}

@media (max-width: 767px) {
	.subul-service-card {
		min-height: 280px;
	}
	.subul-service-card__number {
		font-size: 42px;
	}
	.subul-service-card__title {
		font-size: 22px;
	}
	.subul-service-card__desc {
		font-size: 14px;
	}
}

/* ===== Video popup overrides (shared modal) =====
   Make the modal fully responsive (full viewport width on mobile, large on desktop)
   and move the close button onto the dark overlay (top-right corner of the viewport),
   not floating over the video itself. */
.subul-video-modal {
	padding: 0 !important;
	background: rgba(0, 0, 0, 0.85) !important;
}

.subul-video-modal__dialog {
	width: min(100vw, 1280px) !important;
	max-width: 100vw !important;
	aspect-ratio: 16 / 9 !important;
	max-height: 100vh !important;
	border-radius: 0 !important;
	background: #000 !important;
}

@media (min-width: 768px) {
	.subul-video-modal {
		padding: 40px !important;
	}
	.subul-video-modal__dialog {
		width: min(95vw, 1280px) !important;
		max-height: 90vh !important;
		border-radius: 8px !important;
	}
}

/* Pull the close button OUT of the video frame, anchor to the overlay (viewport). */
.subul-video-modal__close {
	position: fixed !important;
	top: 16px !important;
	right: 16px !important;
	left: auto !important;
	width: 44px !important;
	height: 44px !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	line-height: 1;
	background: rgba(255, 255, 255, 0.18) !important;
	color: #fff !important;
	border: 1px solid rgba(255, 255, 255, 0.35) !important;
	border-radius: 999px !important;
	cursor: pointer;
	z-index: 100001 !important;
	transition: background 0.2s ease, transform 0.2s ease;
}

.subul-video-modal__close:hover {
	background: rgba(255, 255, 255, 0.32) !important;
	transform: scale(1.06);
}
