/* ============================================================
   GENEALOGY CANVAS — genealogy.css
============================================================ */

.hbc-genealogy-wrap {
  position: relative;
  background-color: var(--parchment-light);
  border: 1px solid var(--border-color);
  box-shadow: 3px 3px 16px rgba(0,0,0,0.3);
}

/* ── Toolbar ── */
.hbc-genealogy-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--divider);
  background: rgba(200,146,10,0.07);
  flex-wrap: wrap;
}

.gen-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 1.1rem;
  font-family: var(--font-heading);
  font-weight: 600;
  background: var(--parchment-light);
  border: 1px solid var(--border-color);
  color: var(--ink-mid);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1;
}

.gen-btn:hover {
  background: rgba(200,146,10,0.15);
  border-color: var(--gold);
  color: var(--ink-dark);
}

.gen-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-left: 0.5rem;
  align-items: center;
}

.gen-legend-item {
  font-family: var(--font-smallcaps);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--ink-faded);
  padding-left: 1.4rem;
  position: relative;
}

.gen-legend-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 2px;
}

.gen-legend--parent-child::before { background: #5a1010; }
.gen-legend--spouse::before       { background: none; border-top: 2px dashed #c8920a; height: 0; }
.gen-legend--sibling::before      { background: none; border-top: 2px dotted #2a4a1a; height: 0; }

/* Type legend */
.gen-type-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--divider);
  align-items: center;
}

.gen-type-item {
  font-family: var(--font-smallcaps);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--ink-faded);
}

/* ── Canvas ── */
.hbc-genealogy-canvas-wrap {
  position: relative;
  width: 100%;
  height: 640px;
  overflow: hidden;
}

.hbc-genealogy-svg {
  width: 100%;
  height: 100%;
  display: block;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='1' cy='1' r='1' fill='%23c4a052' opacity='0.15'/%3E%3C/svg%3E"),
    var(--parchment-light);
  user-select: none;
  -webkit-user-select: none;
}

/* ── Tooltip ── */
.hbc-genealogy-tooltip {
  position: absolute;
  z-index: 10;
  background: var(--parchment-light);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--gold);
  padding: 0.75rem 1rem;
  max-width: 210px;
  box-shadow: 3px 3px 10px rgba(0,0,0,0.3);
  pointer-events: none;
}

.hbc-genealogy-tooltip[hidden] { display: none; }

.gen-tip-name {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-dark);
  margin-bottom: 0.15rem;
}

.gen-tip-type {
  display: block;
  font-family: var(--font-smallcaps);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.gen-tip-desc {
  font-size: 0.78rem;
  color: var(--ink-mid);
  font-style: italic;
  margin: 0 0 0.5rem;
  line-height: 1.5;
}

.gen-tip-link {
  font-size: 0.65rem !important;
  pointer-events: all;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .hbc-genealogy-canvas-wrap { height: 360px; }
  .gen-legend { display: none; }
}
