/* ==========================================================
   Building Real-World Agentic AI Systems with LangGraph
   Enhanced EPUB / HTML Styles
   Author: Ranjan Kumar
   Version: 1.4
   ========================================================== */

/* ------------------------------
   Global Layout
------------------------------ */
body {
  font-family: "Georgia", "Times New Roman", serif;
  line-height: 1.6;
  font-size: 1em;
  margin: 0 7%;
  color: #222;
  background: #fff;
}

/* ------------------------------
   Headings
------------------------------ */
h1, h2, h3, h4, h5 {
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #003366;
  font-weight: 700;
  margin-top: 1.8em;
  margin-bottom: 0.7em;
}

h1 {
  font-size: 1.8em;
  border-bottom: 3px solid #00509e;
  padding-bottom: 0.4em;
}

h2 {
  font-size: 1.5em;
  border-left: 4px solid #0077cc;
  padding-left: 0.5em;
}

h3 {
  font-size: 1.25em;
  color: #0a3d62;
}

/* ------------------------------
   Section Numbering Control
------------------------------ */
h4 .header-section-number,
h5 .header-section-number,
h6 .header-section-number {
  display: none;
}

/* ------------------------------
   Links
------------------------------ */
a {
  color: #0077cc;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ------------------------------
   Paragraphs & Lists
------------------------------ */
p, ul, ol {
  margin-top: 0.4em;
  margin-bottom: 0.8em;
}

li {
  margin-bottom: 0.4em;
}

/* ==========================================================
   CODE BLOCKS — BASE
========================================================== */
pre, code {
  font-family: "JetBrains Mono", "Courier New", monospace;
}

code {
  background: #f7f9fb;
  border: 1px solid #e0e6ef;
  border-radius: 4px;
  padding: 0.1em 0.3em;
  font-size: 0.95em;
}

pre {
  background: #f7f9fb;
  border: 1px solid #e0e6ef;
  border-radius: 6px;
  padding: 0.9em 1em;
  overflow-x: auto;
  font-size: 0.92em;
  line-height: 1.45;
}

/* ==========================================================
   QUARTO / PYTHON SYNTAX HIGHLIGHTING
========================================================== */
pre.sourceCode {
  background: #f6f8fa;
  border-left: 5px solid #00509e;
}

/* Base token */
.sourceCode span {
  color: #24292e;
}

/* Keywords (def, class, return, if) */
.sourceCode .kw {
  color: #005cc5;
  font-weight: 600;
}

/* Function & class names */
.sourceCode .fu,
.sourceCode .dt {
  color: #6f42c1;
}

/* Strings */
.sourceCode .st {
  color: #032f62;
}

/* Numbers */
.sourceCode .dv,
.sourceCode .bn,
.sourceCode .fl {
  color: #005cc5;
}

/* Comments */
.sourceCode .co {
  color: #6a737d;
  font-style: italic;
}

/* Decorators, builtins */
.sourceCode .bu {
  color: #d73a49;
}

/* Operators */
.sourceCode .op {
  color: #d73a49;
}

/* Errors */
.sourceCode .er {
  color: #b31d28;
  background: #ffeef0;
}

/* ==========================================================
   ChatML / Agent Prompt Highlighting
========================================================== */
code.language-chatml {
  background: #eef5ff;
  border-left: 4px solid #007bff;
  display: block;
  padding: 0.9em 1em;
  color: #003366;
  white-space: pre-wrap;
}

/* ChatML markers */
.language-chatml span.im-start {
  color: #00509e;
  font-weight: bold;
}

.language-chatml span.im-end {
  color: #cc0000;
  font-weight: bold;
}

/* ==========================================================
   Tables
========================================================== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.95em;
}

th, td {
  border: 1px solid #ccc;
  padding: 0.6em;
}

th {
  background-color: #f0f4f8;
  text-align: left;
}

/* ==========================================================
   Notes, Tips, Warnings
========================================================== */
div.note, div.tip, div.warning {
  border-left: 5px solid #0077cc;
  background: #f8fbff;
  padding: 0.8em 1em;
  margin: 1em 0;
  border-radius: 4px;
}

div.tip {
  border-color: #00b894;
  background: #f2fff9;
}

div.warning {
  border-color: #e17055;
  background: #fff6f5;
}

/* ==========================================================
   Blockquotes
========================================================== */
blockquote {
  border-left: 4px solid #0077cc;
  background: #f8f9fc;
  margin: 1em 2em;
  padding: 0.6em 1em;
  font-style: italic;
  color: #444;
}

/* ==========================================================
   Figures & Images
========================================================== */
figure, img {
  display: block;
  margin: 1.5em auto;
  max-width: 95%;
}

figcaption {
  text-align: center;
  font-size: 0.9em;
  color: #555;
}

/* ==========================================================
   Footer
========================================================== */
footer {
  text-align: center;
  font-size: 0.85em;
  color: #666;
  margin-top: 3em;
  border-top: 1px solid #ddd;
  padding-top: 1em;
}

/* ==========================================================
   Page Breaks (EPUB / PDF)
========================================================== */
.page-break {
  page-break-before: always;
  margin-top: 2em;
}
