/**
 * layout.css
 * ─────────────────────────────────────────────────────────────────
 * Structural layout only: sidebar shell, main content area, cover
 * hero section, reading progress bar, and document section framing.
 *
 * Intentionally contains NO component-specific styles (pipeline,
 * cards, code blocks, etc.) — those live in components.css.
 */

/* ════════════════════════════════════════════
   SIDEBAR
════════════════════════════════════════════ */

#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 32px 24px 24px;
  border-bottom: 1px solid var(--border-soft);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  line-height: 1.3;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.sidebar-meta {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-dim);
}

.sidebar-meta span {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 2px 8px;
  margin: 2px 2px 0 0;
}

nav {
  padding: 20px 0 24px;
  flex: 1;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-soft);
  font-size: 11px;
  color: var(--text-dim);
}

.sidebar-footer strong {
  color: var(--text-muted);
}

/* ════════════════════════════════════════════
   READING PROGRESS BAR
════════════════════════════════════════════ */

.reading-progress {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  height: 2px;
  background: var(--progress-color, var(--accent));
  z-index: 200;
  transition: width 0.1s ease, background-color 0.55s ease;
  width: 0%;
}

/* ════════════════════════════════════════════
   MAIN CONTENT AREA
════════════════════════════════════════════ */

main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

/* ════════════════════════════════════════════
   COVER / HERO
════════════════════════════════════════════ */

.cover {
  min-height: 480px;
  background:
    radial-gradient(ellipse 80% 60% at 60% -10%, rgba(196, 168, 100, 0.22) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 100% 80%, rgba(139,  74,  20, 0.08) 0%, transparent 55%),
    var(--bg);
  display: flex;
  align-items: center;
  padding: 80px 80px 60px;
  border-bottom: 1px solid var(--border-soft);
  position: relative;
  overflow: hidden;
}

/* Subtle engineering grid overlay */
.cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.4;
  pointer-events: none;
}

.cover-inner {
  position: relative;
  max-width: 680px;
}

.cover-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(139, 105, 20, 0.3);
  background: rgba(139, 105, 20, 0.07);
  border-radius: 20px;
  padding: 5px 14px;
  margin-bottom: 28px;
}

/* Pulsing dot inside badge */
.cover-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.cover h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 20px;
}

/* Gradient text on the italic part of the title */
.cover h1 em {
  font-style: italic;
  background: linear-gradient(90deg, var(--accent), #C49A30);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cover-author {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 28px;
}

.cover-author-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.cover-author-meta {
  font-size: 12.5px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.cover-description {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 36px;
}

.cover-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ════════════════════════════════════════════
   CONTENT WRAPPER & SECTIONS
════════════════════════════════════════════ */

.content-wrapper {
  padding: 0 80px 120px;
  max-width: 920px;
}

.section {
  padding-top: 80px;
}

.section-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-soft);
}

.section-num {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(139, 105, 20, 0.09);
  border: 1px solid rgba(139, 105, 20, 0.22);
  border-radius: 6px;
  padding: 4px 10px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 6px;
}

.section-header h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}
