/* Shared breadcrumbs — single line; soft fade on the right (no horizontal scroll) */
.book-breadcrumb,
.bn-breadcrumbs {
	position: relative;
	max-width: 100%;
	text-align: left;
}

.book-breadcrumb {
	margin: 0;
	padding: 0.65rem 0;
	background: transparent;
}

/*
 * Bar alignment:
 * - standalone (direct under main / after hero): same shell as .bn-content-wrap (1120 + 1rem)
 * - nested inside .bn-content-wrap: no extra horizontal pad (parent already pads)
 */
.bn-breadcrumbs-bar {
	width: 100%;
	max-width: 1120px;
	margin-left: auto;
	margin-right: auto;
	padding: 0.65rem 1rem;
	box-sizing: border-box;
	text-align: left;
}

.bn-content-wrap > .bn-breadcrumbs-bar,
.bn-content-wrap .bn-breadcrumbs-bar {
	max-width: none;
	width: 100%;
	margin-left: 0;
	margin-right: 0;
	padding-left: 0;
	padding-right: 0;
}

.bn-breadcrumbs-bar .bn-breadcrumbs {
	margin: 0;
}

.book-breadcrumb ol,
.bn-breadcrumbs ol {
	display: flex !important;
	flex-wrap: nowrap !important;
	align-items: center;
	justify-content: flex-start;
	gap: 0;
	max-width: 100%;
	margin: 0;
	padding: 0.25rem 0 !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	list-style: none !important;
	/* No horizontal scroll — short crumbs stay intact; long ones shrink */
	overflow-x: hidden;
	overflow-y: hidden;
	scrollbar-width: none;
	text-align: left;
}

.book-breadcrumb ol::-webkit-scrollbar,
.bn-breadcrumbs ol::-webkit-scrollbar {
	display: none;
	height: 0;
}

/*
 * Default: never shrink crumbs below their label width.
 * Short groups (Acasă, Cărți, Ion Dur) stay fully readable.
 */
.book-breadcrumb li,
.bn-breadcrumbs li {
	display: inline-flex !important;
	align-items: center;
	flex: 0 0 auto;
	min-width: auto;
	max-width: none;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	white-space: nowrap;
	overflow: visible;
}

/*
 * Current (usually longest) crumb absorbs leftover space and fades out.
 * Soft fade only on truncating items — not on the whole trail.
 */
.book-breadcrumb li:last-child,
.bn-breadcrumbs li:last-child {
	flex: 1 1 0%;
	min-width: 0;
	max-width: 100%;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 1.35rem), transparent 100%);
	mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 1.35rem), transparent 100%);
}

.book-breadcrumb li:last-child,
.book-breadcrumb li:last-child > a,
.bn-breadcrumbs li:last-child > a,
.bn-breadcrumbs li:last-child > span {
	overflow: hidden;
	text-overflow: clip;
	white-space: nowrap;
	min-width: 0;
	max-width: 100%;
}

/*
 * Long penultimate only (e.g. PDF: … › Title › Title PDF):
 * 2nd-to-last AND at least 4th child — never Cărți / short author crumbs.
 */
.book-breadcrumb li:nth-last-child(2):nth-child(n + 4),
.bn-breadcrumbs li:nth-last-child(2):nth-child(n + 4) {
	flex: 0 1 auto; /* shrink if needed, never grow (avoids gap before last) */
	min-width: 0;
	max-width: min(52%, 28rem);
	overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 1.35rem), transparent 100%);
	mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 1.35rem), transparent 100%);
}

.book-breadcrumb li:nth-last-child(2):nth-child(n + 4) > a,
.bn-breadcrumbs li:nth-last-child(2):nth-child(n + 4) > a,
.bn-breadcrumbs li:nth-last-child(2):nth-child(n + 4) > span {
	overflow: hidden;
	text-overflow: clip;
	white-space: nowrap;
	min-width: 0;
	max-width: 100%;
}
.bn-breadcrumbs li::before,
.bn-breadcrumbs li::after {
	content: none !important;
	display: none !important;
}

/* Unified separator › (WP + BN) */
.book-breadcrumb li:not(:last-child)::after,
.bn-breadcrumbs li + li::before {
	content: "›" !important;
	display: inline-block !important;
	flex: 0 0 auto;
	margin: 0 0.5rem;
	color: #b3aaa6;
	font-weight: 400;
}

.book-breadcrumb li:not(:last-child)::after {
	margin-left: 0.5rem;
	margin-right: 0.5rem;
}

.page-carte .book-breadcrumb {
	padding: 0.45rem 0 0.15rem;
	margin: 0;
	background: transparent;
}

/*
 * Book detail: mirror Rezumat shell —
 * Bootstrap .container (breakpoint widths + 15px pad) + inner 720px column.
 * Do NOT constrain .container itself to 720px (that pushed crumbs right).
 */
.page-carte:not(.page-topcarti) .book-breadcrumb > .container {
	/* keep Bootstrap .container max-widths; only normalize pad */
	padding-left: 15px !important;
	padding-right: 15px !important;
	text-align: left;
	box-sizing: border-box;
}

.page-carte:not(.page-topcarti) .book-breadcrumb ol {
	max-width: 720px;
	margin-left: auto;
	margin-right: auto;
}

/* Tight gap between crumbs and first content block (Rezumat, etc.) */
.page-carte .book-breadcrumb + .section-block {
	padding-top: 0.35rem;
}

.page-carte .book-breadcrumb + .section-block .rezumat-block {
	padding-top: 0.4rem;
}

.page-carte .book-breadcrumb + .container.bn-carte-prices {
	padding-top: 0.35rem;
}

/* /topcarti/ hub + booklists: keep Bootstrap .container (align with card grid) */
.page-topcarti .book-breadcrumb > .container {
	margin-left: auto;
	margin-right: auto;
	text-align: left;
	box-sizing: border-box;
}

.page-carte .book-breadcrumb ol {
	font-size: 0.82rem;
	line-height: 1.4;
	color: #6d7585;
}

.page-carte .book-breadcrumb a {
	color: #BF5D54;
	text-decoration: none;
	font-weight: 600;
}

.page-carte .book-breadcrumb a:hover {
	color: #3E4A64;
	text-decoration: underline;
}

.page-carte .book-breadcrumb li[aria-current="page"] {
	color: #3E4A64;
	font-weight: 600;
}

/* Listing hubs: /carti/, /autori/, /edituri/, /topautori/, /topedituri/, /cauta/ */
.bn-carti-listing .book-breadcrumb,
.bn-topautori .book-breadcrumb,
.bn-topedituri .book-breadcrumb,
.bn-site-search .book-breadcrumb {
	padding: 0.55rem 0 0.35rem;
	margin: 0;
	background: transparent;
}

.bn-carti-listing .book-breadcrumb > .container,
.bn-topautori .book-breadcrumb > .container,
.bn-topedituri .book-breadcrumb > .container,
.bn-site-search .book-breadcrumb > .container {
	margin-left: auto;
	margin-right: auto;
	text-align: left;
	box-sizing: border-box;
}

.bn-carti-listing .book-breadcrumb ol,
.bn-topautori .book-breadcrumb ol,
.bn-topedituri .book-breadcrumb ol,
.bn-site-search .book-breadcrumb ol {
	font-size: 0.82rem;
	line-height: 1.4;
	color: #6d7585;
}

.bn-carti-listing .book-breadcrumb a,
.bn-topautori .book-breadcrumb a,
.bn-topedituri .book-breadcrumb a,
.bn-site-search .book-breadcrumb a {
	color: #BF5D54;
	text-decoration: none;
	font-weight: 600;
}

.bn-carti-listing .book-breadcrumb a:hover,
.bn-topautori .book-breadcrumb a:hover,
.bn-topedituri .book-breadcrumb a:hover,
.bn-site-search .book-breadcrumb a:hover {
	color: #3E4A64;
	text-decoration: underline;
}

.bn-carti-listing .book-breadcrumb li[aria-current="page"],
.bn-topautori .book-breadcrumb li[aria-current="page"],
.bn-topedituri .book-breadcrumb li[aria-current="page"],
.bn-site-search .book-breadcrumb li[aria-current="page"] {
	color: #3E4A64;
	font-weight: 600;
}
