@import url("https://fonts.googleapis.com/css2?family=Quicksand:wght@300;500;700&display=swap");

* {
	font-family: Quicksand, sans-serif;
	box-sizing: border-box;
}

.nodeRect {
	fill: #fff;
	stroke: black;
	stroke-width: 2;
	cursor: pointer;
	transition: all 0.2s;
}

.nodeRect:hover {
	fill: #def;
}

.node {
	transition: all 0.2s;
	transform-box: fill-box;
	transform-origin: left;
}

.node:hover {
	transform: scale(1.1);
}

.nodeText {
	stroke-width: 0;
	fill: black;
	dominant-baseline: middle;
	text-anchor: middle;
	cursor: pointer;
	pointer-events: none;
}

.link,
.marriageLink {
	fill: none;
	stroke: black;
	stroke-width: 2;
}

.marriageLink.divorced {
	stroke-dasharray: 5;
}

.nodeRect.deceased {
	fill: #ddd;
}

.nodeRect.deceased:hover {
	fill: #cde;
}

svg {
	margin: 0;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

.hidden {
	display: none;
}

#controls {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	background: #ccc8;
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 10px;
	padding: 10px;
	z-index: 500;
	align-items: center;
	backdrop-filter: blur(2px);
}

#controls > h2 {
    text-transform: capitalize;
}

button {
	padding: 5px;
	border: 2px solid black;
	cursor: pointer;
	border-radius: 3px;
	color: black;
}

button:hover {
	background-color: #cde;
}

button.selected {
	background-color: #cde;
}

a {
	color: #0071a6;
	transition: all 0.2s;
}

a:hover {
	color: #0099e0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
	padding: 0;
	margin: 0;
}

#overlay {
	width: 100%;
	height: 100%;
	position: fixed;
	top: 0;
	left: 0;
	background-color: rgba(0, 0, 0, 0.2);
	z-index: 1000;
	visibility: visible;
	transition: opacity 0.2s;
}

#popup {
	position: absolute;
	top: 50%;
	left: 50%;
	margin: 0 auto;
	transform: translate(-50%, -50%);
	background-color: #fff;
	z-index: 1001;
	padding: 20px;
	display: flex;
	flex-direction: column;
	border-radius: 5px;
}

#overlay.invisible {
	visibility: hidden;
	opacity: 0;
	transition: visibility 0s linear 0.2s, opacity 0.2s;
}

#close {
	position: absolute;
	top: 10px;
	right: 10px;
	font-size: 30px;
	cursor: pointer;
}

#popup-content {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: row;
	justify-content: center;
	gap: 20px;
	min-width: 300px;
}

.popup-text {
	display: flex;
	flex-direction: column;
	gap: 10px;
    flex-grow: 1;
    width: 50%;
}

.img-div {
	width: 50%;
	object-fit: cover;
	overflow: hidden;
	border-radius: 5px;
	display: flex;
	justify-content: center;
	align-items: center;
}

.img-div img {
	flex-grow: 0;
	min-width: 100%;
	min-height: 100%;
	max-width: 800px;
	max-height: 800px;
}

.rootG {
	/* transition: transform 0.1s; */
}

@media only screen and (max-width: 768px) {
	#popup {
		margin: 0 auto;
		width: 90%;
		max-height: 90%;
	}

	#overlay {
		padding: 30px;
	}

	#close {
		position: relative;
		align-self: flex-end;
		top: -10px;
		right: -10px;
		font-size: 20px;
	}

	#popup-content {
		flex-direction: column;
	}

	.img-div {
		width: 100%;
	}

    .popup-text {
        width: 100%;
    }
}

#edit {
	position: absolute;
	bottom: 10px;
	right: 10px;
}
