/**
 * Peak AI Design — Unified node detail styles (refined v2 2026-05-07)
 * Used by article + page + portfolio (full view mode).
 *
 * Design principles applied:
 *   1. Modular type scale (1.25 "major third" ratio)
 *   2. Vertical rhythm — line-height 1.7 body, predictable margin scale
 *   3. Optimal line length — body text capped at 70ch (readability research)
 *   4. Tailwind Typography "prose" defaults adapted for Peak AI Design
 *   5. Existing theme variables (--peak-font-body, --peak-font-heading) honored
 */

/* ── WRAPPER ────────────────────────────────────────────────────────────── */

.node-detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
  font-family: var(--peak-font-body, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  color: #1a3350;
}

/* ── HERO IMAGE ────────────────────────────────────────────────────────── */

.node-hero {
  margin: 0 auto 2.5rem;
  max-width: 800px;
  border: 1px solid rgba(77, 163, 255, 0.2);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px;
}

.node-hero img,
.node-hero .field--name-field-featured-image img,
.node-hero .field--name-field-image img {
  max-width: 800px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
}

/* ── HEADER (title + byline + meta) ────────────────────────────────────── */

.node-header {
  margin-bottom: 2.5rem;
  text-align: left;
}

.node-title {
  font-family: var(--peak-font-heading, var(--peak-font-body, system-ui));
  font-size: 2.5rem;
  font-weight: 700;
  color: #0b1c2d;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

.node-byline {
  color: #5a6f87;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  margin: 0.5rem 0 0;
}

.node-author { font-weight: 600; color: #1a3350; }
.node-date { color: #5a6f87; }

/* ── BODY (the prose area) ─────────────────────────────────────────────── */

.node-body {
  font-size: 1.0625rem;       /* 17px on 16px base */
  line-height: 1.75;
  color: #1a3350;
  max-width: 70ch;             /* readability: 65-75 chars per line is optimal */
}

/* Headings inside body — modular scale, breathing room */

.node-body h2 {
  font-family: var(--peak-font-heading, var(--peak-font-body, system-ui));
  font-size: 1.75rem;
  font-weight: 700;
  color: #0b1c2d;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 3rem 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(77, 163, 255, 0.18);
}

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

.node-body h3 {
  font-family: var(--peak-font-heading, var(--peak-font-body, system-ui));
  font-size: 1.375rem;
  font-weight: 600;
  color: #0b1c2d;
  letter-spacing: -0.005em;
  line-height: 1.3;
  margin: 2.25rem 0 0.875rem;
}

.node-body h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #0b1c2d;
  margin: 1.75rem 0 0.625rem;
}

/* Paragraphs */

.node-body p {
  margin: 0 0 1.25em;
  text-wrap: pretty;           /* modern CSS — better line-break decisions */
}

.node-body p:last-child { margin-bottom: 0; }

/* Lists — breathing room, consistent rhythm */

.node-body ul,
.node-body ol {
  margin: 1.25rem 0 1.5rem;
  padding-left: 1.5rem;
}

.node-body ul { list-style: disc; }
.node-body ol { list-style: decimal; }

.node-body li {
  margin: 0 0 0.5em;
  padding-left: 0.25rem;
  line-height: 1.7;
}

.node-body li::marker { color: #4da3ff; }

.node-body li > p {
  margin: 0 0 0.5em;
}

.node-body ul ul,
.node-body ol ol,
.node-body ul ol,
.node-body ol ul {
  margin: 0.5rem 0 0.75rem;
}

/* Links */

.node-body a {
  color: #1f4fd8;
  text-decoration: none;
  border-bottom: 1px solid rgba(31, 79, 216, 0.4);
  transition: border-color 0.15s, color 0.15s;
}

.node-body a:hover {
  color: #4da3ff;
  border-bottom-color: #4da3ff;
}

/* Strong and emphasis */

.node-body strong {
  font-weight: 600;
  color: #0b1c2d;
}

.node-body em { font-style: italic; }

/* Inline code */

.node-body code {
  background: rgba(31, 79, 216, 0.08);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Consolas, Monaco, "Courier New", monospace;
  font-size: 0.9em;
  color: #0b1c2d;
  font-weight: 500;
}

/* Code blocks */

.node-body pre {
  background: #0b1c2d;
  color: #e6eef7;
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-family: ui-monospace, "SF Mono", Consolas, Monaco, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  border-left: 3px solid #4da3ff;
}

.node-body pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Tables */

.node-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.node-body th,
.node-body td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(77, 163, 255, 0.18);
  text-align: left;
  vertical-align: top;
}

.node-body th {
  background: rgba(31, 79, 216, 0.06);
  font-weight: 600;
  color: #0b1c2d;
  border-bottom: 2px solid rgba(31, 79, 216, 0.3);
}

.node-body tbody tr:hover { background: rgba(31, 79, 216, 0.03); }

/* Blockquotes */

.node-body blockquote {
  border-left: 3px solid #1f4fd8;
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 1.5rem 0;
  color: #1a3350;
  font-style: italic;
  background: rgba(31, 79, 216, 0.03);
}

.node-body blockquote p { margin: 0 0 0.75em; }
.node-body blockquote p:last-child { margin-bottom: 0; }

/* Horizontal rule */

.node-body hr {
  border: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(77, 163, 255, 0.4), transparent);
  margin: 3rem 0;
}

/* Images inside body */

.node-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
  display: block;
}

.node-body figure { margin: 1.5rem 0; }

.node-body figcaption {
  font-size: 0.875rem;
  color: #5a6f87;
  text-align: center;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Hide visually-hidden content (used for fields not explicitly placed) */

.node-extra.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Responsive — tighten on mobile */

@media (max-width: 768px) {
  .node-detail {
    padding: 1.5rem 1rem 2.5rem;
  }
  .node-title { font-size: 2rem; }
  .node-body { font-size: 1rem; }
  .node-body h2 { font-size: 1.5rem; margin-top: 2.25rem; }
  .node-body h3 { font-size: 1.25rem; }
}

@media (max-width: 480px) {
  .node-title { font-size: 1.75rem; line-height: 1.2; }
  .node-body h2 { font-size: 1.375rem; }
}
