/* DAW labs site — bundled CSS (do not edit; generated from src/assets/css/) */

/* === 01-base.css === */
/* CSS variables, theme tokens (light + dark), reset, body background, animations.
 * All dark-mode overrides live in this file (single source of truth for theming). */

:root {
  --bg: #f6f5f2;
  --bg-accent: #edeae2;
  --text: #1a1816;
  --muted: #6b6259;
  --card: rgba(255, 255, 255, 0.92);
  --card-solid: #ffffff;
  --search-bg: #ffffff;
  --border: rgba(45, 38, 31, 0.11);
  --primary: #1a6b8a;
  --primary-soft: rgba(26, 107, 138, 0.08);
  --primary-ink: #ffffff;
  --accent: #c6932f;
  --shadow-sm: 0 2px 8px rgba(34, 28, 22, 0.06);
  --shadow: 0 8px 24px rgba(34, 28, 22, 0.07);
  --shadow-lg: 0 16px 40px rgba(34, 28, 22, 0.1);
  --radius: 12px;
  --radius-lg: 16px;
  --transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #13161a;
  --bg-accent: #1b1f24;
  --text: #e8e6e1;
  --muted: #a8a196;
  --card: rgba(30, 34, 40, 0.88);
  --card-solid: #1e2228;
  --search-bg: #1e2228;
  --border: rgba(255, 255, 255, 0.09);
  --primary: #62b3d1;
  --primary-soft: rgba(98, 179, 209, 0.12);
  --primary-ink: #0f1115;
  --accent: #d4a84c;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  color: var(--text);
  background:
    radial-gradient(ellipse at 10% 0%, rgba(26, 107, 138, 0.1), transparent 50%),
    radial-gradient(ellipse at 90% 5%, rgba(198, 147, 47, 0.08), transparent 45%),
    var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.bg-shape { display: none; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Dark theme component overrides ─────────────────── */

[data-theme="dark"] body {
  background:
    radial-gradient(ellipse at 10% 0%, rgba(98, 179, 209, 0.08), transparent 50%),
    radial-gradient(ellipse at 90% 5%, rgba(212, 168, 76, 0.06), transparent 45%),
    var(--bg);
}

[data-theme="dark"] .site-header {
  background: rgba(27, 31, 36, 0.82);
}

[data-theme="dark"] .hero,
[data-theme="dark"] .lab-head,
[data-theme="dark"] .featured-card {
  background: linear-gradient(150deg, rgba(36, 41, 47, 0.95), rgba(27, 31, 36, 0.9));
}

[data-theme="dark"] .lab-card,
[data-theme="dark"] .panel,
[data-theme="dark"] .lab-content {
  background: rgba(30, 34, 40, 0.88);
}

[data-theme="dark"] .markdown-body table {
  background: rgba(36, 41, 47, 0.55);
}

[data-theme="dark"] .markdown-body :not(pre) > code {
  background: rgba(98, 179, 209, 0.12);
  border-color: rgba(98, 179, 209, 0.25);
  color: #a5d3e5;
}

[data-theme="dark"] .markdown-body img { opacity: 0.92; }

[data-theme="dark"] .part-link,
[data-theme="dark"] .part-nav,
[data-theme="dark"] .btn-ghost {
  background: var(--card-solid);
  color: var(--text);
}

/* === 02-chrome.css === */
/* Site chrome: header, brand, nav, theme toggle, footer. */

.site-header {
  width: min(1120px, calc(100% - 2rem));
  margin: 1.2rem auto 0;
  padding: 0.85rem 1.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.brand {
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.top-nav a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
}

.top-nav a:hover {
  color: var(--text);
  background: var(--primary-soft);
}

.top-nav a.nav-cta {
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1.05rem;
  margin-left: 0.4rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.top-nav a.nav-cta:hover {
  background: var(--accent);
  color: #fff;
  filter: brightness(1.1);
}
.top-nav a.nav-logout {
  color: var(--muted);
  font-size: 0.85rem;
  opacity: 0.75;
}
.top-nav a.nav-logout:hover {
  opacity: 1;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-solid, #fff);
  color: var(--muted);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.theme-toggle:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.site-footer {
  width: min(1120px, calc(100% - 2rem));
  margin: 2.5rem auto 2rem;
  padding: 1.4rem 0 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}

.footer-col {
  min-width: 0;
}

.footer-title {
  margin: 0 0 0.45rem;
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
  font-family: "Merriweather", Georgia, serif;
  letter-spacing: -0.01em;
}

.footer-text {
  margin: 0;
  line-height: 1.55;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
}

/* === 03-search.css === */
/* Search input + dropdown results. */

.search-wrap {
  position: relative;
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--search-bg, #fff);
  padding: 0.32rem 0.45rem 0.32rem 0.6rem;
  gap: 0.45rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 107, 138, 0.1);
}

.search-wrap.header-search { margin-top: 0; }
.search-wrap.header-search input { min-width: min(32vw, 240px); }

.search-wrap .search-icon {
  color: var(--muted);
  flex-shrink: 0;
}

.search-wrap input {
  border: none;
  outline: none;
  background: transparent;
  min-width: min(55vw, 300px);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
}

.search-wrap input::placeholder { color: var(--muted); opacity: 0.8; }

.search-kbd {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg-accent);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.06rem 0.36rem;
  letter-spacing: 0.02em;
}

.search-wrap:focus-within .search-kbd { display: none; }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 360px;
  max-width: 560px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  background: var(--card-solid, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 30;
  padding: 0.35rem;
}

.search-results[hidden] { display: none; }

.search-result {
  display: block;
  padding: 0.55rem 0.7rem;
  text-decoration: none;
  color: var(--text);
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}

.search-result:hover,
.search-result.active {
  background: var(--primary-soft);
  border-color: rgba(26, 107, 138, 0.18);
}

.search-result + .search-result { margin-top: 0.15rem; }

.search-result-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.35;
}

.search-result-meta {
  font-size: 0.78rem;
  color: var(--primary);
  margin-top: 0.1rem;
  font-weight: 600;
}

.search-result-snippet {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.25rem;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.search-result-snippet mark {
  background: rgba(198, 147, 47, 0.28);
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
  font-weight: 700;
}

.search-empty {
  padding: 0.7rem 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* === 04-shell.css === */
/* Page shell: main container, hero block, breadcrumb strip, section labels. */

.main-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 1.2rem auto 2rem;
}

.hero {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.3rem, 3vw, 2.5rem);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.88));
  box-shadow: var(--shadow);
  animation: fadeUp 320ms ease-out;
}

.hero h1 {
  margin: 0;
  font-family: "Merriweather", Georgia, serif;
  font-size: clamp(1.4rem, 4.5vw, 2.4rem);
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0.6rem 0 0;
  max-width: 68ch;
  color: var(--muted);
  line-height: 1.6;
  font-size: 1.05rem;
}

.breadcrumb {
  width: min(1120px, calc(100% - 2rem));
  margin: 0.7rem auto 0;
}

.breadcrumb-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.86rem;
  color: var(--muted);
  background: var(--card-solid, #fff);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}

.breadcrumb a:hover { color: var(--primary); }

.breadcrumb-sep {
  color: var(--border);
  font-size: 0.95rem;
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 600;
}

.section-label {
  margin: 2rem 0 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* === 05-cards.css === */
/* Cards & buttons: lab cards, featured card, resurse cards, btn variants, panels. */

/* ── Labs grid ─────────────────────────────────────── */

.landing-labs-section .labs-grid { margin-top: 0; }

.labs-grid {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ── Lab card ──────────────────────────────────────── */

.lab-card,
.panel,
.lab-content {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.lab-card {
  position: relative;
  padding: 1.1rem 1.2rem;
  opacity: 0;
  transform: translateY(6px);
  animation: fadeUp 320ms ease-out forwards;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition), background var(--transition);
  cursor: pointer;
}

.lab-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  text-decoration: none;
}

.lab-card-link:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: inherit;
}

.lab-card > *:not(.lab-card-link) {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.lab-card .card-actions > * {
  pointer-events: auto;
}

.lab-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--primary);
}

[data-theme="dark"] .lab-card:hover {
  background: rgba(40, 44, 52, 0.95);
}

.lab-card:hover .lab-badge {
  background: var(--primary);
  color: var(--primary-ink);
  transition: background var(--transition), color var(--transition);
}

.lab-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
  justify-content: flex-start;
}

.lab-card-header h3 {
  flex: 1;
  min-width: 0;
}

.lab-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 8px;
  letter-spacing: 0.02em;
}

.lab-card h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text);
  font-weight: 700;
  line-height: 1.3;
}

.lab-card p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

.lab-card-status {
  margin-left: auto;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(198, 147, 47, 0.1);
  border: 1px solid rgba(198, 147, 47, 0.3);
  border-radius: 4px;
  padding: 0.12rem 0.4rem;
}

.lab-card-meta {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.lab-card-meta-item { white-space: nowrap; }

/* ── Buttons ───────────────────────────────────────── */

.card-actions {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-lg {
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
}

.btn-primary:hover {
  background: #15596f;
  box-shadow: 0 4px 12px rgba(26, 107, 138, 0.25);
}

.btn-ghost {
  background: #fff;
  color: var(--muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

/* Quiz variant of btn-ghost - indigo accent matching .lab-chip-quiz */
.btn-ghost.btn-quiz {
  color: #4c2a85;
  background: rgba(124, 58, 237, 0.10);
  border-color: rgba(124, 58, 237, 0.45);
}

.btn-ghost.btn-quiz:hover {
  color: #2e1660;
  background: rgba(124, 58, 237, 0.20);
  border-color: rgba(124, 58, 237, 0.85);
}

[data-theme="dark"] .btn-ghost.btn-quiz {
  color: #c9b3ff;
  background: rgba(167, 139, 250, 0.14);
  border-color: rgba(167, 139, 250, 0.45);
}

[data-theme="dark"] .btn-ghost.btn-quiz:hover {
  color: #e3d4ff;
  background: rgba(167, 139, 250, 0.24);
  border-color: rgba(167, 139, 250, 0.85);
}

/* ── Featured card (guest lecture / lab special) ─────────────────── */

.landing-featured { margin-top: 1.2rem; }

/* ── Carousel pentru featured (scroll-snap orizontal + dots) ─────── */

.landing-carousel {
  margin: 1.2rem auto 0;
  position: relative;
  max-width: 100%;
  width: 100%;
}

.landing-carousel .carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 1rem;
  justify-content: flex-start;
  scrollbar-width: none;            /* Firefox */
  -ms-overflow-style: none;         /* IE / old Edge */
}
.landing-carousel .carousel-track::-webkit-scrollbar { display: none; }

.landing-carousel .carousel-track > .featured-card {
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  min-width: 0;
  margin: 0;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(26, 107, 138, 0.25);
  cursor: pointer;
  padding: 0;
  transition: background 200ms ease, transform 200ms ease;
}

.carousel-dot:hover { background: rgba(26, 107, 138, 0.55); }

.carousel-dot.active {
  background: rgba(26, 107, 138, 0.9);
  transform: scale(1.2);
}

.featured-card {
  border: 1px solid rgba(26, 107, 138, 0.18);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(26, 107, 138, 0.04), rgba(255, 255, 255, 0.96));
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 3vw, 2rem);
  animation: fadeUp 320ms ease-out;
  transition: box-shadow var(--transition);
}

.featured-card:hover {
  box-shadow: var(--shadow-lg);
}

.featured-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
}

.featured-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid rgba(26, 107, 138, 0.15);
  border-radius: 6px;
  padding: 0.22rem 0.6rem;
  margin-bottom: 0.7rem;
}

.featured-title {
  margin: 0 0 0.45rem;
  font-family: "Merriweather", Georgia, serif;
  font-size: clamp(1.15rem, 2.8vw, 1.55rem);
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.featured-excerpt {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.featured-thumb {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.featured-thumb:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.featured-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms ease;
}

.featured-thumb:hover img {
  transform: scale(1.03);
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  transition: background var(--transition);
}

.featured-thumb:hover .play-overlay {
  background: rgba(0, 0, 0, 0.35);
}

.play-overlay svg {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  transition: transform var(--transition);
}

.featured-thumb:hover .play-overlay svg {
  transform: scale(1.1);
}

/* ── Landing panels (currently unused, retained) ───── */

.landing-panels {
  margin-top: 1.2rem;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 1.8fr 1fr;
}

.panel { padding: 1rem; }
.panel h2 { margin: 0; font-family: "Merriweather", Georgia, serif; }
.panel p, .panel li { color: var(--muted); line-height: 1.6; font-size: 1rem; }
.panel ul { margin: 0.7rem 0 0; padding-left: 1rem; }

/* ── /resurse cards ────────────────────────────────── */

.resurse-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.9rem;
}

.resurse-card {
  position: relative;
  padding: 1rem 1.1rem 2.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  min-height: 150px;
}

.resurse-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
  color: var(--text);
  font-weight: 700;
  line-height: 1.3;
}

.resurse-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.resurse-pending {
  position: absolute;
  bottom: 0.85rem;
  left: 1.1rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-accent);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.12rem 0.5rem;
}

/* === 06-lab-page.css === */
/* Lab detail page: head block, chips, prereqs, errata, content, lab-to-lab nav, part pagination. */

/* ── Widescreen container for lab pages ─────────────
 * Lab pages get a wider shell (1320px) so code blocks + TOC sidebar both have room.
 * Landing/labs list stay at the global 1120px. */
.lab-page .site-header,
.lab-page .main-shell,
.lab-page .breadcrumb,
.lab-page .site-footer {
  width: min(1320px, calc(100% - 2rem));
}

/* ── Lab head (replaces hero on lab detail) ───────── */

.lab-head {
  margin-top: 1rem;
  padding: clamp(1.1rem, 2.5vw, 1.7rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.88));
  box-shadow: var(--shadow);
  animation: fadeUp 320ms ease-out;
}

.lab-draft-banner {
  margin: 0 0 0.9rem;
  padding: 0.6rem 0.9rem;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  background: rgba(198, 147, 47, 0.08);
  color: var(--text);
  font-size: 0.88rem;
}

.lab-draft-banner strong {
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.lab-head-top {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.lab-head-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 10px;
  letter-spacing: 0.02em;
}

.lab-head-title-wrap { min-width: 0; flex: 1; }

.lab-head-title {
  margin: 0;
  font-family: "Merriweather", Georgia, serif;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.lab-head-part {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

/* ── Chips (durată / topics / actualizat / GitHub / download) ── */

.lab-chips {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.lab-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-accent);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition);
}

.lab-chip-topic {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: rgba(26, 107, 138, 0.15);
}

.lab-chip-muted { color: var(--muted); }

.lab-chip-link {
  color: var(--primary);
  background: transparent;
  border-color: rgba(26, 107, 138, 0.28);
}

.lab-chip-link:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* Quiz chip - indigo accent (distinct from primary teal + accent gold). Phase 1
 * also has lab-chip-admin-only which keeps it [hidden] until /api/whoami
 * returns kind=prof. */
.lab-chip-quiz {
  color: #4c2a85;
  background: rgba(124, 58, 237, 0.10);
  border-color: rgba(124, 58, 237, 0.45);
}

.lab-chip-quiz:hover {
  color: #2e1660;
  background: rgba(124, 58, 237, 0.20);
  border-color: rgba(124, 58, 237, 0.85);
}

.lab-chip-quiz::before {
  content: "?";
  margin-right: 0.25rem;
  font-weight: 700;
  opacity: 0.7;
}

[data-theme="dark"] .lab-chip-quiz {
  color: #c9b3ff;
  background: rgba(167, 139, 250, 0.14);
  border-color: rgba(167, 139, 250, 0.45);
}

[data-theme="dark"] .lab-chip-quiz:hover {
  color: #e3d4ff;
  background: rgba(167, 139, 250, 0.24);
  border-color: rgba(167, 139, 250, 0.85);
}

/* ── Prerequisites box ─────────────────────────────── */

.lab-prereqs {
  margin: 0.8rem 0 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
  background: var(--bg-accent);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}

.lab-prereqs strong { color: var(--text); }
.lab-prereqs a { color: var(--primary); text-decoration: none; font-weight: 600; }
.lab-prereqs a:hover { text-decoration: underline; }

/* ── Errata block ──────────────────────────────────── */

.lab-errata {
  margin: 0.8rem 0 0;
  padding: 0.5rem 0.75rem 0.2rem;
  background: rgba(198, 0, 0, 0.04);
  border: 1px solid rgba(198, 0, 0, 0.2);
  border-radius: 6px;
  font-size: 0.88rem;
}

.lab-errata summary {
  cursor: pointer;
  font-weight: 700;
  color: #9b1c1c;
}

.lab-errata ul {
  margin: 0.5rem 0 0.2rem;
  padding-left: 1.2rem;
  color: var(--muted);
}

.lab-errata li { margin: 0.15rem 0; }

/* ── Lab content container ─────────────────────────── */

.lab-content {
  margin-top: 1.2rem;
  padding: clamp(1rem, 2.5vw, 2rem);
  /* When prev/next links to #lab-content, leave a small gap above on scroll-into-view. */
  scroll-margin-top: 1rem;
}

/* ── Lab-to-lab navigation (prev/next lab) ─────────── */

.lab-nav-labs {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.lab-nav-labs-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-solid, #fff);
  text-decoration: none;
  color: var(--text);
  min-height: 72px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.lab-nav-labs-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.lab-nav-labs-next { text-align: right; align-items: flex-end; }

.lab-nav-labs-item.placeholder {
  background: transparent;
  border: 1px dashed var(--border);
  pointer-events: none;
  opacity: 0.35;
}

.lab-nav-labs-hint {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.lab-nav-labs-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.lab-nav-labs-item:hover .lab-nav-labs-title { color: var(--primary); }

/* Dark mode: lift contrast on lab-to-lab nav.
 * Default border (rgba white .09) almost invisible on the dark card background;
 * bump it to ~.18 with a barely-there inner tint so the cards feel like buttons. */
[data-theme="dark"] .lab-nav-labs-item {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .lab-nav-labs-item:hover {
  background: rgba(98, 179, 209, 0.08);
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .lab-nav-labs-hint {
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .lab-nav-labs-item.placeholder {
  border-color: rgba(255, 255, 255, 0.1);
  opacity: 0.4;
}

/* ── Part navigation: glass-orb chevrons ────────────────
 * Circular, semi-transparent backdrop-blur orb with a thin SVG chevron.
 * Tooltip + aria-label carry the keyboard-shortcut hint; orb itself stays clean. */

.part-floaters { display: contents; }

.part-floater {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  text-decoration: none;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06), inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  opacity: 0.6;
  z-index: 30;
  transition: opacity 220ms ease, color 220ms ease, background 220ms ease, transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.part-floater-prev { left: 1rem; }
.part-floater-next { right: 1rem; }

.part-floater:hover,
.part-floater:focus-visible {
  opacity: 1;
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  outline: none;
  transform: translateY(-50%) scale(1.06);
}

.part-floater-icon {
  width: 18px;
  height: 18px;
  display: block;
  transition: transform 220ms ease;
}

.part-floater-prev:hover .part-floater-icon,
.part-floater-prev:focus-visible .part-floater-icon { transform: translateX(-2px); }
.part-floater-next:hover .part-floater-icon,
.part-floater-next:focus-visible .part-floater-icon { transform: translateX(2px); }

[data-theme="dark"] .part-floater {
  background: rgba(30, 32, 38, 0.55);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .part-floater:hover,
[data-theme="dark"] .part-floater:focus-visible {
  background: rgba(40, 42, 50, 0.82);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: var(--text);
}

@media (max-width: 720px) {
  .part-floater {
    width: 48px;
    height: 48px;
    opacity: 0.88;
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  }
  .part-floater-prev { left: 0.5rem; }
  .part-floater-next { right: 0.5rem; }
  .part-floater-icon { width: 22px; height: 22px; }

  [data-theme="dark"] .part-floater {
    background: rgba(40, 42, 50, 0.78);
    color: var(--text);
  }
}

/* === 07-markdown.css === */
/* Rendered markdown content: typography, lists, headings, tables, code blocks,
 * language chip on pre, copy button overlay. */

.markdown-body {
  line-height: 1.6;
  font-size: 1.08rem;
}

/* Break long unbreakable tokens (PascalCase identifiers, URLs) so they don't
 * push the container wider than the viewport on mobile. Pre/code blocks have
 * their own overflow-x scroll and are not affected. */
.markdown-body p,
.markdown-body li,
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body :not(pre) > code {
  overflow-wrap: anywhere;
}

/* Tables: break only at word boundaries (avoids "Configu/rare" mid-word breaks).
 * Inline code uses overflow-wrap: break-word — it'll break long identifiers /
 * URLs ONLY when they actually overflow, instead of pre-emptively reporting
 * min-content as 1 character (which made auto table layout squish columns
 * even when other columns had unused whitespace). */
.markdown-body td, .markdown-body th {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.markdown-body td code, .markdown-body th code {
  overflow-wrap: break-word;
  word-break: normal;
}

.markdown-body p { margin: 0.45rem 0 0.6rem; }

.markdown-body ol, .markdown-body ul {
  padding-left: 1.3rem;
  margin-top: 0.4rem;
  margin-bottom: 0.65rem;
}

.markdown-body li { margin: 0.1rem 0; }
.markdown-body ol li > p, .markdown-body ul li > p { margin: 0.1rem 0; }

.markdown-body ol ol, .markdown-body ul ul,
.markdown-body ol ul, .markdown-body ul ol {
  margin-top: 0.2rem;
  margin-bottom: 0.4rem;
  padding-left: 1.1rem;
}

.markdown-body ol ol { list-style-type: lower-alpha; }
.markdown-body ol ol ol { list-style-type: lower-roman; }

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  font-family: "Merriweather", Georgia, serif;
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.markdown-body .header-anchor {
  color: inherit;
  text-decoration: none;
}

.markdown-body .header-anchor:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ── Tables ────────────────────────────────────────── */

.markdown-body table {
  width: 100%;
  max-width: 980px;
  border-collapse: collapse;
  margin: 0.8rem auto;
  display: table;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  overflow: hidden;
}

.markdown-body th, .markdown-body td {
  border: 1px solid var(--border);
  padding: 0.44rem 0.58rem;
  text-align: left;
  vertical-align: middle;
}

.markdown-body th {
  font-weight: 700;
  background: var(--primary-soft);
}

.markdown-body tbody tr:nth-child(even) {
  background: rgba(26, 107, 138, 0.02);
}

/* ── Code blocks ───────────────────────────────────── */

.markdown-body pre {
  position: relative;
  border-radius: var(--radius);
  overflow-x: auto;
  padding-top: 2rem;
  margin: 0.7rem 0 0.9rem;
}

.markdown-body pre code {
  display: block;
  padding: 0.9rem 1rem 1rem;
  line-height: 1.48;
  font-size: 0.95rem;
  white-space: pre;
  tab-size: 4;
  font-family: "Cascadia Code", Consolas, "Fira Code", monospace;
}

.markdown-body :not(pre) > code {
  background: rgba(26, 107, 138, 0.07);
  border: 1px solid rgba(26, 107, 138, 0.1);
  border-radius: 5px;
  padding: 0.08rem 0.32rem;
  font-size: 0.88em;
}

.markdown-body table code {
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.94em;
}

/* Language chip in top-left of pre (uses data-lang from generator). */
.markdown-body pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 0.5rem;
  left: 0.85rem;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

/* Copy button (added by JS in top-right of pre). */
.copy-button {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(26, 29, 34, 0.82);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 0.22rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  transition: color var(--transition), background var(--transition);
}

.copy-button:hover {
  background: rgba(26, 29, 34, 0.95);
  color: #fff;
}

.copy-button.success { color: #6ee7b7; }

/* ── Images ────────────────────────────────────────── */

.markdown-body img {
  display: block;
  margin: 1rem auto;
  width: auto !important;
  max-width: min(100%, 980px) !important;
  max-height: 520px;
  height: auto !important;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.markdown-body p > img:only-child,
.markdown-body p > a > img:only-child {
  margin-left: auto;
  margin-right: auto;
}

/* === 08-toc.css === */
/* TOC sidebar for lab pages: layout grid, sticky desktop sidebar, mobile drawer, scroll-spy active state. */

.lab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.4rem;
  margin-top: 1rem;
}

@media (min-width: 1080px) {
  .lab-layout.has-toc {
    grid-template-columns: minmax(0, 1fr) 240px;
  }
}

.lab-toc-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-solid);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
}

.lab-toc {
  position: sticky;
  top: 1rem;
  align-self: start;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 0.4rem 0;
  font-size: 0.82rem;
}

.lab-toc-title {
  margin: 0 0 0.5rem;
  padding-left: 0.7rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.75;
}

.lab-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lab-toc li { margin: 0; }

.lab-toc ol ol {
  padding-left: 0.75rem;
  margin-top: 0.1rem;
}

.lab-toc a {
  display: block;
  padding: 0.18rem 0.4rem 0.18rem 0.7rem;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.35;
  border-left: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.lab-toc a:hover {
  color: var(--text);
}

.lab-toc a.active {
  color: var(--text);
  border-left-color: var(--primary);
  font-weight: 700;
}

@media (max-width: 1079px) {
  .lab-toc-toggle { display: inline-flex; }

  .lab-toc {
    position: fixed;
    top: 0;
    right: 0;
    max-width: 320px;
    width: 82%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform var(--transition);
    z-index: 40;
  }

  .lab-toc.open { transform: translateX(0); }
}

/* === 09-misc.css === */
/* Misc one-offs that don't deserve their own file: 404 page actions, inline SVG diagrams. */

.not-found-actions {
  margin-top: 1.2rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.diagram-stack {
  margin: 1.2rem auto;
  max-width: 520px;
}

.diagram-stack svg {
  display: block;
  width: 100%;
  height: auto;
}

/* === 10-responsive.css === */
/* Responsive breakpoints — kept consolidated so all collapse/stack rules
 * live in one file (component-specific TOC media queries are in 08-toc.css). */

@media (max-width: 880px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-tools { width: 100%; flex-wrap: wrap; }

  .featured-body {
    grid-template-columns: 1fr;
  }

  .featured-thumb {
    order: -1;
  }

  .landing-panels { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .header-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .top-nav { flex-wrap: wrap; gap: 0.4rem; }
  .search-wrap { width: 100%; }
  .search-wrap input { min-width: 0; width: 100%; }
  .search-wrap.header-search input { min-width: 0; }
  .search-results { min-width: 0; }

  .theme-toggle {
    align-self: flex-start;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.3rem;
  }

  .lab-nav-labs {
    grid-template-columns: 1fr;
  }

  .lab-nav-labs-next {
    text-align: left;
    align-items: flex-start;
  }

  .labs-grid {
    grid-template-columns: 1fr;
  }

  .markdown-body table {
    width: 100%;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .markdown-body img {
    max-width: min(100%, 720px) !important;
    max-height: 360px;
  }
}
