/* Controls row: the segmented tab bar on the left and the search pill on the
   right, on one line (stacks on narrow screens). */
.xl-pf-controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px 24px;
	/* More breathing room below the page header, less below the search row. */
	margin-top: 28px;
	margin-bottom: 4px;
}

/* Segmented tab bar — overrides the plain-pill tabs from
   xl-portfolio-detail.css (this file loads after it, so equal-specificity
   rules win). A soft blue gradient capsule with the active tab as a raised
   white pill. */
.xl-pf-controls .xl-pf-tabs {
	display: inline-flex;
	/* Wider capsule (matches the Figma); the tabs themselves grow to fill it
	   (wider pills) rather than being spaced apart. */
	flex: 1 1 58%;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 4px;
	margin: 0;
	min-height: 70px;
	padding: 8px 14px;
	box-sizing: border-box;
	background: linear-gradient(90deg, #e6f2fe 0%, #cfe6fb 100%);
	border-radius: 999px;
}

.xl-pf-controls .xl-pf-tab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: stretch;
	/* Each tab grows to share the capsule width equally — wide pills, no gaps. */
	flex: 1 1 0;
	padding: 12px 26px;
	/* Transparent border on every tab so the active tab's coloured border
	   doesn't change its size (no layout shift when switching tabs). */
	border: 1.5px solid transparent;
	border-radius: 999px;
	background: transparent;
	color: #1c2b3d;
	text-decoration: none;
	font-size: .95rem;
	font-weight: 600;
	line-height: 1;
	box-shadow: none;
	transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.xl-pf-controls .xl-pf-tab:hover {
	color: #0d1620;
	background: rgba(255, 255, 255, .45);
	border-color: transparent;
}

.xl-pf-controls .xl-pf-tab.is-active {
	/* Clean white pill with a light-blue outline, matching the Figma. */
	background: #ffffff;
	/* border-color: #5aa2f0; */
	color: #0d1620;
	font-weight: 700;
	box-shadow: 0 4px 12px rgba(23, 58, 110, .12);
}

/* Live portfolio search bar — the rounded "Search by names..." pill: a
   soft-bordered field with a light-blue circular icon badge on the left. */
.xl-pf-search {
	--xl-pf-accent: #2f8fe0;
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1 1 38%;
	width: auto;
	min-height: 70px;
	margin: 0;
	padding: 8px 26px 8px 10px;
	background: #fff;
	border: 1px solid #DDDDDD;
	border-radius: 999px;
	box-shadow: 0 6px 18px rgba(20, 30, 60, .06);
	transition: border-color .2s ease, box-shadow .2s ease;
	cursor: text;
}

/* The clear (✕) button is a real control — keep its own pointer cursor. */
.xl-pf-search__clear {
	cursor: pointer;
}

.xl-pf-search:focus-within {
	border-color: #cfe3f8;
	box-shadow: 0 8px 22px rgba(47, 143, 224, .12);
}

.xl-pf-search__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: #35B6FF33;
	color: #191919;
}

.xl-pf-search__icon svg {
	width: 24px;
	height: 24px;
}

/* BeTheme applies a bordered, padded, white box to every input via
   higher-specificity selectors (#Content input …). Force the field flat with
   !important so it reads as one clean pill instead of a box-inside-a-pill. */
.xl-pf-search .xl-pf-search__input {
	flex: 1 1 auto;
	width: auto !important;
	min-width: 0;
	min-height: 0 !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	outline: none !important;
	background: transparent !important;
	box-shadow: none !important;
	font-size: 1rem;
	font-weight: 600;
	color: #384252;
	line-height: 1.5;
}

.xl-pf-search .xl-pf-search__input:focus {
	border: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
}

.xl-pf-search__input::placeholder {
	color: #9aa5b5 !important;
	font-weight: 600;
	opacity: 1;
}

/* Clear (✕) button — shown only when the field has text (JS toggles
   .has-value on the .xl-pf-search pill). */
.xl-pf-search__clear {
	display: none;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #eef2f7;
	color: #5b6b87;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}

.xl-pf-search__clear:hover,
.xl-pf-search__clear:focus {
	background: #e0e6ee;
	color: #191919;
}

.xl-pf-search.has-value .xl-pf-search__clear {
	display: inline-flex;
}

/* Hide the native clear/search decorations so the field stays flat. */
.xl-pf-search__input::-webkit-search-decoration,
.xl-pf-search__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}

/* Loading spinner (replaces nothing visually until a request is in flight). */
.xl-pf-search__spinner {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid #dbe3ef;
	border-top-color: var(--xl-pf-accent);
	opacity: 0;
	transition: opacity .15s ease;
}

.xl-pf-search.is-loading .xl-pf-search__spinner {
	opacity: 1;
	animation: xlPfSearchSpin .7s linear infinite;
}

@keyframes xlPfSearchSpin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.xl-pf-search.is-loading .xl-pf-search__spinner {
		animation: none;
	}
}

/* AJAX-swapped results shouldn't wait on the scroll-reveal observer. */
.xl-pf-results.is-searching .xl-pf-card {
	opacity: 1;
	transform: none;
}

/* Stack the tab bar and search on their own rows once they no longer fit side
   by side, each centred and full-width. */
/* Desktop + laptop (>1024px): tab bar and search sit on one line. Tablet and
   mobile (≤1024px): stack them on separate lines, each full-width. */
@media (max-width: 1024px) {
	.xl-pf-controls {
		flex-direction: column;
		align-items: stretch;
	}

	.xl-pf-controls .xl-pf-tabs {
		flex: 0 0 auto;
		align-self: center;
		max-width: 100%;
	}

	/* Don't force equal-width tabs on mobile — that squeezes multi-word labels
	   ("Packaging Design") into cramped two-line pills. Size each tab to its
	   label on one line and let them wrap into neat centred rows. */
	.xl-pf-controls .xl-pf-tab {
		flex: 0 1 auto;
		white-space: nowrap;
	}

	.xl-pf-search {
		flex: 0 0 auto;
		width: 100%;
		max-width: none;
		margin: 0 auto;
	}
}

@media (max-width: 480px) {
	.xl-pf-controls .xl-pf-tab {
		padding: 10px 18px;
	}
}
