
/* ── Hero (page hub uniquement) — même hauteur fixe et même alignement gauche que .fiche-hero pour éviter le "saut" entre pages ── */
.lore-hero {
  position: relative;
  max-width: none;
  margin: 0;
  background: #120000;
  overflow: hidden;
  height: 250px;
  display: flex;
  align-items: flex-end;
}

.lore-hero .hero-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.lore-hero .hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(2px) brightness(0.7) saturate(0.9);
}

.lore-hero .hero-video-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: linear-gradient(to top, #120000, transparent);
  pointer-events: none;
}

.lore-hero .hero-content {
  position: relative;
  z-index: 1;
  padding: 0 2.5rem 1.6rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.lore-hero .hub-title {
  font-family: 'MedievalSharp', cursive;
  font-size: 2.2rem;
  color: #a78a7f;
  letter-spacing: 2px;
  margin-bottom: 0.4rem;
}


/* ===== LAYOUT PRINCIPAL — sidebar + contenu ===== */
.lore-wrap {
  max-width: 1400px;
  margin: 0 auto;
  margin-top: 80px;
  padding: 3rem 2rem 5rem;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* ── Sidebar nav arborescente ── */
.lore-sidebar {
  position: sticky;
  top: 5.5rem;
  background: rgba(30, 15, 12, 0.55);
  border: 1px solid rgba(180, 140, 100, 0.18);
  border-radius: 10px;
  padding: 1.3rem 1.1rem;
}

.lore-back-link {
  display: block;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #a89080;
  text-decoration: none;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.9rem;
  border: 1px solid rgba(180, 140, 100, 0.25);
  border-radius: 8px;
  transition: border-color 0.2s, color 0.2s;
}

.lore-back-link:hover {
  border-color: var(--gold);
  color: #e8dcc8;
}

.lore-sidebar-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
  text-align: center;
}

.lore-tree {
  list-style: none;
}

.lore-tree > li {
  margin-bottom: 0.9rem;
}

.lore-tree-cat {
  font-family: var(--font-title);
  font-size: 0.8rem;
  color: #d68b57;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(180, 140, 100, 0.15);
}

.lore-tree ul {
  list-style: none;
  padding-left: 0.4rem;
}

.lore-tree ul li {
  margin-bottom: 0.25rem;
}

.lore-tree a {
  display: block;
  padding: 0.3rem 0.5rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: #cbb8a2;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.2s, color 0.2s;
}

.lore-tree a:hover,
.lore-tree a.active {
  background: rgba(106, 120, 95, 0.2);
  color: #e8dcc8;
}

.lore-tree a.stub {
  color: #8a7364;
  font-style: italic;
  cursor: default;
  pointer-events: none;
}

/* ── Contenu principal ── */
.lore-content {
  min-width: 0;
}

.lore-card {
  background: rgba(60, 30, 40, 0.4);
  border: 1px solid rgba(180, 140, 100, 0.18);
  border-radius: 10px;
  padding: 2rem 2.2rem;
  margin-bottom: 2rem;
}

.lore-card::after {
  content: '';
  display: table;
  clear: both;
}

.lore-card h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold);
  letter-spacing: 1px;
  margin-bottom: 0;
}

.lore-divider {
  display: flex;
  align-items: center;
  max-width: 320px;
  margin: 0.7rem auto 1.4rem;
  gap: 0;
}

.lore-divider::before,
.lore-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180, 140, 100, 0.5), rgba(212, 168, 67, 0.3));
}

.lore-divider::after {
  background: linear-gradient(90deg, rgba(212, 168, 67, 0.3), rgba(180, 140, 100, 0.5), transparent);
}

.lore-divider span {
  color: rgba(212, 168, 67, 0.5);
  font-size: 0.65rem;
  padding: 0 0.6rem;
}

.lore-card h3 {
  font-family: var(--font-title);
  font-size: 1.05rem;
  color: #d68b57;
  margin: 1.4rem 0 0.6rem;
}

.lore-card p {
  font-family: var(--font-body);
  color: #cbb8a2;
  line-height: 1.85;
  margin-bottom: 1rem;
  font-size: 1.02rem;
}

.lore-card p:last-child { margin-bottom: 0; }

.lore-card a { color: #d68b57; }

/* ── Fiche façon encyclopédie : chapô + infobox en marginalia ── */
.fiche-header {
  /* conteneur simple, l'infobox flotte à droite et le texte s'écoule autour */
}

.fiche-chapo {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.08rem;
  color: #e8dcc8;
  line-height: 1.8;
  border-left: 3px solid var(--gold);
  padding-left: 1rem;
}

.fiche-infobox {
  float: right;
  width: 290px;
  margin: 0 0 1.2rem 2rem;
  background: rgba(20, 10, 8, 0.55);
  border: 1px solid rgba(180, 140, 100, 0.3);
  border-radius: 10px;
  overflow: hidden;
}

.fiche-infobox img {
  width: 100%;
  display: block;
  object-fit: contain;
  background: rgba(0,0,0,0.25);
  padding: 1rem;
}

.fiche-infobox-body {
  padding: 1rem 1.2rem;
}

.fiche-infobox-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(180, 140, 100, 0.12);
  font-family: var(--font-body);
  font-size: 0.88rem;
}

.fiche-infobox-row:last-child { border-bottom: none; }

.fiche-infobox-label {
  color: #a89080;
  flex-shrink: 0;
}

.fiche-infobox-value {
  color: #e8dcc8;
  text-align: right;
  min-width: 0;
  overflow-wrap: break-word;
}

@media (max-width: 720px) {
  .fiche-infobox { float: none; width: 100%; margin: 0 0 1.2rem; }
}

.lore-quote {
  border-left: 3px solid var(--gold);
  padding-left: 1.2rem;
  font-family: var(--font-body);
  font-style: italic;
  color: #cbb8a2;
}

.lore-quote p {
  margin-bottom: 0.9rem;
  line-height: 1.75;
}

.lore-quote-signature {
  color: #a89080;
  font-size: 0.9rem;
}

.lore-quote-inline {
  border-left: 3px solid var(--gold);
  padding-left: 1.2rem;
  margin: 1rem 0;
  font-family: var(--font-body);
  font-style: italic;
  color: #e8dcc8;
}

.lore-chapter {
  background: rgba(60, 30, 40, 0.4);
  border: 1px solid rgba(180, 140, 100, 0.18);
  border-radius: 10px;
  margin-bottom: 1.2rem;
  overflow: hidden;
}

.lore-chapter summary {
  cursor: pointer;
  list-style: none;
  padding: 1.2rem 1.6rem;
  font-family: var(--font-title);
  font-size: 1.05rem;
  color: var(--gold);
  letter-spacing: 0.5px;
  position: relative;
  transition: background 0.2s;
}

.lore-chapter summary::-webkit-details-marker { display: none; }

.lore-chapter summary::after {
  content: '+';
  position: absolute;
  right: 1.6rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--gold);
}

.lore-chapter[open] summary::after {
  content: '−';
}

.lore-chapter summary:hover {
  background: rgba(106, 120, 95, 0.12);
}

.lore-chapter-body {
  padding: 0 1.6rem 1.6rem;
  border-top: 1px solid rgba(180, 140, 100, 0.15);
}

.lore-chapter-body p {
  font-family: var(--font-body);
  color: #cbb8a2;
  line-height: 1.8;
  margin: 1rem 0;
  font-size: 0.98rem;
}

.lore-chapter-body h4 {
  font-family: var(--font-title);
  color: #d68b57;
  font-size: 0.95rem;
  margin-top: 1.4rem;
}

/* ===== BOOK VIEWER (page tournée, en test) ===== */
.book-viewer { padding: 0; }

.book-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem 2rem;
  border-bottom: 1px solid rgba(180, 140, 100, 0.2);
  flex-wrap: wrap;
}

.book-nav-btn {
  background: rgba(20, 10, 8, 0.5);
  border: 1px solid rgba(180, 140, 100, 0.35);
  color: #cbb8a2;
  font-family: var(--font-title);
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  padding: 0.55rem 1.2rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.book-nav-btn:hover:not(:disabled) {
  border-color: var(--gold);
  color: #e8dcc8;
  background: rgba(106, 120, 95, 0.2);
}

.book-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.book-page-select {
  background: rgba(20, 10, 8, 0.5);
  border: 1px solid rgba(180, 140, 100, 0.35);
  color: #e8dcc8;
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 0.55rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  max-width: 100%;
  text-overflow: ellipsis;
  transition: border-color 0.2s;
}

.book-page-select:hover,
.book-page-select:focus {
  border-color: var(--gold);
  outline: none;
}

.book-page-select option {
  background: #241612;
  color: #e8dcc8;
}

.book-pages {
  padding: 2rem 2.2rem 2.4rem;
  min-height: 200px;
}

.book-page {
  display: none;
  animation: book-page-in 0.35s ease;
}

.book-page.active {
  display: block;
}

@keyframes book-page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.book-page h3 {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1.3rem;
  letter-spacing: 0.5px;
  margin-bottom: 1.2rem;
}

.book-page h4 {
  font-family: var(--font-title);
  color: #d68b57;
  font-size: 0.95rem;
  margin-top: 1.4rem;
  margin-bottom: 0.4rem;
}

.book-page p {
  font-family: var(--font-body);
  color: #cbb8a2;
  line-height: 1.8;
  margin: 1rem 0;
  font-size: 0.98rem;
}

.book-page ul {
  list-style: none;
  margin: 0.8rem 0 1.2rem;
  padding: 0;
}

.book-page ul li {
  font-family: var(--font-body);
  color: #cbb8a2;
  line-height: 1.7;
  font-size: 0.98rem;
  padding-left: 1.4rem;
  position: relative;
  margin-bottom: 0.5rem;
}

.book-page ul li::before {
  content: '◆';
  position: absolute;
  left: 0;
  top: 0.05rem;
  color: var(--gold);
  font-size: 0.65rem;
}

/* ===== Table des matières in-univers (Compendium, Prospectus...) ===== */
.toc-box {
  border-radius: 10px;
  padding: 1.3rem 1.6rem;
  margin: 1.2rem 0 1.6rem;
  width: 50%;
}

@media (max-width: 720px) {
  .toc-box { width: 100%; }
}

.toc-title {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  text-align: center;
  margin-bottom: 0.3rem;
}

.toc-note {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.8rem;
  color: #a89080;
  text-align: center;
  margin-bottom: 0.9rem;
}

.toc-list {
  list-style: none;
}

.toc-entry {
  padding: 0.55rem 0;
  border-top: 1px solid rgba(180, 140, 100, 0.15);
}

.toc-entry:first-child { border-top: none; padding-top: 0; }

.toc-chapter {
  display: block;
  font-family: var(--font-title);
  color: #d68b57;
  font-size: 0.88rem;
  letter-spacing: 0.3px;
  margin-bottom: 0.25rem;
}

.toc-desc {
  display: block;
  font-family: var(--font-body);
  color: #cbb8a2;
  font-size: 0.85rem;
  line-height: 1.5;
}

.toc-sub {
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0;
  counter-reset: toc-sub;
}

.toc-sub li {
  font-family: var(--font-body);
  color: #cbb8a2;
  font-size: 0.85rem;
  line-height: 1.55;
  padding-left: 1.3rem;
  position: relative;
  counter-increment: toc-sub;
}

.toc-sub li::before {
  content: counter(toc-sub) '.';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 0.8rem;
}

.book-nav-bottom {
  display: flex;
  justify-content: space-between;
  padding: 0 2.2rem 2rem;
}

@media (max-width: 600px) {
  .book-nav-top { flex-direction: column; text-align: center; }
}

/* ===== DOUBLE TIMELINE ===== */
.timeline-tabs {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.timeline-tab-btn {
  background: rgba(60, 30, 40, 0.5);
  border: 1px solid rgba(180, 140, 100, 0.25);
  color: #cbb8a2;
  font-family: var(--font-title);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  padding: 0.55rem 1.3rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s;
}

.timeline-tab-btn.active,
.timeline-tab-btn:hover {
  background: rgba(106, 120, 95, 0.3);
  border-color: var(--gold);
  color: #e8dcc8;
}

.timeline-panel { display: none; }
.timeline-panel.active { display: block; }

.timeline-list {
  list-style: none;
  position: relative;
  padding-left: 1.6rem;
}

.timeline-list::before {
  content: '';
  position: absolute;
  left: 0.35rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: rgba(180, 140, 100, 0.25);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.4rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.6rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(20,10,8,0.8);
}

.timeline-date {
  font-family: var(--font-title);
  font-size: 0.82rem;
  color: #d68b57;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.2rem;
}

.timeline-latest-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.7rem;
  color: var(--gold);
  background: rgba(212, 168, 67, 0.12);
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 10px;
  padding: 1px 9px;
  margin-bottom: 0.35rem;
}

.timeline-text {
  font-family: var(--font-body);
  color: #cbb8a2;
  font-size: 0.98rem;
  line-height: 1.6;
}

/* ===== Frise enrichie : tags, liens, révélation au scroll ===== */
.timeline-list.timeline-rich .timeline-item {
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-list.timeline-rich .timeline-item.in-view {
  opacity: 1;
  transform: translateX(0);
}

.timeline-tag {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 0.66rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
  margin-bottom: 0.4rem;
  color: #cbb8a2;
  background: rgba(180, 140, 100, 0.12);
  border: 1px solid rgba(180, 140, 100, 0.25);
}

.timeline-tag.tag-avatar { color: #d68b57; border-color: rgba(214, 139, 87, 0.4); background: rgba(214, 139, 87, 0.1); }
.timeline-tag.tag-overlay { color: #9fb08c; border-color: rgba(106, 120, 95, 0.4); background: rgba(106, 120, 95, 0.15); }
.timeline-tag.tag-site { color: var(--gold); border-color: rgba(167, 138, 127, 0.4); background: rgba(167, 138, 127, 0.12); }
.timeline-tag.tag-anomalie { color: #c96a4f; border-color: rgba(201, 106, 79, 0.4); background: rgba(201, 106, 79, 0.12); }

.timeline-link {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-title);
  font-size: 0.76rem;
  color: #a89080;
  text-decoration: none;
  width: fit-content;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.timeline-link:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

@media (prefers-reduced-motion: reduce) {
  .timeline-list.timeline-rich .timeline-item {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== Brique vidéo/audio d'intro ===== */
.lore-voice-teaser {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(20, 10, 8, 0.45);
  border: 1px dashed rgba(180, 140, 100, 0.35);
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
}

.lore-voice-teaser-icon { font-size: 1.8rem; }

.lore-voice-teaser p {
  font-family: var(--font-body);
  color: #a89080;
  font-size: 0.92rem;
  margin: 0;
}

.lore-teaser-title {
  font-family: var(--font-title);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
  text-align: center;
  margin-bottom: 1rem;
}

.teaser-list {
  list-style: none;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.6rem;
}

.teaser-list li {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: #cbb8a2;
  padding-left: 1.2rem;
  position: relative;
}

.teaser-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 0.75rem;
}

.teaser-list strong { color: #e8dcc8; }

.teaser-note {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.8rem;
  color: #8a7364;
  margin-top: 0.9rem;
  text-align: center;
}

/* ===== Liens rapides Archives/Bestiaire/Registre ===== */
.lore-quicklinks {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.lore-quicklinks .hub-quest-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: rgba(60, 30, 40, 0.5);
  border: 1px solid rgba(180, 140, 100, 0.2);
  border-radius: 8px;
  color: #e8dcc8;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all 0.3s;
}

.lore-quicklinks .hub-quest-btn:hover {
  background: rgba(106, 120, 95, 0.25);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.lore-quicklinks .hub-quest-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: 0.8;
  flex-shrink: 0;
}

/* ===== Liste de lieux (stub) ===== */
.lieux-stub-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

.lieux-stub-list li {
  font-family: var(--font-body);
  color: #8a7364;
  font-style: italic;
  font-size: 0.92rem;
  padding: 0.4rem 0.7rem;
  background: rgba(20,10,8,0.35);
  border-radius: 6px;
}

@media (max-width: 860px) {
  .lore-wrap { grid-template-columns: 1fr; }
  .lore-sidebar { position: static; }
}

/* ===== FICHE HERO (header de page, pages internes du grimoire) ===== */
.fiche-hero {
  position: relative;
  height: 250px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #120000;
}

.fiche-hero-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.fiche-hero-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fiche-hero-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #120000 5%, rgba(18,0,0,0.55) 55%, rgba(18,0,0,0.15) 100%);
}

.fiche-hero-content {
  position: relative;
  z-index: 1;
  padding: 0 2.5rem 1.6rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.fiche-hero-badge {
  display: inline-block;
  background: rgba(20, 10, 8, 0.65);
  border: 1px solid rgba(180, 140, 100, 0.4);
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 0.6rem;
}

.fiche-hero-title {
  font-family: var(--font-body);
  font-size: 2.2rem;
  color: #a78a7f;
  letter-spacing: 1px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

/* ===== PREVIEW CARD (cross-références vers d'autres pages du grimoire) ===== */
.lore-preview-card {
  display: block;
  text-decoration: none;
  background: rgba(20, 10, 8, 0.4);
  border: 1px solid rgba(180, 140, 100, 0.25);
  border-radius: 12px;
  overflow: hidden;
  margin: 1rem 0;
  max-width: 420px;
  transition: border-color 0.25s, transform 0.25s;
}

.lore-preview-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.lore-preview-cover {
  position: relative;
  height: 120px;
  background-size: cover;
  background-position: center;
}

.lore-preview-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20,10,8,0.95), transparent 75%);
}

.lore-preview-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  background: rgba(20, 10, 8, 0.7);
  border: 1px solid rgba(180, 140, 100, 0.4);
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 4px;
}

.lore-preview-body {
  padding: 0.9rem 1.1rem 1.1rem;
}

.lore-preview-title {
  font-family: var(--font-title);
  color: #e8dcc8;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.lore-preview-desc {
  font-family: var(--font-body);
  color: #a89080;
  font-size: 0.85rem;
  line-height: 1.5;
}
