/* ============================================================
   article.css — Document / Article view page
   Import AFTER style.css:
     <link rel="stylesheet" href="style.css" />
     <link rel="stylesheet" href="article.css" />
   ============================================================ */

/* ── Back button ─────────────────────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "Courier New", monospace;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  padding: 7px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #000;
  color: green;
  margin-bottom: 22px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.back-btn:hover {
  background: var(--accent-soft);
  transform: translate(-2px, -2px);
}

.back-btn::before {
  content: "←";
  font-size: 1rem;
  line-height: 1;
}

/* ── Article page layout ─────────────────────────────────── */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 22px;
  align-items: start;
}

/* ── Article header (top of main column) ─────────────────── */
.article-header {
  padding: 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}

.article-header .section-kicker {
  margin-bottom: 10px;
}

.article-header h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.04em;
  margin: 8px 0 16px;
  max-width: 100%;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed rgba(33, 31, 26, 0.35);
}

.meta-pill {
  display: inline-block;
  padding: 5px 11px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #000;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  color: green;
}

/* ── Article body prose ──────────────────────────────────── */
.article-body {
  padding: 26px;
  box-shadow: var(--shadow);
}

.article-body h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  margin: 2rem 0 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed rgba(33, 31, 26, 0.35);
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body h3 {
  font-size: 1.1rem;
  margin: 1.4rem 0 0.5rem;
  color: var(--muted);
}

.article-body p {
  font-size: 1.02rem;
  line-height: 1.8;
  color: #d4d4d4;
  margin-bottom: 1.1rem;
}

.article-body strong {
  color: var(--ink);
}

.article-body ul,
.article-body ol {
  padding-left: 1.3rem;
  margin-bottom: 1.1rem;
}

.article-body li {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: #d4d4d4;
  line-height: 1.75;
}

/* Callout / pull quote */
.callout {
  border-left: 3px solid var(--ink);
  background: #000;
  padding: 14px 18px;
  margin: 1.4rem 0;
  border-radius: 0 8px 8px 0;
}

.callout p {
  margin: 0;
  font-size: 0.97rem;
  color: var(--ink);
}

.callout--accent {
  border-left-color: var(--accent);
}

.callout--accent p {
  color: #ccc;
}

/* Inline code */
.article-body code {
  font-family: "Courier New", monospace;
  font-size: 0.88rem;
  background: #000;
  color: var(--ink);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

/* Reference / citation block */
.references {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 2px solid var(--line);
}

.references h2 {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0.75rem;
}

.references ol {
  padding-left: 1.2rem;
  margin: 0;
}

.references li {
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.65rem;
  line-height: 1.6;
}

.references a {
  color: var(--ink);
  word-break: break-all;
}

.references a:hover {
  text-decoration: underline;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.article-sidebar {
  position: sticky;
  top: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-panel {
  padding: 18px;
  box-shadow: 4px 4px 0 var(--line);
}

.sidebar-panel .section-kicker {
  display: block;
  margin-bottom: 12px;
}

/* Table of contents */
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  border-bottom: 1px dashed rgba(33, 31, 26, 0.3);
}

.toc-list li:last-child {
  border-bottom: none;
}

.toc-list a {
  display: block;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 6px 0;
  text-decoration: none;
  transition: color 0.15s, padding-left 0.15s;
}

.toc-list a:hover {
  color: var(--ink);
  padding-left: 5px;
}

/* Meta detail list in sidebar */
.sidebar-detail {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-detail li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(33, 31, 26, 0.3);
  font-size: 0.84rem;
}

.sidebar-detail li:last-child {
  border-bottom: none;
}

.sidebar-detail .sd-label {
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

.sidebar-detail .sd-value {
  color: #d4d4d4;
  font-family: "Courier New", monospace;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 860px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 520px) {
  .article-header,
  .article-body,
  .sidebar-panel {
    padding: 16px;
    border-radius: 14px;
  }
}
