/* ─────────────────────────────────────────────
   Thenema Writer — Panel Manuals  v1.0
   Shared stylesheet for all seven manuals
   ───────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Playfair+Display:wght@700;900&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── Tokens ── */
:root {
  --navy:    #0d1f33;
  --blue:    #2c7bd9;
  --blue-lt: #e8f2fc;
  --amber:   #b98245;
  --amber-lt:#fdf6ec;
  --green:   #27ae60;
  --green-lt:#edf8f2;
  --red:     #c0392b;
  --red-lt:  #fdf0ee;
  --teal:    #0d7377;
  --teal-lt: #e6f7f7;
  --purple:  #8844aa;
  --purple-lt:#f5ecfa;
  --ink:     #1a2232;
  --muted:   #5a6a80;
  --rule:    #dde5ef;
  --page:    #f8fafc;
  --white:   #ffffff;
  --card-bg: #ffffff;
  --radius:  8px;
  --shadow:  0 2px 12px rgba(13,31,51,.08);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.manual-wrapper {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

/* ── Sidebar nav ── */
.manual-nav {
  grid-row: 1 / 3;
  background: var(--navy);
  padding: 0 0 40px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--blue) var(--navy);
}

.nav-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 12px;
}
.nav-logo .brand {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--blue);
  letter-spacing: .5px;
}
.nav-logo .sub {
  font-size: 10px;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 2px;
}

.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: rgba(255,255,255,.28);
  padding: 16px 20px 4px;
}

.manual-nav a {
  display: block;
  padding: 8px 20px;
  font-size: 12.5px;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.manual-nav a:hover {
  color: #fff;
  background: rgba(44,123,217,.15);
  border-left-color: var(--blue);
}
.manual-nav a.active {
  color: #fff;
  font-weight: 600;
  background: rgba(44,123,217,.18);
  border-left-color: var(--blue);
}
.nav-divider {
  height: 1px;
  background: rgba(255,255,255,.07);
  margin: 12px 0;
}
.nav-back {
  display: block;
  margin: 16px 20px 0;
  padding: 7px 12px;
  background: rgba(44,123,217,.15);
  border: 1px solid rgba(44,123,217,.3);
  border-radius: var(--radius);
  color: var(--blue) !important;
  font-size: 11.5px;
  text-align: center;
  border-left: 3px solid var(--blue) !important;
}

/* ── Top bar ── */
.manual-topbar {
  grid-column: 2;
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  padding: 14px 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.manual-topbar .breadcrumb {
  font-size: 12px;
  color: var(--muted);
}
.manual-topbar .breadcrumb span {
  color: var(--blue);
  font-weight: 600;
}
.topbar-badge {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  background: var(--blue-lt);
  color: var(--blue);
}

/* ── Main content ── */
.manual-content {
  grid-column: 2;
  padding: 48px 48px 80px;
  max-width: 820px;
}

/* ── Hero ── */
.manual-hero {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 2px solid var(--rule);
}
.hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--blue);
  margin-bottom: 10px;
}
.manual-hero h1 {
  font-family: var(--font-display);
  font-size: 42px;
  line-height: 1.15;
  color: var(--navy);
  margin-bottom: 14px;
}
.manual-hero .lead {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 640px;
}

/* ── Sections ── */
.manual-section {
  margin-bottom: 52px;
}
.manual-section h2 {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--navy);
  margin-bottom: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.section-intro {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 22px;
}
.manual-section h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin: 28px 0 10px;
}
.manual-section h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin: 22px 0 8px;
}
.manual-section p {
  margin-bottom: 14px;
}

/* ── Figure / image placeholder ── */
figure {
  margin: 28px 0;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
figure .img-placeholder {
  background: linear-gradient(135deg,#e8f2fc 0%,#f0f4f8 100%);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
  padding: 32px;
  text-align: center;
}
figure .img-placeholder .ph-icon {
  font-size: 36px;
  opacity: .5;
}
figure figcaption {
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
}

/* ── Tip / callout boxes ── */
.callout {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 22px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.callout-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.callout-body { flex: 1; }
.callout-body strong { display: block; margin-bottom: 4px; font-size: 13px; }
.callout-body p { margin: 0; font-size: 13.5px; }

.callout.tip   { background: var(--blue-lt);   border-left: 4px solid var(--blue); }
.callout.note  { background: var(--amber-lt);  border-left: 4px solid var(--amber); }
.callout.ai    { background: var(--teal-lt);   border-left: 4px solid var(--teal); }
.callout.warn  { background: var(--red-lt);    border-left: 4px solid var(--red); }
.callout.good  { background: var(--green-lt);  border-left: 4px solid var(--green); }

/* ── Step list ── */
.steps { list-style: none; counter-reset: step; margin: 20px 0; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  margin-bottom: 18px;
  align-items: start;
}
.steps li::before {
  content: counter(step);
  width: 36px; height: 36px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.steps li .step-body strong { font-size: 14px; display: block; margin-bottom: 3px; color: var(--navy); }
.steps li .step-body p { margin: 0; font-size: 13.5px; color: var(--ink); }

/* ── Feature grid ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.feature-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s;
}
.feature-card:hover { box-shadow: 0 4px 20px rgba(13,31,51,.12); }
.feature-card .fc-icon { font-size: 22px; margin-bottom: 8px; }
.feature-card h4 { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--navy); text-transform: none; letter-spacing: 0; }
.feature-card p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ── Connection table ── */
.conn-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 13.5px;
}
.conn-table th {
  background: var(--navy);
  color: #fff;
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.conn-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.conn-table tr:last-child td { border-bottom: none; }
.conn-table tr:nth-child(even) td { background: var(--page); }

/* ── Keyboard shortcut badge ── */
kbd {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--navy);
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #334;
}

/* ── Code / path snippets ── */
code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: #f0f4f8;
  color: #c0392b;
  padding: 2px 6px;
  border-radius: 3px;
}

/* ── "Send to" pill ── */
.send-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin: 3px 3px 3px 0;
}
.send-pill.blue   { background: #ddeeff; color: var(--blue); }
.send-pill.green  { background: #ddf5ea; color: var(--green); }
.send-pill.purple { background: #f0e8fa; color: var(--purple); }
.send-pill.amber  { background: var(--amber-lt); color: var(--amber); }
.send-pill.teal   { background: var(--teal-lt); color: var(--teal); }
.send-pill.red    { background: var(--red-lt);  color: var(--red); }

/* ── Footer ── */
.manual-footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.manual-footer a { color: var(--blue); text-decoration: none; }

/* ── Print ── */
@media print {
  .manual-nav, .manual-topbar { display: none; }
  .manual-wrapper { grid-template-columns: 1fr; }
  .manual-content { grid-column: 1; padding: 20px; max-width: none; }
  figure .img-placeholder { min-height: 140px; }
  .callout, .feature-card { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .manual-wrapper { grid-template-columns: 1fr; }
  .manual-nav { display: none; }
  .manual-topbar, .manual-content { grid-column: 1; }
  .manual-content { padding: 24px 20px 60px; }
}
