/* Codex public — extension postuler / lore */

.codex-group-block {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.codex-group-block:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.codex-group-kicker {
  margin: 0 0 0.35rem;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--post-primary-2);
}

.codex-group-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.codex-group-desc {
  margin: 0 0 0.85rem;
  font-size: 12px;
  line-height: 1.55;
  color: #737373;
}

.codex-sidebar-group {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.codex-sidebar-group:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.codex-sidebar-group-label {
  padding: 0 15px 0.35rem;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #52525b;
}

.post-step--book {
  grid-template-columns: 36px 1fr;
}

.post-step--book b {
  font-size: 14px;
  line-height: 1;
}

.codex-book-content {
  min-width: 0;
}

.codex-book-content .glass-card,
.codex-book-content .codex-page {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

.codex-book-content .codex-font {
  font-family: 'Plus Jakarta Sans', Inter, system-ui, sans-serif;
  letter-spacing: -0.01em;
}

.codex-book-content .codex-verse {
  font-style: italic;
  color: rgba(196, 181, 253, 0.85);
}

.codex-book-content .codex-divine {
  color: #fde68a;
}

.codex-member-banner {
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(255, 184, 77, 0.35);
  background: rgba(255, 184, 77, 0.08);
  font-size: 11px;
  line-height: 1.55;
  color: #fde68a;
}

.codex-member-banner a {
  color: #c7d2fe;
  font-weight: 800;
}

.codex-justice-aside {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.08);
  font-size: 11px;
  line-height: 1.5;
  color: #d4d4d8;
}

.codex-justice-aside.hidden {
  display: none !important;
}

.codex-partial-nav.hidden {
  display: none !important;
}

.codex-book-content .codex-page {
  opacity: 1;
  transform: none;
}

@media (max-width: 640px) {
  .codex-book-content header.text-center h1 {
    font-size: 2rem !important;
  }
}

/* ——— Table des matières & chapitres (lecteur Codex) ——— */
.codex-book-content #codex-toc,
.codex-book-content .codex-toc {
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem !important;
  padding: 1.35rem 1.35rem 1.25rem !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 0 !important;
  background:
    linear-gradient(125deg, rgba(157, 124, 255, 0.1), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    rgba(8, 8, 12, 0.88) !important;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.codex-book-content #codex-toc::before,
.codex-book-content .codex-toc::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #c4b5fd, #6366f1 55%, transparent);
  opacity: 0.9;
}

.codex-book-content #codex-toc > h2,
.codex-book-content .codex-toc > h2 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1rem !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: 0.28em !important;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72) !important;
}

.codex-book-content #codex-toc > h2::before,
.codex-book-content .codex-toc > h2::before {
  content: "";
  width: 1.1rem;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.codex-book-content #codex-toc > ul,
.codex-book-content .codex-toc > ul {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: codex-toc;
}

.codex-book-content #codex-toc > ul > li,
.codex-book-content .codex-toc > ul > li {
  margin: 0;
  counter-increment: codex-toc;
}

.codex-book-content #codex-toc > ul > li > a,
.codex-book-content .codex-toc > ul > li > a {
  display: grid !important;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  margin: 0;
  padding: 0.75rem 0.9rem !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.07) !important;
  background: rgba(0, 0, 0, 0.28);
  color: rgba(228, 228, 231, 0.78) !important;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.codex-book-content #codex-toc > ul > li > a::before,
.codex-book-content .codex-toc > ul > li > a::before {
  content: counter(codex-toc, decimal-leading-zero);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #a5b4fc;
}

.codex-book-content #codex-toc > ul > li > a:hover,
.codex-book-content .codex-toc > ul > li > a:hover {
  transform: translateX(3px);
  border-color: rgba(167, 139, 250, 0.4) !important;
  background: rgba(110, 91, 255, 0.12);
  color: #fff !important;
}

.codex-book-content #codex-toc > ul > li > a:hover::before,
.codex-book-content .codex-toc > ul > li > a:hover::before {
  color: #e9d5ff;
}

.codex-book-content section.glass-card[id],
.codex-book-content section.codex-chapter {
  position: relative;
  margin-bottom: 1.35rem !important;
  padding: 1.5rem 1.35rem 1.45rem !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: 0 !important;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.014)),
    rgba(8, 8, 12, 0.9) !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.codex-book-content section.glass-card[id]::before,
.codex-book-content section.codex-chapter::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.75), rgba(167, 139, 250, 0.08));
}

.codex-book-content section.glass-card[id] > h2.codex-font:first-of-type,
.codex-book-content section.codex-chapter > .codex-chapter__kicker,
.codex-book-content section.codex-chapter > h2.codex-font:first-of-type {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  width: auto;
  max-width: 100%;
  margin: 0 0 0.55rem !important;
  padding: 0.38rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: 0.22em !important;
  text-transform: uppercase;
  line-height: 1.2;
}

.codex-book-content section.glass-card[id] > h3.codex-font,
.codex-book-content section.codex-chapter > .codex-chapter__title,
.codex-book-content section.codex-chapter > h3.codex-font {
  margin: 0 0 1.15rem !important;
  font-size: clamp(1.4rem, 2.6vw, 1.95rem) !important;
  font-weight: 900 !important;
  letter-spacing: -0.035em !important;
  line-height: 1.12 !important;
  color: #fff !important;
}

@media (min-width: 640px) {
  .codex-book-content #codex-toc,
  .codex-book-content .codex-toc {
    padding: 1.55rem 1.65rem 1.45rem !important;
  }

  .codex-book-content section.glass-card[id],
  .codex-book-content section.codex-chapter {
    padding: 1.75rem 1.7rem 1.6rem !important;
  }
}

/* Roadmap — Liber Viæ */
.codex-roadmap-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  max-width: 28rem;
  margin: 1.75rem auto 0;
}

.codex-roadmap-stat {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem 0.5rem;
  text-align: center;
}

.codex-roadmap-stat strong {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.codex-roadmap-stat span {
  display: block;
  margin-top: 0.35rem;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #737373;
}

.codex-roadmap-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.codex-roadmap-filter {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.45rem 0.7rem;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a3a3a3;
  cursor: pointer;
  transition: 0.18s ease;
}

.codex-roadmap-filter:hover,
.codex-roadmap-filter.is-active {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(16, 185, 129, 0.12);
  color: #fff;
}

.codex-roadmap-quarter {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 2rem;
}

.codex-roadmap-quarter::before {
  content: '';
  position: absolute;
  left: 0.2rem;
  top: 0.45rem;
  bottom: -1.25rem;
  width: 2px;
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.55), rgba(52, 211, 153, 0.08));
}

.codex-roadmap-quarter:last-child::before {
  bottom: 0.45rem;
}

.codex-roadmap-quarter-dot {
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 0.65rem;
  height: 0.65rem;
  border: 2px solid rgba(52, 211, 153, 0.7);
  background: #050507;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.35);
}

.codex-roadmap-theme {
  margin-bottom: 1.5rem;
}

.codex-roadmap-theme-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.codex-roadmap-theme-kicker {
  margin: 0;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(52, 211, 153, 0.75);
}

.codex-roadmap-theme-title {
  margin: 0.15rem 0 0;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #fff;
}

.codex-roadmap-theme-bar {
  flex: 1 1 120px;
  max-width: 180px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.codex-roadmap-theme-bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #10b981, #34d399);
}

.codex-roadmap-grid {
  display: grid;
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .codex-roadmap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.codex-roadmap-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  padding: 0.9rem 1rem;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.codex-roadmap-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.codex-roadmap-card.is-hidden {
  display: none;
}

.codex-roadmap-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.45rem;
}

.codex-roadmap-card-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
  color: #fff;
}

.codex-roadmap-badge {
  flex-shrink: 0;
  border: 1px solid transparent;
  padding: 0.2rem 0.45rem;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.codex-roadmap-badge--shipped {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
}

.codex-roadmap-badge--progress {
  border-color: rgba(129, 140, 248, 0.4);
  background: rgba(99, 102, 241, 0.14);
  color: #c7d2fe;
}

.codex-roadmap-badge--planned {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(245, 158, 11, 0.1);
  color: #fde68a;
}

.codex-roadmap-card-desc {
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
  color: #a3a3a3;
}

.codex-roadmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.5rem;
}

.codex-roadmap-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 10px;
  color: #737373;
}

@media (max-width: 480px) {
  .codex-roadmap-hero-stats {
    grid-template-columns: 1fr;
    max-width: 12rem;
  }

  .codex-roadmap-theme-bar {
    max-width: 100%;
    flex-basis: 100%;
  }
}
