/* ============ PALETTE ============ */
:root {
  --max-w: 1160px;

  /* Tag semantic colors — from design decisions log */
  --tag-date: #6b6560;
}

/* ============ HEADER ============ */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  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);
}
nav a.active {
  color: var(--secondary-color);
}

/* ============ DEMO SWITCHER ============ */
.demo-switcher {
  position: fixed;
  top: 94px;
  left: 0;
  right: 0;
  z-index: 199;
  background: var(--menu-background-color, var(--text-color-strong));
  border-bottom: 1px solid rgba(201, 150, 12, 0.25);
  display: flex;
  align-items: center;
  padding: 0 2.5rem;
  height: 46px;
  gap: 0;
}
.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.3);
  margin-right: 1.5rem;
  white-space: nowrap;
}
.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.45);
  padding: 0 1.1rem;
  height: 46px;
  display: flex;
  align-items: center;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  background: none;
  white-space: nowrap;
  transition:
    color 0.2s,
    border-color 0.2s;
}
.demo-tab:hover {
  color: rgba(245, 240, 232, 0.75);
}
.demo-tab.active {
  color: var(--secondary-color);
  border-bottom-color: var(--secondary-color);
}
.demo-tab-div {
  width: 1px;
  height: 14px;
  background: rgba(245, 240, 232, 0.1);
}

/* ============ BREADCRUMB ============ */
.breadcrumb {
  background: var(--surface-primary-background);
  padding: 0.55rem 4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: rgba(245, 240, 232, 0.6);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb-sep {
  color: rgba(245, 240, 232, 0.35);
  font-size: 0.72rem;
}
.breadcrumb-current {
  color: var(--secondary-color);
}

/* ============ FICHE PAGE WRAPPER ============ */
.fiche-page {
  padding-top: 142px;
  display: none;
}
.fiche-page.active {
  display: block;
}

/* ============ EVENT HEADER ============ */
.event-header {
  background: var(--surface-primary-background);
  position: relative;
  overflow: hidden;
}
.event-header::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;
}
.event-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 4rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2.5rem;
  align-items: start;
  position: relative;
  z-index: 1;
}

/* ── DATE BLOCK — equalized, all elements readable ── */
.event-date-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  padding: 0.85rem 0.75rem;
  border: 1px solid rgba(201, 150, 12, 0.3);
  background: rgba(201, 150, 12, 0.05);
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.event-date-block:hover {
  border-color: rgba(201, 150, 12, 0.55);
  background: rgba(201, 150, 12, 0.1);
}
.event-date-day {
  font-family: "Playfair Display", serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--secondary-color);
  line-height: 1;
}
.event-date-month {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.8);
  margin-top: 0.15rem;
}
.event-date-year {
  font-family: "Playfair Display", serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(245, 240, 232, 0.85);
  margin-top: 0.3rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(201, 150, 12, 0.2);
}
/* Hover tooltip */
.event-date-tooltip {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(201, 150, 12, 0.5);
  margin-top: 0.4rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.event-date-block:hover .event-date-tooltip {
  opacity: 1;
}

/* Meta area */
.event-meta {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.event-type-badge {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.55);
  position: relative;
  padding-left: 1rem;
}
.event-type-badge::before {
  content: "◆";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-size: 0.62rem;
}
.event-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.5rem, 2.8vw, 2.5rem);
  font-weight: 700;
  color: var(--background-color);
  line-height: 1.2;
  max-width: 640px;
}
.event-subtitle {
  font-family: "EB Garamond", serif;
  font-size: 1.05rem;
  font-style: italic;
  color: rgba(245, 240, 232, 0.65);
  margin-top: 0.1rem;
}

/* ── TAG GROUPS — semantic colors from design log ── */
.tag-groups {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.65rem;
}
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.tag-group-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.4);
  margin-right: 0.25rem;
  width: 42px;
  flex-shrink: 0;
}
.ftag {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
  text-decoration: none;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: rgba(245, 240, 232, 0.85);
}
/* Date — grey */
.ftag-date {
  background: var(--tag-date-bg);
  border: 1px solid var(--tag-date-border);
  color: var(--tag-date-text);
}
.ftag-date:hover {
  background: var(--tag-date-hover-bg);
}
/* Époque — blue (#1A2A42) */
.ftag-epoque {
  background: var(--tag-epoque-bg-strong);
  border: 1px solid var(--tag-epoque-border);
}
.ftag-epoque:hover {
  background: var(--tag-epoque-hover-bg);
}
/* Thème — brown/orange (#6B3A10) */
.ftag-theme {
  background: var(--tag-theme-bg-strong);
  border: 1px solid var(--tag-theme-border);
}
.ftag-theme:hover {
  background: var(--tag-theme-hover-bg);
}
/* Quartier — green (#1A3D22), arrondissement is brighter */
.ftag-arrond {
  background: var(--tag-arrond-bg);
  border: 1px solid var(--tag-arrond-border);
}
.ftag-arrond:hover {
  background: var(--tag-arrond-hover-bg);
}
.ftag-quartier {
  background: var(--tag-quartier-bg-strong);
  border: 1px solid var(--tag-quartier-border);
}
.ftag-quartier:hover {
  background: var(--tag-quartier-hover-bg);
}
/* Lieu — dark (#3A3530) */
.ftag-lieu {
  background: var(--tag-lieu-bg);
  border: 1px solid var(--tag-lieu-border);
}
.ftag-lieu:hover {
  background: var(--tag-lieu-hover-bg);
}
.ftag-voie { background: rgba(92,82,70,0.22); }
.ftag-voie:hover { background: rgba(92,82,70,0.38); }

/* ============ ACTION BAR — share + error ============ */
.action-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--surface-primary-foreground-muted);
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-color-subtle);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--surface-primary-foreground-muted);
  background: var(--background-color);
  cursor: pointer;
  transition: all 0.18s;
}
.action-btn:hover {
  border-color: var(--surface-primary-foreground-strong);
  color: var(--surface-primary-background);
  background: var(--background-color-muted);
}
.action-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}
.action-sep {
  flex: 1;
}

/* ============ MAIN BODY LAYOUT ============ */
.fiche-body {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 4rem 3rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3.5rem;
  align-items: start;
}
.fiche-main {
  min-width: 0;
}

/* Address bar */
.address-bar {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.75rem 1rem;
  background: var(--surface-primary-foreground);
  border-left: 3px solid var(--secondary-color);
  margin-bottom: 1.25rem;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.82rem;
  color: var(--surface-primary-background);
}
.address-bar-icon {
  color: var(--primary-color);
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.address-bar a {
  color: var(--surface-primary-background);
  text-decoration: none;
  border-bottom: 1px solid var(--surface-primary-foreground-muted);
  transition: border-color 0.2s;
}
.address-bar a:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}
.address-bar-type {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-color-subtle);
  margin-left: auto;
  flex-shrink: 0;
}
.address-bar-content {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* Historical address annotation — only rendered when address differs from modern */
.address-historical {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: var(--text-color-muted);
  padding-top: 0.25rem;
}
.address-historical-icon {
  font-size: 0.7rem;
  flex-shrink: 0;
}
.address-historical em {
  font-style: italic;
  color: var(--surface-primary-background-muted);
}
.address-historical-note {
  font-size: 0.72rem;
  color: var(--text-color-subtle);
  font-style: italic;
}

/* Old map toggle in sidebar */
.sidebar-map-layers {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--surface-primary-foreground-muted);
}
.map-layer-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  color: var(--text-color-muted);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 1px solid var(--surface-primary-foreground-muted);
  transition:
    background 0.15s,
    color 0.15s;
  width: 100%;
  text-align: left;
}
.map-layer-btn:last-child {
  border-bottom: none;
}
.map-layer-btn:hover {
  background: var(--background-color-muted);
  color: var(--surface-primary-background);
}
.map-layer-btn.active {
  background: rgba(201, 150, 12, 0.08);
  color: var(--surface-primary-background);
  font-weight: 600;
}
.map-layer-btn .layer-icon {
  font-size: 0.75rem;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}
.map-layer-btn .layer-label {
  flex: 1;
}
.map-layer-btn .layer-date {
  font-size: 0.72rem;
  color: var(--text-color-subtle);
  letter-spacing: 0.05em;
}

/* Section styles */
.fiche-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--surface-primary-foreground-muted);
}
.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(--primary-color);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.fiche-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--surface-primary-foreground-muted), transparent);
}

.fiche-text {
  font-size: 1.12rem;
  line-height: 1.88;
  color: var(--text-color);
}
.fiche-text p {
  margin-bottom: 1.2rem;
}
.fiche-text p:last-child {
  margin-bottom: 0;
}
.fiche-text a {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 40, 28, 0.25);
  transition: border-color 0.2s;
}
.fiche-text a:hover {
  border-color: var(--primary-color);
}

/* ── FIGURE — main image with optional gallery strip ── */
.fiche-figure {
  float: right;
  width: 280px;
  margin: 0 0 1.5rem 2rem;
}
.fiche-figure-main {
  position: relative;
  cursor: pointer;
}
.fiche-figure-main img {
  width: 100%;
  display: block;
  filter: sepia(20%) contrast(1.05);
  border: 1px solid var(--surface-primary-foreground-muted);
}
.fiche-figure figcaption {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  color: var(--text-color-subtle);
  line-height: 1.4;
  padding: 0.55rem 0 0.4rem;
}
.fiche-figure .fig-credit {
  display: block;
  font-size: 0.72rem;
  color: var(--text-color-subtle);
  margin-top: 0.15rem;
  font-style: italic;
}

/* Thumbnail strip for 3+ images */
.fig-thumbnails {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.fig-thumb {
  width: 52px;
  height: 40px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.18s;
  flex-shrink: 0;
}
.fig-thumb.active {
  border-color: var(--secondary-color);
}
.fig-thumb:hover {
  border-color: var(--surface-primary-foreground-strong);
}
.fig-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(20%) contrast(1.05);
}

/* Secondary figure — left float */
.fiche-figure-secondary {
  float: left;
  width: 220px;
  margin: 0.5rem 2rem 1.5rem 0;
}
.fiche-figure-secondary img {
  width: 100%;
  display: block;
  filter: sepia(20%) contrast(1.05);
  border: 1px solid var(--surface-primary-foreground-muted);
}
.fiche-figure-secondary figcaption {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  color: var(--text-color-subtle);
  line-height: 1.35;
  padding: 0.45rem 0;
}

/* ============ 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 map */
.sidebar-map {
  border: 1px solid var(--surface-primary-foreground-muted);
  overflow: hidden;
}
.sidebar-map-canvas {
  width: 100%;
  height: 200px;
  background: #0d1829;
  position: relative;
  overflow: hidden;
}
.sidebar-map-canvas svg {
  width: 100%;
  height: 100%;
}
.sidebar-map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 2;
}
.sidebar-map-pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 2.5px solid rgba(245, 240, 232, 0.8);
  animation: pinPulse 2.8s ease-in-out infinite;
}
@keyframes pinPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(184, 40, 28, 0.35);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(184, 40, 28, 0);
  }
}
.sidebar-map-label {
  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.72rem;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.65rem;
  text-align: center;
}
.sidebar-map-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem;
  background: var(--background-color-muted);
  border-top: 1px solid var(--surface-primary-foreground-muted);
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-color-muted);
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
  text-decoration: none;
}
.sidebar-map-expand:hover {
  background: var(--surface-primary-foreground);
  color: var(--surface-primary-background);
}

.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;
}

.bib-item {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--surface-primary-foreground-muted);
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-color-muted);
}
.bib-item:last-child {
  border-bottom: none;
}
.bib-item em {
  font-style: italic;
}

/* Clickable bib entry */
.bib-link {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--text-color-muted);
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--surface-primary-foreground-muted);
  font-size: 0.8rem;
  line-height: 1.4;
  transition: color 0.18s;
}
.bib-link:last-of-type {
  border-bottom: none;
}
.bib-link:hover {
  color: var(--primary-color);
}
.bib-link:hover .bib-arrow {
  color: var(--primary-color);
  opacity: 1;
}
.bib-link em {
  font-style: italic;
}
.bib-arrow {
  flex-shrink: 0;
  margin-left: auto;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  color: var(--text-color-subtle);
  opacity: 0.5;
  transition:
    color 0.18s,
    opacity 0.18s;
}

.bib-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0 0;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-color-subtle);
  cursor: pointer;
  border: none;
  background: none;
  transition: color 0.2s;
}
.bib-toggle:hover {
  color: var(--primary-color);
}
.bib-toggle .arrow {
  transition: transform 0.25s;
  display: inline-block;
  font-size: 0.62rem;
}
.bib-toggle.open .arrow {
  transform: rotate(180deg);
}
.bib-hidden {
  display: none;
}
.bib-hidden.show {
  display: block;
}

.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;
}

/* ============ PERSONNAGE CHIPS ============ */
.personnage-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.personnage-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  padding: 0.45rem 0.85rem 0.45rem 0.45rem;
  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);
}
.personnage-chip:hover {
  border-left-color: var(--secondary-color);
  background: var(--background-color-muted);
}
.personnage-chip-avatar {
  width: 36px;
  height: 36px;
  background: var(--surface-primary-background);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(201, 150, 12, 0.2);
  overflow: hidden;
  font-family: "Playfair Display", serif;
  font-size: 0.78rem;
  font-weight: 900;
  color: rgba(201, 150, 12, 0.45);
}
.personnage-chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(25%) contrast(1.05);
}
/* When avatar has an image, reset the dark background */
.personnage-chip-avatar:has(img) {
  background: var(--surface-primary-foreground);
  border-color: var(--surface-primary-foreground-muted);
}
.personnage-chip-name {
  font-family: "Playfair Display", serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--surface-primary-background);
  line-height: 1.2;
}
.personnage-chip-role {
  display: block;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-color-subtle);
}

/* ============ RELATED FICHES — subtler placeholders ============ */
.related-section {
  background: var(--surface-primary-foreground);
  border-top: 1px solid var(--surface-primary-foreground-muted);
  padding: 2.5rem 0;
}
.related-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 4rem;
}
.related-title {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.related-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--surface-primary-foreground-muted), transparent);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.related-card {
  background: var(--background-color);
  border: 1px solid var(--surface-primary-foreground-muted);
  text-decoration: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.related-card:hover {
  border-color: var(--secondary-color);
  box-shadow: 0 2px 12px rgba(26, 42, 66, 0.08);
}

/* Card WITH image */
.related-card-img {
  width: 100%;
  height: 120px;
  overflow: hidden;
  position: relative;
}
.related-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(25%) contrast(1.05);
  transition: transform 0.3s;
}
.related-card:hover .related-card-img img {
  transform: scale(1.04);
}

/* Card WITHOUT image — no big blue block, just a thin accent bar */
.related-card-noimg {
  border-top: 3px solid var(--secondary-color);
}

.related-card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.related-card-date {
  font-family: "Playfair Display", serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 0.25rem;
}
.related-card-title {
  font-family: "Playfair Display", serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--surface-primary-background);
  line-height: 1.3;
  margin-bottom: 0.5rem;
}
.related-card-reason {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  color: var(--text-color-subtle);
  line-height: 1.4;
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px solid var(--surface-primary-foreground-muted);
}
.related-card-reason strong {
  color: var(--text-color-muted);
  font-weight: 600;
}

.ai-attribution {
  margin-top: 1rem;
  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;
  gap: 0.4rem;
}
.ai-attribution-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-color-subtle);
}

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

/* ============ FICHE NAV ============ */
.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) {
  header {
    padding: 0 1.25rem;
  }
  nav {
    display: none;
  }
  .breadcrumb {
    padding: 0.55rem 1.5rem;
    font-size: 0.72rem;
  }
  .event-header-inner {
    padding: 1.5rem;
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
  }
  .event-date-block {
    min-width: 72px;
    padding: 0.65rem 0.5rem;
  }
  .event-date-day {
    font-size: 1.5rem;
  }
  .event-title {
    font-size: 1.35rem;
  }
  .event-subtitle {
    font-size: 1.05rem;
  }
  .event-type-badge {
    font-size: 0.72rem;
  }
  .tag-group-label {
    display: none;
  }
  .tag-groups {
    gap: 0.3rem;
  }
  .tag-group {
    gap: 0.25rem;
  }
  .ftag {
    font-size: 0.72rem;
    height: 24px;
    line-height: 24px;
    padding: 0 0.5rem;
  }

  .fiche-body {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 2rem;
  }
  .fiche-sidebar {
    position: static;
    order: 2;
  }
  .fiche-main {
    order: 1;
  }
  .fiche-figure {
    float: none;
    width: 100%;
    margin: 0 0 1.5rem 0;
  }
  .fiche-figure-secondary {
    float: none;
    width: 100%;
    margin: 0 0 1.5rem 0;
  }

  /* Mobile text size bumps */
  .fiche-text {
    font-size: 1.15rem;
    line-height: 1.85;
  }
  .address-bar {
    font-size: 0.88rem;
  }
  .address-bar-type {
    font-size: 0.72rem;
  }
  .action-btn {
    font-size: 0.72rem;
    padding: 0.4rem 0.75rem;
  }
  .fiche-section-title {
    font-size: 0.72rem;
  }
  .stub-notice-text {
    font-size: 0.88rem;
  }
  .stub-notice-text strong {
    font-size: 0.92rem;
  }
  .personnage-chip-name {
    font-size: 0.9rem;
  }
  .personnage-chip-role {
    font-size: 0.72rem;
  }
  .sidebar-block-title {
    font-size: 0.72rem;
  }
  .bib-item {
    font-size: 0.88rem;
  }
  .bib-link {
    font-size: 0.88rem;
  }
  .bib-toggle {
    font-size: 0.72rem;
  }
  .related-card-title {
    font-size: 1rem;
  }
  .related-card-date {
    font-size: 0.78rem;
  }
  .related-card-reason {
    font-size: 0.72rem;
  }
  .fiche-nav-title {
    font-size: 0.92rem;
  }
  .fiche-nav-dir {
    font-size: 0.72rem;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
  .related-inner {
    padding: 0 1.5rem;
  }

  .fiche-nav {
    grid-template-columns: 1fr;
  }
  .fiche-nav-item {
    padding: 0.85rem 1.5rem;
  }
  .fiche-nav-item + .fiche-nav-item {
    border-left: none;
    border-top: 1px solid rgba(201, 150, 12, 0.12);
    justify-content: flex-start;
    text-align: left;
  }
  .personnage-chips {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .event-header-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .event-date-block {
    flex-direction: row;
    align-items: baseline;
    gap: 0.35rem;
    justify-self: center;
    padding: 0.6rem 1.2rem;
    min-width: auto;
  }
  .event-date-block .event-date-tooltip {
    display: none;
  }
  .event-date-day {
    font-size: 1.5rem;
  }
  .event-date-month {
    margin-top: 0;
    font-size: 0.72rem;
  }
  .event-date-year {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    border-left: 1px solid rgba(201, 150, 12, 0.25);
    padding-left: 0.45rem;
    margin-left: 0.1rem;
    font-size: 1.05rem;
  }
  .event-type-badge {
    justify-content: center;
  }
  .event-title {
    font-size: 1.35rem;
  }
  .tag-groups {
    align-items: center;
  }
  .tag-group {
    justify-content: center;
  }
}

/* ── Share dropdown ── */
.share-dropdown {
  position: relative;
  display: inline-block;
}
.share-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: var(--background-color);
  border: 1px solid var(--surface-primary-foreground-muted);
  box-shadow: var(--shadow-card-1);
  z-index: 20;
  min-width: 160px;
}
.share-menu.show {
  display: block;
}
.share-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  color: var(--text-color-muted);
  text-decoration: none;
  transition: background 0.15s;
}
.share-menu a:hover {
  background: var(--background-color-muted);
  color: var(--surface-primary-background);
}
