/* Abilis CPX Tutorial — Stylesheet */

body {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 20px;
  font-family: -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: #222;
}

h1 { font-size: 24px; border-bottom: 2px solid #0366d6; padding-bottom: 8px; }
h2 { font-size: 19px; margin-top: 40px; padding-top: 20px; border-top: 1px solid #e0e0e0; color: #0366d6; }
h2:first-of-type { border-top: none; padding-top: 0; margin-top: 24px; }
h3 { font-size: 16px; margin-top: 22px; }

p { margin: 10px 0; }

a { color: #0366d6; }

/* Tables */
table { border-collapse: collapse; width: 100%; margin: 14px 0; }
th, td { border: 1px solid #ddd; padding: 8px 10px; text-align: left; font-size: 14px; }
th { background: #f5f5f5; }

/* Inline code & GUI labels */
code { background: #f0f0f0; padding: 1px 5px; border-radius: 3px; font-size: 13px; }
.gui { background: #e8f0fe; padding: 2px 6px; border-radius: 3px; font-weight: 600; white-space: nowrap; }

/* Callout boxes */
.note, .warning, .tip {
  border-left: 4px solid; padding: 12px 16px 12px 40px; margin: 16px 0; border-radius: 4px;
  position: relative;
}
.note    { border-color: #0366d6; background: #f0f7ff; }
.warning { border-color: #d73a49; background: #fff5f5; }
.tip     { border-color: #28a745; background: #f0fff0; }
.note::before    { content: "Note: "; font-weight: 700; }
.warning::before { content: "Warning: "; font-weight: 700; }
.tip::before     { content: "Tip: "; font-weight: 700; }

/* Step-by-step instructions */
ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
ol.steps > li {
  counter-increment: step;
  margin-bottom: 12px;
  padding-left: 36px;
  position: relative;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: #0366d6; color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Screenshot / diagram placeholder */
.screenshot {
  background: #f9f9f9;
  border: 2px dashed #ccc;
  border-radius: 6px;
  padding: 20px;
  margin: 16px 0;
  text-align: center;
  color: #888;
  font-size: 13px;
  font-style: italic;
}

/* Inline SVG diagrams */
.diagram {
  margin: 16px 0;
  text-align: center;
}
.diagram svg { max-width: 100%; height: auto; }

/* Help desk callout */
.helpdesk {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 16px 0;
  font-size: 14px;
}
.helpdesk::before {
  content: "Need help? ";
  font-weight: 700;
}

/* Beyond Abilis — features requiring third-party integration */
.beyond {
  background: #fff0f0;
  border: 1px solid #e57373;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 16px 0;
  font-size: 14px;
  color: #b71c1c;
}
.beyond::before {
  content: "Beyond Abilis: ";
  font-weight: 700;
}

/* Jargon explanation */
.jargon {
  background: #e8f5e9;
  border-radius: 4px;
  padding: 8px 12px;
  margin: 10px 0;
  font-size: 14px;
}
.jargon::before {
  content: "What does this mean? ";
  font-weight: 700;
  font-size: 13px;
}

/* Inline SVG icons */
img.icon { width: 20px; height: 20px; vertical-align: middle; margin-right: 3px; }
img.icon-lg { width: 28px; height: 28px; vertical-align: middle; margin-right: 4px; }

/* Screenshots */
img.screenshot {
  max-width: 100%; height: auto; border: 1px solid #ddd;
  border-radius: 6px; margin: 12px 0; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.fig { margin: 16px 0; }
.fig figcaption { font-size: 13px; color: #666; font-style: italic; margin-top: 4px; }

/* Support contact footer */
.support-contact {
  background: #f0f7ff; border: 1px solid #c8ddf0; border-radius: 6px;
  padding: 14px 16px; margin: 30px 0 10px; font-size: 14px; line-height: 1.8;
}
.support-contact strong { display: block; margin-bottom: 4px; }
.support-contact a { font-weight: 600; }

/* Previous / Next page navigation */
.page-nav {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  margin-top: 30px; padding-top: 16px; border-top: 1px solid #ddd; font-size: 14px;
}
.page-nav a {
  padding: 6px 14px; background: #f5f5f5; border: 1px solid #ddd;
  border-radius: 4px; text-decoration: none; color: #0366d6;
}
.page-nav a:hover { background: #e8f0fe; }

/* Scenario box */
.scenario {
  background: #fafafa; border: 1px solid #e0e0e0; border-radius: 6px;
  padding: 14px 16px; margin: 14px 0;
}
.scenario h4 { margin: 0 0 6px; font-size: 14px; color: #333; }
.scenario p { margin: 0 0 6px; font-size: 14px; }

/* How-To index cards */
.howto-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 16px 0; }
.howto-card {
  border: 1px solid #ddd; border-radius: 6px; padding: 16px; background: #fafafa;
}
.howto-card h3 { margin: 0 0 8px; font-size: 16px; color: #0366d6; }
.howto-card p { font-size: 14px; margin: 0 0 8px; }
.howto-card ul { margin: 4px 0 0 18px; font-size: 13px; }
.howto-card ul li { margin-bottom: 3px; }

/* Horizontal rule */
hr { border: none; border-top: 1px solid #ddd; margin: 30px 0; }

/* Table of Contents */
.toc {
  background: #f8f9fa;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 16px 20px;
  margin: 20px 0 30px;
}
.toc h3 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #24292e;
}
.toc ol {
  margin: 0;
  padding-left: 22px;
  columns: 2;
  column-gap: 30px;
}
.toc ol li {
  font-size: 13px;
  line-height: 1.8;
  break-inside: avoid;
}
.toc ol li a {
  color: #0366d6;
  text-decoration: none;
}
.toc ol li a:hover {
  text-decoration: underline;
}
@media (max-width: 600px) {
  .toc ol { columns: 1; }
}

/* Responsive: tables scroll horizontally on small screens */
table { display: block; overflow-x: auto; }

/* Responsive: small screens */
@media (max-width: 600px) {
  body { padding: 14px 10px; font-size: 14px; }
  h1 { font-size: 20px; }
  h2 { font-size: 17px; }
  .gui { white-space: normal; }
  ol.steps > li { padding-left: 30px; }
  ol.steps > li::before { width: 22px; height: 22px; font-size: 11px; }
}

/* CLI reference — collapsed, non-intrusive block.
   Appears at the foot of how-to sections where a direct CLI counterpart
   exists in the old Abilis manual. Closed by default; users who want the
   CLI command sequence open it with one click. */
details.cli-ref {
  margin: 24px 0 8px 0;
  border-top: 1px dashed #d0d7de;
  padding-top: 10px;
  font-size: 13px;
  color: #57606a;
}
details.cli-ref > summary {
  cursor: pointer;
  color: #57606a;
  font-weight: 500;
  padding: 2px 0;
  list-style: none;
  user-select: none;
}
details.cli-ref > summary::-webkit-details-marker { display: none; }
details.cli-ref > summary::before {
  content: "▸ ";
  display: inline-block;
  margin-right: 4px;
  transition: transform 0.15s ease;
}
details.cli-ref[open] > summary::before {
  content: "▾ ";
}
details.cli-ref > summary:hover {
  color: #0366d6;
}
details.cli-ref .cli-ref-body {
  margin-top: 8px;
  padding: 10px 14px;
  background: #f6f8fa;
  border-left: 3px solid #d0d7de;
  border-radius: 0 4px 4px 0;
  color: #444;
}
details.cli-ref .cli-ref-body a {
  color: #0366d6;
  text-decoration: none;
}
details.cli-ref .cli-ref-body a:hover {
  text-decoration: underline;
}
details.cli-ref .cli-ref-body em {
  color: #57606a;
  font-size: 12px;
}

/* Back-to-top button (how-to pages) */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0366d6;
  color: #fff;
  border: none;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, background 0.15s ease;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-to-top.visible { opacity: 0.9; visibility: visible; }
.back-to-top:hover   { opacity: 1; background: #0257b8; }
.back-to-top:focus-visible { outline: 2px solid #0366d6; outline-offset: 2px; }
@media (max-width: 600px) {
  .back-to-top { bottom: 16px; right: 16px; width: 38px; height: 38px; font-size: 18px; }
}
