.family-tree-container {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

.family-tree-content {
  overflow-x: auto;
  text-align: center;
  cursor: grab;
}

.tree-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.tree-node.node-male > .tree-node-content {
  background-color: #f7ffff;
  border: 1px #2196F3 solid;
}

.tree-node.node-female > .tree-node-content, .tree-node-wife {
  background-color: #fff9fb;
  border: 1px #ffcdd6 solid;
}

.tree-node-children .tree-node {
  font-size: 16px;
  padding: 0 2px;
}

.tree-node-children .tree-node:before {
  position: relative;
  content: " ";
  display: block;
  margin: 0 auto;
}

.tree-node-children .tree-node:before {
  height: 2px;
  width: calc(100% + 10px);
  background: #aaa;
  margin-bottom: -3px;
  margin-left: -5px;
}

.tree-node-children .tree-node:first-child:before {
  width: calc(50% + 5px);
  margin-right: -5px;
  margin-left: auto;
}

.tree-node-children .tree-node:last-child:before {
  width: calc(50% + 5px);
  margin-left: -5px;
}

.tree-node-children .tree-node:first-child:last-child:before {
  width: 0;
  margin-left: 50%;
}

.tree-node-content {
  max-width: 200px;
  margin: 10px auto;
  padding: 0;
  /* max-height: 100px; */
  text-align: center;
  border: 1px solid #aaa;
  display: block;
  position: relative;
  word-wrap: break-word;
}

.tree-node-name {
  padding: 3px 10px;
  display: block;
}

.tree-node-children .tree-node-content:before, .tree-node-children:before {
  position: absolute;
  content: " ";
  height: 10px;
  width: 2px;
  background: #aaa;
  left: 50%;
  display: block;
}

.tree-node-children .tree-node-content:before {
  top: -10px;
  margin-left: -1px;
  height: 9px;
}

.tree-node-children:before {
  top: -10px;
  left: 50%;
  margin-left: -1px;
}

.tree-node-children {
  display: flex;
  position: relative;
  padding: 0;
}

.tree-node-wife {
  font-size: 0.8em;
  padding: 2px;
  border-width: 0;
  border-top-width: 1px;
}

.tree-depth-0 ~ .tree-node-children {
  padding: 0 20px;
}

.tree-node-note {
  font-size: 0.8em;
  background-color: #eee;
  border-top: 1px solid #aaa;
}

.tree-node-rotated {
  padding: 0;
}
.tree-node-rotated .tree-content-wrapper {
  writing-mode: sideways-lr;
}
.tree-node-rotated .tree-node-name {
  padding: 10px 3px;
}
.tree-node-rotated .tree-node-wife {
  padding: 5px 2px;
  border-width: 0;
  border-left-width: 1px;
}
.tree-node-rotated .tree-node-note {
  border: 0;
}

.family-tree-orientation {
  width: 80px;
  text-align: center;
  background-color: #eee;
  font-size: 14px;
  padding: 10px;
  cursor: pointer;
  border-radius: 5px;
  position: absolute;
  z-index: 999;
}

.horizontal-tree .family-tree-content > .tree-node .tree-node-content {
  margin: 2px 9px 2px 5px;
}
.horizontal-tree .tree-node {
  flex-direction: row;
  position: relative;
}
.horizontal-tree .tree-node-content {
  width: 150px;
}
.horizontal-tree .tree-content-wrapper {
  writing-mode: horizontal-tb;
}
.horizontal-tree .tree-node-children {
  flex-direction: column;
  align-items: start;
  padding-left: 0;
  margin: 5px 0;
}
.horizontal-tree .tree-node-children:before {
  height: 2px;
  width: 11px;
  left: -8px;
  top: 50%;
}
.horizontal-tree .tree-node-children .tree-node {
  padding: 0 5px;
}
.horizontal-tree .tree-node-children .tree-node:before {
  width: 2px;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  margin: 0;
}
.horizontal-tree .tree-node-children .tree-node:first-child:before {
  top: 50%;
  height: 50%;
}
.horizontal-tree .tree-node-children .tree-node:last-child:before {
  top: 0;
  height: calc(50% + 2px);
}
.horizontal-tree .tree-node-children .tree-node-content {
  margin: 5px;
  padding: 0;
}
.horizontal-tree .tree-node-children .tree-node-content:before {
  height: 2px;
  width: 8px;
  top: 50%;
  left: -8px;
}
.horizontal-tree .tree-node-children .tree-node-name {
  padding: 3px 5px;
}
.horizontal-tree .tree-node-children .tree-node-wife {
  padding: 2px;
  border-width: 0;
  border-top-width: 1px;
}

.family-tree-shortcode .family-tree-container {
  width: 100% !important;
  margin: 0 auto !important;
}

.family-tree-shortcode {
  text-align: center;
  margin: 20px auto;
}

.family-tree-shortcode h2 {
  font-size: 1.5em;
}

.family-tree-shortcode .family-tree-orientation {
  display: none;
}