/**
 * GF Videohaku - filter bar, chips, status and pagination.
 *
 * The cards and the player modal are deliberately not styled here: the
 * results wrapper carries the video slider block's class, so those styles
 * come from custom-video-slider-block and stay defined in one place.
 */

.gf-video-filter {
	--gf-vf-radius: 10px;
	--gf-vf-panel-bg: rgba(255, 255, 255, 0.04);
	/*
	 * Tag appearance, matching .category-tag in custom-video-slider-block so
	 * the filter uses the same element as the rest of the site rather than a
	 * second variant of it.
	 */
	--gf-vf-tag-bg: rgba(255, 255, 255, 0.1);
	--gf-vf-tag-bg-hover: rgba(255, 255, 255, 0.15);
	--gf-vf-tag-border: rgba(255, 255, 255, 0.25);
	--gf-vf-tag-border-hover: rgba(255, 255, 255, 0.35);
	--gf-vf-control-bg: rgba(255, 255, 255, 0.1);
	--gf-vf-control-border: rgba(255, 255, 255, 0.25);
	--gf-vf-border: rgba(255, 255, 255, 0.25);
	--gf-vf-surface: rgba(255, 255, 255, 0.1);
	--gf-vf-text: rgba(255, 255, 255, 0.9);
	--gf-vf-muted: rgba(255, 255, 255, 0.7);
	--gf-vf-accent: #b8860b;

	color: var(--gf-vf-text);

	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	width: 100%;
}

/* ---------------------------------------------------------------- Form */

.gf-video-filter__form {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.gf-video-filter__heading {
	margin: 0;
	font-size: clamp(1.25rem, 2vw, 1.6rem);
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
}

/* The controls sit in one tinted panel, the way the reference layout does. */
.gf-video-filter__panel {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	padding: 1.5rem;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: var(--gf-vf-panel-bg);
	color: var(--gf-vf-text);
}

.gf-video-filter__search {
	position: relative;
	display: flex;
	align-items: center;
	max-width: 32rem;
	width: 100%;
}

.gf-video-filter__search-icon {
	position: absolute;
	left: 0.85rem;
	opacity: 0.6;
	pointer-events: none;
}

.gf-video-filter__search input[type="search"] {
	width: 100%;
	padding: 0.7rem 1rem 0.7rem 2.75rem;
	border: 1px solid var(--gf-vf-control-border);
	border-radius: var(--gf-vf-radius);
	background: var(--gf-vf-control-bg);
	color: var(--gf-vf-text);
	font-size: 1rem;
	line-height: 1.4;
}

.gf-video-filter__search input[type="search"]::placeholder {
	color: var(--gf-vf-muted);
}

.gf-video-filter__search input[type="search"]:focus-visible,
.gf-video-filter__field select:focus-visible,
.gf-video-filter__pill input:focus-visible + span {
	outline: 2px solid var(--gf-vf-accent);
	outline-offset: 2px;
}

.gf-video-filter__selects {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

.gf-video-filter__field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	min-width: 14rem;
	flex: 1 1 14rem;
	max-width: 22rem;
}

.gf-video-filter__field label {
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
}

.gf-video-filter__field select {
	width: 100%;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--gf-vf-control-border);
	border-radius: var(--gf-vf-radius);
	background: var(--gf-vf-control-bg);
	color: var(--gf-vf-text);
	font-size: 0.95rem;
}

.gf-video-filter__field select option {
	/* Native menus do not inherit the page's dark palette reliably. */
	color: #131415;
	background: #fff;
}

/* --------------------------------------------------------------- Pills */

.gf-video-filter__pills {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
}

.gf-video-filter__pills-label {
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.3;
	min-width: 7.5rem;
	color: #fff;
}

.gf-video-filter__pills-group {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.gf-video-filter__pill {
	display: inline-flex;
	align-items: center;
	padding: 0.5rem 0.8rem;
	border: 1px solid var(--gf-vf-tag-border);
	border-radius: var(--gf-vf-radius);
	background: var(--gf-vf-tag-bg);
	color: var(--gf-vf-text);
	font-size: 0.85rem;
	font-weight: 500;
	line-height: 1.3;
	cursor: pointer;
	transition: all 0.2s ease;
}

.gf-video-filter__pill:hover {
	background: var(--gf-vf-tag-bg-hover);
	border-color: var(--gf-vf-tag-border-hover);
	transform: translateY(-1px);
}

.gf-video-filter__pill input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.gf-video-filter__pill.is-active {
	background: var(--gf-vf-accent);
	border-color: var(--gf-vf-accent);
	color: #fff;
	font-weight: 600;
}

/* --------------------------------------------------------------- Chips */

.gf-video-filter__chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.gf-video-filter__chips-label {
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: var(--gf-vf-muted);
}

.gf-video-filter__chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 0.8rem;
	border-radius: var(--gf-vf-radius);
	border: 1px solid var(--gf-vf-accent);
	background: rgba(184, 134, 11, 0.18);
	color: var(--gf-vf-text);
	font-size: 0.85rem;
	font-weight: 500;
	line-height: 1.3;
	text-decoration: none;
	transition: all 0.2s ease;
}

.gf-video-filter__chip:hover,
.gf-video-filter__chip:focus-visible {
	background: var(--gf-vf-accent);
	color: #fff;
	transform: translateY(-1px);
}

.gf-video-filter__chip-x {
	font-size: 1.1em;
	line-height: 1;
}

.gf-video-filter__clear {
	font-size: 0.85rem;
	text-decoration: underline;
	color: var(--gf-vf-muted);
}

.gf-video-filter__clear:hover {
	color: #fff;
}

/* -------------------------------------------------------------- Status */

.gf-video-filter__status {
	margin: 0;
	font-size: 0.9rem;
	color: var(--gf-vf-muted);
}

/* ------------------------------------------------------------- Results */

/*
 * auto-fit collapses empty tracks, so a single result stretched across the
 * whole row as one oversized 16:9 image. auto-fill keeps the tracks, so one
 * result stays the size of a card in a full grid. The selector deliberately
 * matches the slider stylesheet's specificity, which would otherwise win.
 */
.gf-video-filter .gf-video-filter__results.is-grid .video-grid-container.responsive-grid {
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media (max-width: 1200px) {
	.gf-video-filter .gf-video-filter__results.is-grid .video-grid-container.responsive-grid {
		grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	}
}

@media (max-width: 900px) {
	.gf-video-filter .gf-video-filter__results.is-grid .video-grid-container.responsive-grid {
		grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	}
}

@media (max-width: 600px) {
	.gf-video-filter .gf-video-filter__results.is-grid .video-grid-container.responsive-grid {
		grid-template-columns: 1fr;
	}
}

/*
 * The results wrapper borrows the slider block's class so the cards inherit
 * its card styles. It must not inherit that block's layout box, though - the
 * width/padding combination overflows narrow viewports.
 */
.gf-video-filter .gf-video-filter__results {
	max-width: none;
	width: 100%;
	margin-left: 0;
	margin-right: 0;
	padding-left: 0;
	padding-right: 0;
}

.gf-video-filter.is-loading .gf-video-filter__results {
	opacity: 0.5;
	transition: opacity 0.15s ease;
}

.gf-video-filter__empty {
	padding: 3rem 1rem;
	text-align: center;
	color: var(--gf-vf-muted);
}

.gf-video-filter__empty p {
	margin: 0 0 1rem;
}

/* ---------------------------------------------------------- Pagination */

.gf-video-filter__pagination {
	display: flex;
	justify-content: center;
}

.gf-video-filter__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.8rem;
	margin: 0 0.15rem;
	border: 1px solid var(--gf-vf-tag-border);
	border-radius: var(--gf-vf-radius);
	background: var(--gf-vf-tag-bg);
	text-decoration: none;
	color: var(--gf-vf-text);
	font-size: 0.9rem;
	font-weight: 500;
	transition: all 0.2s ease;
}

.gf-video-filter__pagination a.page-numbers:hover {
	background: var(--gf-vf-tag-bg-hover);
	border-color: var(--gf-vf-tag-border-hover);
	transform: translateY(-1px);
}

.gf-video-filter__pagination .page-numbers.current {
	background: var(--gf-vf-accent);
	border-color: var(--gf-vf-accent);
	color: #fff;
	font-weight: 600;
}

.gf-video-filter__pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
}

/* ---------------------------------------------------------------- Misc */

/* With JS the filters apply as you go, so the manual submit is redundant. */
.gf-video-filter--js .gf-video-filter__submit {
	display: none;
}

.gf-video-filter__submit {
	align-self: flex-start;
	padding: 0.6rem 1.4rem;
	border: 1px solid var(--gf-vf-accent);
	border-radius: var(--gf-vf-radius);
	background: var(--gf-vf-accent);
	color: #fff;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
}

body.gf-video-filter-modal-open {
	overflow: hidden;
}

/*
 * The filter sits in a full-bleed dark section; carrying it to the page
 * background stops the theme's main/footer gap showing as a white sliver.
 */
body.gf-video-filter-page {
	background-color: #000;
}

@media (max-width: 782px) {
	.gf-video-filter__pills-label {
		min-width: 100%;
	}

	.gf-video-filter__field {
		max-width: none;
	}
}

/* -------------------------------------------------------------- Editor */

.gf-video-filter-editor__summary {
	margin: 0;
	font-size: 0.9rem;
	opacity: 0.8;
}
