/*
 * Credential badges shortcode styles.
 * Self-contained — no Bootstrap / jQuery dependency.
 */

.col--item:has(.jet-listing-dynamic-field__content:empty) {
    display: none; /* or any styles */
}

.bl-cred {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.bl-cred__group {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.bl-badge {
	--bl-badge-size: 38px;
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--bl-badge-size);
	height: var(--bl-badge-size);
	cursor: pointer;
	outline: none;
}

.bl-badge:focus-visible {
	box-shadow: 0 0 0 2px #4a90e2;
	border-radius: 4px;
}

.bl-badge > img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.bl-badge__placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f0f0f0;
	color: #555;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	border-radius: 4px;
}

.bl-badge__popover {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	min-width: 180px;
	max-width: 280px;
	padding: 0.5rem 0.75rem;
	background: #1f2937;
	color: #fff;
	font-size: 0.8125rem;
	line-height: 1.4;
	border-radius: 4px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 120ms ease;
	z-index: 9999;
	text-align: left;
	white-space: normal;
}

.bl-badge__popover strong {
	display: block;
	margin-bottom: 0.25rem;
	color: #fff;
	font-weight: 600;
}

.bl-badge__popover .bl-badge__meta {
	display: block;
	color: #d1d5db;
	font-size: 0.75rem;
	margin-top: 0.125rem;
}

.bl-badge__popover::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: #1f2937;
}

.bl-badge:hover .bl-badge__popover,
.bl-badge:focus .bl-badge__popover,
.bl-badge:focus-within .bl-badge__popover,
.bl-badge.bl-badge--open .bl-badge__popover {
	opacity: 1;
	visibility: visible;
}

/* Touch devices: hover/focus do not apply reliably — only the JS-toggled class opens the popover. */
@media (pointer: coarse) {
	.bl-badge:hover .bl-badge__popover,
	.bl-badge:focus .bl-badge__popover,
	.bl-badge:focus-within .bl-badge__popover {
		opacity: 0;
		visibility: hidden;
	}

	.bl-badge.bl-badge--open .bl-badge__popover {
		opacity: 1;
		visibility: visible;
	}
}
