/* ============================================================
   Embedded Mastery Tutorial — PDF Styles (WeasyPrint-compatible)
   Self-contained stylesheet with no unsupported CSS properties.
   ============================================================ */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 11pt;
  line-height: 1.6;
  color: #1a1a2e;
  background-color: #ffffff;
}

/* Hide interactive elements */
#sidebar,
#sidebar-overlay,
#topbar,
#footer,
.page-nav,
#sidebar-close,
#sidebar-toggle,
#theme-toggle {
  display: none !important;
}

/* --- Main Content --- */
#content {
  margin-left: 0;
  margin-top: 0;
}

#main-article {
  max-width: 100%;
  padding: 0;
  margin: 0;
}

/* --- Typography --- */
.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e2e5e9;
}

h1.title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: #1a1a2e;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.15rem;
  color: #4a4a5a;
  font-weight: 400;
}

.author, .date {
  color: #6b7280;
  font-size: 0.9rem;
}

h1 { font-size: 1.75rem; font-weight: 700; margin: 2rem 0 0.75rem; line-height: 1.3; }
h2 { font-size: 1.35rem; font-weight: 600; margin: 1.75rem 0 0.65rem; line-height: 1.35; }
h3 { font-size: 1.15rem; font-weight: 600; margin: 1.25rem 0 0.4rem; }
h4 { font-size: 1rem; font-weight: 600; margin: 1rem 0 0.4rem; }

p {
  margin-bottom: 0.75rem;
  color: #1a1a2e;
}

a {
  color: #1a1a2e;
  text-decoration: underline;
}

/* --- Code --- */
code {
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", "Source Code Pro", "Consolas", "Monaco", monospace;
  font-size: 0.85em;
  background: #f0f2f5;
  color: #e83e8c;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid #e5e7eb;
}

pre {
  background: #f6f8fa;
  border: 1px solid #e2e5e9;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  font-size: 0.85rem;
  line-height: 1.55;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: #24292e;
  font-size: inherit;
}

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.85rem;
  border: 1px solid #e2e5e9;
  border-radius: 6px;
}

thead {
  background: #f0f2f5;
}

th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  font-weight: 600;
  color: #1a1a2e;
  border-bottom: 2px solid #e2e5e9;
}

td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid #e2e5e9;
  color: #4a4a5a;
}

tbody tr:nth-child(even) {
  background: #f8f9fa;
}

/* --- Lists --- */
ul, ol {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.25rem;
}

li > ul, li > ol {
  margin-top: 0.2rem;
  margin-bottom: 0.2rem;
}

/* --- Checklists --- */
ul:has(input[type="checkbox"]) {
  list-style: none;
  padding-left: 0;
}

ul:has(input[type="checkbox"]) li {
  padding-left: 0.25rem;
}

input[type="checkbox"] {
  margin-right: 0.5rem;
}

/* --- Blockquotes / Callouts --- */
blockquote {
  border-left: 4px solid #d1d5db;
  padding: 0.85rem 1rem;
  margin: 1rem 0;
  background: #f6f8fa;
  border-radius: 0 6px 6px 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

blockquote.tip {
  border-left-color: #a5d6a7;
  background: #e8f5e9;
}

blockquote.warning {
  border-left-color: #ffe082;
  background: #fff8e1;
}

blockquote.note {
  border-left-color: #90caf9;
  background: #e3f2fd;
}

/* --- Horizontal Rule --- */
hr {
  border: none;
  height: 2px;
  background: #e2e5e9;
  margin: 1.5rem 0;
  border-radius: 1px;
}

/* --- Images --- */
img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.25rem 0;
}

/* --- Syntax Highlighting (Tango light) --- */
span.kw { color: #204a87; font-weight: 500; }
span.dt { color: #204a87; }
span.dv { color: #0000cf; }
span.bn { color: #0000cf; }
span.fl { color: #0000cf; }
span.ch { color: #4e9a06; }
span.st { color: #4e9a06; }
span.co { color: #8f5902; font-style: italic; }
span.ot { color: #204a87; }
span.al { color: #ef2929; font-weight: 500; }
span.fu { color: #000000; }
span.re { color: #0000cf; }
span.er { color: #ef2929; font-weight: 500; }
span.cn { color: #0000cf; font-weight: 500; }
span.sc { color: #4e9a06; }
span.ss { color: #4e9a06; }
span.im { color: #8f5902; }
span.va { color: #ce5c00; }
span.cf { color: #204a87; font-weight: 500; }
span.op { color: #204a87; }
span.pp { color: #8f5902; }

/* --- Page breaks --- */
h1, h2, h3 {
  page-break-after: avoid;
}

pre, table, blockquote {
  page-break-inside: avoid;
}
