/* Learning content pages (unix-fundamentals, Learning_content/*) */

.learning-page:has(.top-nav) .header {
  display: none;
}

.header {
  background: rgba(15, 23, 42, 0.88);
  border-bottom: 1px solid rgba(56, 189, 248, 0.1);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 24px rgba(2, 6, 23, 0.2);
}

.header-content {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
}

.logo {
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-icon {
  font-size: 22px;
}

.learning-page .container {
  padding-block: 24px 60px;
}

.topic-title {
  font-size: clamp(28px, 4vw, 38px);
  margin-bottom: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--gradient-heading);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topic-subtitle {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 820px;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  padding: 16px;
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: var(--radius-lg);
  background: var(--gradient-card);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}

.toc a {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  background: rgba(56, 189, 248, 0.08);
  color: var(--soft);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.2s;
}

.toc a:hover {
  color: var(--cyan);
  border-color: rgba(56, 189, 248, 0.4);
}

.section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(35, 50, 74, 0.5);
}

.section:last-child {
  border-bottom: 0;
}

.section h2 {
  color: var(--text);
  font-size: 22px;
  margin-bottom: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  position: relative;
  padding-bottom: 10px;
}

.section h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  border-radius: 999px;
  background: var(--gradient-brand);
}

.section p {
  color: var(--soft);
  line-height: 1.7;
  margin-bottom: 12px;
}

.note {
  margin: 16px 0;
  padding: 16px 18px;
  border-left: 3px solid var(--cyan);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.35), rgba(15, 23, 42, 0.5));
  color: var(--soft);
  font-size: 14px;
  line-height: 1.6;
  box-shadow: var(--shadow-sm);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.code-header h2 {
  margin: 0;
}

.copy-btn {
  padding: 6px 12px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
}

.copy-btn:hover {
  background: rgba(56, 189, 248, 0.2);
}

.code-box {
  margin: 12px 0;
  padding: 16px;
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #081120, #0a1628);
  overflow-x: auto;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.code-box pre {
  margin: 0;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.highlight {
  color: var(--cyan);
  font-weight: 700;
}

/* Collapsible cheat-sheets */
.cheat-sheet {
  margin: 12px 0;
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #081120, #0a1628);
  overflow: hidden;
}

.cheat-summary {
  padding: 14px 16px;
  cursor: pointer;
  color: var(--cyan);
  font-size: 14px;
  font-weight: 700;
  list-style: none;
  user-select: none;
}

.cheat-summary::-webkit-details-marker {
  display: none;
}

.cheat-summary::before {
  content: '▸ ';
  opacity: 0.7;
}

.cheat-sheet[open] .cheat-summary::before {
  content: '▾ ';
}

.cheat-body {
  padding: 0 16px 16px;
}

.cheat-body pre {
  margin: 0;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

@media (max-width: 768px) {
  .header-content {
    flex-wrap: wrap;
  }

  .toc {
    gap: 6px;
  }

  .toc a {
    font-size: 12px;
    padding: 6px 10px;
  }

  .section h2 {
    font-size: 19px;
  }

  .code-box pre {
    font-size: 12px;
  }
}
