/**
 * FreshBrand Portfolio Widget styles.
 *
 * Only the bits that are unique to this widget: the Pentagram "sentence + dropdowns" filter,
 * the custom block cell, the Load More button and the loading state. The grid and item visuals
 * are inherited from the Einar theme (reused qodef-* classes).
 *
 * @package FreshBrand_Portfolio_Widget
 */

/* ---------- Pentagram filter ---------- */
.fbpw-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.35em 0.5em;
	margin: 0 0 5.6rem;
	font-size: clamp(1.8rem, 2.6vw, 2.4rem);
	line-height: 1.25;
}

.fbpw-filter-text {
	white-space: nowrap;
}

/* ---------- Dropdown trigger ---------- */
.fbpw-dropdown {
	position: relative;
	display: inline-flex;
	max-width: 100%;
}

.fbpw-dropdown-trigger {
	font: inherit;
	color: inherit;
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--bd-color, currentColor);
	border-radius: 0;
	margin: 0;
	padding: 0 0.15em 0.06em;
	max-width: 100%;
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	cursor: pointer;
	transition: color 0.2s ease;
}

.fbpw-dropdown-trigger:hover,
.fbpw-dropdown.fbpw--open .fbpw-dropdown-trigger {
	color: var(--primary, #00aeef);
}

.fbpw-dropdown-trigger:focus-visible {
	outline: none;
}

.fbpw-dropdown-label {
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fbpw-dropdown-arrow {
	flex: 0 0 auto;
	width: 7px;
	height: 7px;
	border-right: 1px solid currentColor;
	border-bottom: 1px solid currentColor;
	transform: rotate(-45deg);
	transform-origin: center;
	margin-bottom: -0.08em;
	transition: transform 0.25s ease, margin 0.25s ease;
}

.fbpw-dropdown.fbpw--open .fbpw-dropdown-arrow {
	/* transform: rotate(-135deg); */
	margin-bottom: -0.06em;
}

/* ---------- Dropdown panel ---------- */
.fbpw-dropdown-panel {
	position: absolute;
	top: calc(100% + 0.6rem);
	left: 0;
	z-index: 1000;
	display: none;
	box-sizing: border-box;
	max-width: min(1000px, 92vw);
	max-height: 70vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	scroll-behavior: smooth;
	overscroll-behavior: contain;
	padding: 2.8rem 4.2rem;
	background: var(--qode-main-opposite-color, #ffffff);
	border-radius: 14px;
	box-shadow: 0 14px 21px var(--theme-glow);
}

.fbpw-dropdown.fbpw--open .fbpw-dropdown-panel {
	display: block;
	animation: fbpw-fade-in 0.18s ease-out;
}

.fbpw-dropdown-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(200px, 1fr));
	gap: 1.4rem;
}

@media (max-width: 880px) {
	.fbpw-dropdown-grid {
		grid-template-columns: repeat(2, minmax(20rem, 1fr));
		gap: 2.1rem 2.1rem;
	}
}

@media (max-width: 520px) {
	.fbpw-dropdown-panel {
		padding: 1.4rem;
		width: 28rem;
	}

	.fbpw-dropdown-grid {
		grid-template-columns: 1fr;
	}
}

/* ---------- Dropdown items + visual hierarchy ---------- */
.fbpw-dropdown-item {
	display: flex;
	font-family: inherit;
	font-weight: 400;
	line-height: 1.25;
	color: var(--qode-main-color, #374151);
	/* gray-700 */
	background-color: transparent;
	border: 0;
	border-radius: 0;
	padding: 4px 7px;
	margin: 0;
	text-align: left;
	cursor: pointer;
	transition: color 0.18s ease;
}

.fbpw-dropdown-item:hover,
.fbpw-dropdown-item.qodef--active {
	color: var(--primary, #00aeef);
}

/* "All" stands apart: slightly heavier + darker. */
.fbpw-dropdown-item--all {
	font-weight: 600;
	/* font-medium */
	color: var(--secondary, #111827);
	/* gray-900 */
}

/* Services items are a touch larger than Industries (hierarchy between the two menus). */
.fbpw-dropdown--service .fbpw-dropdown-item {
	font-size: clamp(1.6rem, 1.55392rem + 0.1282vw, 1.8rem);
}

.fbpw-dropdown--industry .fbpw-dropdown-item {
	font-size: clamp(1.6rem, 1.55392rem + 0.1282vw, 1.8rem);
}

@keyframes fbpw-fade-in {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

.fbpw-filter-spinner {
	display: none;
	width: 1em;
	height: 1em;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	align-self: center;
	animation: fbpw-spin 0.7s linear infinite;
}

.fbpw--loading .fbpw-filter-spinner {
	display: inline-block;
}

/* ---------- Loading state ---------- */
.fbpw--loading .qodef-grid-inner {
	opacity: 0.45;
	transition: opacity 0.2s ease;
	pointer-events: none;
}

@keyframes fbpw-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------- Custom block cell ---------- */
.fbpw-custom-block {
	display: flex;
}

.fbpw-custom-block>* {
	width: 100%;
}

/* ---------- Load More ---------- */
.fbpw-load-more-holder {
	width: 100%;
	margin-top: 2.5rem;
	text-align: center;
}

.fbpw-load-more-button {
	font: inherit;
	color: inherit;
	background: transparent;
	border: 1px solid currentColor;
	border-radius: 99px;
	padding: 0.85em 2.4em;
	cursor: pointer;
	transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.fbpw-load-more-button:hover {
	opacity: 0.8;
	color: var(--qode-main-opposite-color);
	background-color: var(--qode-main-color);
}

.fbpw-load-more-button[disabled] {
	opacity: 0.5;
	cursor: default;
}

/* ---------- Empty state ---------- */
.fbpw-no-posts {
	width: 100%;
	margin: 1rem 0;
}