/* The library pages (/videos: webcasts.tpl, /research: rlist.tpl): a sidebar of views next to search,
   filters and the card grid. Shared, so the two libraries look and behave the same; what only one of
   them has stays in its own template. */
/* ---- layout: sidebar + main column; the grid has 3 cards per row next to the open sidebar
   and 4 next to the collapsed rail, fewer when the main column itself is narrow ---- */
.rl-layout {
	display: flex;
	align-items: flex-start;
	gap: 36px;
	padding: 0 0 24px;   /* the page wrapper (mega_page.tpl) already has the 40px on top */
	--rl-border: #e5e5ea;
}
.dark .rl-layout { --rl-border: rgba(255,255,255,0.15); }
/* the white reaches up to the header: from 1280px it covers the page wrapper's pt-10 too */
@media (min-width: 1280px) { .rl-page { margin-top: -40px; padding-top: 40px; } }
.rl-main { flex: 1 1 auto; min-width: 0; container-type: inline-size; }
.rl-side {
	flex: 0 0 280px;
	width: 280px;
	/* not sticky: body has overflow-x:hidden (mega_page.tpl) next to html's, which makes body the
	   scroll container - body never scrolls, so a sticky sidebar never stuck and its "top" only
	   pushed it below the search box (measured from inside body's header padding) */
	overflow-x: hidden;
	transition: flex-basis 0.2s, width 0.2s;
}
.rl-side-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 8px;
	background: transparent;
	color: inherit;
	cursor: pointer;
}
/* the burger and the library's name; the name lines up with the item labels (8 + 24 + 16 = 40 + 8) */
.rl-side-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rl-side-title { font-size: 20px; font-weight: 600; white-space: nowrap; }
.rl-collapsed .rl-side-title { display: none; }
.rl-side-toggle:hover { background: rgba(128,128,128,0.1); }
.rl-side-nav { display: flex; flex-direction: column; }
.rl-side-item {
	display: flex;
	align-items: center;
	gap: 16px;
	height: 40px;
	padding: 0 8px;
	border-radius: 8px;
	color: inherit;
	font-size: 16px;
	text-decoration: none;
	white-space: nowrap;
}
.rl-side-item:hover { background: rgba(128,128,128,0.08); }
.rl-side-item.rl-side-active { background: rgba(128,128,128,0.14); font-weight: 600; }
.rl-side-item svg, .rl-side-icon { flex: 0 0 24px; width: 24px; height: 24px; }
.rl-side-icon { border-radius: 50%; object-fit: cover; }
/* a sidebar link that leaves the library (webinar recordings): a small arrow after the label */
.rl-side-item .rl-side-out { flex: 0 0 14px; width: 14px; height: 14px; margin-left: -8px; opacity: 0.6; }
.rl-collapsed .rl-side-out { display: none; }
.rl-side-initial {
	display: flex;
	align-items: center;
	justify-content: center;
	background: hsl(var(--rl-hue, 0), 60%, 45%);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
}
.rl-side-label { overflow: hidden; text-overflow: ellipsis; }
.rl-side-divider { height: 1px; margin: 16px 8px; background: var(--rl-border); }
.rl-side-heading { padding: 0 8px 8px; font-size: 15px; opacity: 0.6; white-space: nowrap; }

/* "Events & Webinars": the next conference and webinar at the end of the sidebar - only in the open sidebar, on large screens */
.rl-side-event {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0 0 12px;
	padding: 16px;
	border: 1px solid var(--rl-border);
	border-radius: 4px;
	color: inherit;
	text-decoration: none;
	white-space: normal;
}
.rl-side-event:hover { background: rgba(128,128,128,0.06); }
.rl-side-event-title { font-size: 17px; line-height: 1.35; }
.rl-side-event-date { font-size: 13px; opacity: 0.7; }
.rl-side-event-text { font-size: 14px; line-height: 1.5; opacity: 0.8; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.rl-side-event-cta { font-size: 13px; font-weight: 600; }
.rl-collapsed .rl-side-event, .rl-collapsed .rl-side-events-only, .rl-collapsed .rl-side-events-heading { display: none; }
/* large screens only: below 1280px the sidebar is collapsed by default anyway, and opened there
   it is better kept short (the heading is hidden with the box, see .rl-side-events-heading) */
@media (max-width: 1279px) {
	.rl-side-event, .rl-side-events-only, .rl-side-events-heading { display: none; }
}

/* collapsed: an icon rail */
.rl-collapsed .rl-side { flex-basis: 40px; width: 40px; }
.rl-collapsed .rl-side-item { justify-content: center; padding: 0; }
.rl-collapsed .rl-side-label, .rl-collapsed .rl-side-heading { display: none; }
.rl-collapsed .rl-side-divider { margin: 16px 4px; }

.rl-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rl-collapsed .rl-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@container (max-width: 820px) { .rl-cards, .rl-collapsed .rl-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 520px) { .rl-cards, .rl-collapsed .rl-cards { grid-template-columns: minmax(0, 1fr); } }
/* up to 1023px the cards lose their side padding (lg:px-0 in _webcasts_grid.tpl), so the columns need a gap of their own */
@media (max-width: 1023px) { .rl-cards { column-gap: 32px; } }
/* up to 1279px the page wrapper drops its top padding (header-footer-xl:pt-0 in mega_page.tpl) */
@media (max-width: 1279px) { .rl-layout { padding-top: 24px; } }

.rl-title { font-size: 36px; line-height: 1.25; margin: 28px 0 8px; }
.rl-filter-bar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	padding: 12px 0 8px;
}
.rl-search-wrap {
	display: flex;
	align-items: center;
	width: 100%;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--rl-border, #e5e5ea);
	border-radius: 8px;
	background: transparent;
}
.dark .rl-search-wrap { --rl-border: rgba(255,255,255,0.15); }
.rl-search-icon { flex-shrink: 0; margin-right: 8px; opacity: 0.6; }
.rl-search-input {
	flex: 1;
	border: none;
	background: transparent;
	outline: none;
	font-size: 14px;
	min-width: 0;
	color: inherit;
}
.rl-search-clear {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	margin-left: 6px;
	border: none;
	border-radius: 50%;
	background: rgba(128,128,128,0.15);
	color: inherit;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}
.rl-search-clear:hover { background: rgba(128,128,128,0.3); }
.rl-toggle-btn {
	display: none;
	align-items: center;
	gap: 6px;
	height: 38px;
	padding: 0 14px;
	border: 1px solid var(--rl-border, #e5e5ea);
	border-radius: 8px;
	background: transparent;
	color: inherit;
	font-size: 13px;
	cursor: pointer;
}
.dark .rl-toggle-btn { --rl-border: rgba(255,255,255,0.15); }
.rl-dropdowns {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	flex: 1 1 auto;
}
.rl-dd-group { padding: 6px 14px 2px; font-size: 12px; opacity: 0.6; }
.rl-filter-wrap { position: relative; flex-shrink: 0; }
.rl-filter-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	height: 38px;
	padding: 0 14px;
	border: 1px solid var(--rl-border, #e5e5ea);
	border-radius: 8px;
	background: transparent;
	color: inherit;
	font-size: 13px;
	cursor: pointer;
	white-space: nowrap;
	max-width: 220px;
	overflow: hidden;
	text-overflow: ellipsis;
}
.dark .rl-filter-btn { --rl-border: rgba(255,255,255,0.15); }
.rl-filter-active { border-color: #e4003a; color: #e4003a; }
.rl-chevron { flex-shrink: 0; opacity: 0.6; transition: transform 0.2s; }
.rl-filter-wrap.open .rl-chevron { transform: rotate(180deg); }
.rl-filter-dropdown {
	display: none;
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	min-width: 200px;
	background: var(--rl-dd-bg, #fff);
	border: 1px solid var(--rl-border, #e5e5ea);
	border-radius: 8px;
	padding: 6px 0;
	z-index: 200;
	box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.dark .rl-filter-dropdown { --rl-dd-bg: #2a3237; --rl-border: rgba(255,255,255,0.15); }
.rl-filter-dropdown.open { display: block; }
.rl-filter-dropdown-scroll { max-height: 260px; overflow-y: auto; }
.rl-dd-search {
	display: block;
	width: calc(100% - 20px);
	margin: 2px 10px 6px;
	padding: 5px 8px;
	font-size: 13px;
	border: 1px solid var(--rl-border, #e5e5ea);
	border-radius: 6px;
	background: transparent;
	color: inherit;
	outline: none;
}
.rl-dd-opt.rl-dd-hidden { display: none; }
.rl-dd-empty {
	padding: 7px 14px;
	font-size: 13px;
	opacity: 0.6;
}
.rl-reset-btn {
	height: 38px;
	padding: 0 10px;
	border: none;
	background: transparent;
	color: inherit;
	opacity: 0.7;
	font-size: 13px;
	text-decoration: underline;
	cursor: pointer;
}
.rl-reset-btn:hover { opacity: 1; }
.rl-sort-toggle[hidden] { display: none; }
.rl-signin { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 80px 0; text-align: center; }
.rl-sort-toggle {
	display: flex;
	margin-left: auto;
	height: 38px;
	border: 1px solid var(--rl-border, #e5e5ea);
	border-radius: 8px;
	overflow: hidden;
	flex-shrink: 0;
}
.dark .rl-sort-toggle { --rl-border: rgba(255,255,255,0.15); }
.rl-sort-opt {
	border: none;
	background: transparent;
	color: inherit;
	opacity: 0.7;
	font-size: 13px;
	padding: 0 14px;
	cursor: pointer;
}
.rl-sort-opt + .rl-sort-opt { border-left: 1px solid var(--rl-border, #e5e5ea); }
.rl-sort-opt:hover { opacity: 1; }
.rl-sort-opt.rl-sort-sel { opacity: 1; font-weight: 600; background: rgba(128,128,128,0.12); }
.rl-dd-opt {
	padding: 7px 14px;
	font-size: 13px;
	cursor: pointer;
	white-space: nowrap;
}
.rl-dd-opt:hover { background: rgba(128,128,128,0.1); }
.rl-dd-sel { font-weight: 600; }
.rl-grid-container { position: relative; transition: opacity 0.15s; }
.rl-grid-container.rl-loading { opacity: 0.5; pointer-events: none; }
.rl-skel-img {
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 4px;
	background: rgba(128,128,128,0.15);
}
.rl-skel-line {
	height: 14px;
	margin-top: 12px;
	border-radius: 4px;
	background: rgba(128,128,128,0.15);
}
.rl-skel-line-title { width: 90%; margin-top: 16px; }
.rl-skel-line-title2 { width: 60%; margin-top: 8px; }
.rl-skel-line-meta { width: 40%; margin-top: 16px; height: 12px; }
.rl-skel-img, .rl-skel-line { animation: rl-skel-pulse 1.4s ease-in-out infinite; }
.dark .rl-skel-img, .dark .rl-skel-line { background: rgba(255,255,255,0.08); }
@keyframes rl-skel-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.4; }
}

/* phones: the sidebar becomes a row of icons above the search */
@media (max-width: 767px) {
	/* stretch, not flex-start: the main column is a size container (for the card columns), so
	   left to its content's width it would shrink to nothing */
	.rl-layout { flex-direction: column; align-items: stretch; gap: 16px; }
	.rl-main { width: 100%; }
	/* phones: one row of icons only (names in the tooltips), spread across the width; a row too
	   long for the screen (the research formats) scrolls sideways with a finger, without a scrollbar */
	.rl-side, .rl-collapsed .rl-side { position: static; width: 100%; flex: none; max-height: none; overflow: visible; }
	.rl-side-toggle, .rl-side-head { display: none; }
	.rl-side-nav {
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		gap: 4px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}
	.rl-side-nav::-webkit-scrollbar { display: none; }
	/* more icons off to the right or left: the row fades out at that edge (set by research-library.js) */
	.rl-side-nav.rl-side-more-right { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
	.rl-side-nav.rl-side-more-left { -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px); mask-image: linear-gradient(90deg, transparent, #000 40px); }
	.rl-side-nav.rl-side-more-left.rl-side-more-right { -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
	.rl-side-item, .rl-collapsed .rl-side-item { flex: 0 0 40px; width: 40px; padding: 0; justify-content: center; }
	.rl-side-label, .rl-collapsed .rl-side-label { display: none; }
	.rl-side-out { display: none; }
	.rl-side-divider, .rl-collapsed .rl-side-divider { width: 1px; height: 24px; margin: 0; flex: none; }
	.rl-side-heading, .rl-collapsed .rl-side-heading { display: none; }
	.rl-title { font-size: 28px; margin-top: 20px; }
	.rl-sort-toggle { margin-left: 0; }
	.rl-toggle-btn { display: flex; }
	.rl-dropdowns {
		display: none;
		width: 100%;
		flex-direction: column;
	}
	.rl-dropdowns.open { display: flex; }
	.rl-filter-wrap { width: 100%; }
	.rl-filter-btn { width: 100%; max-width: none; }
	.rl-filter-dropdown { position: static; width: 100%; box-shadow: none; margin-top: 4px; }
}

/* under video search results: webinar recordings are searched on /webinars (see _webcasts_grid.tpl) */
.rl-webinar-hint { text-align: center; padding: 0 0 40px; font-size: 15px; opacity: 0.8; }
.rl-webinar-hint a { font-weight: 600; color: inherit; }
