/* ================================================================
   Canvas LMS–inspired design — aula (lesson) pages
   Covers all component classes used in aula-1.html / aula-2.html
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ──────────────────────────────────── */
:root {
  --nav-bg:       #394B59;
  --course-color: #2B7A6F;
  --link:         #0770A3;
  --bg:           #F2F2F2;
  --white:        #FFFFFF;
  --text:         #2D2D2D;
  --muted:        #5F6E7A;
  --text-muted:   #5F6E7A;   /* alias for backward compat */
  --border:       #C7CDD1;
  --border-light: #E5E9EC;
  --accent:       #0770A3;
  --accent2:      #2B7A6F;
  --green:        #127A2A;
  --yellow:       #7A5C00;
  --red:          #A80000;
  --orange:       #A83B00;
  --code-bg:      #1C2B2D;
  --surface:      #FFFFFF;
  --surface2:     #F5F6F7;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.09);
  --shadow:       0 2px 8px rgba(0,0,0,0.10);
  --radius:       4px;
  --radius-md:    6px;
  --radius-lg:    8px;
  --sidenav-w:    200px;
  --topbar-h:     56px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Lato", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

a { color: var(--link); }
a:hover { text-decoration: underline; }
strong { color: var(--text); font-weight: 700; }

/* ── Canvas Topbar ──────────────────────────────────── */
.canvas-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--nav-bg);
  display: flex;
  align-items: center;
  z-index: 200;
  box-shadow: 0 2px 4px rgba(0,0,0,0.28);
}
.topbar-brand {
  width: var(--sidenav-w);
  padding: 0 16px;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; text-decoration: none;
}
.topbar-brand:hover { text-decoration: none; }
.topbar-brand-icon {
  width: 34px; height: 34px;
  background: var(--course-color);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.topbar-brand-name { color: white; font-size: 0.88rem; font-weight: 700; }
.topbar-crumb {
  flex: 1; padding: 0 20px;
  display: flex; align-items: center; gap: 6px;
  font-size: 0.85rem;
}
.topbar-crumb a { color: rgba(255,255,255,0.8); text-decoration: none; }
.topbar-crumb a:hover { color: white; text-decoration: underline; }
.topbar-crumb .sep { color: rgba(255,255,255,0.35); }
.topbar-crumb .current { color: rgba(255,255,255,0.95); font-weight: 700; }
.topbar-right { padding: 0 16px; display: flex; align-items: center; gap: 8px; }
.topbar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%; background: #5A8FA3;
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; cursor: pointer;
}

/* ── Shell Layout ───────────────────────────────────── */
.canvas-shell {
  display: block;
  min-height: 100vh;
  padding-top: 0;
}

/* ── Sidenav ────────────────────────────────────────── */
.canvas-sidenav {
  width: var(--sidenav-w);
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.sidenav-course {
  padding: 12px 16px;
  font-size: 0.82rem; font-weight: 700;
  background: var(--course-color);
  color: white; line-height: 1.35;
}
.sidenav-nav { list-style: none; }
.sidenav-nav li a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  color: var(--text); font-size: 0.88rem;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.12s;
}
.sidenav-nav li a:hover { background: #F0F2F4; text-decoration: none; }
.sidenav-nav li a.active {
  border-left-color: var(--course-color);
  background: rgba(43,122,111,0.07);
  color: var(--course-color); font-weight: 700;
}
.nav-icon { font-size: 14px; width: 18px; text-align: center; opacity: 0.8; }

/* ── Main ───────────────────────────────────────────── */
.canvas-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

/* ── Course Banner ──────────────────────────────────── */
.course-banner {
  background: var(--course-color);
  color: white;
  padding: 16px 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.banner-back {
  position: absolute;
  top: 14px;
  right: 32px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.12s;
}
.banner-back:hover { background: rgba(255,255,255,0.3); text-decoration: none; color: #fff; }

/* colapso do meta ao rolar */
.course-banner.scrolled { padding-top: 12px; padding-bottom: 12px; }
.course-banner::before {
  content: "";
  position: absolute; right: -50px; top: -50px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  pointer-events: none;
}
.banner-eyebrow {
  font-size: 0.73rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  opacity: 0.82; margin-bottom: 5px;
}
.banner-title {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 700; line-height: 1.2;
  margin-bottom: 10px;
  font-family: "Lato", sans-serif;
}
.banner-meta {
  display: flex; flex-wrap: wrap; gap: 16px;
  font-size: 0.83rem; opacity: 0.88;
  margin-top: 8px; max-height: 80px; overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin-top 0.25s ease;
}
.course-banner.scrolled .banner-meta {
  max-height: 0; opacity: 0; margin-top: 0;
}
.banner-meta span { display: flex; align-items: center; gap: 5px; }

/* ── Page Content ───────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 20px 32px 32px;
  max-width: 1120px;
}

/* ── Typography ─────────────────────────────────────── */
h2 {
  font-size: 1.15rem; font-weight: 700;
  color: var(--text);
  padding-left: 12px;
  border-left: 4px solid var(--course-color);
  margin: 36px 0 14px;
  line-height: 1.3;
}
h3 {
  font-size: 1rem; font-weight: 700;
  color: var(--text); margin: 20px 0 8px;
}
h4 {
  font-size: 0.88rem; font-weight: 700;
  color: var(--muted); margin: 14px 0 6px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
p { color: var(--text); margin-bottom: 8px; }
li { color: var(--text); }
ul, ol { padding-left: 1.4rem; }

/* ── Header badge (kept for banner fallback) ── */
.badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
  padding: 3px 10px; border-radius: 20px; margin-bottom: 10px;
}

/* ── Tags ───────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-size: 0.72rem; font-weight: 700;
  padding: 2px 9px; border-radius: 20px;
  margin: 2px; border: 1px solid transparent;
}
.tag-blue   { background: #E5F0FA; color: #0562AC; border-color: #C2DCF5; }
.tag-green  { background: #E5F6E8; color: #127A2A; border-color: #BCDFBF; }
.tag-yellow { background: #FEF8E3; color: #7A5C00; border-color: #F5DFA0; }
.tag-red    { background: #FEE8E8; color: #A80000; border-color: #F5C0C0; }
.tag-purple { background: #F0EAFA; color: #6936C4; border-color: #D0BBEF; }
.tag-orange { background: #FEF0E6; color: #A83B00; border-color: #F5C6A0; }
.tag-muted  { background: #F0F0F0; color: #666;    border-color: #DCDCDC; }

/* ── Cards ──────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

/* ── Time Block ─────────────────────────────────────── */
.time-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.time-block-header {
  display: flex; align-items: center; gap: 12px;
  background: #F5F6F7;
  border-bottom: 1px solid var(--border);
  padding: 11px 18px;
}
.time-pill {
  background: var(--course-color);
  color: white;
  font-size: 0.74rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  white-space: nowrap;
  font-family: "JetBrains Mono", monospace;
}
.time-block-title { font-weight: 700; font-size: 0.93rem; color: var(--text); }
.time-block-body { padding: 18px 20px; }

/* ── Code Blocks ────────────────────────────────────── */
pre {
  background: var(--code-bg);
  border: 1px solid #2A3C3E;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  overflow-x: auto;
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  margin: 10px 0;
  color: #B8D0CC;
}
code { font-family: inherit; }
code:not(pre > code) {
  background: #E8F0EE;
  color: #0D6B59;
  padding: 0.1em 0.38em;
  border-radius: 3px;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.875em;
}
kbd {
  display: inline-block;
  background: #E8F0EE;
  color: #0D6B59;
  border: 1px solid #B8CFC9;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.05em 0.45em;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.8em;
  line-height: 1.4;
}
.comment { color: #5A7A7A; }
.prompt  { color: #48C774; }
.out     { color: #8AAAA8; }
/* Realce de sintaxe shell (usado nas aulas de scripting) */
.kw      { color: #7AA2F7; font-weight: 500; }
.str     { color: #E0AF68; }
.cmd-label {
  font-size: 0.72rem; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-top: 14px; margin-bottom: 3px;
}

/* ── Objective List ─────────────────────────────────── */
.obj-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  padding: 0;
}
.obj-list li {
  background: #F5FAF8;
  border: 1px solid #BCDFBF;
  border-left: 3px solid var(--course-color);
  border-radius: var(--radius);
  padding: 9px 13px;
  font-size: 0.9rem; color: var(--text);
}
.obj-list li::before { content: "✓ "; color: var(--green); font-weight: 700; }

/* ── Prereq List ────────────────────────────────────── */
.prereq-list { list-style: none; padding: 0; }
.prereq-list li {
  padding: 5px 0;
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 0.9rem; color: var(--text);
}
.prereq-list li::before { content: "→"; color: var(--course-color); font-weight: 700; flex-shrink: 0; }

/* ── Architecture Boxes ─────────────────────────────── */
.arch-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  margin: 5px 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.87rem;
  line-height: 1.5;
}
.arch-user    { border-color: #BCDFBF; color: #135A1A; background: #F0FAF1; }
.arch-syscall { border-color: #F5DFA0; color: #7A5C00; background: #FEFBF0; text-align: center; }
.arch-kernel  { border-color: #C2DCF5; color: #0562AC; background: #EEF5FD; }
.arch-hw      { border-color: #D0D5DA; color: #4A5568; background: #F8F9FA; }

/* ── Tables ─────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 10px 0;
}
th {
  background: var(--course-color);
  color: white;
  padding: 10px 14px;
  text-align: left; font-weight: 700;
  font-size: 0.82rem; white-space: nowrap;
}
td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top; color: var(--text);
}
tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: #F9FAFB; }
tr:hover td { background: #EEF5FD; }

.timetable { font-size: 0.86rem; }
.timetable th { background: #3A5060; }
.timetable .phase {
  color: var(--course-color); font-weight: 700;
  white-space: nowrap; font-family: "JetBrains Mono", monospace;
}

/* ── Checklist ──────────────────────────────────────── */
.checklist { list-style: none; padding: 0; }
.checklist li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem; color: var(--text);
}
.checklist li:last-child { border-bottom: none; }
.check-box {
  width: 17px; height: 17px; min-width: 17px;
  border: 2px solid var(--border);
  border-radius: 3px; margin-top: 2px;
  background: white;
}

/* ── Lab Header ─────────────────────────────────────── */
.lab-header {
  display: flex; align-items: center; gap: 14px;
  background: #EEF8F5;
  border-left: 4px solid var(--course-color);
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.lab-num {
  font-size: 2rem; font-weight: 900;
  color: var(--course-color); line-height: 1;
}
.lab-header h3 { margin: 0; color: var(--text); }
.lab-header p  { margin: 0; color: var(--muted); font-size: 0.88rem; }

/* ── Challenge ──────────────────────────────────────── */
.challenge {
  background: #FFFBF0;
  border: 1px solid #F5DFA0;
  border-radius: var(--radius-md);
  padding: 20px;
}
.challenge-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.05rem; font-weight: 700;
  color: #7A5C00; margin-bottom: 12px;
}

/* ── Info / Warning Boxes ───────────────────────────── */
.info-box {
  background: #EEF5FD;
  border: 1px solid #C2DCF5;
  border-left: 4px solid var(--link);
  border-radius: var(--radius);
  padding: 12px 16px; font-size: 0.88rem;
  margin: 10px 0; color: var(--text);
}
.warn-box {
  background: #FFFBF0;
  border: 1px solid #F5DFA0;
  border-left: 4px solid #D4A400;
  border-radius: var(--radius);
  padding: 12px 16px; font-size: 0.88rem;
  margin: 10px 0; color: var(--text);
}

/* ── Distro Grid ────────────────────────────────────── */
.distro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
.distro-card {
  background: #F8F9FA;
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.distro-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.distro-desc { font-size: 0.82rem; color: var(--muted); }

/* ── Directory Tree ─────────────────────────────────── */
.dir-tree { font-family: "JetBrains Mono", monospace; font-size: 0.87rem; }
.dir-entry { padding: 3px 0; display: flex; gap: 8px; }
.dir-name  { color: var(--course-color); font-weight: 700; }
.dir-desc  { color: var(--muted); }

/* ── Steps ──────────────────────────────────────────── */
.steps { counter-reset: step; }
.step {
  counter-increment: step;
  display: flex; align-items: flex-start;
  padding: 7px 0; font-size: 0.9rem; color: var(--text);
}
.step::before {
  content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  background: var(--course-color); color: white;
  font-size: 0.74rem; font-weight: 700;
  border-radius: 50%; flex-shrink: 0;
  margin-right: 10px; margin-top: 1px;
}

/* ── Utilities ──────────────────────────────────────── */
.flex-gap  { display: flex; flex-wrap: wrap; gap: 7px; margin: 7px 0; }
.divider   { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.two-col   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.container { /* legacy wrapper, layout handled by .page-content */ }

/* ── Page Navigation Footer ─────────────────────────── */
.page-nav {
  border-top: 1px solid var(--border);
  padding: 14px 32px;
  background: var(--white);
}
.page-nav-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  max-width: 1120px; gap: 12px;
}
.nav-prev, .nav-next {
  font-size: 0.88rem; font-weight: 700;
  color: var(--link); text-decoration: none;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  transition: background 0.12s, border-color 0.12s;
}
.nav-prev:hover, .nav-next:hover {
  background: var(--bg); border-color: var(--course-color);
  text-decoration: none;
}
.nav-center { font-size: 0.82rem; color: var(--muted); text-align: center; }
.nav-disabled {
  font-size: 0.88rem; color: var(--muted);
  padding: 7px 14px; cursor: default;
}

/* ── Old footer hidden (replaced by page-nav) ── */
footer {
  display: none;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .canvas-sidenav { display: none; }
  :root { --sidenav-w: 0px; }
  .page-content { padding: 16px; }
  .course-banner { padding: 20px 16px; }
  .page-nav { padding: 12px 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .obj-list  { grid-template-columns: 1fr; }
  .distro-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}
@media (max-width: 600px) {
  pre { font-size: 0.76rem; padding: 10px 12px; }
  .timetable th, .timetable td { padding: 7px 8px; font-size: 0.8rem; }
}

/* ════════════════════════════════════════════════════
   Menu de Seções (gerado por aula-nav.js)
   ════════════════════════════════════════════════════ */

/* alvo do scroll — compensa o banner sticky */
.page-content [id^="sec-"] { scroll-margin-top: 104px; }

/* ── Botão flutuante ── */
.secnav-fab {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: 300;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  background: var(--course-color);
  color: #fff;
  border: none;
  border-radius: 24px;
  font-family: "Lato", "Segoe UI", Arial, sans-serif;
  font-size: 0.84rem; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0,0,0,0.26);
  transition: background 0.14s, box-shadow 0.14s, transform 0.12s;
}
.secnav-fab:hover  { background: #24675E; box-shadow: 0 5px 18px rgba(0,0,0,0.32); }
.secnav-fab:active { transform: translateY(1px); }
.secnav-fab:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.secnav-fab .secnav-fab-icon { font-size: 1rem; line-height: 1; }

/* ── Painel ── */
.secnav-panel {
  position: fixed;
  right: 24px; bottom: 76px;
  z-index: 300;
  width: 330px;
  max-width: calc(100vw - 32px);
  max-height: min(66vh, 560px);
  display: flex; flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 28px rgba(0,0,0,0.22);
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.secnav-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.secnav-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
  flex-shrink: 0;
}
.secnav-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1.1rem; line-height: 1;
  padding: 2px 6px; border-radius: var(--radius);
}
.secnav-close:hover { background: var(--border-light); color: var(--text); }

.secnav-list { overflow-y: auto; padding: 6px 0; }
.secnav-list a {
  display: block;
  padding: 7px 16px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.secnav-list a:hover { background: var(--surface2); text-decoration: none; }
.secnav-list a.lvl-2 {
  padding-left: 30px;
  font-size: 0.8rem;
  color: var(--muted);
}
.secnav-list a.active {
  border-left-color: var(--course-color);
  background: rgba(43,122,111,0.08);
  color: var(--course-color);
  font-weight: 700;
}
.secnav-num {
  display: inline-block;
  min-width: 15px;
  margin-right: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.75;
}
.secnav-list a.active .secnav-num { color: var(--course-color); opacity: 1; }

@media (max-width: 600px) {
  .secnav-fab   { right: 14px; bottom: 14px; padding: 10px 15px; }
  .secnav-panel { right: 14px; bottom: 64px; }
  .page-content [id^="sec-"] { scroll-margin-top: 88px; }
}

@media print {
  .secnav-fab, .secnav-panel { display: none !important; }
}
