/**
 * Facet archive styling.
 *
 * Deliberately light: the product grid itself is rendered through the theme's
 * own card template, so it inherits Rehub's styling. Only the facet chrome
 * (header, navigator, previews, related links) is styled here.
 */

.ylm-facet-archive {
	margin: 0 auto;
	max-width: 1200px;
	padding: 0 15px 40px;
}

/* Breadcrumb */
.ylm-facet-breadcrumb {
	font-size: 13px;
	margin: 16px 0;
	opacity: 0.8;
}

.ylm-facet-breadcrumb span[aria-hidden] {
	margin: 0 6px;
}

/* Header */
.ylm-facet-header {
	margin-bottom: 24px;
}

.ylm-facet-title {
	font-size: 30px;
	line-height: 1.2;
	margin: 0 0 10px;
}

.ylm-facet-intro {
	font-size: 15px;
	line-height: 1.6;
	margin: 0;
	max-width: 70ch;
	opacity: 0.9;
}

.ylm-facet-page-note {
	font-size: 13px;
	margin: 8px 0 0;
	opacity: 0.7;
}

/* Navigator */
.ylm-facet-nav {
	align-items: center;
	background: rgba( 0, 0, 0, 0.03 );
	border-radius: 6px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 24px;
	padding: 12px;
}

.ylm-facet-nav__label {
	font-size: 13px;
	font-weight: 600;
	margin: 0 6px 0 0;
	text-transform: uppercase;
}

.ylm-facet-nav select {
	max-width: 100%;
	min-width: 140px;
}

.ylm-facet-nav__go {
	cursor: pointer;
}

/* Preview player */
.ylm-facet-preview {
	align-items: center;
	display: flex;
	gap: 8px;
	margin: 8px 0;
}

.ylm-facet-preview__button {
	background: #111;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	flex: 0 0 auto;
	height: 30px;
	padding: 0;
	position: relative;
	width: 30px;
}

.ylm-facet-preview__icon {
	border-color: transparent transparent transparent #fff;
	border-style: solid;
	border-width: 6px 0 6px 10px;
	display: block;
	left: 52%;
	position: absolute;
	top: 50%;
	transform: translate( -50%, -50% );
}

.ylm-facet-preview.is-playing .ylm-facet-preview__icon {
	border-color: #fff;
	border-width: 0 3px;
	height: 12px;
	width: 10px;
}

.ylm-facet-preview.has-error .ylm-facet-preview__button {
	opacity: 0.4;
}

.ylm-facet-preview__bar {
	background: rgba( 0, 0, 0, 0.12 );
	border-radius: 2px;
	display: block;
	flex: 1 1 auto;
	height: 4px;
	overflow: hidden;
}

.ylm-facet-preview__fill {
	background: #111;
	display: block;
	height: 100%;
	transition: width 0.1s linear;
	width: 0;
}

/* Card extras */
.ylm-facet-card__meta {
	font-size: 12px;
	margin: 4px 0;
	opacity: 0.75;
}

.ylm-facet-card__preview-link {
	font-size: 12px;
}

/*
 * WooCommerce/Rehub product grids float their cards, so every block that follows
 * the loop has to clear them or it wraps up alongside the grid.
 */
.ylm-facet-clear {
	clear: both;
	display: block;
	height: 0;
	overflow: hidden;
}

/* Pagination */
.ylm-facet-pagination {
	clear: both;
	margin: 32px 0;
}

.ylm-facet-pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ylm-facet-pagination a,
.ylm-facet-pagination span {
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	border-radius: 4px;
	display: block;
	padding: 6px 12px;
	text-decoration: none;
}

.ylm-facet-pagination .current {
	background: #111;
	border-color: #111;
	color: #fff;
}

/* Related + hub directory */
.ylm-facet-related,
.ylm-facet-directory {
	border-top: 1px solid rgba( 0, 0, 0, 0.1 );
	clear: both;
	margin-top: 32px;
	padding-top: 20px;
}

/* On the hub the directory leads; it is the point of the page. */
.ylm-facet-directory--lead {
	border-bottom: 1px solid rgba( 0, 0, 0, 0.1 );
	border-top: 0;
	margin-top: 0;
	padding-bottom: 24px;
}

.ylm-facet-related h2,
.ylm-facet-directory h2 {
	font-size: 18px;
	margin: 0 0 12px;
}

.ylm-facet-related ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ylm-facet-related li {
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	border-radius: 20px;
	padding: 6px 14px;
}

.ylm-facet-related__count {
	font-size: 12px;
	margin-left: 6px;
	opacity: 0.6;
}

.ylm-facet-directory {
	display: grid;
	gap: 24px;
	grid-template-columns: repeat( auto-fit, minmax( 220px, 1fr ) );
}

.ylm-facet-directory ul {
	columns: 2;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ylm-facet-recent-heading {
	clear: both;
	font-size: 18px;
	margin: 28px 0 12px;
}

.ylm-facet-directory li {
	margin-bottom: 4px;
}

.ylm-facet-empty {
	margin: 32px 0;
	opacity: 0.8;
}

@media ( max-width: 600px ) {
	.ylm-facet-title {
		font-size: 24px;
	}

	.ylm-facet-nav select {
		flex: 1 1 100%;
	}
}
