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

.hp-genealogy-container.lp-shell.hp-families,
.lp-shell.hp-families {
	/* inherits shell padding/bg from list-chrome */
}

/* --------------------------------------------------------------------------
	Toolbar (search / sort / per-page)
	-------------------------------------------------------------------------- */
.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: 12rem;
}

.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;
}

/* --------------------------------------------------------------------------
	Families table
	-------------------------------------------------------------------------- */
.hp-families-table {
	margin-bottom: 0;
}

.hp-families-table__wrap {
	padding: 0;
	overflow-x: auto;
}

.hp-families-table table {
	width: 100%;
	border-collapse: collapse;
	background: var(--lp-color-surface);
}

.hp-families-table thead tr {
	background: var(--lp-color-surface-alt);
}

.hp-families-table th {
	padding: var(--lp-space-4) var(--lp-space-5);
	text-align: left;
	font-size: var(--lp-text-sm);
	font-weight: var(--lp-weight-semibold);
	color: var(--lp-color-text-secondary);
	border-bottom: 1px solid var(--lp-color-border);
	white-space: nowrap;
}

.hp-families-table th.center {
	text-align: center;
}

.hp-families-table tbody tr {
	border: none;
	transition: background 0.12s ease;
}

.hp-families-table tbody tr:hover {
	background: var(--lp-color-surface-alt);
}

.hp-families-table td {
	padding: var(--lp-space-4) var(--lp-space-5);
	border-bottom: 1px solid var(--lp-color-border);
	vertical-align: top;
	font-size: var(--lp-text-base);
	color: var(--lp-color-text);
}

.hp-families-table tbody tr:last-child td {
	border-bottom: none;
}

.hp-families-table td.center {
	text-align: center;
	vertical-align: middle;
}

.hp-families-table td.empty {
	padding: var(--lp-space-10) var(--lp-space-5);
	text-align: center;
	color: var(--lp-color-text-secondary);
}

.hp-families-table td a {
	color: var(--lp-link-color, var(--lp-color-accent));
	text-decoration: none;
	font-weight: var(--lp-weight-medium);
}

.hp-families-table td a:hover {
	text-decoration: underline;
}

.hp-families-table .birth-year,
.hp-families-table .marr-place {
	font-size: var(--lp-text-xs);
	color: var(--lp-color-text-secondary);
	margin-top: 2px;
}

.hp-families-table .marr-date {
	font-weight: var(--lp-weight-medium);
}

.hp-families-table .unknown {
	color: var(--lp-color-text-muted);
}

.hp-families-table .children-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.75rem;
	padding: 0.2rem 0.65rem;
	background: var(--lp-color-accent);
	color: #fff;
	border-radius: var(--lp-radius-pill);
	font-size: var(--lp-text-sm);
	font-weight: var(--lp-weight-semibold);
	line-height: 1.2;
}

.lp-badge {
	display: inline-block;
	margin-left: var(--lp-space-2);
	padding: 0.15rem 0.5rem;
	border-radius: var(--lp-radius-sm);
	font-size: 0.6875rem;
	font-weight: var(--lp-weight-semibold);
	letter-spacing: 0.02em;
	text-transform: uppercase;
	vertical-align: middle;
}

.lp-badge--living {
	background: #28a745;
	color: #fff;
}

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

@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;
	}
}
