/* ================================================
   THE DESCENT — PROJECT DETAIL PAGES
   Aesthetic: Editorial, technical, warm parchment ground
   Typography: Instrument Serif, Archivo, Plus Jakarta Sans, JetBrains Mono
   ================================================ */

.project-detail-body {
  background-color: var(--paper, #F1EEE7);
  color: var(--carbon, #171715);
  font-family: var(--font-body, "Plus Jakarta Sans", system-ui, sans-serif);
  line-height: 1.7;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Detail Page Header / Nav */
.detail-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(241, 238, 231, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule, rgba(23, 23, 21, 0.12));
  padding: 1rem var(--pad, clamp(20px, 4.5vw, 72px));
}

.detail-nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.detail-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--carbon, #171715);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.detail-nav-back:hover {
  opacity: 0.7;
  transform: translateX(-2px);
}

.detail-nav-back:focus-visible {
  outline: 2px solid var(--carbon, #171715);
  outline-offset: 4px;
}

.detail-nav-chapter {
  color: var(--muted, #77736D);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

/* Main Container */
.detail-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 5rem) var(--pad, clamp(20px, 4.5vw, 72px));
}

/* Hero Section */
.detail-hero {
  margin-bottom: clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--rule, rgba(23, 23, 21, 0.12));
  padding-bottom: clamp(2.5rem, 4vw, 4rem);
}

.detail-kicker {
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 0.8125rem;
  color: var(--muted, #77736D);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.detail-title {
  font-family: var(--font-serif, "Instrument Serif", Georgia, serif);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--carbon, #171715);
  margin: 0 0 1.25rem 0;
}

.detail-lead {
  font-family: var(--font-body, "Plus Jakarta Sans", system-ui, sans-serif);
  font-size: clamp(1.125rem, 2vw, 1.35rem);
  line-height: 1.6;
  color: var(--charcoal, #171715);
  max-width: 54ch;
  margin: 0 0 2.5rem 0;
}

/* Metadata Bar */
.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule, rgba(23, 23, 21, 0.12));
}

.detail-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.detail-meta-label {
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #77736D);
}

.detail-meta-value {
  font-family: var(--font-body, "Plus Jakarta Sans", system-ui, sans-serif);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--carbon, #171715);
}

.detail-meta-value a {
  color: var(--carbon, #171715);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--stone, #C9C0B2);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.detail-meta-value a:hover {
  text-decoration-color: var(--carbon, #171715);
}

/* Architectural Plate */
.detail-figure {
  margin: 0 0 clamp(2.5rem, 4.5vw, 4rem) 0;
  background: #0B0C0E;
  border: 1px solid var(--rule, rgba(23, 23, 21, 0.16));
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 16px 40px -10px rgba(23, 23, 21, 0.14), 0 4px 14px rgba(23, 23, 21, 0.04);
}

.detail-figure img,
.detail-figure svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 680px;
  object-fit: contain;
  background: #0B0C0E;
}

.detail-figure-caption {
  padding: 0.875rem 1.25rem;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 0.75rem;
  color: var(--muted, #77736D);
  border-top: 1px solid var(--rule, rgba(23, 23, 21, 0.12));
  background: var(--paper, #EAE5DA);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Narrative Body */
.detail-content {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  margin-bottom: clamp(3.5rem, 6vw, 6rem);
}

.detail-sidebar {
  position: sticky;
  top: 5rem;
  align-self: start;
}

@media (max-width: 860px) {
  .detail-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .detail-sidebar {
    position: static;
  }
}

.detail-toc {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.detail-toc a {
  color: var(--muted, #77736D);
  text-decoration: none;
  transition: color 0.2s ease;
  display: block;
  padding: 0.25rem 0;
}

.detail-toc a:hover {
  color: var(--carbon, #171715);
}

.detail-article {
  max-width: 68ch;
}

.detail-section {
  margin-bottom: 3.5rem;
  scroll-margin-top: 5rem;
}

.detail-section-title {
  font-family: var(--font-display, "Archivo", system-ui, sans-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--carbon, #171715);
  margin: 0 0 1.25rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule, rgba(23, 23, 21, 0.12));
}

.detail-article p {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--charcoal, #171715);
  margin: 0 0 1.5rem 0;
}

.detail-article ul {
  margin: 0 0 1.75rem 0;
  padding-left: 1.25rem;
}

.detail-article li {
  margin-bottom: 0.75rem;
  line-height: 1.65;
  font-size: 1rem;
}

.detail-article li strong {
  font-weight: 600;
  color: var(--carbon, #171715);
}

.detail-article a {
  color: var(--carbon, #171715);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--stone, #C8C3BA);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.detail-article a:hover {
  color: var(--carbon, #171715);
  text-decoration-color: var(--carbon, #171715);
}

.theme-drev .detail-article a {
  color: var(--carbon, #171715);
  text-decoration-color: rgba(200, 70, 0, 0.4);
}

.theme-drev .detail-article a:hover {
  color: #C84600;
  text-decoration-color: #C84600;
}

/* Specifications Table */
.detail-spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9375rem;
}

.detail-spec-table th,
.detail-spec-table td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--rule, rgba(23, 23, 21, 0.12));
}

.detail-spec-table th {
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #77736D);
  width: 32%;
}

.detail-spec-table td {
  font-family: var(--font-body, "Plus Jakarta Sans", system-ui, sans-serif);
  color: var(--carbon, #171715);
}

.detail-spec-table td code {
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 0.8125rem;
  background: rgba(23, 23, 21, 0.05);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
}

/* Code Snippet Block */
.detail-code-block {
  background: #171715;
  color: #F1EEE7;
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  overflow-x: auto;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.detail-code-block code {
  font-family: inherit;
}

/* Bottom Pagination */
.detail-footer {
  border-top: 1px solid var(--rule, rgba(23, 23, 21, 0.16));
  padding-top: 3rem;
  margin-top: 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.detail-footer-link {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--carbon, #171715);
  transition: opacity 0.2s ease;
}

.detail-footer-link:hover {
  opacity: 0.7;
}

.detail-footer-direction {
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #77736D);
}

.detail-footer-target {
  font-family: var(--font-serif, "Instrument Serif", Georgia, serif);
  font-size: 1.5rem;
  font-weight: 400;
}

/* ==========================================================================
   5. DREV CI THEME — LIGHT EDITORIAL PARCHMENT WITH RESTRAINED ORANGE ACCENT
   ========================================================================== */
.project-detail-body.theme-drev {
  background-color: var(--paper, #F1EEE7);
  color: var(--carbon, #171715);
}

.theme-drev .detail-header {
  background-color: rgba(241, 238, 231, 0.92);
  border-bottom: 1px solid var(--rule, rgba(23, 23, 21, 0.12));
}

.theme-drev .detail-nav-back {
  color: var(--carbon, #171715);
}

.theme-drev .detail-nav-back:hover {
  color: #C84600;
  opacity: 1;
}

.theme-drev .detail-nav-back:focus-visible {
  outline-color: #C84600;
}

.theme-drev .detail-nav-chapter {
  color: var(--muted, #77736D);
}

.theme-drev .detail-hero {
  border-bottom: 1px solid var(--rule, rgba(23, 23, 21, 0.12));
}

.theme-drev .detail-kicker {
  color: #C84600;
  font-weight: 600;
}

.theme-drev .detail-title {
  color: var(--carbon, #171715);
}

.theme-drev .detail-lead {
  color: var(--charcoal, #171715);
}

.theme-drev .detail-meta-grid {
  border-top: 1px solid var(--rule, rgba(23, 23, 21, 0.12));
}

.theme-drev .detail-meta-label {
  color: var(--muted, #77736D);
}

.theme-drev .detail-meta-value {
  color: var(--carbon, #171715);
}

.theme-drev .detail-meta-value a {
  color: var(--carbon, #171715);
  text-decoration-color: rgba(200, 70, 0, 0.4);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.theme-drev .detail-meta-value a:hover {
  color: #C84600;
  text-decoration-color: #C84600;
}

.theme-drev .detail-figure {
  background: #0B0C0E;
  border: 1px solid var(--rule, rgba(23, 23, 21, 0.16));
  box-shadow: 0 16px 40px -10px rgba(23, 23, 21, 0.14), 0 4px 14px rgba(23, 23, 21, 0.04);
}

.theme-drev .detail-figure img {
  background: #0B0C0E;
}

.theme-drev .detail-figure-caption {
  background: var(--paper, #EAE5DA);
  color: var(--muted, #77736D);
  border-top: 1px solid var(--rule, rgba(23, 23, 21, 0.12));
}

.theme-drev .detail-toc a {
  color: var(--muted, #77736D);
}

.theme-drev .detail-toc a:hover,
.theme-drev .detail-toc a.active {
  color: #C84600;
}

.theme-drev .detail-section-title {
  color: var(--carbon, #171715);
  border-bottom: 1px solid var(--rule, rgba(23, 23, 21, 0.12));
}

.theme-drev .detail-article p {
  color: var(--charcoal, #171715);
}

.theme-drev .detail-article strong {
  color: var(--carbon, #171715);
}

.theme-drev .detail-article li {
  color: var(--charcoal, #171715);
}

.theme-drev .detail-article li strong {
  color: var(--carbon, #171715);
}

.theme-drev .detail-spec-table th,
.theme-drev .detail-spec-table td {
  border-bottom: 1px solid var(--rule, rgba(23, 23, 21, 0.12));
}

.theme-drev .detail-spec-table th {
  color: var(--muted, #77736D);
}

.theme-drev .detail-spec-table td {
  color: var(--carbon, #171715);
}

.theme-drev .detail-spec-table td code {
  background: rgba(200, 70, 0, 0.08);
  color: #C84600;
}

.theme-drev .detail-spec-table a {
  color: var(--carbon, #171715);
  text-decoration-color: rgba(200, 70, 0, 0.4);
}

.theme-drev .detail-spec-table a:hover {
  color: #C84600;
  text-decoration-color: #C84600;
}

.theme-drev .detail-code-block {
  background: #171715;
  border: 1px solid rgba(23, 23, 21, 0.16);
  color: #F1EEE7;
}

.theme-drev .detail-footer {
  border-top: 1px solid var(--rule, rgba(23, 23, 21, 0.16));
}

.theme-drev .detail-footer-link {
  color: var(--carbon, #171715);
}

.theme-drev .detail-footer-link:hover {
  color: #C84600;
}

.theme-drev .detail-footer-direction {
  color: var(--muted, #77736D);
}


