/* who-am-i.css — v3.75 */

/* Floating picker button — bottom-right, persistent */
.whoami-btn {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 200;
  background: #1F1A14;
  border: 1px solid #AE8636;
  color: #FBF7EC;
  font-family: 'Cormorant SC', serif;
  font-size: 10px;
  letter-spacing: 1.8px;
  padding: 10px 16px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.whoami-btn:hover {
  background: #8A322A;
  border-color: #FBF7EC;
}
.whoami-btn .whoami-label {
  color: #D1AB5F;
}
.whoami-btn .whoami-name {
  color: #FBF7EC;
  font-weight: 600;
}

/* Modal overlay */
#whoami-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 26, 20, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.whoami-card {
  background: #FBF7EC;
  border: 1px solid #AE8636;
  max-width: 540px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 32px 28px 24px;
  position: relative;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.whoami-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #8C7D66;
  line-height: 1;
}
.whoami-eyebrow {
  font-family: 'Cormorant SC', serif;
  font-size: 10px;
  letter-spacing: 2.5px;
  color: #AE8636;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 8px;
}
.whoami-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  color: #1F1A14;
  text-align: center;
  margin: 0 0 12px;
  font-weight: 500;
}
.whoami-sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 14.5px;
  color: #4F4234;
  text-align: center;
  margin-bottom: 22px;
  line-height: 1.55;
}

.whoami-list {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}
.whoami-option {
  background: #FFFFFF;
  border: 1px solid #D4C3A0;
  text-align: left;
  padding: 12px 16px;
  cursor: pointer;
  font-family: 'Cormorant Garamond', serif;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.15s;
}
.whoami-option:hover {
  border-color: #AE8636;
  background: #F6F0E0;
}
.whoami-option-name {
  font-size: 16px;
  font-weight: 500;
  color: #1F1A14;
}
.whoami-option-detail {
  font-size: 12px;
  font-style: italic;
  color: #8C7D66;
}

.whoami-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  border-top: 1px solid #E8DCBF;
  padding-top: 16px;
}
.whoami-action {
  background: transparent;
  border: 1px solid #D4C3A0;
  font-family: 'Cormorant SC', serif;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #4F4234;
  padding: 8px 14px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
}
.whoami-action:hover {
  border-color: #8A322A;
  color: #8A322A;
}

/* Greeting banner under draft-banner */
.whoami-greeting {
  background: linear-gradient(180deg, #FBF4DD 0%, #F2E9D4 100%);
  border-bottom: 1px solid #D4C3A0;
  padding: 9px 20px;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 13.5px;
  color: #4F4234;
  font-style: italic;
}
.whoami-greeting strong {
  color: #8A322A;
  font-style: normal;
  font-weight: 600;
}
.whoami-greeting button {
  background: transparent;
  border: none;
  color: #AE8636;
  font-family: 'Cormorant SC', serif;
  font-size: 9.5px;
  letter-spacing: 1.5px;
  cursor: pointer;
  text-transform: uppercase;
  margin-left: 4px;
}
.whoami-greeting button:hover { color: #8A322A; }

/* ============================================================
   v5.10 — Relationship lines redesigned: italic serif with gold
   em-dashes. No more maroon blocks or boxy badges that clash with
   the hand-bound-book aesthetic.
   ============================================================ */

/* Per-/p/-page hero relationship line — below the name, refined */
.whoami-rel-line {
  text-align: center;
  margin: 14px auto 8px;
  padding: 0 16px;
  line-height: 1.35;
}
.whoami-rel-line .whoami-rel-label {
  display: inline;
  background: transparent;
  color: var(--maroon, #8A322A);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 19px;
  letter-spacing: 0;
  text-transform: none;
  padding: 0;
  border-radius: 0;
}
.whoami-rel-line .whoami-rel-label::before,
.whoami-rel-line .whoami-rel-label::after {
  content: '—';
  color: var(--gold, #AE8636);
  font-style: normal;
  margin: 0 10px;
  font-weight: 400;
}

/* Branch-fallback hero label — softer ink-fade, gold dashes */
.whoami-rel-line .whoami-rel-label[data-fallback="branch"] {
  color: var(--ink-fade, #8C7D66);
}

.whoami-self-badge {
  font-family: 'Cormorant SC', serif;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--living, #567E42);
  text-align: center;
  margin: 8px auto 6px;
  text-transform: uppercase;
}


@media (max-width: 768px) {
  .whoami-btn {
    bottom: 12px;
    left: 12px;
    font-size: 9px;
    padding: 8px 12px;
  }
  .whoami-card {
    max-height: 92vh;
    padding: 24px 20px 18px;
  }
  .whoami-title { font-size: 22px; }
  .whoami-sub { font-size: 13px; }
  .whoami-rel-line .whoami-rel-label {
    font-size: 16px;
  }
  .whoami-rel-line .whoami-rel-label::before,
  .whoami-rel-line .whoami-rel-label::after {
    margin: 0 6px;
  }
}


/* ============================================================
   v5.10: card-rel badge — elegant italic caption under name+dates
   No box, no background, no border. Just gold em-dash + maroon
   italic serif + gold em-dash. Wraps gracefully on narrow cards.
   ============================================================ */

.whoami-card-rel {
  display: block;
  width: auto;
  max-width: 100%;
  margin: 8px auto 2px;
  padding: 0 4px;
  background: transparent;
  color: var(--maroon, #8A322A);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
  border: none;
  border-radius: 0;
  border-left: none !important;
  box-shadow: none;
  pointer-events: none;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.3;
}
.whoami-card-rel::before,
.whoami-card-rel::after {
  content: '—';
  color: var(--gold, #AE8636);
  font-style: normal;
  margin: 0 5px;
  font-weight: 400;
  display: inline-block;
}

/* Card body variant — block beneath name+dates */
.whoami-card-rel--card {
  display: block;
  width: 100%;
  max-width: 100%;
}

/* Chip variant — inline within a pill-shaped backlink (kept compact) */
.whoami-card-rel--chip {
  display: inline-block;
  margin: 0 0 0 8px;
  padding: 0;
  font-size: 11px;
  vertical-align: baseline;
}
.whoami-card-rel--chip::before,
.whoami-card-rel--chip::after {
  margin: 0 3px;
}

/* Branch-fallback variant — softer ink-fade for "on the X side of the family" */
.whoami-card-rel[data-fallback="branch"] {
  color: var(--ink-fade, #8C7D66);
}

/* v4.62: Household grouping in picker */
.whoami-household {
  margin-bottom: 20px;
}
.whoami-household-label {
  font-family: 'Cormorant SC', serif;
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--maroon, #8A322A);
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(174, 134, 54, 0.25);
}
.whoami-household-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

/* v4.62: First-visit banner */
.whoami-first-visit {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 720px;
  width: calc(100vw - 32px);
  background: var(--paper, #FBF7EC);
  border: 2px solid var(--maroon, #8A322A);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(31, 26, 20, 0.18);
  padding: 16px 22px;
  z-index: 10000;
  animation: whoami-fv-slide-in 0.35s ease-out;
}
@keyframes whoami-fv-slide-in {
  from { opacity: 0; transform: translate(-50%, 30px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.whoami-fv-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.whoami-fv-text {
  flex: 1 1 320px;
  min-width: 0;
}
.whoami-fv-text strong {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink, #1F1A14);
  margin-bottom: 2px;
}
.whoami-fv-text span {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14.5px;
  color: var(--ink-fade, #5a4d3a);
}
.whoami-fv-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.whoami-fv-btn {
  font-family: 'Cormorant SC', serif;
  font-size: 11.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.whoami-fv-primary {
  background: var(--maroon, #8A322A);
  color: var(--paper, #FBF7EC);
  border: 1px solid var(--maroon, #8A322A);
}
.whoami-fv-primary:hover { background: #6E2620; }
.whoami-fv-secondary {
  background: transparent;
  color: var(--ink-fade, #5a4d3a);
  border: 1px solid rgba(31, 26, 20, 0.25);
}
.whoami-fv-secondary:hover { background: rgba(31, 26, 20, 0.04); }

@media (max-width: 560px) {
  .whoami-first-visit { padding: 14px 16px; }
  .whoami-fv-actions { width: 100%; }
  .whoami-fv-btn { flex: 1; }
}

/* v4.77: hide corner button if it slipped through (the JS function is also disabled) */
#whoami-btn { display: none !important; }
