/* ═══════════════════════════════════════════
   PALETTE & TOKENS
═══════════════════════════════════════════ */
:root {
  --max-w: 1160px;
  --sidebar-w: 292px;
}

/* ── Outdoor / high-contrast override ── */
body.outdoor {
  --background-color: #ffffff;
  --background-color-muted: #f4f4f4;
  --surface-primary-foreground-muted: #cccccc;
  --surface-primary-foreground: #efefef;
  --text-color: #080604;
  --text-color-subtle: #3a3028;
  --text-color-muted: #2a2018;
  --text-color-strong: #000000;
  --secondary-color: #a67800;
  --primary-color: #960000;
}
body.outdoor .fiche-text p {
  font-size: 1.08rem;
  line-height: 2.05;
}
body.outdoor body::before {
  display: none;
}

/* ── Respect OS high-contrast preference ── */
@media (prefers-contrast: more) {
  :root {
    --text-color: #000000;
    --text-color-subtle: #3a3028;
    --background-color: #ffffff;
    --surface-primary-foreground-muted: #bbbbbb;
    --secondary-color: #8b6000;
    --primary-color: #900000;
  }
}

/* Noise texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.35;
}

/* ═══════════════════════════════════════════
   GLOBAL HEADER
═══════════════════════════════════════════ */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--surface-primary-background);
  border-bottom: 2px solid var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  height: 64px;
}
.logo-mark {
  width: 34px;
  height: 34px;
  border: 2px solid var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cinzel", serif;
  font-size: 1rem;
  color: var(--secondary-color);
}

nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}
nav a {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.75);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  transition: color 0.2s;
}
nav a:hover {
  color: var(--secondary-color-strong);
}

/* Outdoor toggle button */
.btn-outdoor {
  background: none;
  border: 1px solid rgba(201, 150, 12, 0.3);
  color: rgba(245, 240, 232, 0.5);
  font-size: 0.9rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 2px;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.btn-outdoor:hover {
  border-color: var(--secondary-color);
  color: var(--secondary-color);
}
body.outdoor .btn-outdoor {
  border-color: var(--secondary-color);
  color: var(--secondary-color);
  background: rgba(201, 150, 12, 0.08);
}

/* ═══════════════════════════════════════════
   DEMO SWITCHER
═══════════════════════════════════════════ */
.demo-switcher {
  position: fixed;
  top: var(--header-h, 92px);
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--surface-primary-background);
  border-bottom: 1px solid rgba(201, 150, 12, 0.25);
  display: flex;
  align-items: center;
  padding: 0 max(2.5rem, calc(50% - 600px));
  height: 46px;
  gap: 0;
  overflow-x: auto;
}
.demo-label {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.45);
  margin-right: 1.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.demo-tab {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.6);
  background: none;
  border: none;
  padding: 0 1rem;
  height: 46px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition:
    color 0.15s,
    border-color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.demo-tab:hover {
  color: rgba(245, 240, 232, 0.85);
}
.demo-tab.active {
  color: var(--secondary-color);
  border-bottom-color: var(--secondary-color);
}

/* ═══════════════════════════════════════════
   FICHE PAGE WRAPPER
═══════════════════════════════════════════ */
.fiche-page {
  display: none;
  padding-top: 110px;
  min-height: 100vh;
  animation: fadeIn 0.25s ease;
}
.fiche-page.active {
  display: block;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ═══════════════════════════════════════════
   BREADCRUMB
═══════════════════════════════════════════ */
.breadcrumb {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.75rem 4rem;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-color-subtle);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.breadcrumb a {
  color: var(--text-color-subtle);
  text-decoration: none;
  transition: color 0.15s;
}
.breadcrumb a:hover {
  color: var(--primary-color);
}
.breadcrumb-sep {
  color: var(--surface-primary-foreground-strong);
}
.breadcrumb-current {
  color: var(--text-color);
}

/* ═══════════════════════════════════════════
   FICHE TAGS — filter-linked
═══════════════════════════════════════════ */
.fiche-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}
.ftag {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-decoration: none;
  padding: 0.25rem 0.6rem;
  border: 1px solid;
  transition: all 0.18s;
  line-height: 1;
}
.ftag-primary {
  color: var(--secondary-color-strong);
  border-color: rgba(201, 150, 12, 0.4);
  background: rgba(201, 150, 12, 0.07);
}
.ftag-primary:hover {
  background: rgba(201, 150, 12, 0.15);
  border-color: var(--secondary-color);
}
.ftag-secondary {
  color: var(--text-color-subtle);
  border-color: rgba(200, 184, 154, 0.4);
  background: rgba(200, 184, 154, 0.08);
}
.ftag-secondary:hover {
  color: var(--text-color);
  border-color: var(--surface-primary-foreground-strong);
}
.ftag-theme {
  color: var(--primary-color);
  border-color: rgba(184, 40, 28, 0.3);
  background: rgba(184, 40, 28, 0.05);
}
.ftag-theme:hover {
  background: rgba(184, 40, 28, 0.1);
  border-color: var(--primary-color);
}
.ftag-ext {
  color: var(--surface-primary-background-muted);
  border-color: rgba(44, 74, 110, 0.35);
  background: rgba(44, 74, 110, 0.05);
}
.ftag-ext:hover {
  background: rgba(44, 74, 110, 0.1);
  border-color: var(--surface-primary-background-muted);
}

/* ═══════════════════════════════════════════
   PERSON HEADER — STATE 1 (BASE / monogram)
═══════════════════════════════════════════ */
.person-header-base {
  background: var(--surface-primary-background);
  position: relative;
  overflow: hidden;
}
.person-header-base::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(201, 150, 12, 0.035) 3px,
    rgba(201, 150, 12, 0.035) 4px
  );
  pointer-events: none;
}
.person-header-base-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.75rem 4rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
}
.person-monogram {
  width: 120px;
  height: 120px;
  border: 1px solid rgba(201, 150, 12, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Playfair Display", serif;
  font-size: 3rem;
  font-weight: 900;
  color: rgba(201, 150, 12, 0.4);
  flex-shrink: 0;
  background: rgba(201, 150, 12, 0.04);
  position: relative;
}
.person-monogram::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(201, 150, 12, 0.1);
}
.person-type-badge {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--secondary-color);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.person-type-badge::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--secondary-color);
}
.person-name {
  font-family: "Playfair Display", serif;
  font-size: clamp(2rem, 3.5vw, 3.8rem);
  font-weight: 900;
  color: var(--background-color);
  line-height: 0.95;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}
.person-born-name {
  font-family: "EB Garamond", serif;
  font-size: 1rem;
  font-style: italic;
  color: var(--text-color-subtle);
  margin-bottom: 1.25rem;
  display: block;
}
.person-vitals {
  display: flex;
  gap: 2rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(201, 150, 12, 0.18);
  flex-wrap: wrap;
}
.vital {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.vital-label {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.3);
}
.vital-value {
  font-family: "Playfair Display", serif;
  font-size: 0.9rem;
  color: var(--background-color);
  font-weight: 400;
}

/* External links in header */
.header-ext-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.header-ext-link {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.45);
  text-decoration: none;
  border: 1px solid rgba(245, 240, 232, 0.15);
  padding: 0.2rem 0.6rem;
  transition: all 0.18s;
}
.header-ext-link:hover {
  color: var(--secondary-color-strong);
  border-color: rgba(201, 150, 12, 0.4);
}
.header-ext-link::after {
  content: " ↗";
  font-size: 0.5rem;
}

/* ═══════════════════════════════════════════
   PERSON HEADER — STATE 2/3 (portrait)
═══════════════════════════════════════════ */
.person-header-enriched {
  background: var(--surface-primary-background);
  position: relative;
  overflow: hidden;
  padding: 3.25rem 4rem 0;
}
.person-header-enriched::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(201, 150, 12, 0.035) 3px,
    rgba(201, 150, 12, 0.035) 4px
  );
  pointer-events: none;
}
.person-header-enriched-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  align-items: end;
  position: relative;
  z-index: 1;
}
.person-portrait {
  width: 220px;
  height: 280px;
  object-fit: cover;
  object-position: top center;
  filter: sepia(18%) contrast(1.1);
  display: block;
  border: 1px solid rgba(201, 150, 12, 0.25);
}
/* Gallery variant: multiple images */
.portrait-gallery-wrap {
  width: 220px;
}
.portrait-main {
  width: 220px;
  height: 280px;
  object-fit: cover;
  object-position: top center;
  filter: sepia(18%) contrast(1.1);
  display: block;
  border: 1px solid rgba(201, 150, 12, 0.25);
}
.portrait-thumbs {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.portrait-thumb {
  flex: 1;
  height: 52px;
  object-fit: cover;
  filter: sepia(30%) contrast(1.05);
  border: 1px solid rgba(201, 150, 12, 0.15);
  cursor: pointer;
  transition:
    border-color 0.18s,
    filter 0.18s;
  opacity: 0.7;
}
.portrait-thumb:hover,
.portrait-thumb.active {
  border-color: var(--secondary-color);
  opacity: 1;
  filter: sepia(15%) contrast(1.1);
}
/* Portrait-only (engraving oval) */
.portrait-oval-wrap {
  width: 220px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.portrait-oval {
  width: 160px;
  height: 200px;
  border-radius: 50%;
  border: 2px solid rgba(201, 150, 12, 0.35);
  background: rgba(201, 150, 12, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  box-shadow:
    0 0 0 6px rgba(201, 150, 12, 0.08),
    0 0 0 12px rgba(201, 150, 12, 0.04);
}
.portrait-oval-initial {
  font-family: "Playfair Display", serif;
  font-size: 4rem;
  font-weight: 900;
  color: rgba(201, 150, 12, 0.5);
  line-height: 1;
}
.portrait-oval-name {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.4);
  margin-top: 0.4rem;
  line-height: 1.4;
}
.portrait-oval-dates {
  font-family: "EB Garamond", serif;
  font-size: 0.75rem;
  font-style: italic;
  color: rgba(201, 150, 12, 0.4);
  margin-top: 0.25rem;
}
/* No image placeholder */
.portrait-placeholder {
  width: 220px;
  height: 280px;
  background: linear-gradient(160deg, #0d1829 0%, #1a2a42 60%, #1e3252 100%);
  border: 1px solid rgba(201, 150, 12, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.portrait-placeholder-num {
  font-family: "Cinzel", serif;
  font-size: 4rem;
  font-weight: 600;
  color: rgba(201, 150, 12, 0.2);
  line-height: 1;
}
.portrait-placeholder-label {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.2);
}
.portrait-placeholder-cta {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  color: rgba(201, 150, 12, 0.45);
  text-decoration: none;
  margin-top: 0.5rem;
  transition: color 0.18s;
}
.portrait-placeholder-cta:hover {
  color: var(--secondary-color);
}

.person-portrait-caption {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: rgba(245, 240, 232, 0.28);
  margin-top: 0.4rem;
  font-style: italic;
}
.person-meta {
  padding-bottom: 2.25rem;
}

/* State badges */
.state-badge {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border: 1px solid;
}
.state-1 {
  color: var(--text-color-subtle);
  border-color: rgba(122, 112, 96, 0.35);
}
.state-2 {
  color: #5c8a3c;
  border-color: rgba(92, 138, 60, 0.4);
}
.state-3 {
  color: #4a7ab5;
  border-color: rgba(74, 122, 181, 0.4);
}

/* ═══════════════════════════════════════════
   FICHE BODY LAYOUT
═══════════════════════════════════════════ */
.fiche-body-base {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 3rem;
  align-items: start;
}
.fiche-body {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 3rem;
  align-items: start;
}

/* ═══════════════════════════════════════════
   FICHE SECTIONS
═══════════════════════════════════════════ */
.fiche-section {
  border-bottom: 1px solid var(--surface-primary-foreground-muted);
  padding-bottom: 2rem;
  margin-bottom: 2rem;
}
.fiche-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.fiche-section-title {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-color-subtle);
  margin-bottom: 1.1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--surface-primary-foreground-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.fiche-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--surface-primary-foreground-muted);
}
.fiche-text p {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text-color);
  margin-bottom: 1rem;
}
.fiche-text p:last-child {
  margin-bottom: 0;
}
.fiche-pullquote {
  border-left: 3px solid var(--secondary-color);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-color-muted);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.65;
}
.fiche-pullquote cite {
  display: block;
  font-size: 0.75rem;
  font-style: normal;
  font-family: "Source Sans 3", sans-serif;
  color: var(--text-color-subtle);
  letter-spacing: 0.04em;
  margin-top: 0.5rem;
}

/* Stub notice */
.stub-notice {
  background: var(--surface-primary-foreground);
  border: 1px solid var(--surface-primary-foreground-strong);
  border-left: 3px solid var(--secondary-color);
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.stub-notice-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.stub-notice-text {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  color: var(--text-color-muted);
  line-height: 1.5;
}
.stub-notice-text strong {
  color: var(--surface-primary-background);
  display: block;
  margin-bottom: 0.2rem;
}
.stub-notice-text a {
  color: var(--primary-color);
  text-decoration: none;
}
.stub-notice-text a:hover {
  text-decoration: underline;
}

/* Source attribution */
.source-line {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  color: var(--text-color-subtle);
  font-style: italic;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--surface-primary-foreground-muted);
}

/* ═══════════════════════════════════════════
   EVENTS — TIMELINE (>3 events) vs LIST (≤3)
═══════════════════════════════════════════ */
.events-timeline {
  position: relative;
  padding-left: 1.5rem;
}
.events-timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    var(--secondary-color) 0%,
    rgba(201, 150, 12, 0.1) 100%
  );
}
.timeline-item {
  position: relative;
  padding: 0 0 1.25rem 1.25rem;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0.75rem;
  align-items: start;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--secondary-color);
  border: 2px solid var(--background-color);
  box-shadow: 0 0 0 2px rgba(201, 150, 12, 0.25);
}
.timeline-year {
  font-family: "Playfair Display", serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--secondary-color);
  line-height: 1.4;
  text-align: right;
}
.timeline-content {
  flex: 1;
}
.timeline-event-link {
  font-family: "Playfair Display", serif;
  font-size: 0.92rem;
  color: var(--surface-primary-background);
  text-decoration: none;
  font-weight: 700;
  line-height: 1.3;
  display: block;
  transition: color 0.18s;
}
.timeline-event-link:hover {
  color: var(--primary-color);
}
.timeline-event-desc {
  font-family: "EB Garamond", serif;
  font-size: 0.88rem;
  color: var(--text-color);
  line-height: 1.6;
  margin-top: 0.15rem;
}
/* AI-enriched badge */
.ai-enriched-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.4rem 0.65rem;
  background: var(--surface-primary-foreground);
  border: 1px solid var(--surface-primary-foreground-strong);
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  color: var(--text-color-subtle);
  font-style: italic;
}
.ai-enriched-note strong {
  color: var(--text-color-muted);
  font-style: normal;
}

/* ═══════════════════════════════════════════
   CROSSREF GRID (linked figures)
═══════════════════════════════════════════ */
.crossref-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.crossref-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--surface-primary-foreground-muted);
  border-left: 3px solid var(--surface-primary-foreground-muted);
  transition:
    border-left-color 0.18s,
    background 0.18s;
  background: var(--background-color);
}
.crossref-item:hover {
  border-left-color: var(--secondary-color);
  background: var(--background-color-muted);
}
.crossref-img-placeholder {
  width: 38px;
  height: 38px;
  background: var(--surface-primary-foreground);
  border: 1px solid var(--surface-primary-foreground-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.crossref-body {
  flex: 1;
  min-width: 0;
}
.crossref-type {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  color: var(--text-color-subtle);
  display: block;
  margin-bottom: 0.1rem;
}
.crossref-name {
  font-family: "Playfair Display", serif;
  font-size: 0.85rem;
  color: var(--surface-primary-background);
  display: block;
  line-height: 1.2;
}

/* ═══════════════════════════════════════════
   MAP
═══════════════════════════════════════════ */
.fiche-map-wrap {
  border: 1px solid var(--surface-primary-foreground-muted);
  overflow: hidden;
}
.fiche-map {
  position: relative;
  background: #0d1829;
}
.fiche-map svg {
  display: block;
  width: 100%;
  height: auto;
}
.fiche-map-pins {
  position: absolute;
  inset: 0;
}
.fiche-map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 2;
}
.fiche-map-pin-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(245, 240, 232, 0.8);
  animation: pinPulse 2.8s ease-in-out infinite;
  transition: transform 0.18s;
}
.fiche-map-pin:hover .fiche-map-pin-dot {
  transform: scale(1.5);
}
@keyframes pinPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
  }
}
.pin-residence .fiche-map-pin-dot {
  background: var(--primary-color);
}
.pin-oeuvre .fiche-map-pin-dot {
  background: var(--secondary-color);
}
.pin-memoire .fiche-map-pin-dot {
  background: #4a7ab5;
}
.pin-social .fiche-map-pin-dot {
  background: #2e7d52;
}
.fiche-map-pin-label {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-primary-background);
  border: 1px solid rgba(201, 150, 12, 0.3);
  color: var(--background-color);
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.56rem;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
  z-index: 10;
}
.fiche-map-pin:hover .fiche-map-pin-label {
  opacity: 1;
}
.map-filter-bar {
  background: rgba(13, 24, 41, 0.95);
  padding: 0.55rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(201, 150, 12, 0.15);
}
.map-filter-label {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.3);
  margin-right: 0.3rem;
}
.map-filter-btn {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.45);
  background: none;
  border: 1px solid rgba(245, 240, 232, 0.1);
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  transition: all 0.18s;
}
.map-filter-btn:hover {
  color: var(--secondary-color-strong);
  border-color: rgba(201, 150, 12, 0.35);
}
.map-filter-btn.active {
  color: var(--secondary-color);
  border-color: rgba(201, 150, 12, 0.5);
  background: rgba(201, 150, 12, 0.08);
}
.map-legend-bar {
  background: rgba(13, 24, 41, 0.85);
  padding: 0.45rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.map-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.55);
}
.map-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(245, 240, 232, 0.5);
}
.map-pin-count {
  margin-left: auto;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  color: rgba(245, 240, 232, 0.35);
}
.walk-teaser {
  background: var(--surface-primary-background);
  border-top: 1px solid rgba(201, 150, 12, 0.15);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.walk-teaser-icon {
  font-size: 1rem;
  flex-shrink: 0;
}
.walk-teaser-text {
  flex: 1;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  color: rgba(245, 240, 232, 0.55);
  line-height: 1.35;
}
.walk-teaser-text strong {
  color: var(--secondary-color);
  display: block;
  margin-bottom: 0.1rem;
  font-size: 0.72rem;
}
.walk-teaser-badge {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-color-subtle);
  border: 1px solid rgba(201, 150, 12, 0.2);
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Walk selector (multi-itinerary) */
.walk-selector {
  background: var(--surface-primary-foreground);
  border: 1px solid var(--surface-primary-foreground-strong);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.walk-selector-title {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-color-subtle);
  margin-bottom: 0.65rem;
}
.walk-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.walk-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--surface-primary-foreground-muted);
  background: var(--background-color);
  text-decoration: none;
  transition:
    border-color 0.18s,
    background 0.18s;
  cursor: pointer;
}
.walk-option:hover {
  border-color: var(--secondary-color);
  background: var(--background-color-muted);
}
.walk-option-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
}
.walk-option-body {
  flex: 1;
}
.walk-option-name {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--surface-primary-background);
  display: block;
  margin-bottom: 0.1rem;
}
.walk-option-meta {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  color: var(--text-color-subtle);
}
.walk-option-arrow {
  color: var(--secondary-color);
  font-size: 0.85rem;
}

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
.fiche-sidebar {
  position: sticky;
  top: 126px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.sidebar-block {
  background: var(--background-color);
  border: 1px solid var(--surface-primary-foreground-muted);
  border-top: 3px solid var(--secondary-color);
  padding: 1.1rem;
}
.sidebar-block-title {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-color-subtle);
  margin-bottom: 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--surface-primary-foreground-muted);
}
.sidebar-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}
.sidebar-list li {
  border-bottom: 1px solid var(--surface-primary-foreground-muted);
}
.sidebar-list li:last-child {
  border-bottom: none;
}
.sidebar-list a {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  text-decoration: none;
  padding: 0.55rem 0;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.76rem;
  color: var(--surface-primary-background);
  transition: color 0.2s;
  line-height: 1.3;
}
.sidebar-list a:hover {
  color: var(--primary-color);
}
.sidebar-list-year {
  font-family: "Playfair Display", serif;
  font-size: 0.72rem;
  color: var(--secondary-color);
  font-weight: 700;
  flex-shrink: 0;
  min-width: 32px;
}

/* Bibliography sidebar */
.bib-item {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--surface-primary-foreground-muted);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-color-muted);
}
.bib-item:last-child {
  border-bottom: none;
}
.bib-item em {
  font-style: italic;
}
.bib-item .bib-page {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  color: var(--text-color-subtle);
  display: block;
  margin-top: 0.15rem;
}
.bib-item .bib-links {
  margin-top: 0.25rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.bib-item a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.72rem;
  font-family: "Source Sans 3", sans-serif;
  letter-spacing: 0.04em;
}
.bib-item a:hover {
  text-decoration: underline;
}
.bib-more {
  display: block;
  text-align: center;
  margin-top: 0.75rem;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-color);
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(184, 40, 28, 0.3);
  transition: all 0.18s;
}
.bib-more:hover {
  background: rgba(184, 40, 28, 0.06);
}

/* External links sidebar block */
.ext-link-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--surface-primary-foreground-muted);
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.74rem;
}
.ext-link-item:last-child {
  border-bottom: none;
}
.ext-link-item a {
  color: var(--surface-primary-background-muted);
  text-decoration: none;
  transition: color 0.18s;
  font-weight: 600;
}
.ext-link-item a:hover {
  color: var(--primary-color);
}
.ext-link-item a::after {
  content: " ↗";
  font-size: 0.6rem;
  font-weight: 400;
}
.ext-link-source {
  font-size: 0.72rem;
  color: var(--text-color-subtle);
}

/* Random fiche */
.random-fiche {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  padding: 0.8rem 1rem;
  background: var(--surface-primary-foreground);
  border: 1px solid var(--surface-primary-foreground-strong);
  transition: background 0.2s;
}
.random-fiche:hover {
  background: var(--surface-primary-foreground-muted);
}
.random-fiche-icon {
  font-size: 1.1rem;
}
.random-fiche-text {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  color: var(--text-color-muted);
  line-height: 1.3;
}
.random-fiche-text strong {
  display: block;
  color: var(--surface-primary-background);
  margin-bottom: 0.1rem;
  font-size: 0.72rem;
}

/* ═══════════════════════════════════════════
   FICHE NAV (prev/next)
═══════════════════════════════════════════ */
.fiche-nav {
  background: var(--surface-primary-background);
  border-top: 1px solid rgba(201, 150, 12, 0.12);
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.fiche-nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 4rem;
  text-decoration: none;
  transition: background 0.18s;
}
.fiche-nav-item:hover {
  background: rgba(201, 150, 12, 0.05);
}
.fiche-nav-item + .fiche-nav-item {
  border-left: 1px solid rgba(201, 150, 12, 0.12);
  justify-content: flex-end;
  text-align: right;
}
.fiche-nav-dir {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-color-subtle);
  display: block;
  margin-bottom: 0.2rem;
}
.fiche-nav-title {
  font-family: "Playfair Display", serif;
  font-size: 0.88rem;
  color: var(--background-color);
  display: block;
  line-height: 1.3;
}
.fiche-nav-arrow {
  font-size: 1.1rem;
  color: var(--secondary-color);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .fiche-body,
  .fiche-body-base {
    grid-template-columns: 1fr;
    padding: 1.75rem 1.5rem;
  }
  .fiche-sidebar {
    position: static;
  }
  .person-header-base-inner {
    padding: 1.75rem 1.5rem;
    gap: 1.5rem;
  }
  .person-header-enriched {
    padding: 2rem 1.5rem 0;
  }
  .person-header-enriched-inner {
    grid-template-columns: 140px 1fr;
    gap: 1.5rem;
  }
  .person-portrait,
  .portrait-gallery-wrap,
  .portrait-placeholder,
  .portrait-oval-wrap {
    width: 140px;
  }
  .portrait-main {
    width: 140px;
    height: 180px;
  }
  .person-portrait {
    height: 180px;
  }
  .breadcrumb {
    padding: 0.6rem 1.5rem;
  }
  .fiche-nav-item {
    padding: 1rem 1.5rem;
  }
  .crossref-grid {
    grid-template-columns: 1fr;
  }
  nav {
    display: none;
  }
  .person-name {
    font-size: 2.2rem;
  }
}
@media (max-width: 600px) {
  .person-header-enriched-inner {
    grid-template-columns: 1fr;
  }
  .portrait-gallery-wrap,
  .portrait-oval-wrap,
  .portrait-placeholder {
    width: 100%;
  }
  .portrait-main {
    width: 100%;
    height: 220px;
  }
  .portrait-oval {
    width: 130px;
    height: 160px;
  }
  .person-vitals {
    gap: 1rem;
  }
}
