/**
 * Development work by David Lane
 */
/**
 * Genealogy source file.
 * Author: Levi Lane.
 */
body.lane-direct-page {
  --history-bg: #0f141b;
  --history-text: #f2ebdf;
  --history-surface: #1a2230;
  --history-border: #2b3647;
  --history-accent: #caa56c;
  --history-link: #b8c3d3;
  --lane-qnav-link-bd: #33455d;
  --lane-qnav-link-fg: var(--history-link);
  --lane-qnav-link-fs: 0.74rem;
  --lane-qnav-link-tracking: 0.06em;
  --lane-qnav-link-case: uppercase;
  --lane-qnav-link-pad-v: 0.25rem;
  --lane-qnav-link-pad-h: 0.55rem;
  --lane-qnav-link-hover-bd: var(--history-accent);
  --lane-qnav-link-hover-fg: var(--history-text);
  --lane-qnav-link-hover-bg: rgba(202, 165, 108, 0.12);
  --lane-qnav-focus-color: rgba(240, 228, 200, 0.95);
  --lane-context-note-fg: #c5d1e0;
  background: var(--history-bg);
  color: var(--history-text);
}

body.lane-direct-page .text-muted {
  color: #b9c6d8 !important;
}

.direct-wrap {
  max-width: 1080px;
  margin: 2rem auto 4rem;
  padding: 0 1rem;
}

.direct-card {
  background: var(--history-surface);
  border: 1px solid var(--history-border);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.direct-header,
.direct-footer {
  padding: 1.2rem;
}

.direct-kicker {
  color: #caa56c;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.direct-context-callout {
  border: 1px solid rgba(202, 165, 108, 0.45);
  border-left-width: 4px;
  border-radius: 10px;
  background: rgba(202, 165, 108, 0.08);
  padding: 0.65rem 0.75rem;
  color: #d5c8ae;
  font-size: 0.9rem;
}

.direct-quick-nav {
  margin-bottom: 0.55rem;
}

.direct-story-mode {
  margin-top: 0.95rem;
  border: 1px solid rgba(43, 54, 71, 0.95);
  border-radius: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: rgba(15, 20, 27, 0.45);
}

.direct-story-header {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.direct-story-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--history-accent);
}

.direct-story-copy {
  margin-top: 0.5rem;
  color: var(--lane-context-note-fg);
  font-size: 0.84rem;
}

.direct-story-voice-hint {
  padding-left: 0.65rem;
  border-left: 3px solid rgba(202, 165, 108, 0.45);
  color: #d5dde8;
}

.direct-story-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: #b9c7da;
}

.direct-story-option {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
}

.direct-story-option input {
  margin: 0;
  accent-color: rgba(202, 165, 108, 0.85);
}

.direct-story-overlay {
  margin-top: 0.65rem;
  border: 1px solid rgba(202, 165, 108, 0.32);
  border-left: 4px solid rgba(202, 165, 108, 0.64);
  border-radius: 0.55rem;
  padding: 0.6rem 0.7rem;
  background: rgba(9, 12, 18, 0.55);
}

.direct-story-overlay.direct-story-overlay--floating {
  position: fixed;
  margin-top: 0;
  left: auto;
  right: auto;
  top: auto;
  z-index: 1150;
  max-width: min(20rem, calc(100vw - 24px));
  pointer-events: none;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.5);
  background: rgba(12, 17, 24, 0.94);
  border-left-width: 4px;
  backdrop-filter: blur(6px);
}

.direct-story-scene-kicker {
  font-size: 0.67rem;
  color: #b9aa8e;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.direct-story-scene-title {
  font-family: Georgia, 'Palatino Linotype', Palatino, serif;
  color: #f6efe3;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 500;
  line-height: 1.3;
}

.direct-story-scene-copy {
  color: #c9d2df;
  font-size: 0.84rem;
  line-height: 1.5;
}

@media (max-width: 576px) {
  .direct-story-overlay.direct-story-overlay--floating {
    max-width: calc(100vw - 18px);
  }
}

.direct-timeline {
  margin-top: 1rem;
}

.ancestor-entry {
  scroll-margin-top: 5rem;
  margin-bottom: 0.85rem;
  padding: 1.1rem 1.15rem;
}

.ancestor-entry--story-active {
  box-shadow:
    0 0 0 1px rgba(140, 199, 255, 0.45),
    0 12px 32px rgba(0, 0, 0, 0.45);
  background: rgba(60, 90, 120, 0.22);
  animation: directStoryPulse 1800ms ease-in-out infinite;
}

@keyframes directStoryPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(140, 199, 255, 0.45),
      0 12px 32px rgba(0, 0, 0, 0.45);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(140, 199, 255, 0.62),
      0 0 18px rgba(140, 199, 255, 0.16),
      0 12px 32px rgba(0, 0, 0, 0.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ancestor-entry--story-active {
    animation: none;
  }
}

.ancestor-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ancestor-years {
  color: #9fb2c9;
  font-size: 0.9rem;
}

.ancestor-tags {
  margin-top: 0.45rem;
}

.ancestor-tags .badge {
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
}

.ancestor-line {
  border-left: 3px solid #caa56c;
  padding-left: 0.8rem;
  margin-top: 0.75rem;
  color: #d6dde8;
  line-height: 1.62;
  letter-spacing: 0.01em;
}

.ancestor-quote {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px dashed #3b4c64;
  border-radius: 8px;
  color: #d7e1ef;
  font-size: 0.92rem;
  line-height: 1.5;
}

.family-context {
  margin-top: 0.75rem;
  color: #b8c3d3;
  font-size: 0.9rem;
}

.desc-draft-list {
  margin-top: 0.75rem;
}

.desc-item {
  border: 1px solid #33455d;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.45rem;
  background: #212c3c;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.desc-item-meta {
  color: #9fb2c9;
  font-size: 0.84rem;
}

.direct-descendant-details summary {
  cursor: pointer;
  color: var(--history-text);
  list-style: none;
}

.direct-descendant-details summary::-webkit-details-marker {
  display: none;
}

.direct-descendant-details summary::before {
  content: 'Show draft tools';
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b9c7da;
  display: block;
  margin-bottom: 0.25rem;
}

.direct-descendant-details[open] summary::before {
  content: 'Hide draft tools';
}

/* Direct descendant storybook wall: responsive grid + cards use .ddw-* in lane-direct-descendant-wall.css */
#directDescendantWall {
  scroll-margin-top: 5rem;
}

#directDescendantWall .ddw-grid {
  margin-top: 0.25rem;
}

#directDescendantWall .ddw-card-title {
  letter-spacing: 0.02em;
}
