/**
 * ForeBranch sources browse polish
 * Depends on list-chrome.css (hub tokens under .lp-shell).
 */

/* --------------------------------------------------------------------------
	Toolbar (search / per-page) — shared pattern with families
	-------------------------------------------------------------------------- */
.lp-toolbar {
	margin-bottom: var(--lp-space-6);
}

.lp-toolbar__body {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: var(--lp-space-4);
}

.lp-toolbar__meta {
	font-size: var(--lp-text-sm);
	color: var(--lp-color-text-secondary);
}

.lp-toolbar__form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--lp-space-2);
}

.lp-input,
.lp-select {
	min-height: 2.25rem;
	padding: var(--lp-space-2) var(--lp-space-3);
	font-family: inherit;
	font-size: var(--lp-text-sm);
	color: var(--lp-color-text);
	background: var(--lp-color-surface);
	border: 1px solid var(--lp-color-border);
	border-radius: var(--lp-radius-sm);
	line-height: 1.2;
}

.lp-input {
	min-width: 14rem;
}

.lp-input:focus,
.lp-select:focus {
	outline: none;
	box-shadow: var(--lp-focus-ring);
	border-color: var(--lp-color-accent-muted);
}

.lp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.25rem;
	padding: var(--lp-space-2) var(--lp-space-4);
	font-family: inherit;
	font-size: var(--lp-text-sm);
	font-weight: var(--lp-weight-medium);
	line-height: 1.2;
	color: #fff;
	background: var(--lp-color-accent);
	border: 1px solid var(--lp-color-accent);
	border-radius: var(--lp-radius-sm);
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.lp-btn:hover {
	background: var(--lp-color-accent-hover);
	border-color: var(--lp-color-accent-hover);
	color: #fff;
	text-decoration: none;
}

.lp-btn:focus-visible {
	outline: none;
	box-shadow: var(--lp-focus-ring);
}

.lp-shell a.lp-btn--ghost,
.lp-btn--ghost {
	color: var(--lp-color-accent);
	background: var(--lp-color-surface);
	border-color: var(--lp-color-border);
}

.lp-shell a.lp-btn--ghost:hover,
.lp-btn--ghost:hover {
	background: var(--lp-color-accent-soft);
	border-color: var(--lp-color-accent-muted);
	color: var(--lp-color-accent);
	text-decoration: none;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* --------------------------------------------------------------------------
	Sources list
	-------------------------------------------------------------------------- */
.hp-sources-list {
	overflow: hidden;
}

.hp-sources-list .source-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--lp-space-4);
	padding: var(--lp-space-4) var(--lp-space-5);
	border-bottom: 1px solid var(--lp-color-border);
	transition: background 0.12s ease;
}

.hp-sources-list .source-item:last-child {
	border-bottom: none;
}

.hp-sources-list .source-item:hover {
	background: var(--lp-color-surface-alt);
}

.hp-sources-list .source-item a {
	color: var(--lp-link-color, var(--lp-color-accent));
	text-decoration: none;
	font-weight: var(--lp-weight-medium);
	font-size: var(--lp-text-base);
	flex: 1 1 auto;
	min-width: 0;
}

.hp-sources-list .source-item a:hover {
	text-decoration: underline;
	color: var(--lp-link-color, var(--lp-color-accent));
	background: transparent;
	padding: 0;
}

.hp-sources-list .individual-count {
	color: var(--lp-color-text-secondary);
	font-size: var(--lp-text-sm);
	white-space: nowrap;
	flex: 0 0 auto;
}

.hp-sources-list .empty-state {
	padding: var(--lp-space-10) var(--lp-space-5);
	text-align: center;
	color: var(--lp-color-text-secondary);
}

.hp-sources .lp-pager {
	margin-top: var(--lp-space-6);
}

/* Back to top (FSE) */
.hp-back-to-top {
	position: fixed;
	bottom: 1.25rem;
	right: 1.25rem;
	width: 2.75rem;
	height: 2.75rem;
	border: none;
	border-radius: 50%;
	background: var(--lp-color-accent, #004466);
	color: #fff;
	font-size: 1.125rem;
	font-weight: 700;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease, background 0.15s ease;
	z-index: 9999;
	box-shadow: var(--lp-shadow-hover, 0 4px 12px rgba(26, 31, 36, 0.12));
}

.hp-back-to-top:hover {
	background: var(--lp-color-accent-hover, #003350);
}

@media (max-width: 720px) {
	.lp-toolbar__body {
	flex-direction: column;
	align-items: stretch;
	}

	.lp-toolbar__form {
	width: 100%;
	}

	.lp-input,
	.lp-select {
	flex: 1 1 100%;
	width: 100%;
	min-width: 0;
	}

	.hp-sources-list .source-item {
	flex-direction: column;
	align-items: flex-start;
	gap: var(--lp-space-1);
	}
}
