/* =====================================================
   persons.css  —  Personenregister layout & components
   ===================================================== */

/* ----- Page-level viewport fill (persons page only) ------------------- */

body.persons-page {
	display: flex;
	flex-direction: column;
	height: 100vh;
	overflow: hidden;
}

/* ----- Three-column main layout --------------------------------------- */

.persons-layout {
	display: flex;
	align-items: stretch;
	gap: 0;
	padding: var(--space-lg);
	flex: 1;
	min-height: 0;
	overflow: hidden;
}

/* ----- Left: search panel --------------------------------------------- */

.search-panel {
	width: 13%;
	min-width: 9rem;
	max-width: 14rem;
	flex-shrink: 0;
	margin-right: var(--space-lg);
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
	min-height: 0;
}

.search-box input {
	width: 100%;
	padding: var(--space-sm) var(--space-md);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	background: var(--color-surface);
	color: var(--color-text);
	font-size: var(--font-size-sm);
	font-family: var(--font-sans);
	outline: none;
}

.search-box input:focus {
	border-color: var(--color-accent);
}

#person-list {
	list-style: none;
	padding: 0;
	margin: 0;
	overflow-y: auto;
	flex: 1;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
}

#person-list li {
	padding: var(--space-sm) var(--space-md);
	margin: 0;
	cursor: pointer;
	border-bottom: 1px solid var(--color-border);
	font-size: var(--font-size-sm);
	line-height: 1.4;
}

#person-list li:last-child {
	border-bottom: none;
}

#person-list li:hover {
	background: var(--color-bg);
}

#person-list li.selected {
	background: var(--color-text);
	color: var(--color-bg);
}

/* ID badge shown after name in each list item */
.person-list-name {
	display: block;
}

.person-list-id {
	display: block;
	font-size: var(--font-size-xs);
	color: var(--color-muted);
}

li.selected .person-list-id {
	color: var(--color-dim);
}

/* ----- Middle: content area ------------------------------------------- */

.content-area {
	position: relative;
	flex: 1;
	min-width: 0;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: 0;
	overflow-y: auto;
	min-height: 0;
}

/* ----- Right: metadata panel ------------------------------------------ */

/* ----- Right: wrapper for meta + map ---------------------------------- */

.right-panel {
	width: 47%;
	min-width: 14rem;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
	min-height: 0;
}

.meta-panel {
	position: relative;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: 0;
	margin-bottom: 0;
}

.panel-body {
	padding: var(--space-lg);
}

/* ----- Shared placeholder --------------------------------------------- */

.placeholder-text {
	color: var(--color-muted);
	font-style: italic;
	font-size: var(--font-size-sm);
}

/* ----- Sticky panel headers ------------------------------------------- */

.panel-sticky-header {
	position: sticky;
	top: 0;
	z-index: 10;
	background: var(--color-surface);
	border-bottom: 1px solid var(--color-border);
	margin: 0;
	padding: var(--space-sm) var(--space-lg);
	line-height: 1.3;
}

.content-area>h1.panel-sticky-header {
	font-size: 1.6rem;
	font-weight: 700;
	padding: var(--space-md) var(--space-lg);
}

.meta-panel>h2.panel-sticky-header {
	font-size: var(--font-size-sm);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-muted);
	padding: var(--space-md) var(--space-lg);
}

/* ----- Metadata panel: sections --------------------------------------- */

.meta-section {
	margin-bottom: var(--space-lg);
}

.meta-section:last-child {
	margin-bottom: 0;
}

.meta-section h3 {
	font-size: var(--font-size-xs);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-muted);
	margin-bottom: var(--space-sm);
	padding-bottom: var(--space-xs);
	border-bottom: 1px solid var(--color-border);
}

.meta-name {
	font-size: var(--font-size-xl);
	font-weight: 700;
	line-height: 1.2;
	margin-bottom: var(--space-xs);
}

.meta-label {
	color: var(--color-muted);
	font-size: var(--font-size-xs);
	margin-bottom: var(--space-xs);
}

.meta-influence-text {
	font-size: var(--font-size-sm);
	color: var(--color-muted);
	margin: 0;
	line-height: 1.5;
}

.meta-influence-text strong {
	color: var(--color-text);
	font-weight: 600;
}

.info-btn {
	display: inline-block;
	margin-left: 0.25em;
	cursor: pointer;
	color: var(--color-muted);
	border: 1px solid var(--color-border);
	border-radius: 50%;
	font-size: 0.65em;
	line-height: 1.4;
	width: 1.4em;
	height: 1.4em;
	text-align: center;
	vertical-align: super;
	user-select: none;
}

.info-btn:hover {
	color: var(--color-text);
	border-color: var(--color-text);
}

.info-tooltip {
	display: block;
	margin-top: var(--space-xs);
	font-size: var(--font-size-xs);
	color: var(--color-muted);
	font-style: italic;
	font-weight: normal;
	text-transform: none;
	letter-spacing: 0;
}

/* Smaller icon variants inside poe-list */
.poe-list .wikidata-icon {
	height: 0.6em;
}

.poe-list .herrnhut-icon {
	height: 0.75em;
}

/* Places-of-effect table */
.poe-temporal {
	white-space: nowrap;
	font-size: var(--font-size-xs);
}

/* Logo row */
.person-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
	align-items: center;
}

/* ----- Content area: sections ----------------------------------------- */

.content-section {
	margin-bottom: var(--space-lg);
}

.content-section:last-child {
	margin-bottom: 0;
}

.content-section h3 {
	font-size: var(--font-size-xs);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-muted);
	margin-bottom: var(--space-sm);
	padding-bottom: var(--space-xs);
	border-bottom: 1px solid var(--color-border);
}

/* Collection badges */
.collection-badge {
	display: inline-block;
	padding: 0.15em 0.55em;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	font-size: var(--font-size-xs);
	margin: 0.15em;
	color: var(--color-text);
}

.collection-badge a {
	color: inherit;
}

/* Work / citation lists */
.works-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.works-list li {
	font-size: var(--font-size-sm);
	padding: var(--space-xs) 0;
	border-bottom: 1px solid var(--color-border);
	margin: 0;
}

.works-list li:last-child {
	border-bottom: none;
}

.collection-nybg {
	color: var(--color-muted);
	font-size: var(--font-size-xs);
}

.collection-link {
	display: inline-block;
	margin-left: 0.35em;
	font-size: 0.8em;
	vertical-align: middle;
	text-decoration: none;
	opacity: 0.6;
	line-height: 1;
}

.collection-link:hover {
	opacity: 1;
}

/* ----- Sourced data ------------------------------------------------------- */

.sourced {
	color: #7a0000;
	cursor: pointer;
}

.sourced:hover {
	text-decoration: underline;
}

.source-popup {
	position: fixed;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: var(--space-sm) var(--space-md);
	max-width: 22rem;
	font-size: var(--font-size-sm);
	z-index: 1000;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
	line-height: 1.5;
}

.source-popup-type {
	font-size: var(--font-size-xs);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--color-muted);
	margin-bottom: var(--space-xs);
}

.source-popup-detail {
	font-size: var(--font-size-xs);
	color: var(--color-muted);
	margin-top: var(--space-xs);
}

.source-popup a {
	color: var(--color-accent);
	font-size: var(--font-size-xs);
	display: block;
	margin-top: var(--space-xs);
}

/* ----- Resize handles ------------------------------------------------- */

.col-resize-handle {
	flex-shrink: 0;
	width: 9px;
	cursor: col-resize;
	position: relative;
	margin: 0 var(--space-sm);
}

.col-resize-handle::after {
	content: "";
	position: absolute;
	top: 8%;
	bottom: 8%;
	left: 50%;
	transform: translateX(-50%);
	width: 2px;
	border-radius: 2px;
	background: var(--color-border);
	transition: background 0.15s;
}

.col-resize-handle:hover::after,
.col-resize-handle.dragging::after {
	background: var(--color-accent);
}

.row-resize-handle {
	flex-shrink: 0;
	height: 9px;
	cursor: row-resize;
	position: relative;
	margin: var(--space-sm) 0;
}

.row-resize-handle::after {
	content: "";
	position: absolute;
	left: 8%;
	right: 8%;
	top: 50%;
	transform: translateY(-50%);
	height: 2px;
	border-radius: 2px;
	background: var(--color-border);
	transition: background 0.15s;
}

.row-resize-handle:hover::after,
.row-resize-handle.dragging::after {
	background: var(--color-accent);
}

/* Prevent text selection while dragging */
body.resizing {
	user-select: none;
	cursor: col-resize;
}

body.resizing-v {
	user-select: none;
	cursor: row-resize;
}

/* ----- Bottom: life trajectory map ------------------------------------ */

.trajectory-section {
	flex-shrink: 0;
	padding: 0;
}

.trajectory-title {
	font-size: var(--font-size-xs);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-muted);
	margin-bottom: var(--space-sm);
}

#trajectory-map {
	height: 20rem;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
}