/* Young Gunns Projects: front-end styles */

.yg-ba-showcase,
.yg-projects {
	--yg-brand: var(--e-global-color-primary, #1E2E4F);
	--yg-ink: var(--e-global-color-secondary, #141B2B);
	--yg-muted: var(--e-global-color-ygmuted, #5B6578);
	--yg-surface: var(--e-global-color-ygsurf, #F2F5FA);
	--yg-border: var(--e-global-color-ygborder, #E3E7EE);
	--yg-ba-line: #fff;
	--yg-ba-handle-bg: #fff;
	--yg-ba-handle-color: var(--yg-brand);
	--yg-ba-thumb-active: var(--yg-brand);
	--yg-ba-thumb-opacity: 0.72;
	--yg-filter-active-bg: var(--yg-brand);
	--yg-filter-active-color: #fff;
}

/* Comparison slider */
.yg-ba {
	--yg-pos: 50%;
	position: relative;
	width: 100%;
	aspect-ratio: 1.88;
	min-height: 280px;
	overflow: hidden;
	border-radius: 24px;
	background: var(--yg-surface, #F2F5FA);
	box-shadow: 0 10px 30px rgba(17, 26, 46, 0.10);
	user-select: none;
	-webkit-user-select: none;
	touch-action: pan-y;
	isolation: isolate;
}

.yg-ba__img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	display: block;
	border-radius: 0 !important;
	pointer-events: none;
	transition: opacity 0.25s ease;
}

.yg-ba__before {
	clip-path: inset(0 calc(100% - var(--yg-pos)) 0 0);
}

.yg-ba.is-loading .yg-ba__img {
	opacity: 0.4;
}

.yg-ba__line {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--yg-pos);
	width: 3px;
	margin-left: -1.5px;
	background: var(--yg-ba-line);
	box-shadow: 0 0 0 1px rgba(17, 26, 46, 0.15);
	pointer-events: none;
	z-index: 2;
}

.yg-ba__handle {
	position: absolute;
	top: 50%;
	left: var(--yg-pos);
	width: 48px;
	height: 48px;
	margin: -24px 0 0 -24px;
	border-radius: 50%;
	background: var(--yg-ba-handle-bg);
	color: var(--yg-ba-handle-color);
	display: grid;
	place-items: center;
	box-shadow: 0 12px 32px rgba(17, 26, 46, 0.18);
	pointer-events: none;
	z-index: 3;
	transition: transform 0.18s ease;
}

.yg-ba--card .yg-ba__handle {
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
}

.yg-ba:hover .yg-ba__handle,
.yg-ba.is-dragging .yg-ba__handle {
	transform: scale(1.06);
}

.yg-ba__badge {
	position: absolute;
	top: 16px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	border-radius: 999px;
	font-family: var(--e-global-typography-text-font-family, "Figtree"), sans-serif;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	pointer-events: none;
}

.yg-ba__badge--before {
	left: 16px;
	background: rgba(11, 18, 32, 0.78);
	color: #fff;
}

.yg-ba__badge--after {
	right: 16px;
	background: #fff;
	color: var(--yg-brand);
}

.yg-ba--card .yg-ba__badge {
	top: 12px;
	font-size: 12px;
	padding: 5px 10px;
}

.yg-ba--card .yg-ba__badge--before { left: 12px; }
.yg-ba--card .yg-ba__badge--after { right: 12px; }

/* The range input covers the whole frame: drag anywhere, keyboard arrows work. */
.yg-ba__range {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	opacity: 0;
	cursor: ew-resize;
	z-index: 4;
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
}

.yg-ba__range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 48px;
	height: 100vh;
	cursor: ew-resize;
}

.yg-ba__range::-moz-range-thumb {
	width: 48px;
	height: 100vh;
	border: 0;
	cursor: ew-resize;
}

.yg-ba:has(.yg-ba__range:focus-visible) {
	outline: 3px solid var(--yg-brand);
	outline-offset: 3px;
}

/* Showcase layout */
.yg-ba-showcase {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.yg-ba-caption {
	margin: 0;
	font-family: var(--e-global-typography-secondary-font-family, "Manrope"), sans-serif;
	font-weight: 700;
	color: var(--yg-ink);
}

.yg-ba-thumbs {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 12px;
}

.yg-ba-thumb {
	padding: 0 !important;
	margin: 0;
	border: 2px solid transparent !important;
	border-radius: 14px;
	overflow: hidden;
	cursor: pointer;
	background: var(--yg-surface) !important;
	aspect-ratio: 4 / 3;
	opacity: var(--yg-ba-thumb-opacity);
	transition: opacity 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
	box-shadow: none !important;
	line-height: 0;
}

.yg-ba-thumb:hover {
	opacity: 1;
	transform: translateY(-2px);
}

.yg-ba-thumb.is-active {
	border-color: var(--yg-ba-thumb-active) !important;
	opacity: 1;
}

.yg-ba-thumb:focus-visible {
	outline: 3px solid var(--yg-brand);
	outline-offset: 2px;
}

.yg-ba-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 0;
}

@media (max-width: 767px) {
	.yg-ba { min-height: 240px; border-radius: 18px; }
	.yg-ba-thumbs { gap: 8px; }
	.yg-ba-thumb { border-radius: 10px; }
	.yg-ba__handle { width: 42px; height: 42px; margin: -21px 0 0 -21px; }
	.yg-ba__badge { top: 12px; font-size: 12px; padding: 5px 10px; }
	.yg-ba__badge--before { left: 12px; }
	.yg-ba__badge--after { right: 12px; }
}

/* Projects grid */
.yg-projects {
	display: flex;
	flex-direction: column;
	gap: 28px;
}

.yg-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.yg-filter__btn {
	padding: 10px 18px !important;
	border-radius: 999px !important;
	border: 1px solid var(--yg-border) !important;
	background: #fff !important;
	color: var(--yg-ink) !important;
	font-family: var(--e-global-typography-accent-font-family, "Figtree"), sans-serif;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.yg-filter__btn:hover {
	border-color: var(--yg-brand) !important;
}

.yg-filter__btn.is-active {
	background: var(--yg-filter-active-bg) !important;
	border-color: var(--yg-filter-active-bg) !important;
	color: var(--yg-filter-active-color) !important;
}

.yg-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

.yg-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--yg-border);
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 6px 20px rgba(17, 26, 46, 0.06);
	transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.yg-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 14px 34px rgba(17, 26, 46, 0.12);
}

.yg-card[hidden] {
	display: none;
}

.yg-card__media {
	position: relative;
	aspect-ratio: 1.33;
	overflow: hidden;
	background: var(--yg-surface);
}

.yg-card__media .yg-ba {
	position: absolute;
	inset: 0;
	height: 100%;
	min-height: 0;
	aspect-ratio: auto;
	border-radius: 0;
	box-shadow: none;
}

.yg-card__img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	display: block;
	border-radius: 0 !important;
}

.yg-card__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	padding: 22px 24px 26px;
}

.yg-card__tag {
	display: inline-flex;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--yg-surface);
	color: var(--yg-brand);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.yg-card__title {
	margin: 2px 0 0;
	font-family: var(--e-global-typography-secondary-font-family, "Manrope"), sans-serif;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--yg-ink);
}

.yg-card__location {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-size: 14px;
	color: var(--yg-muted);
}

.yg-card__text {
	margin: 4px 0 0;
	font-size: 15px;
	line-height: 1.6;
	color: var(--yg-muted);
}

@media (max-width: 1024px) {
	.yg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
	.yg-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
	.yg-card,
	.yg-ba-thumb,
	.yg-ba__handle,
	.yg-ba__img { transition: none; }
}
