/**
 * Documentation Pages Styling
 *
 * Clean, readable styling for metric documentation pages.
 * More restrained than framework pages but maintains design cohesion.
 * Applied to: 15 metric pages, benchmark scoring, time-and-effort/skill-and-artistry/complexity-and-detail pages
 */

/* ============================================
   DOCUMENTATION PAGE BODY STYLING
   ============================================ */

body.documentation-page {
  font-family: var(--font-body);
  color: var(--color-text-primary);
  line-height: var(--leading-relaxed);
  background: #ffffff;
}

/* ============================================
   NAVBAR STYLING - MATCH LANDING PAGE
   ============================================ */

/* Navbar container */
body.documentation-page .navbar {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(10, 31, 68, 0.08);
  box-shadow: var(--shadow-md);
  padding: var(--space-2) 0;
}

/* Navbar branding and title */
body.documentation-page .navbar-brand,
body.documentation-page .navbar-title {
  color: var(--color-navy-900) !important;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
}

/* Navbar navigation spacing */
body.documentation-page .navbar-nav {
  gap: var(--space-4);
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Navbar links - IMPORTANT: No underlines */
body.documentation-page .navbar-nav .nav-link {
  font-weight: var(--weight-medium);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  color: var(--color-text-secondary) !important;
  transition: background var(--transition-base), color var(--transition-base);
  text-decoration: none !important;
}

/* Navbar link hover state - NO underlines */
body.documentation-page .navbar-nav .nav-link:hover,
body.documentation-page .navbar-nav .nav-link:focus {
  background: rgba(10, 31, 68, 0.08);
  color: var(--color-navy-900) !important;
  text-decoration: none !important;
}

/* Navbar active link */
body.documentation-page .navbar-nav .nav-link.active {
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--color-navy-900) !important;
  box-shadow: var(--shadow-sm);
}

/* Color scheme toggle */
body.documentation-page .quarto-navbar-tools .quarto-color-scheme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  padding: var(--space-2);
  color: var(--color-text-secondary) !important;
}

/* Main content area */
body.documentation-page #quarto-document-content {
  max-width: 850px;
  line-height: var(--leading-relaxed);
}

/* ============================================
   SIDEBAR NAVIGATION STYLING
   ============================================ */

/* Sidebar container */
body.documentation-page .sidebar {
  background: var(--color-surface-raised);
  border-right: 1px solid var(--color-border);
  font-size: var(--text-sm);
}

/* Sidebar titles and section headers */
body.documentation-page .sidebar-title,
body.documentation-page .sidebar .sidebar-section-heading {
  font-weight: var(--weight-semibold);
  color: var(--color-navy-900) !important;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
}

/* Sidebar navigation links - OVERRIDE PURPLE */
body.documentation-page .sidebar a,
body.documentation-page .sidebar .sidebar-item a,
body.documentation-page .sidebar-item-text,
body.documentation-page .sidebar-link {
  color: var(--color-text-primary) !important;
  text-decoration: none !important;
  font-weight: var(--weight-normal);
  transition: color var(--transition-base), background var(--transition-base);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  display: block;
}

/* Sidebar link hover state */
body.documentation-page .sidebar a:hover,
body.documentation-page .sidebar .sidebar-item a:hover {
  background: rgba(10, 31, 68, 0.06) !important;
  color: var(--color-navy-900) !important;
  text-decoration: none !important;
}

/* Sidebar active/current page link */
body.documentation-page .sidebar a.active,
body.documentation-page .sidebar .sidebar-item.active > a,
body.documentation-page .sidebar .sidebar-item.active .sidebar-item-text {
  background: rgba(212, 175, 55, 0.15) !important;
  color: var(--color-navy-900) !important;
  font-weight: var(--weight-medium) !important;
  border-left: 3px solid var(--color-gold-medium);
}

/* Remove bullets from sidebar and navigation */
body.documentation-page .sidebar ul,
body.documentation-page .sidebar li,
body.documentation-page .navbar-nav ul,
body.documentation-page .navbar-nav li,
body.documentation-page .navbar-nav .nav-item {
  list-style: none !important;
  list-style-type: none !important;
}

body.documentation-page .sidebar li::marker,
body.documentation-page .navbar-nav li::marker {
  content: '' !important;
  display: none !important;
}

/* ============================================
   DOCUMENTATION HEADERS
   ============================================ */

body.documentation-page .quarto-title {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

body.documentation-page .title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--color-navy-900);
  margin-bottom: var(--space-2);
  line-height: var(--leading-tight);
}

body.documentation-page .subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  font-weight: var(--weight-normal);
  line-height: var(--leading-relaxed);
}

/* Section headings */
body.documentation-page h2 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--color-navy-900);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

body.documentation-page h3 {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--color-navy-800);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

body.documentation-page h4 {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--color-navy-700);
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
}

body.documentation-page p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

body.documentation-page strong {
  font-weight: var(--weight-semibold);
  color: var(--color-navy-900);
}

/* ============================================
   DOCUMENTATION CALLOUTS
   ============================================ */

body.documentation-page .callout {
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin: var(--space-5) 0;
  border-left-width: 3px;
  border-left-style: solid;
  background: var(--callout-bg);
  border-left-color: var(--callout-color);
}

body.documentation-page .callout-important {
  --callout-bg: rgba(59, 130, 246, 0.06);
  --callout-color: #3b82f6;
}

body.documentation-page .callout-tip {
  --callout-bg: rgba(16, 185, 129, 0.06);
  --callout-color: #10b981;
}

body.documentation-page .callout-note {
  --callout-bg: rgba(139, 92, 246, 0.06);
  --callout-color: #8b5cf6;
}

body.documentation-page .callout-warning {
  --callout-bg: rgba(245, 158, 11, 0.06);
  --callout-color: #f59e0b;
}

body.documentation-page .callout-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--callout-color);
  margin-bottom: var(--space-2);
}

/* ============================================
   DOCUMENTATION LISTS
   ============================================ */

body.documentation-page ul:not([class]),
body.documentation-page ol:not([class]) {
  margin: var(--space-4) 0;
  padding-left: var(--space-6);
}

body.documentation-page li:not([class]) {
  margin-bottom: var(--space-2);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
}

body.documentation-page ul:not([class]) li:not([class]) {
  list-style-type: disc;
}

body.documentation-page ol:not([class]) li:not([class]) {
  list-style-type: decimal;
}

/* ============================================
   DOCUMENTATION TABLES
   ============================================ */

body.documentation-page table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-5) 0;
  font-size: var(--text-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

body.documentation-page thead {
  background: var(--color-navy-50);
}

body.documentation-page th {
  padding: var(--space-3);
  text-align: left;
  font-weight: var(--weight-semibold);
  color: var(--color-navy-900);
  border-bottom: 1px solid var(--color-border);
}

body.documentation-page td {
  padding: var(--space-3);
  border-bottom: 1px solid rgba(10, 31, 68, 0.05);
  vertical-align: top;
}

body.documentation-page tbody tr:last-child td {
  border-bottom: none;
}

body.documentation-page tbody tr:hover {
  background: rgba(59, 130, 246, 0.02);
}

/* ============================================
   DOCUMENTATION CODE & FORMULAS
   ============================================ */

body.documentation-page code:not([class]) {
  background: rgba(59, 130, 246, 0.06);
  color: #1e40af;
  padding: 0.15em 0.35em;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  font-family: var(--font-mono);
  border: 1px solid rgba(59, 130, 246, 0.1);
}

body.documentation-page pre {
  background: var(--color-navy-50);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin: var(--space-5) 0;
  overflow-x: auto;
  font-size: var(--text-sm);
}

body.documentation-page pre code {
  background: none;
  color: var(--color-navy-900);
  padding: 0;
  border: none;
}

/* Formula blocks */
body.documentation-page .katex-display,
body.documentation-page .MathJax_Display {
  margin: var(--space-5) 0;
  padding: var(--space-4);
  background: rgba(59, 130, 246, 0.03);
  border-radius: var(--radius-md);
  border-left: 3px solid #3b82f6;
}

/* ============================================
   DOCUMENTATION LINKS
   ============================================ */

body.documentation-page a:not([class]) {
  color: #3b82f6;
  text-decoration: none;
  transition: color var(--transition-base);
  font-weight: var(--weight-medium);
}

body.documentation-page a:not([class]):hover {
  color: #2563eb;
  text-decoration: underline;
}

/* Cross-reference links */
body.documentation-page .quarto-xref {
  color: #3b82f6;
  font-weight: var(--weight-medium);
}

/* ============================================
   DOCUMENTATION HORIZONTAL RULES
   ============================================ */

body.documentation-page hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: var(--space-8) 0;
}

/* ============================================
   DOCUMENTATION BLOCKQUOTES
   ============================================ */

body.documentation-page blockquote {
  border-left: 3px solid var(--color-navy-300);
  padding-left: var(--space-4);
  margin: var(--space-5) 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

body.documentation-page blockquote p {
  margin-bottom: var(--space-2);
}

/* ============================================
   DOCUMENTATION TOC SIDEBAR
   ============================================ */

body.documentation-page #TOC {
  font-size: var(--text-sm);
}

body.documentation-page #TOC ul {
  list-style: none;
  padding-left: var(--space-4);
}

body.documentation-page #TOC li {
  margin: var(--space-1) 0;
}

body.documentation-page #TOC a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-base);
}

body.documentation-page #TOC a:hover,
body.documentation-page #TOC a.active {
  color: #3b82f6;
  font-weight: var(--weight-medium);
}

/* ============================================
   DOCUMENTATION DEFINITION LISTS
   ============================================ */

body.documentation-page dt {
  font-weight: var(--weight-semibold);
  color: var(--color-navy-900);
  margin-top: var(--space-3);
}

body.documentation-page dd {
  margin-left: var(--space-5);
  margin-bottom: var(--space-3);
  color: var(--color-text-primary);
}

/* ============================================
   DOCUMENTATION EXAMPLE BLOCKS
   ============================================ */

body.documentation-page .example {
  background: rgba(139, 92, 246, 0.04);
  border-left: 3px solid #8b5cf6;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin: var(--space-5) 0;
}

body.documentation-page .example-title {
  font-weight: var(--weight-semibold);
  color: #8b5cf6;
  margin-bottom: var(--space-2);
}

/* ============================================
   DOCUMENTATION FOOTNOTES
   ============================================ */

body.documentation-page .footnotes {
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

body.documentation-page .footnotes ol {
  padding-left: var(--space-5);
}

body.documentation-page .footnotes li {
  margin-bottom: var(--space-2);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
  body.documentation-page .title {
    font-size: var(--text-2xl);
  }

  body.documentation-page h2 {
    font-size: var(--text-xl);
  }

  body.documentation-page h3 {
    font-size: var(--text-lg);
  }

  body.documentation-page table {
    font-size: var(--text-xs);
  }

  body.documentation-page th,
  body.documentation-page td {
    padding: var(--space-2);
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  body.documentation-page {
    background: white;
  }

  body.documentation-page .navbar,
  body.documentation-page .sidebar,
  body.documentation-page #TOC {
    display: none;
  }

  body.documentation-page a {
    color: inherit;
    text-decoration: underline;
  }

  body.documentation-page .callout {
    border: 1px solid var(--callout-color);
  }
}
