/* ═══════════════════════════════════════════════════════════
   ULTRAWIKI — lore.css
   Couleurs par zone :
     Passé    → ocre    #c8972a
     Présent  → rouge   var(--red)
     Futur    → violet  #8b5cf6
     Théorie  → violet dim #6d4cb8
═══════════════════════════════════════════════════════════ */

/* ── Hero titre ─────────────────────────────────────────── */
.lore-hero {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, rgba(204,0,0,0.04), transparent);
  padding: 48px 48px 36px;
}

.lore-hero-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.lore-hero-sub {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.lore-hero-title {
  font-family: var(--font-head);
  font-size: clamp(48px, 8vw, 80px);
  font-weight: 700;
  letter-spacing: 0.4em;
  color: var(--white);
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 16px;
  /* Légère teinte rouge sur le texte */
  text-shadow: 0 0 60px rgba(230,0,0,0.2);
}

.lore-hero-desc {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto;
}

/* ── Tabs de zone ────────────────────────────────────────── */
.lore-tabs-bar {
  position: sticky;
  top: 89px;
  z-index: 50;
  display: flex;
  align-items: stretch;
  background: rgba(19,19,19,0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.lore-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 14px 20px;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
  color: var(--text-dim);
}

.lore-tab:hover { background: rgba(255,255,255,0.03); }

.lore-tab::after {
  content: '';
  position: absolute;
  bottom: 0; left: 15%; right: 15%;
  height: 2px;
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

/* Couleur de la barre active par zone */
.lore-tab[data-zone="past"]::after    { background: #c8972a; }
.lore-tab[data-zone="present"]::after { background: var(--red); }
.lore-tab[data-zone="future"]::after  { background: #8b5cf6; }

.lore-tab.active { color: var(--white); }
.lore-tab.active::after { transform: scaleX(1); }

.tab-icon {
  font-size: 10px;
  opacity: 0.6;
}

.lore-tab.active .tab-icon { opacity: 1; }

.tab-label {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.lore-tab[data-zone="past"].active    .tab-label { color: #c8972a; }
.lore-tab[data-zone="present"].active .tab-label { color: var(--red); }
.lore-tab[data-zone="future"].active  .tab-label { color: #8b5cf6; }

.tab-sub {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.tab-separator {
  width: 1px;
  background: var(--border);
  margin: 10px 0;
}

/* ── Contenu principal ───────────────────────────────────── */
.lore-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

/* ── Zones ───────────────────────────────────────────────── */
.lore-zone {
  display: none;
  padding-top: 48px;
}

.lore-zone.active { display: block; }

/* ── En-tête de zone ─────────────────────────────────────── */
.zone-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
}

.zone-header-line {
  flex: 1;
  height: 1px;
}

#zone-past    .zone-header-line { background: linear-gradient(to right, transparent, #c8972a40); }
#zone-present .zone-header-line { background: linear-gradient(to right, transparent, rgba(230,0,0,0.25)); }
#zone-future  .zone-header-line { background: linear-gradient(to right, transparent, #8b5cf640); }

#zone-past    .zone-header-line:first-child { background: linear-gradient(to left,  transparent, #c8972a40); }
#zone-present .zone-header-line:first-child { background: linear-gradient(to left,  transparent, rgba(230,0,0,0.25)); }
#zone-future  .zone-header-line:first-child { background: linear-gradient(to left,  transparent, #8b5cf640); }

.zone-header-content { text-align: center; flex-shrink: 0; }

.zone-era-tag {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  padding: 3px 10px;
  border: 1px solid;
  margin-bottom: 8px;
}

.past-tag    { color: #c8972a; border-color: #c8972a55; background: rgba(200,151,42,0.08); }
.present-tag { color: var(--red); border-color: rgba(230,0,0,0.4); background: rgba(230,0,0,0.06); }
.future-tag  { color: #8b5cf6; border-color: #8b5cf655; background: rgba(139,92,246,0.08); }

.zone-title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 4px;
}

.zone-subtitle {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

/* ── Sélecteur de couche (zone Présent) ─────────────────── */
.layer-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.layer-label {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  flex-shrink: 0;
}

.layer-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.layer-tab {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}

.layer-tab:hover { border-color: #555; color: var(--text); }

.layer-tab.active {
  border-color: var(--red);
  color: var(--white);
  background: rgba(230,0,0,0.08);
}

/* ── Avertissement théorie ───────────────────────────────── */
.theory-warning {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid #8b5cf640;
  background: rgba(139,92,246,0.05);
  margin-bottom: 36px;
}

.warning-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  color: #8b5cf6;
  margin-top: 1px;
}

.theory-warning p {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}

.theory-warning strong { color: var(--text); }

/* ═══════════════════════════════════════════════════════
   BLOCS LORE (timeline)
═══════════════════════════════════════════════════════ */
.lore-blocks {
  display: flex;
  flex-direction: column;
}

/* ── Bloc individuel ─────────────────────────────────────── */
.lore-block {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 0 20px;
  scroll-margin-top: 150px;
}

/* ── Connecteur timeline ─────────────────────────────────── */
.block-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 22px;
}

.connector-line {
  width: 1px;
  flex: 1;
  min-height: 16px;
}

.connector-line.dashed {
  background: repeating-linear-gradient(
    to bottom,
    var(--border) 0px, var(--border) 4px,
    transparent 4px, transparent 8px
  );
  width: 1px;
}

/* Couleur des lignes selon la zone */
#zone-past    .connector-line:not(.dashed) { background: #c8972a55; }
#zone-present .connector-line:not(.dashed) { background: rgba(230,0,0,0.3); }
#zone-future  .connector-line:not(.dashed) { background: #8b5cf655; }

.connector-line.last { flex: 0 0 24px; }

.connector-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid;
  background: var(--bg-2);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* Couleurs des points */
#zone-past    .connector-dot { border-color: #c8972a; }
#zone-present .connector-dot { border-color: var(--red); }

.future-dot  { border-color: #8b5cf6 !important; }
.theory-dot  { border-color: #6d4cb8 !important; }
.present-dot { border-color: var(--red) !important; }

/* Quand le bloc est ouvert, le point se remplit */
.lore-block.open .connector-dot {
  background: currentColor;
}

#zone-past    .lore-block.open .connector-dot { background: #c8972a; }
#zone-present .lore-block.open .connector-dot { background: var(--red); }
#zone-future  .lore-block:not(.theory-block).open .connector-dot { background: #8b5cf6; }
#zone-future  .lore-block.theory-block.open .connector-dot { background: #6d4cb8; }

/* ── Carte du bloc ───────────────────────────────────────── */
.block-content {
  background: var(--bg-2);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.lore-block:hover .block-content { border-color: #333; }

/* Bordure gauche colorée quand ouvert */
#zone-past    .lore-block.open .block-content { border-left: 2px solid #c8972a; }
#zone-present .lore-block.open .block-content { border-left: 2px solid var(--red); }
#zone-future  .lore-block:not(.theory-block).open .block-content { border-left: 2px solid #8b5cf6; }
#zone-future  .lore-block.theory-block.open .block-content { border-left: 2px solid #6d4cb8; }

/* ── En-tête du bloc ─────────────────────────────────────── */
.block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.block-header:hover { background: rgba(255,255,255,0.02); }

.block-header-left { flex: 1; min-width: 0; }

.block-era {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.past-era      { color: #c8972a; }
.present-era   { color: var(--red); }
.confirmed-era { color: #8b5cf6; }
.theory-era    { color: #6d4cb8; }

.block-title {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.block-subtitle {
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

/* Bouton toggle */
.block-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: all 0.2s;
}

.block-toggle-btn svg {
  width: 14px; height: 14px;
  transition: transform 0.3s ease;
}

.lore-block.open .block-toggle-btn svg { transform: rotate(180deg); }
.lore-block.open .block-toggle-btn {
  border-color: var(--text-dim);
  color: var(--white);
}

/* ── Corps du bloc (accordion) ───────────────────────────── */
.block-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lore-block.open .block-body { max-height: 2000px; }

.block-body-inner {
  border-top: 1px solid var(--border);
  padding: 20px 18px 22px;
}

/* Zone de texte éditable (placeholder pour l'instant) */
.block-text-area {
  min-height: 80px;
}

.block-placeholder {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--border);
  font-style: italic;
  padding: 20px 0;
  text-align: center;
  border: 1px dashed var(--border);
}

/* ── Hint ajout bloc ─────────────────────────────────────── */
.add-block-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  margin-left: 52px; /* aligne avec les blocs */
  border: 1px dashed var(--border);
  margin-top: 4px;
  opacity: 0.4;
  transition: opacity 0.2s;
  cursor: default;
}

.add-block-hint span {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .lore-hero { padding: 32px 20px 24px; }
  .lore-main { padding: 0 16px 60px; }
  .lore-tabs-bar { position: static; }
  .tab-sub { display: none; }
  .tab-label { font-size: 11px; }
  .layer-tabs { gap: 3px; }
  .layer-tab { font-size: 9px; padding: 3px 7px; }
}
