/* Lissot.net - Linux Storage, Partitioning & Sysadmin Engineering Hub
   Modern High-Density Technical Documentation Stylesheet */

:root {
  /* Surface & Background Palette */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-muted: #e2e8f0;
  
  /* Borders & Dividers */
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #0284c7;

  /* Typography Colors */
  --text-primary: #090d16;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  /* Precision Accent - Single Cohesive Primary */
  --accent-primary: #0284c7;
  --accent-hover: #0369a1;
  --accent-active: #075985;
  --accent-subtle: rgba(2, 132, 199, 0.08);
  --accent-glow: rgba(2, 132, 199, 0.15);

  /* Callout Semantic Hues */
  --callout-note: #0284c7;
  --callout-warning: #b45309;
  --callout-tip: #059669;
  --callout-info: #475569;

  /* Dark Code & Terminal Surfaces */
  --terminal-bg: #0b0f19;
  --terminal-header: #131b2e;
  --terminal-border: #1e293b;
  --terminal-text: #e2e8f0;
  --terminal-comment: #64748b;
  --terminal-prompt: #10b981;

  /* Typography Stacks */
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, Menlo, Monaco, Consolas, monospace;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Elevation Shadows (Hue-Tinted with Slate) */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.05), 0 1px 2px -1px rgba(15, 23, 42, 0.05);
  --shadow-elevated: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);

  /* Smooth Easing Functions */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.68;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Accessibility Focus States */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background-color: rgba(2, 132, 199, 0.18);
  color: var(--text-primary);
}

/* Screen-reader-only utility (for live regions, labels) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip Link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  background-color: var(--accent-primary);
  color: #ffffff;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* Honor reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================================
   Header & Navigation
   ========================================================================= */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.85rem 1.5rem;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.025em;
  transition: opacity 0.15s ease;
}

.brand:hover {
  opacity: 0.88;
}

.brand-icon {
  width: 28px;
  height: 28px;
  background-color: var(--text-primary);
  color: #ffffff;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.brand-sub {
  color: var(--accent-primary);
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-xs);
  position: relative;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-links a:hover {
  color: var(--accent-primary);
  background-color: var(--bg-subtle);
}

.nav-links a.active {
  color: var(--accent-primary);
  font-weight: 600;
  background-color: var(--accent-subtle);
}

.header-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
  display: inline-block;
  letter-spacing: -0.01em;
}

/* =========================================================================
   Layout Structure
   ========================================================================= */
.layout-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 3.5rem;
  flex: 1;
  width: 100%;
}

.layout-single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1020px;
}

/* =========================================================================
   Sidebar Navigation
   ========================================================================= */
aside.sidebar {
  position: sticky;
  top: 5rem;
  height: calc(100vh - 6rem);
  overflow-y: auto;
  padding-right: 1.25rem;
  display: flex;
  flex-direction: column;
}

/* Sleek scrollbar for sidebar */
aside.sidebar::-webkit-scrollbar {
  width: 4px;
}

aside.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

.sidebar-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* Mobile sidebar toggle (hidden on desktop) */
.sidebar-toggle {
  display: none;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-nav a {
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.45;
  transition: color 0.15s var(--ease-smooth), background-color 0.15s var(--ease-smooth), border-color 0.15s var(--ease-smooth), transform 0.15s var(--ease-smooth);
  border-left: 2px solid transparent;
  font-weight: 450;
}

.sidebar-nav a:hover {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  transform: translateX(2px);
}

.sidebar-nav a.active {
  background-color: var(--accent-subtle);
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
  font-weight: 600;
}

.sidebar-badge {
  margin-top: 2rem;
  padding: 0.9rem 1rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
}

.sidebar-badge strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
}

/* =========================================================================
   Main Content Area & Typography
   ========================================================================= */
main.content {
  min-width: 0;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.breadcrumbs a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.breadcrumbs a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.breadcrumbs span {
  color: var(--border-strong);
  font-size: 0.75rem;
}

.doc-header {
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.75rem;
}

.doc-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  text-wrap: balance;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.doc-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Markdown & Content Headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.025em;
  scroll-margin-top: 5.5rem;
  text-wrap: balance;
}

h1 {
  font-size: 2.1rem;
  line-height: 1.22;
  margin-bottom: 1.1rem;
}

h2 {
  font-size: 1.45rem;
  line-height: 1.35;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
}

h3 {
  font-size: 1.15rem;
  line-height: 1.4;
  margin: 1.85rem 0 0.7rem;
}

h4 {
  font-size: 1rem;
  margin: 1.35rem 0 0.5rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 68ch;
  line-height: 1.7;
}

a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

ul, ol {
  margin: 0 0 1.35rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 68ch;
}

li {
  margin-bottom: 0.45rem;
  line-height: 1.65;
}

hr {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: 2.5rem 0;
}

/* Inline Code */
code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-weight: 500;
}

/* =========================================================================
   Terminal & Preformatted Code Blocks
   ========================================================================= */
pre {
  background-color: var(--terminal-bg);
  border: 1px solid var(--terminal-border);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.35rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.65;
  margin: 1.35rem 0 1.75rem;
  position: relative;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  color: var(--terminal-text);
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  font-weight: 400;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--terminal-header);
  border: 1px solid var(--terminal-border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--terminal-comment);
}

.code-header + pre {
  margin-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.copy-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  border-radius: var(--radius-xs);
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.copy-btn:hover {
  background-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.copy-btn:active {
  transform: translateY(1px) scale(0.97);
}

/* =========================================================================
   Callouts & Alerts
   ========================================================================= */
.callout {
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  border-left: 3px solid;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.callout-note {
  border-left-color: var(--callout-note);
  background-color: #f0f9ff;
}

.callout-warning {
  border-left-color: var(--callout-warning);
  background-color: #fffbeb;
}

.callout-tip {
  border-left-color: var(--callout-tip);
  background-color: #f0fdf4;
}

.callout-history {
  border-left-color: var(--callout-info);
  background-color: #f8fafc;
}

.callout-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.callout-note .callout-title { color: #0369a1; }
.callout-warning .callout-title { color: #92400e; }
.callout-tip .callout-title { color: #065f46; }
.callout-history .callout-title { color: var(--text-primary); }

.callout p:last-child {
  margin-bottom: 0;
}

/* =========================================================================
   Data & Architecture Tables
   ========================================================================= */
.table-wrapper {
  overflow-x: auto;
  margin: 1.75rem 0 2.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  box-shadow: var(--shadow-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

th, td {
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background-color 0.12s ease;
}

tbody tr:hover {
  background-color: #f8fafc;
}

/* =========================================================================
   Hero Section (Homepage)
   ========================================================================= */
.hero {
  padding: 3rem 0 2.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2.5rem;
  position: relative;
}

.hero h1 {
  font-size: 2.45rem;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.08rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  max-width: 68ch;
  line-height: 1.65;
}

.badge {
  display: inline-block;
  background-color: var(--accent-subtle);
  color: var(--accent-primary);
  border: 1px solid rgba(2, 132, 199, 0.22);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 1.1rem;
}

/* =========================================================================
   Card Grid (Modern Technical Cards)
   ========================================================================= */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.35rem;
  margin: 1.5rem 0 2.75rem;
}

.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--ease-spring);
  box-shadow: var(--shadow-card);
  position: relative;
}

.card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-elevated);
  transform: translateY(-2px);
}

.card:active {
  transform: translateY(0);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.card-title a {
  text-decoration: none;
  color: inherit;
}

.card-title a:hover {
  color: var(--accent-primary);
}

.card-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.55;
  flex: 1;
  margin-bottom: 1.1rem;
}

.card-footer {
  font-size: 0.82rem;
  color: var(--accent-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: auto;
  text-decoration: none;
  transition: transform 0.15s ease, color 0.15s ease;
}

.card-footer:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

.card:hover .card-footer {
  transform: translateX(3px);
}

/* =========================================================================
   Footer
   ========================================================================= */
footer.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 1.5rem 2.25rem;
  margin-top: auto;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2.5rem;
}

.footer-brand {
  max-width: 420px;
}

.footer-brand-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.footer-col-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

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

.footer-top a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-top a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
}

/* =========================================================================
   Responsive Breakpoints
   ========================================================================= */
@media (max-width: 900px) {
  .layout-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem 1rem;
  }

  aside.sidebar {
    position: static;
    height: auto;
    overflow: visible;
    padding-right: 0;
  }

  .sidebar-title {
    display: none;
  }

  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.7rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: 0.75rem;
    transition: background-color 0.15s ease, border-color 0.15s ease;
  }

  .sidebar-toggle:hover {
    background-color: var(--bg-subtle);
    border-color: var(--border-strong);
  }

  .sidebar-toggle[aria-expanded="true"] .sidebar-toggle-icon {
    transform: rotate(180deg);
  }

  .sidebar-toggle-icon {
    font-size: 0.7rem;
    transition: transform 0.15s ease;
  }

  #sidebar-nav-list[hidden] {
    display: none;
  }

  .hero h1 {
    font-size: 1.95rem;
  }

  .doc-title {
    font-size: 1.85rem;
  }

  .header-container {
    gap: 1rem;
  }
}
