/* =========================================================
   JOURNAL.CSS — single-page "Dive Deeper" system.
   Sticky sidebar (grouped by category) + a content pane that
   swaps instantly via JS, no page reloads. Background is a
   quiet white-to-gray fade for now — easy to make more
   atmospheric later once real content/images are in.
   ========================================================= */

.journal-page main {
  max-width: 100% !important;
  padding: 0 !important;
}

/* Quiet placeholder backdrop — swap for something more
   atmospheric later once content is filled in. */
.journal-shell {
  background: linear-gradient(180deg, #FFFFFF 0%, #F3F1EC 55%, #E2DFD8 100%);
  background-attachment: fixed;
  min-height: calc(100vh - 90px);
}

.journal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  max-width: 1320px;
  margin: 0 auto;
  align-items: start;
}

/* ---------- SIDEBAR ---------- */
.journal-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 40px 0 40px;
  border-right: 1px solid var(--gold-line);
}
.sb-intro {
  padding: 0 14px 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--gold-line);
}
.sb-intro .back-link {
  display: inline-block;
  margin-bottom: 14px;
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rust);
  text-decoration: none;
}
.sb-intro .back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.sb-intro h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  max-width: none;
}
.sb-intro p {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
}

.sb-group { margin-top: 22px; }
.sb-group:first-of-type { margin-top: 18px; }
.sb-group-label {
  display: block;
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  padding: 0 14px;
  margin-bottom: 6px;
}
.sb-item {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  padding: 8px 14px;
  font-family: 'Geist', sans-serif;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}
.sb-item:hover { background: rgba(196,121,30,0.06); color: var(--ink); }
.sb-item.active {
  border-left-color: var(--rust);
  background: rgba(196,121,30,0.09);
  color: var(--ink);
  font-weight: 500;
}
.sb-item .sb-org {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-soft);
  opacity: 0.75;
  margin-top: 1px;
}

@media (max-width: 900px) {
  .journal-layout { grid-template-columns: 1fr; }
  .journal-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--gold-line);
    padding: 24px 0;
  }
  .sb-group { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding: 0 20px; }
  .sb-group-label { width: 100%; padding: 0; }
  .sb-item {
    width: auto;
    flex-direction: row;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.5);
    border: 1px solid var(--gold-line);
  }
  .sb-item.active { border-left: none; border-color: var(--rust); background: rgba(196,121,30,0.1); }
  .sb-item .sb-org { display: none; }
}

/* ---------- CONTENT PANES ---------- */
.journal-content {
  padding: 44px clamp(24px, 4vw, 64px) 80px;
  max-width: 880px;
}

.entry-pane { display: none; }
.entry-pane.active { display: block; animation: entry-fade-in 0.3s ease both; }
@keyframes entry-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.entry-pane h1 {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 10px;
  max-width: none;
}
.entry-pane .post-org {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 4px;
}
.entry-pane .post-date {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 26px;
}

.post-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--gold-line);
  border-radius: 4px;
  padding: 18px 22px;
  margin: 0 0 36px;
}
.post-facts dt {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 4px;
}
.post-facts dd {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
}
.post-facts .fact-links { display: flex; flex-direction: column; gap: 3px; }
.post-facts .fact-links a { color: var(--rust); text-decoration: none; }
.post-facts .fact-links a:hover { text-decoration: underline; text-underline-offset: 2px; }

.post-body h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 40px 0 14px;
}
.post-body h2:first-child { margin-top: 0; }
.post-body p {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink-soft);
  margin: 0 0 16px;
}
.post-body p.placeholder { font-family: 'Geist'; opacity: 1.0; color: rgba(from var(--ink-soft) r g b / 0.7);}
.post-body ul { margin: 0 0 16px; padding-left: 20px; }
.post-body li { font-size: 15.5px; line-height: 1.7; color: var(--ink-soft); margin-bottom: 6px; }

/* images / diagrams — just drop an <img> or <figure> anywhere
   in an entry's HTML and it'll be styled automatically */
.post-body img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 8px 22px rgba(42,31,20,0.14);
  margin: 24px 0;
}

.post-body figure { margin: 24px 0; }
 
/* two-up grid for smaller supporting images/charts — wrap figures
   in <div class="figure-grid">...</div> to use it */
.figure-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 24px 0;
}
.figure-grid figure { margin: 0; }
.figure-grid img { margin: 0 0 8px; }
 
@media (max-width: 560px) {
  .figure-grid { grid-template-columns: 1fr; }
}
.post-body figure img { margin: 0 0 8px; }
.post-body figcaption {
  font-family: 'Geist Mono', monospace;
  font-size: 11.5px;
  color: var(--ink-soft);
  text-align: center;
}

.post-pullquote {
  font-family: 'Special Elite', 'Geist Mono', monospace;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  border-left: 3px solid var(--rust);
  padding: 4px 0 4px 20px;
  margin: 28px 0;
}

.algo-panel {
  background: rgba(42,31,20,0.035);
  border: 1px solid var(--gold-line);
  border-left: 3px solid var(--amber);
  border-radius: 3px;
  padding: 18px 20px;
  margin: 20px 0 28px;
}
.algo-panel .algo-label {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 10px;
}
.algo-panel p {
  font-family: 'Geist';
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 10px;
}
.algo-panel p:last-child { margin-bottom: 0; }

.project_title {
  color: var(--rust);
}

@media (max-width: 560px) {
  .journal-content { padding: 32px 20px 60px; }
}