/* ============================================================================
 * Unified Resource Library card — used site-wide by rl_render_card().
 * Scoped under .rl-uni-card so the styles don't leak to unrelated markup
 * that reuses the same generic classes (.author-info, .post-images, etc.).
 * ============================================================================ */

.rl-uni-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	height: 100%;
	background: transparent;
}

/* Thumbnail */
.rl-uni-thumb-link {
	display: block;
	position: relative;
	overflow: hidden;
	border-radius: 12px;
	background: #ece5db;
}
.rl-uni-thumb {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
	object-fit: cover;
	margin: 0;
	border-radius: 12px;
}
.rl-uni-play-badge {
	position: absolute;
	left: 50%; top: 50%;
	transform: translate(-50%, -50%);
	width: 60px; height: 60px;
	border-radius: 50%;
	background: rgba(224, 99, 78, 0.94);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
	display: flex; align-items: center; justify-content: center;
	transition: transform .15s ease;
	pointer-events: none;
}
.rl-uni-play-badge::before {
	content: "";
	border-style: solid;
	border-width: 11px 0 11px 17px;
	border-color: transparent transparent transparent #fff;
	margin-left: 5px;
}
.rl-uni-thumb-link:hover .rl-uni-play-badge {
	transform: translate(-50%, -50%) scale(1.07);
}

/* Topic chips row — horizontally scrollable with fade + chevron affordance */
.rl-uni-topics-wrap {
	position: relative;
	margin: 10px 0 4px;
}
.rl-uni-topics-wrap::after {
	content: "";
	position: absolute;
	right: 0; top: 0; bottom: 0;
	width: 40px;
	pointer-events: none;
	background: linear-gradient(to right, rgba(247, 240, 232, 0) 0%, #f7f0e8 80%);
	opacity: 0;
	transition: opacity .15s ease;
	z-index: 1;
}
.rl-uni-topics-wrap.rl-has-overflow::after { opacity: 1; }
.rl-uni-topics-wrap.rl-has-overflow.rl-scrolled-end::after { opacity: 0; }

/* Left-fade + prev-button visible only after user has scrolled */
.rl-uni-topics-wrap::before {
	content: "";
	position: absolute;
	left: 0; top: 0; bottom: 0;
	width: 32px;
	pointer-events: none;
	background: linear-gradient(to left, rgba(247, 240, 232, 0) 0%, #f7f0e8 80%);
	opacity: 0;
	transition: opacity .15s ease;
	z-index: 1;
}
.rl-uni-topics-wrap.rl-scrolled-start::before { opacity: 1; }

/* Clickable prev/next buttons — overlay the fade zone. Real buttons so
   keyboard + screen readers get proper affordance; z-index puts them above
   the ::before/::after fade masks. */
.rl-uni-topics-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 26px; height: 26px;
	border: none;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
	color: #422f31;
	font: 700 18px/1 'Heebo', sans-serif;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	opacity: 0;
	transition: opacity .15s ease, transform .1s ease, background .15s ease;
	z-index: 3;
}
.rl-uni-topics-nav:hover { background: #f7f0e8; transform: translateY(-50%) scale(1.05); }
.rl-uni-topics-nav:active { transform: translateY(-50%) scale(0.95); }
.rl-uni-topics-prev { left: 2px; }
.rl-uni-topics-next { right: 2px; }
.rl-uni-topics-wrap.rl-has-overflow .rl-uni-topics-next { opacity: 1; }
.rl-uni-topics-wrap.rl-has-overflow.rl-scrolled-end .rl-uni-topics-next { opacity: 0; pointer-events: none; }
.rl-uni-topics-wrap.rl-scrolled-start .rl-uni-topics-prev { opacity: 1; }
.rl-uni-topics-wrap:not(.rl-scrolled-start) .rl-uni-topics-prev { opacity: 0; pointer-events: none; }

.rl-uni-topics {
	display: flex;
	gap: 10px;
	white-space: nowrap;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: none;
}
.rl-uni-topics::-webkit-scrollbar { display: none; height: 0; }
.rl-uni-topics a {
	flex: 0 0 auto;
	font: 700 12.5px/1.2 'Heebo', sans-serif;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #158ca5;
	text-decoration: none;
}
.rl-uni-topics a:hover { text-decoration: underline; }

/* Podcast eyebrow (Season · Episode · Duration) */
.rl-uni-eyebrow {
	font: 700 13px/1.2 'Heebo', sans-serif;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #7e7472;
	margin: 12px 0 -2px;
}

/* Title */
.rl-uni-title {
	font-family: 'Heebo', sans-serif;
	font-size: 21px;
	line-height: 26px;
	font-weight: 500;
	color: #212529;
	margin: 12px 0 8px;
	overflow: hidden;
	text-overflow: ellipsis;
}
.rl-uni-title a {
	color: inherit;
	text-decoration: none;
	font-family: 'Heebo', sans-serif;
	font-size: 21px;
	line-height: 26px;
	font-weight: 500;
}
.rl-uni-title a:hover { color: #e0634e; }

/* Byline — avatar + optional prefix + name(s) */
.rl-uni-byline {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 8px;
}
.rl-uni-byline-avatar {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	object-fit: cover;
	background: #f3f1ec;
	flex: 0 0 auto;
}
.rl-uni-byline-text {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
	min-width: 0;
}
.rl-uni-byline-prefix {
	font: 400 12px/1.2 'Heebo', sans-serif;
	color: #9a8f8d;
	text-transform: lowercase;
	letter-spacing: 0;
	margin-bottom: 2px;
}
.rl-uni-byline-names {
	position: relative;
	font: 600 16px/1.25 'Heebo', sans-serif;
	color: #422f31;
	max-width: fit-content;
	padding-bottom: 4px;
}
.rl-uni-byline-names::after {
	display: block;
	content: '';
	width: 100%;
	height: 3px;
	background: #f05d48;
	margin-top: 2px;
}
.rl-uni-byline-names a { color: inherit; text-decoration: none; }
.rl-uni-byline-names a:hover { color: #e0634e; }

/* Excerpt + CTA */
.rl-uni-excerpt {
	overflow: hidden;
	text-overflow: ellipsis;
	padding-top: 4px;
}
.rl-uni-excerpt a { color: #000; text-decoration: none; }
.rl-uni-excerpt p {
	margin: 0;
	padding: 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 15.5px;
	line-height: 1.55;
	color: #4a3d3f;
}
.rl-uni-excerpt p.rl-uni-cta {
	display: block;
	margin-top: 12px !important;
	color: #e0634e;
	font-weight: 700;
	font-size: 14.5px;
	-webkit-line-clamp: initial;
	overflow: visible;
}

/* ============================================================================
 * Bootstrap independence.
 *
 * rl_render_card() emits Bootstrap utility classes (rounded, d-flex,
 * rounded-circle, ms-2, mt-3 …) inherited from the original category-page
 * markup. Bootstrap is NOT enqueued site-wide — measured 2026-08-24 it loads on
 * /category/ and /podcast-library/ but not on /audiences/, /webinars/,
 * /videos/ or /resources/<person>/. The same card therefore rendered
 * differently depending on the page it appeared on.
 *
 * Worst case was the thumbnail. Card markup carried BOTH `rl-uni-thumb` (12px,
 * defined above) and Bootstrap's `.rounded` (6px), so the corner radius was
 * decided by whichever stylesheet loaded last — 6px on /category/ and
 * /podcast-library/, 12px everywhere else.
 *
 * Specificity cannot settle this: Bootstrap 5 generates its utilities with
 * `!important`, so `.rounded` beats any selector that is not itself
 * `!important`. Rather than start an `!important` war, rl_render_card() no
 * longer emits `rounded` on card thumbnails at all — one class owns the
 * radius. Book thumbs use `.rl-book-thumb` for the same reason.
 * ========================================================================= */

/* Book-card equivalents of the Bootstrap utilities its markup assumes, so the
   card is identical with or without Bootstrap present. Scoped to
   .rl-book-card — these must never leak to real Bootstrap layouts. */
.rl-book-card img.img-fluid {
	max-width: 100%;
}
.rl-book-card img.rl-book-thumb {
	border-radius: 12px;
}
.rl-book-card .d-flex {
	display: flex;
}
.rl-book-card .align-items-center {
	align-items: center;
}
.rl-book-card .flex-wrap {
	flex-wrap: wrap;
}
.rl-book-card img.rounded-circle {
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 auto;
}
.rl-book-card .ms-2 {
	margin-left: 0.5rem;
}
.rl-book-card .mt-3 {
	margin-top: 1rem;
}
.rl-book-card .mb-2 {
	margin-bottom: 0.5rem;
}
.rl-book-card .fw-bold {
	font-weight: 700;
}
.rl-book-card .text-decoration-none {
	text-decoration: none;
}

/* ============================================================================
 * Book card — rl_render_card() keeps the original WooCommerce-style render for
 * post_type=product ("books can stay as they are"), emitting
 * .resource-item.rl-book-card.
 *
 * Those styles previously lived ONLY in category.php's inline <style>, scoped
 * with body.category. Every other page that renders a book through the shared
 * partial — /resources/<person>/ and /audiences/<slug>/ — therefore got the
 * markup with none of the typography. Verified 2026-08-24: no enqueued
 * stylesheet in the theme defined .resource-item at all.
 *
 * Scoped to .rl-book-card, so this only touches cards the partial produced.
 * category.php's body.category rules are more specific and still win there,
 * which keeps that page pixel-identical.
 * ========================================================================= */

.rl-book-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	height: 100%;
}
.rl-book-card > a:first-child {
	display: block;
	border-radius: 12px;
	overflow: hidden;
	background: #ece5db;
}
.rl-book-card img.img-fluid {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
}
.rl-book-card h4 {
	font-family: 'Heebo', sans-serif;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 400;
	margin: 12px 0 6px;
}
.rl-book-card h4 a,
.rl-book-card a.text-dark {
	color: #212529;
	text-decoration: none;
}
.rl-book-card .resource-author {
	font-weight: 600;
	position: relative;
	color: #4a3d3f;
}
/* Coral underline on the author name — mirrors the unified card's byline. */
.rl-book-card .resource-author::after {
	content: '';
	display: block;
	height: 2px;
	background: #f05d48;
	position: absolute;
	bottom: -2px;
	left: 0;
	width: 100%;
}
.rl-book-card .resource-excerpt {
	font-size: 15.5px;
	line-height: 1.55;
	color: #4a3d3f;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.rl-book-card .read-more {
	margin-top: auto;
	padding-top: 12px;
	color: #e0634e;
	font-weight: 700;
	font-size: 14.5px;
	text-decoration: none;
}
