/* Network Skills theme — Lab page template. Loaded after style.css only where needed (see ns_scripts() in functions.php). */

/* ---------- SINGLE LAB PAGE ---------- */
.lab-meta{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:14px;font-size:16px;color:var(--muted);}

.lab-back{margin-top:24px;}

/* Solution toggle */
.solution-block{margin-top:20px;}
.solution-block > summary{
  list-style:none;cursor:pointer;display:flex;align-items:center;gap:14px;
  background:var(--panel);border:1px solid var(--line);border-left:3px solid var(--amber);
  border-radius:10px;padding:18px 22px;box-shadow:var(--shadow-sm);
}
.solution-block > summary::-webkit-details-marker{display:none;}
.solution-block > summary:hover{border-color:var(--blue);border-left-color:var(--amber);}
.solution-label{font-weight:700;font-size:18px;}
.solution-label:before{content:"▸ ";color:var(--amber);}
.solution-block[open] > summary{border-radius:10px 10px 0 0;border-bottom:none;}
.solution-block[open] .solution-label:before{content:"▾ ";}
.solution-hint{font-size:16px;color:var(--muted);margin-left:auto;}

@media(max-width:560px){
  .solution-block > summary{flex-direction:column;align-items:flex-start;gap:6px;padding:16px;}
  .solution-hint{margin-left:0;}
}

/* ============================================================
   LAB PAGE (HTML) — 1.51.0
   Template "Lab page (HTML)": the lab is written by hand as HTML in the
   editor; these rules style the .lab-* classes. assets/lab.js adds the
   terminal windows (<pre class="cli">), Copy and the task counter.
   ============================================================ */
.ns-lab-body > * + *{margin-top:20px;}
.ns-lab-body p:empty{display:none;}
.ns-lab-body ul{list-style:none;padding-left:0;}
.ns-lab-body ul > li{position:relative;padding-left:18px;margin-bottom:6px;}
.ns-lab-body ul > li:before{content:"—";position:absolute;left:0;color:var(--blue);}
.ns-lab-body ol{padding-left:22px;}
.ns-lab-body ol > li::marker{color:var(--blue);font-weight:700;}
.ns-lab-count{color:var(--muted);}

/* Cards */
.ns-lab-body .lab-steps,
.ns-lab-body .lab-card{background:var(--panel);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow-sm);}
.ns-lab-body .lab-card{padding:22px 26px 24px;}
/* text before the tasks (moved into the card by lab.js) */
.ns-lab-body .lab-steps > .lab-intro{margin:0;padding:20px 0;border-bottom:1px solid var(--line);}
.ns-lab-body > .lab-lead{margin:0 0 22px;max-width:none;font-size:17px;line-height:1.65;}
.lab-h{margin:0 0 14px;font-size:14px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);}
.lab-h span{font-weight:500;text-transform:none;letter-spacing:0;}

/* Numbered steps: the number is a CSS counter, nothing to type */
.lab-steps{counter-reset:lab-step;padding:6px 26px;}
.lab-step{counter-increment:lab-step;display:grid;grid-template-columns:36px minmax(0,1fr);column-gap:16px;padding:22px 0;border-bottom:1px solid var(--line);}
.lab-step:last-child{border-bottom:0;}
.lab-step::before{content:counter(lab-step);grid-column:1;grid-row:1;width:36px;height:36px;border-radius:10px;background:rgba(22,104,199,0.1);color:var(--blue);font:700 17px/36px 'IBM Plex Mono',monospace;text-align:center;}
.lab-step > *{grid-column:2;min-width:0;margin-top:0;margin-bottom:10px;}
.lab-step > :last-child{margin-bottom:0;}
.lab-step > p:first-of-type{font-size:19px;line-height:1.5;font-weight:500;}

/* Topology */
.lab-topology{text-align:center;}
.lab-topology .lab-h{text-align:left;}
.lab-topology-link{display:block;}
.lab-topology img{display:inline-block;max-width:100%;width:auto;max-height:640px;height:auto;margin:0;border:0;background:none;border-radius:0;padding:0;}
.lab-topology-hint{margin:10px 0 0;font-size:14px;color:var(--muted);}

/* Config tiles: two per row, the rest wrap onto the next row */
.lab-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start;}
.lab-tiles .ns-term{margin:0;}

/* File bar + note: one component */
.lab-files{background:var(--panel);border:1px solid #C9DCF4;border-radius:12px;overflow:hidden;box-shadow:var(--shadow-sm);}
.lab-files-bar{display:flex;align-items:center;gap:16px;background:#EAF2FC;padding:16px 20px;}
.lab-file-ic{flex:0 0 auto;min-width:46px;height:42px;padding:0 8px;border-radius:10px;background:var(--blue);color:var(--on-accent);font:600 13px/42px 'IBM Plex Mono',monospace;text-align:center;}
.lab-file-tx{flex:1;min-width:0;display:flex;flex-direction:column;}
.lab-file-tx strong{font-size:18px;line-height:1.35;}
.lab-file-tx span{font-size:16px;color:var(--muted);line-height:1.5;}
.lab-files-bar .btn{flex:0 0 auto;white-space:nowrap;}
.lab-note{padding:16px 20px 18px;border-top:1px solid #C9DCF4;}
.lab-note-label{margin-bottom:6px;font-size:14px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--blue);}
.lab-note p{margin:0 0 8px;font-size:17px;line-height:1.6;}
.lab-note p:last-child{margin-bottom:0;}

/* Solution toggle: a <details class="solution-block"> holding a .lab-steps card */
.ns-lab-body .solution-block > .lab-steps{border-radius:0 0 10px 10px;border-top:none;box-shadow:none;}
/* in the solution the first paragraph is ordinary text ("Task N. …"), not a big step title */
.ns-lab-body .solution-block .lab-step > p:first-of-type{font-size:inherit;font-weight:inherit;line-height:inherit;}

/* h4 before a <pre class="cli"> is the window title */
.ns-lab-body h4{margin:14px 0 8px;}
.ns-lab-body .lab-tiles > div > h4{margin-top:0;}
.ns-lab-body .lab-step > h4{margin:4px 0 8px;}
.lab-tiles > div > h4{margin-top:0;}
/* Config window (built by lab.js from <pre class="cli">): the title is a plain heading above a dark block */
.ns-term{margin:0 0 14px;min-width:0;}
.ns-term-cap{margin:0 0 8px;}
.ns-lab-body h4,.ns-term-cap{font-size:16px;font-weight:700;line-height:1.4;color:var(--text);}
.ns-term-box{position:relative;border-radius:10px;overflow:hidden;border:1px solid var(--term-line);background:var(--term-bg);}
.ns-lab .ns-term button.ns-copy.ns-copy.ns-copy.ns-copy{
  position:absolute;top:8px;right:8px;z-index:1;cursor:pointer;background:var(--term-panel) !important;color:var(--term-blue) !important;
  border:1px solid var(--term-line) !important;border-radius:6px !important;padding:3px 10px !important;
  font:700 13px/1.4 'Manrope',sans-serif !important;box-shadow:none !important;text-shadow:none !important;
}
.ns-lab .ns-term button.ns-copy.ns-copy.ns-copy.ns-copy:hover{border-color:var(--term-blue) !important;background:var(--term-panel) !important;}
.ns-lab .ns-term button.ns-copy.ns-copy.ns-copy.ns-copy.is-copied{color:#7FD99F !important;border-color:#7FD99F !important;}
.ns-lab .ns-term pre.ns-term-code{margin:0;border:0;border-radius:0;background:transparent;color:var(--term-text);padding:14px 70px 14px 16px;font:500 14.5px/1.7 'IBM Plex Mono',monospace;overflow-x:auto;white-space:pre;}
/* without JavaScript the <pre class="cli"> is still a dark code block */
.ns-lab-body pre.cli:not(.ns-term-code){margin:14px 0 4px;}

@media(max-width:700px){
  .lab-tiles{grid-template-columns:minmax(0,1fr);}
  .lab-files-bar{flex-direction:column;align-items:stretch;gap:10px;padding:14px 16px;}
  .lab-file-ic{align-self:flex-start;}
  .lab-files-bar .btn{text-align:center;}
  .lab-note{padding:14px 16px 16px;}
  .lab-steps{padding:2px 14px;}
  .lab-step{column-gap:12px;padding:18px 0;grid-template-columns:30px minmax(0,1fr);}
  .lab-step::before{width:30px;height:30px;font-size:15px;line-height:30px;}
  .lab-step > p:first-of-type{font-size:18px;}
  .ns-lab-body .solution-block .lab-step > p:first-of-type{font-size:inherit;}
  .ns-lab-body .lab-steps > .lab-intro{padding:16px 0;}
  .ns-lab-body .lab-card{padding:16px 12px 18px;}
  .ns-lab .ns-term pre.ns-term-code{font-size:13px;padding:12px;}
}
