/**
 * Faiza Baig & Co - Project single widgets (Before/After, Video, Gallery)
 * Colors and fonts default to Elementor Kit globals via widget controls.
 */

/* ---------- Hide empty widgets / sections on the live site ---------- */
/* A widget that has no data outputs .fb-is-empty. Its own wrapper is removed, and any parent
   container given the CSS class "fb-hide-if-empty" is removed too, so no blank space remains.
   Not applied inside the Elementor editor so the section can still be edited. */
body:not(.elementor-editor-active) .elementor-widget:has(.fb-is-empty),
body:not(.elementor-editor-active) .fb-hide-if-empty:has(.fb-is-empty) {
	display: none !important;
}

.fb-widget-placeholder {
	padding: 18px 20px;
	border: 1px dashed #A48E77;
	background: #F6F2ED;
	color: #1E1A19;
	font-size: 13px;
	line-height: 1.6;
}

/* ---------- Before / After ---------- */
.fb-ba-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 30px;
}

.fb-ba { margin: 0; --fb-ba-handle: #FFFFFF; --fb-ba-arrow: #4E1822; }

.fb-ba__stage {
	--fb-ba-pos: 50%;
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #F6F2ED;
	user-select: none;
	-webkit-user-select: none;
	touch-action: pan-y;
}

.fb-ba__layer { position: absolute; inset: 0; }
.fb-ba__layer--before { clip-path: inset(0 calc(100% - var(--fb-ba-pos)) 0 0); }

.fb-ba__stage .fb-ba__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	pointer-events: none;
}

.fb-ba__tag {
	position: absolute;
	top: 16px;
	z-index: 2;
	padding: 6px 12px;
	background: rgba(30, 26, 25, 0.72);
	color: #FFFFFF;
	font-size: 11px;
	letter-spacing: 0.34em;
	text-transform: uppercase;
	line-height: 1.2;
	pointer-events: none;
}
.fb-ba__tag--before { left: 16px; }
.fb-ba__tag--after { right: 16px; }

.fb-ba__divider {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--fb-ba-pos);
	z-index: 3;
	width: 2px;
	margin-left: -1px;
	background: var(--fb-ba-handle);
	box-shadow: 0 0 12px rgba(0, 0, 0, 0.25);
	pointer-events: none;
}

.fb-ba__knob {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 46px;
	height: 46px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: var(--fb-ba-handle);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
/* Two small arrows (◂ ▸) drawn with CSS so no icon font is needed. */
.fb-ba__knob::before,
.fb-ba__knob::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 0;
	height: 0;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
	transform: translateY(-50%);
}
.fb-ba__knob::before { left: 11px; border-right: 7px solid var(--fb-ba-arrow); }
.fb-ba__knob::after { right: 11px; border-left: 7px solid var(--fb-ba-arrow); }

/* Native range input covers the whole image: drag, touch and arrow keys work out of the box. */
.fb-ba__range {
	position: absolute;
	inset: 0;
	z-index: 4;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: ew-resize;
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
}
.fb-ba__range::-webkit-slider-thumb { -webkit-appearance: none; width: 46px; height: 100%; }
.fb-ba__range::-moz-range-thumb { width: 46px; height: 100%; border: 0; }

.fb-ba__stage:has(.fb-ba__range:focus-visible) .fb-ba__knob {
	outline: 2px solid var(--fb-ba-arrow);
	outline-offset: 3px;
}

.fb-ba__caption {
	margin-top: 14px;
	font-size: 11px;
	letter-spacing: 0.34em;
	text-transform: uppercase;
}

@media (max-width: 767px) {
	.fb-ba-grid { grid-template-columns: minmax(0, 1fr); }
	.fb-ba__knob { width: 38px; height: 38px; }
	.fb-ba__tag { top: 10px; padding: 5px 9px; font-size: 10px; letter-spacing: 0.24em; }
	.fb-ba__tag--before { left: 10px; }
	.fb-ba__tag--after { right: 10px; }
}

/* ---------- Video ---------- */
.fb-video { width: 100%; margin: 0 auto; }
.fb-video__heading { margin: 0 0 24px; }
.fb-video__frame { position: relative; aspect-ratio: 16 / 9; background: #1E1A19; overflow: hidden; }
.fb-video__frame iframe,
.fb-video__file { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; background: #1E1A19; }

.fb-video__facade {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	border-radius: 0;
	cursor: pointer;
	background-color: #1E1A19;
	background-position: center;
	background-size: cover;
}
.fb-video__facade::after { content: ""; position: absolute; inset: 0; background-color: rgba(25, 21, 20, 0.25); transition: background-color .3s ease; }
.fb-video__play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 76px;
	height: 76px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background-color: #4E1822;
	color: #FFFFFF;
	transition: transform .3s ease;
}
.fb-video__play svg { margin-left: 4px; }
.fb-video__facade:hover .fb-video__play,
.fb-video__facade:focus-visible .fb-video__play { transform: translate(-50%, -50%) scale(1.06); }
.fb-video__facade:focus-visible { outline: 2px solid #4E1822; outline-offset: 3px; }

.fb-video__desc { --fb-video-desc-gap: 24px; }
.fb-video__desc--below { margin-top: var(--fb-video-desc-gap); }
.fb-video__desc--above { margin-bottom: var(--fb-video-desc-gap); }
.fb-video__desc p:last-child { margin-bottom: 0; }

@media (max-width: 767px) {
	.fb-video__play { width: 60px; height: 60px; }
}

/* ---------- Gallery ---------- */
.fb-gallery {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}
.fb-gallery__item {
	display: block;
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border: 1px solid #E6DED4;
	background: #F6F2ED;
}
.fb-gallery__item img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform .6s cubic-bezier(.25, 1, .5, 1);
}
.fb-gallery-zoom-yes .fb-gallery__item:hover img { transform: scale(1.05); }
.fb-gallery__item:focus-visible { outline: 2px solid #4E1822; outline-offset: 2px; }

@media (max-width: 767px) {
	.fb-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
	.fb-gallery__item img,
	.fb-video__play,
	.fb-video__facade::after { transition: none; }
}
