/* ============================================================
   print.css — varianta tipăribilă a paginilor de curs și laborator
   Se aplică atât la Ctrl+P din browser, cât și la PDF-urile
   generate automat (tools/pdf.js).
   ============================================================ */

@media print {

/* ---------- pagina ---------- */
@page {
  size: A4;
  margin: 17mm 15mm 17mm 15mm;
}

:root {
  --navy: #0b3824;
  --ink: #14231b;
  --muted: #5e6357;
  --border: #c6c3b9;
}

html { font-size: 10.5pt; }

body {
  background: #fff !important;
  color: var(--ink) !important;
  line-height: 1.5;
  font-family: "Segoe UI", Roboto, -apple-system, sans-serif;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* ---------- elemente care nu se tipăresc ---------- */
.site-header,
.site-footer,
.nav-toggle,
.lab-nav,
.copy-btn,
.cod-b-run,
.cod-b-sol,
.or-btn,
.rl-btn,
.ns-btn,
.ns-tools,
.ns-input,
.ns-prompt,
.mc-buton,
.mc-trimite,
.mc-viteza,
.print-hide {
  display: none !important;
}

/* butoanele din widgeturi, generic */
.widget button,
.widget input[type="range"],
.widget input[type="text"],
.widget select,
.widget textarea {
  display: none !important;
}

/* ---------- blocul de titlu ---------- */
.lab-hero {
  background: #fff !important;
  color: var(--navy) !important;
  padding: 0 0 5mm !important;
  margin: 0 0 7mm !important;
  border-bottom: 2pt solid var(--accent, #a35d26);
  break-after: avoid;
}
.lab-hero .container { padding: 0 !important; max-width: none !important; }
.lab-hero::after, .lab-hero::before { display: none !important; content: none !important; }

.lab-hero .crumb,
.lab-hero .crumb a {
  color: var(--muted) !important;
  font-size: 8.5pt;
  text-transform: uppercase;
  letter-spacing: 0.6pt;
  text-decoration: none;
}

.lab-num {
  display: inline-block;
  background: transparent !important;
  color: var(--accent, #a35d26) !important;
  border: 1pt solid var(--accent, #a35d26);
  padding: 1.5pt 6pt !important;
  font-size: 8pt;
  letter-spacing: 1pt;
  margin-bottom: 3mm !important;
}

.lab-hero h1 {
  font-size: 20pt !important;
  line-height: 1.2;
  color: var(--navy) !important;
  margin: 0 0 3mm !important;
  letter-spacing: -0.3pt;
}

.lab-chips { gap: 4pt !important; }
.lab-chip {
  background: transparent !important;
  border: none !important;
  border-left: 2pt solid var(--border) !important;
  border-radius: 0 !important;
  color: var(--ink) !important;
  font-family: inherit !important;
  font-size: 8.5pt !important;
  padding: 0 8pt 0 6pt !important;
  text-decoration: none;
}
.lab-chip b { color: var(--muted) !important; font-weight: 600; }

/* ---------- structura paginii ---------- */
.lab-layout {
  display: block !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.lab-body { max-width: none !important; }

.lab-lead {
  font-size: 11pt;
  color: var(--ink) !important;
  border-left: 2.5pt solid var(--border);
  padding-left: 4mm;
  margin: 0 0 6mm !important;
}

/* ---------- cuprinsul, ca bloc pe prima pagină ---------- */
.lab-toc {
  position: static !important;
  max-height: none !important;
  overflow: visible !important;
  border: 1pt solid var(--border) !important;
  border-left: 1pt solid var(--border) !important;
  border-radius: 2pt;
  padding: 4mm 5mm !important;
  margin: 0 0 7mm !important;
  font-size: 9pt !important;
  break-inside: avoid;
  break-after: page;
  counter-reset: toc;
}
.lab-toc h4 {
  font-size: 8pt !important;
  letter-spacing: 1pt;
  color: var(--muted) !important;
  margin: 0 0 3mm !important;
}
.lab-toc a {
  display: flex;
  align-items: baseline;
  gap: 2mm;
  color: var(--ink) !important;
  text-decoration: none;
  padding: 1.2mm 0;
  border-bottom: 0.4pt dotted var(--border);
  counter-increment: toc;
}
.lab-toc a::before {
  content: counter(toc) ".";
  display: inline-block;
  width: 7mm;
  color: var(--muted);
}
.lab-toc a:last-child { border-bottom: none; }
.lab-toc a.active {
  background: transparent !important;
  border-left: none !important;
  color: var(--ink) !important;
  font-weight: 400 !important;
  padding-left: 0 !important;
}
.lab-toc a i {
  margin-left: auto;
  font-style: normal;
  color: var(--muted) !important;
  font-size: 8pt;
}

/* ---------- titluri ---------- */
.lab-body h2 {
  font-size: 14pt !important;
  color: var(--navy) !important;
  margin: 7mm 0 3mm !important;
  padding-bottom: 1.5mm;
  border-bottom: 0.8pt solid var(--border);
  break-after: avoid;
  break-inside: avoid;
}
.lab-body h2 .h-num {
  color: var(--accent, #a35d26) !important;
  background: transparent !important;
  margin-right: 2mm;
}
.lab-body h2 .h-min {
  float: right;
  font-weight: 400;
  font-size: 8.5pt;
  color: var(--muted) !important;
}
.lab-body h3 {
  font-size: 11.5pt !important;
  color: var(--navy) !important;
  margin: 5mm 0 2mm !important;
  break-after: avoid;
}
.lab-body h4 { break-after: avoid; }

.lab-body section { break-before: auto; }

p, li { orphans: 3; widows: 3; }
p { margin: 0 0 2.5mm; }
ul, ol { margin: 0 0 3mm; padding-left: 6mm; }
li { margin-bottom: 1mm; }

a { color: var(--navy) !important; text-decoration: none; }

/* ---------- casete de text evidențiat ---------- */
.note, .tip, .warn, .rl-def, .rl-ex, .rl-pro, .rl-mist,
.rl-recap, .rl-key, .cod-nota, .cod-avert, .verdict, .ns-hint {
  break-inside: avoid;
  box-shadow: none !important;
  border-radius: 2pt !important;
}

/* ---------- cod ---------- */
.code-wrap {
  break-inside: avoid;
  margin: 3mm 0 4mm !important;
  border: 0.8pt solid var(--border);
  border-radius: 2pt;
  overflow: hidden;
}
.code-wrap .code-head {
  background: #f2f1ee !important;
  color: #31453a !important;
  border-bottom: 0.8pt solid var(--border);
  font-size: 8pt !important;
  padding: 1.5mm 3mm !important;
}
.code-wrap .code-head span::before { color: #3a6d53 !important; }
.code-wrap pre {
  background: #fafbfc !important;
  color: #19241e !important;
  font-size: 8.5pt !important;
  line-height: 1.42 !important;
  padding: 3mm !important;
  margin: 0 !important;
  white-space: pre-wrap;
  word-break: break-word;
  border: none !important;
}
/* paleta de sintaxă, variantă pentru hârtie */
.code-wrap pre .tk-k { color: #8a2a7a !important; font-weight: 600; }
.code-wrap pre .tk-s { color: #0b6b3a !important; }
.code-wrap pre .tk-c { color: #73786b !important; font-style: italic; }
.code-wrap pre .tk-n { color: #9a4a12 !important; }
.code-wrap pre .tk-p { color: #19241e !important; }

/* ---------- tabele ---------- */
table {
  break-inside: auto;
  border-collapse: collapse;
  width: 100%;
  font-size: 9pt;
  margin: 3mm 0 4mm;
}
thead { display: table-header-group; }
tr { break-inside: avoid; }
th, td {
  border: 0.5pt solid var(--border) !important;
  padding: 1.5mm 2.5mm !important;
  text-align: left;
  vertical-align: top;
}
th { background: #f2f1ee !important; color: var(--navy) !important; font-weight: 600; }

/* ---------- figuri, diagrame, imagini ---------- */
img, svg, canvas { max-width: 100% !important; height: auto; break-inside: avoid; }
.fig, .rl-topo, .ns-topo, .rl-wave, .rl-flow, .pinout, .mc-montaj {
  break-inside: avoid;
}

/* ---------- widgeturi interactive ---------- */
.widget {
  break-inside: avoid;
  background: #fbfcfd !important;
  border: 0.8pt solid var(--border) !important;
  border-radius: 2pt !important;
  box-shadow: none !important;
  padding: 3mm 4mm !important;
  margin: 3mm 0 4mm !important;
}
.widget .w-title {
  font-size: 8.5pt !important;
  color: var(--muted) !important;
  letter-spacing: 0.5pt;
}
.widget::after {
  content: "Versiune interactivă pe site.";
  display: block;
  margin-top: 2.5mm;
  padding-top: 1.5mm;
  border-top: 0.4pt dotted var(--border);
  font-size: 7.5pt;
  font-style: italic;
  color: var(--muted);
}
.widget[data-widget="quiz"]::after { content: none; }

/* Bancul de lucru este interactiv prin definiție. Pe hârtie păstrăm doar
   ce se poate citi: topologia și lista de obiective. Restul — consola,
   panoul de configurare, tabelele de stare — rămâne online. */
.ns-term, .ns-scroll, .ns-msg, .ns-trace, .ns-count, .ns-tw,
.ns-cab, .ns-chips, .ns-head, .ns-x, .ns-dot,
.ns-task, .ns-mac, .ns-inline {
  display: none !important;
}
/* din panoul lateral păstrăm doar lista de obiective */
.ns-panel:has(input), .ns-panel:has(select), .ns-panel:has(.ns-cab),
.ns-panel.ns-wide { display: none !important; }
.ns-side { display: block !important; }
.ns-panel h5 { font-size: 8pt !important; color: var(--muted) !important; margin: 0 0 2mm !important; }
.ns-panel h5 b { color: var(--navy) !important; }
.ns {
  border: 0.8pt solid var(--border) !important;
  border-radius: 2pt !important;
  background: #fff !important;
  overflow: hidden !important;
  max-width: 100% !important;
  break-inside: avoid;
  padding: 3mm !important;
}
.ns-work, .ns-panel {
  display: block !important;
  border: none !important;
  background: #fff !important;
  padding: 0 !important;
  max-width: 100% !important;
}
.ns-topo { margin: 0 auto 3mm !important; }
.ns-topo svg { min-width: 0 !important; width: 100% !important; max-width: 150mm !important; }
.ns-goals { font-size: 9pt; }
.ns-goals li::before { color: var(--muted) !important; }
.ns::after {
  content: "Bancul de lucru rulează doar în pagina online: consola, configurarea echipamentelor și verificarea automată a obiectivelor.";
  display: block;
  margin-top: 2mm;
  padding-top: 1.5mm;
  border-top: 0.4pt dotted var(--border);
  font-size: 7.5pt;
  font-style: italic;
  color: var(--muted);
}

/* ---------- quiz ---------- */
.quiz-q { break-inside: avoid; border: 0.8pt solid var(--border) !important; background: #fff !important; padding: 3mm 4mm !important; }
.quiz-opt { border: 0.5pt solid var(--border) !important; padding: 1.2mm 3mm !important; margin-bottom: 1.2mm; font-size: 9.5pt; }
.quiz-fb { display: none !important; }

/* cheia de răspunsuri, generată de print.js */
.print-key {
  break-inside: avoid;
  margin: 2mm 0 4mm;
  padding: 2.5mm 4mm;
  border-left: 2pt solid var(--accent, #a35d26);
  background: #f8f7f5 !important;
  font-size: 8.5pt;
}
.print-key b { color: var(--navy); }
.print-key p { margin: 0 0 1mm; }

/* ---------- resturi de aspect ecran ---------- */
* { box-shadow: none !important; }
.container { max-width: none !important; padding: 0 !important; }

}
