/*
 * Minimal styling for [bd_cat_shortcodes_book_authors] and [bd_cat_shortcodes_product_taxonomy] output.
 * Both render as an inline, comma-separated link list meant to sit inside
 * body text (e.g. a Divi text module) — not a block-level layout, so this
 * intentionally stays light: a subtle hover treatment for linked names, and
 * a small pill for the taxonomy "+N more" indicator (it carries a `title`
 * tooltip with the full remaining list), and a superscript "+N" badge for
 * extra authors/editors whose CSS tooltip reads `data-bd-tip`. Uses currentColor/inherit throughout since this
 * renders inside an arbitrary theme/page background.
 *
 * Overridable from a child theme or Divi's own Custom CSS.
 */
.bd-cs-book-authors-link,
.bd-cs-product-taxonomy-link {
	text-decoration: underline;
	text-decoration-color: currentColor;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
	opacity: 0.85;
	transition: opacity 0.15s ease;
}

.bd-cs-book-authors-link:hover,
.bd-cs-product-taxonomy-link:hover {
	opacity: 1;
}

.bd-cs-product-taxonomy-more {
	display: inline-block;
	margin-left: 0.35em;
	padding: 0.05em 0.6em;
	font-size: 0.85em;
	line-height: 1.6;
	color: inherit;
	background-color: #f0f0f1;
	border-radius: var(--bd-radius, 4px);
	cursor: help;
	white-space: nowrap;
}

/*
 * Extra authors/editors: a compact "+N" badge raised beside the last name
 * shown, with a CSS tooltip listing the others. text-transform/letter-spacing
 * are reset because the book card sets its author line in uppercase. The
 * template prints no space before it, so it reads as the name's superscript.
 */
.bd-cs-book-authors-more {
	position: relative;
	/* Inline, not inline-block: an atomic box is a line-break opportunity, text is not. */
	display: inline;
	vertical-align: super;
	margin-left: 0.15em;
	padding: 0 0.4em;
	font-size: var(--bd-fs-xs, 11px);
	font-weight: 600;
	line-height: 1.5;
	text-transform: none;
	letter-spacing: normal;
	color: inherit;
	background-color: var(--bd-bg-subtle, #f3f5fb);
	border-radius: var(--bd-radius, 4px);
	cursor: help;
	white-space: nowrap;
}

.bd-cs-book-authors-more:focus-visible {
	outline: 2px solid var(--bd-blue, #001e60);
	outline-offset: 2px;
}

.bd-cs-book-authors-more .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.bd-cs-book-authors-more::after {
	content: attr(data-bd-tip);
	position: absolute;
	/* Below the badge, so on a card it never covers the title above. */
	top: calc(100% + 6px);
	left: 50%;
	z-index: 10;
	width: max-content;
	max-width: 240px;
	padding: 4px 8px;
	font-size: var(--bd-fs-xs, 11px);
	font-weight: 400;
	line-height: 1.4;
	text-align: left;
	white-space: normal;
	color: var(--bd-white, #fff);
	background-color: var(--bd-blue, #001e60);
	border-radius: var(--bd-radius, 4px);
	transform: translateX(-50%);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.15s ease, visibility 0.15s ease;
}

.bd-cs-book-authors-more:hover::after,
.bd-cs-book-authors-more:focus-visible::after {
	opacity: 1;
	visibility: visible;
}

/* The compact card clips its body (overflow: hidden): a tooltip would be cut. */
.bd-book-card--compact .bd-cs-book-authors-more::after {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.bd-cs-book-authors-more::after {
		transition: none;
	}
}
