/**
 * graph.css — styling for the People <-> Organizations <-> Artifacts
 * relationship graph (Cytoscape.js). Covers both the sitewide /network/ page
 * (.pbc-graph--page) and the single-page Connections tab (.pbc-graph--tab).
 */

/* The /network/ page hero is white rather than the design-system default
 * pale-blue tint (.hero { background: #eef3fa } in hero.css). The page_hero
 * renderer treats #ffffff as "keep the default tint", so white is unreachable
 * via the block's bg_color field — hence this page-scoped override. */
body.page-slug-network .hero {
	background: #fff;
}

.pbc-graph {
	position: relative;
	width: 100%;
	min-height: 480px;
	background: #f4f4f5;
	border: 1px solid #e4dcc9;
	border-radius: 4px;
	overflow: hidden;
}

.pbc-graph--page {
	min-height: 72vh;
}

.pbc-graph--tab {
	min-height: 460px;
}

.pbc-graph-tab-intro {
	margin: 0 0 1rem;
	color: #6b6052;
	font-family: Georgia, 'Times New Roman', serif;
	font-style: italic;
	line-height: 1.5;
}

/* Loading / empty / error states */
.pbc-graph-loading::after {
	content: 'Loading the connection graph…';
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #8a7a5c;
	font-family: Georgia, 'Times New Roman', serif;
	font-style: italic;
}
.pbc-graph-empty,
.pbc-graph-error {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 240px;
}
.pbc-graph-empty-msg {
	color: #8a7a5c;
	font-family: Georgia, 'Times New Roman', serif;
	font-style: italic;
	margin: 0;
	padding: 2rem;
	text-align: center;
}

/* Legend / filter toggles */
.pbc-graph-legend {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 5;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	background: rgba(225, 225, 228, 0.94);
	border: 1px solid #d4d4d8;
	border-radius: 4px;
	padding: 6px 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.pbc-graph-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 3px;
	padding: 3px 8px;
	font-size: 12px;
	font-family: Georgia, 'Times New Roman', serif;
	color: #3a3225;
	cursor: pointer;
	transition: opacity 0.15s ease, background 0.15s ease;
}
.pbc-graph-legend-item:hover {
	background: #d7d7db;
}
.pbc-graph-legend-item:not(.is-on) {
	opacity: 0.4;
	text-decoration: line-through;
}
.pbc-graph-legend-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	display: inline-block;
	flex: 0 0 auto;
}
.pbc-graph-fit {
	background: #e4e4e7;
	border: 1px solid #c4c4c8;
	border-radius: 3px;
	padding: 3px 10px;
	font-size: 12px;
	font-family: Georgia, 'Times New Roman', serif;
	color: #3a3225;
	cursor: pointer;
	margin-left: 4px;
}
.pbc-graph-fit:hover {
	background: #d7d7db;
}

/* Tapped-node info panel */
.pbc-graph-info {
	position: absolute;
	bottom: 12px;
	left: 12px;
	z-index: 5;
	max-width: 320px;
	background: #fff;
	border: 1px solid #e4dcc9;
	border-radius: 4px;
	padding: 10px 12px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
	font-family: Georgia, 'Times New Roman', serif;
}
.pbc-graph-info-badge {
	display: inline-block;
	color: #fff;
	font-size: 10px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 1px 7px;
	border-radius: 10px;
	margin-bottom: 6px;
}
.pbc-graph-info-title {
	display: block;
	font-size: 16px;
	color: #2b2b2b;
	margin-bottom: 6px;
	line-height: 1.25;
}
.pbc-graph-info-link {
	font-size: 13px;
	color: #2c5f7c;
	text-decoration: none;
}
.pbc-graph-info-link:hover {
	text-decoration: underline;
}

/* Right-click context menu */
.pbc-graph-menu {
	position: absolute;
	z-index: 6;
	min-width: 180px;
	max-width: 260px;
	background: #fff;
	border: 1px solid #c4c4c8;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
	overflow: hidden;
	font-family: Georgia, 'Times New Roman', serif;
}
.pbc-graph-menu-name {
	padding: 7px 12px 5px;
	font-size: 13px;
	font-weight: 600;
	color: #2b2b2b;
	border-bottom: 1px solid #ececef;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.pbc-graph-menu-item {
	display: block;
	width: 100%;
	text-align: left;
	background: transparent;
	border: 0;
	padding: 9px 12px;
	font-size: 13px;
	font-family: inherit;
	color: #2c5f7c;
	cursor: pointer;
}
.pbc-graph-menu-item:hover {
	background: #d7d7db;
}

/* Search box (full /network/ graph, top-right) */
.pbc-graph-search {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 6;
	width: 240px;
	max-width: calc(100% - 24px);
}
.pbc-graph-search-input {
	width: 100%;
	box-sizing: border-box;
	padding: 7px 30px 7px 12px;
	font-size: 13px;
	font-family: Georgia, 'Times New Roman', serif;
	color: #2b2b2b;
	background: #fff;
	border: 1px solid #c4c4c8;
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.pbc-graph-search-input:focus {
	outline: none;
	border-color: #8a8a90;
}
.pbc-graph-search-clear {
	position: absolute;
	top: 0;
	right: 1px;
	height: 31px;
	width: 28px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #8a8a90;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}
.pbc-graph-search-clear:hover {
	color: #2b2b2b;
}
.pbc-graph-search-results {
	list-style: none;
	margin: 4px 0 0;
	padding: 4px 0;
	max-height: 280px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #c4c4c8;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}
.pbc-graph-search-result {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 13px;
	color: #2b2b2b;
	cursor: pointer;
}
.pbc-graph-search-result:hover,
.pbc-graph-search-result.is-active {
	background: #d7d7db;
}
.pbc-graph-search-chip {
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	border-radius: 50%;
}
.pbc-graph-search-label {
	flex: 1 1 auto;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

@media (max-width: 640px) {
	.pbc-graph--page { min-height: 60vh; }
	.pbc-graph-info { max-width: calc(100% - 24px); }
	.pbc-graph-search { width: calc(100% - 24px); }
}
