/* Family tree page */

.tree-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.tree-search-wrap { position: relative; flex: 1; min-width: 240px; max-width: 420px; }
#tree-search { width: 100%; font-family: var(--font-body); font-size: 16px; padding: 11px 16px; border: 1px solid var(--linen); border-radius: 10px; background: #fff; color: var(--ink); }
#tree-search:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px rgba(78,96,69,0.15); }
#search-results { position: absolute; top: 48px; left: 0; right: 0; background: #fff; border: 1px solid var(--linen); border-radius: 10px; box-shadow: 0 12px 28px rgba(46,42,36,0.16); overflow: hidden; display: none; z-index: 60; }
.search-hit { display: block; width: 100%; text-align: left; background: none; border: none; padding: 10px 16px; font-family: var(--font-body); font-size: 15px; color: var(--ink); cursor: pointer; border-bottom: 1px solid var(--linen); }
.search-hit:last-child { border-bottom: none; }
.search-hit:hover { background: var(--pine); color: var(--cream); }
.search-hit:hover .muted { color: var(--cream); }
.tree-jumps { display: flex; gap: 8px; flex-wrap: wrap; }

.tree-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.tree-scroll { background: var(--linen); border-radius: 14px; padding: 28px 20px; overflow-x: auto; min-height: 460px; }
.tree-stage { display: flex; flex-direction: column; align-items: center; gap: 0; min-width: min-content; }

.tree-row { display: flex; justify-content: center; gap: 14px; flex-wrap: nowrap; }
.gen-grand { opacity: 0.92; }
.connector { width: 2px; height: 26px; background: var(--sage); margin: 6px 0; }

/* Person node */
.node { display: flex; align-items: center; gap: 10px; text-decoration: none; background: #fff; border: 1px solid #e6dcc9; border-radius: 12px; padding: 8px 12px; transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; min-width: 0; }
.node:hover { background: var(--pine); border-color: var(--pine); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(60,75,53,0.22); }
.node:hover .node-name, .node:hover .node-years { color: var(--cream); }
.node .mono { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--sage); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-size: 14px; font-weight: 600; }
.node .mono.has-photo { background: var(--pine); }
.node-info { display: flex; flex-direction: column; line-height: 1.2; }
.node-name { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.node-years { font-size: 12px; color: var(--walnut); }

.node-focus { background: var(--pine); border-color: var(--pine); padding: 12px 18px; }
.node-focus .node-name { color: var(--cream); font-size: 17px; }
.node-focus .node-years { color: #d9e0cf; }
.node-focus .mono { width: 44px; height: 44px; font-size: 18px; background: var(--cream); color: var(--pine); }
.node-focus:hover { transform: none; }
.node-md .mono { width: 38px; height: 38px; }

.spouse-link { font-family: var(--font-heading); font-size: 20px; color: var(--walnut); align-self: center; padding: 0 2px; }

/* Profile panel */
.profile { background: #fff; border: 1px solid var(--linen); border-radius: 14px; padding: 24px; position: sticky; top: 20px; }
.profile-mono { width: 64px; height: 64px; border-radius: 50%; background: var(--sage); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-size: 26px; font-weight: 600; margin-bottom: 14px; }
.profile-mono.has-photo { background: var(--pine); }
.profile-name { font-size: 24px; margin-bottom: 2px; }
.profile-life { color: var(--walnut); font-size: 15px; margin-bottom: 12px; }
.photo-note { font-size: 13px; color: var(--walnut); background: var(--linen); padding: 8px 12px; border-radius: 8px; margin-bottom: 14px; }
.facts { margin-bottom: 16px; }
.fact { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--linen); font-size: 14px; }
.fact .fk { flex: none; width: 56px; color: var(--walnut); font-weight: 600; }
.fact .fv { flex: 1; }
.rel-group { margin-top: 14px; }
.rel-label { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--walnut); margin-bottom: 6px; }
.rel-people { display: flex; flex-direction: column; gap: 4px; }
.rel-people a { font-size: 15px; color: var(--pine); text-decoration: none; padding: 4px 8px; border-radius: 6px; transition: background 0.15s ease, color 0.15s ease; }
.rel-people a:hover { background: var(--pine); color: var(--cream); }
.rel-people a:hover .muted { color: var(--cream); }

@media (max-width: 880px) {
  .tree-layout { grid-template-columns: 1fr; }
  .profile { position: static; }
}
