/**
 * BlueBot Our Work — core widget styles.
 * Class names are namespaced with `bbow-` to avoid theme collisions.
 */

.bbow-widget {
	position: relative;
	width: 100%;
}

.bbow-widget.is-loading .bbow-grid {
	pointer-events: none;
}

.bbow-widget.is-loading .bbow-filter-bar {
	pointer-events: none;
}

/* Loading overlay (shown over the grid while a filter request is in flight) */
.bbow-grid-wrap {
	position: relative;
}

.bbow-loader {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba( 255, 255, 255, 0.6 );
	opacity: 0;
	transition: opacity 200ms ease;
	border-radius: inherit;
}

.bbow-widget.is-loading-filter .bbow-loader {
	display: flex;
	opacity: 1;
}

.bbow-loader__spinner {
	width: 34px;
	height: 34px;
	border: 3px solid rgba( 0, 0, 0, 0.12 );
	border-top-color: currentColor;
	border-radius: 50%;
	color: #222;
	animation: bbow-spin 700ms linear infinite;
}

.bbow-loader__text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	white-space: nowrap;
	clip: rect( 0, 0, 0, 0 );
	clip-path: inset( 50% );
}

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

@media ( prefers-reduced-motion: reduce ) {
	.bbow-loader__spinner {
		animation-duration: 1400ms;
	}
}

/* Filter buttons: dim + block clicks while any request is in flight */
.bbow-filter-btn:disabled {
	opacity: 0.55;
	cursor: default;
}

/* Load More button: swap label for an inline spinner while loading */
.bbow-load-more-btn {
	position: relative;
}

.bbow-load-more-btn.is-loading {
	color: transparent;
	pointer-events: none;
}

.bbow-load-more-btn.is-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	border: 2px solid rgba( 34, 34, 34, 0.25 );
	border-top-color: #222;
	border-radius: 50%;
	animation: bbow-spin 700ms linear infinite;
}

/* Section header */
.bbow-section {
	margin-bottom: 24px;
}

.bbow-section__title {
	margin: 0 0 8px;
	font-size: 28px;
	line-height: 1.3;
}

.bbow-section__description {
	margin: 0;
	font-size: 16px;
	line-height: 1.6;
	opacity: 0.8;
}

/* Filter row: wraps the button filter bar + the tag dropdown, dropdown
   pinned to the right regardless of whether the filter bar is present. */
.bbow-filter-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 28px;
}

/* Filter bar */
.bbow-filter-bar {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 28px;
	min-width: 0;
}

.bbow-filter-row .bbow-filter-bar {
	flex: 1 1 auto;
	margin-bottom: 0;
}

.bbow-filter-track-wrap {
	flex: 1 1 auto;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	-ms-overflow-style: none;
	scrollbar-width: none;
	cursor: grab;
}

.bbow-filter-track-wrap.is-dragging {
	cursor: grabbing;
	scroll-behavior: auto;
}

.bbow-filter-track-wrap::-webkit-scrollbar {
	display: none;
}

.bbow-filter-track {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 10px;
	list-style: none;
	margin: 0;
	padding: 4px 2px;
	width: max-content;
}

.bbow-filter-btn {
	flex: 0 0 auto;
	white-space: nowrap;
	cursor: pointer;
	border: 1px solid rgba(0, 0, 0, 0.12);
	background: #fff;
	color: #222;
	padding: 10px 20px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 500;
	transition: background-color 300ms ease, color 300ms ease, border-color 300ms ease;
	-webkit-user-select: none;
	user-select: none;
}

.bbow-filter-btn:hover {
	background: rgba(0, 0, 0, 0.04);
}

.bbow-filter-btn.is-active {
	background: #1a1a1a;
	color: #fff;
	border-color: #1a1a1a;
}

.bbow-filter-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.bbow-filter-arrow {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.12);
	background: #fff;
	color: #222;
	cursor: pointer;
	transition: background-color 300ms ease, color 300ms ease, opacity 300ms ease;
}

.bbow-filter-arrow:hover {
	background: rgba(0, 0, 0, 0.04);
}

.bbow-filter-arrow.is-disabled,
.bbow-filter-arrow:disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

/* Tag dropdown filter */
.bbow-tag-dropdown {
	position: relative;
	flex: 0 0 auto;
	margin-left: auto;
}

.bbow-tag-dropdown__trigger {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	border: 1px solid rgba(0, 0, 0, 0.12);
	background: #fff;
	color: #222;
	padding: 10px 18px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
	transition: background-color 300ms ease, color 300ms ease, border-color 300ms ease;
}

.bbow-tag-dropdown__trigger:hover {
	background: rgba(0, 0, 0, 0.04);
}

.bbow-tag-dropdown.is-open .bbow-tag-dropdown__trigger {
	background: #1a1a1a;
	color: #fff;
	border-color: #1a1a1a;
}

.bbow-tag-dropdown__trigger:disabled {
	opacity: 0.6;
	cursor: default;
}

.bbow-tag-dropdown__chevron {
	flex: 0 0 auto;
	transition: transform 250ms ease;
}

.bbow-tag-dropdown.is-open .bbow-tag-dropdown__chevron {
	transform: rotate( 180deg );
}

.bbow-tag-dropdown__panel {
	position: absolute;
	top: calc( 100% + 8px );
	right: 0;
	z-index: 20;
	min-width: 180px;
	max-height: 280px;
	overflow-y: auto;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 12px;
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
	opacity: 0;
	transform: translate3d(0, -6px, 0);
	pointer-events: none;
	transition: opacity 200ms ease, transform 200ms ease;
}

.bbow-tag-dropdown.is-open .bbow-tag-dropdown__panel {
	opacity: 1;
	transform: translate3d(0, 0, 0);
	pointer-events: auto;
}

.bbow-tag-dropdown__item {
	cursor: pointer;
	padding: 9px 14px;
	border-radius: 8px;
	font-size: 14px;
	color: #222;
	white-space: nowrap;
	transition: background-color 200ms ease, color 200ms ease;
}

.bbow-tag-dropdown__item:hover {
	background: rgba(0, 0, 0, 0.06);
}

.bbow-tag-dropdown__item.is-active {
	background: #1a1a1a;
	color: #fff;
}

/* Grid */
.bbow-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 24px;
	transition: opacity 300ms ease;
}

/* Empty state */
.bbow-empty-state {
	grid-column: 1 / -1;
	text-align: center;
	padding: 48px 16px;
	opacity: 0.7;
}

/* Card */
.bbow-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	transition: transform 350ms ease, box-shadow 350ms ease;
}

.bbow-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 24px 48px rgba(15, 23, 42, 0.16);
}

.bbow-card__image-wrap {
	position: relative;
	width: 100%;
	height: 260px;
	overflow: hidden;
	background: #f2f2f2;
}

.bbow-card__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 500ms ease;
}

.bbow-card:hover .bbow-card__image {
	transform: scale(1.08);
}

.bbow-card__image--placeholder {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, #eee 25%, #f7f7f7 25%, #f7f7f7 50%, #eee 50%, #eee 75%, #f7f7f7 75%, #f7f7f7 100%);
	background-size: 40px 40px;
}

.bbow-card__overlay {
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.4);
	opacity: 0;
	transition: opacity 300ms ease;
	pointer-events: none;
}

.bbow-card__hover-logo {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	opacity: 0;
	transition: opacity 300ms ease, transform 300ms ease;
	transform: scale( 0.92 );
	pointer-events: none;
}

.bbow-card:hover .bbow-card__hover-logo {
	opacity: 1;
	transform: scale( 1 );
}

.bbow-card__hover-logo img {
	display: block;
	width: auto;
	height: auto;
	max-width: 55%;
	max-height: 60%;
	object-fit: contain;
}

.bbow-card__tags {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 3;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	max-width: calc(100% - 32px);
}

.bbow-card__tags--body {
	position: static;
	top: auto;
	left: auto;
	max-width: 100%;
	margin: 0 0 12px;
}

.bbow-card__acf-tag {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 3;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	max-width: calc(100% - 32px);
}

.bbow-card__acf-tag--body {
	position: static;
	top: auto;
	right: auto;
	max-width: 100%;
	margin: 0 0 12px;
}

.bbow-card__tag {
	display: inline-flex;
	align-items: center;
	background: rgba(255, 255, 255, 0.95);
	color: #1a1a1a;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	padding: 9px 14px;
	border-radius: 999px;
}

.bbow-card__arrow {
	position: absolute;
	right: 16px;
	bottom: 16px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #ff5a1f;
	color: #fff;
	text-decoration: none;
	opacity: 0;
	transform: translateY(14px) scale(0.8);
	transition: opacity 300ms ease, transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1), background-color 250ms ease;
	pointer-events: none;
}

.bbow-card:hover .bbow-card__arrow {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.bbow-card__arrow:hover {
	background: #1a1a1a;
}

.bbow-card__arrow svg {
	display: block;
	transition: transform 250ms ease;
}

.bbow-card__arrow:hover svg {
	transform: translate(2px, -2px);
}

.bbow-card__logo-wrap {
	position: absolute;
	top: 16px;
	left: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.92);
	border-radius: 8px;
	padding: 8px 12px;
	max-width: 45%;
	opacity: 1;
	transition: opacity 300ms ease;
}

/* Hide the always-on corner client-logo badge on hover so it doesn't
   overlap/compete with the centered hover_logo + overlay. Only matters
   when both a "client_logo" and a "hover_logo" are set on the same post;
   harmless no-op otherwise. */
.bbow-card:hover .bbow-card__logo-wrap {
	opacity: 0;
}

.bbow-card__logo {
	max-width: 100%;
	max-height: 32px;
	width: auto;
	height: auto;
	display: block;
}

.bbow-card__body {
	padding: 20px 24px 24px;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
}

.bbow-card__title {
	margin: 0 0 10px;
	font-size: 20px;
	line-height: 1.3;
}

.bbow-card__summary {
	margin: -4px 0 10px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	opacity: 0.75;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.bbow-card__description {
	margin: 0 0 16px;
	font-size: 15px;
	line-height: 1.6;
	opacity: 0.8;
	flex: 1 1 auto;
}

.bbow-card__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
	text-decoration: none;
	padding: 10px 22px;
	border-radius: 999px;
	background: #1a1a1a;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	border: none;
	transition: background-color 300ms ease, color 300ms ease, transform 300ms ease;
}

.bbow-card__button:hover {
	background: #333;
	color: #fff;
}

/* Load more */
.bbow-load-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 32px;
}

.bbow-load-more-btn {
	cursor: pointer;
	border: 1px solid rgba(0, 0, 0, 0.15);
	background: #fff;
	color: #222;
	padding: 12px 32px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	transition: background-color 300ms ease;
}

.bbow-load-more-btn:hover {
	background: rgba(0, 0, 0, 0.04);
}

/* AJAX error notice */
.bbow-ajax-error {
	margin-top: 16px;
	padding: 12px 16px;
	border-radius: 8px;
	background: #fdecea;
	color: #611a15;
	font-size: 14px;
	text-align: center;
}

/* Reveal-on-viewport animation. Elements start hidden/offset and fade +
   rise into place the first time they scroll into view (see widget.js
   BlueBotReveal, which toggles the `is-visible` class via
   IntersectionObserver). Applied to the filter row and each card. */
.bbow-reveal {
	opacity: 0;
}

.bbow-reveal.is-visible {
	-webkit-animation: bbow-fadeUpSmall 700ms ease both;
	animation: bbow-fadeUpSmall 700ms ease both;
}

/* Stagger the grid cards slightly so they don't all pop in at once. */
.bbow-grid .bbow-reveal.is-visible:nth-child(2) { animation-delay: 80ms; }
.bbow-grid .bbow-reveal.is-visible:nth-child(3) { animation-delay: 160ms; }
.bbow-grid .bbow-reveal.is-visible:nth-child(4) { animation-delay: 240ms; }
.bbow-grid .bbow-reveal.is-visible:nth-child(n+5) { animation-delay: 300ms; }

@-webkit-keyframes bbow-fadeUpSmall {
	from {
		opacity: 0;
		-webkit-transform: translate3d(0, 25px, 0);
		transform: translate3d(0, 25px, 0);
	}
	to {
		opacity: 1;
		-webkit-transform: translate3d(0, 0, 0);
		transform: translate3d(0, 0, 0);
	}
}
@keyframes bbow-fadeUpSmall {
	from {
		opacity: 0;
		-webkit-transform: translate3d(0, 25px, 0);
		transform: translate3d(0, 25px, 0);
	}
	to {
		opacity: 1;
		-webkit-transform: translate3d(0, 0, 0);
		transform: translate3d(0, 0, 0);
	}
}

/* Editor-only placeholder (kept minimal; render() drives real preview) */
.bbow-editor-placeholder {
	padding: 40px;
	text-align: center;
	opacity: 0.6;
}
