/* Custom CSS for Quarto project */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600;700&display=swap');

/* Base font size - reduce site-wide */
html {
  font-size: 14px;
}

body {
  font-size: 0.9rem;
}

/* Headings - proportionally smaller */
h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

/* Header styling */
.navbar-brand {
  font-weight: bold;
}

/* Content styling: let Bootstrap/Quarto handle container width */
/* Removed hard max-width to prevent excessive gap with right TOC */

/* Code block styling */
pre {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 0.375rem;
  padding: 1rem;
  font-size: 0.8rem;
}

code {
  font-size: 0.85em;
}

/* List styling */
ul, ol {
  font-size: 0.9rem;
}

/* TOC styling */
.toc-actions, .sidebar nav {
  font-size: 0.85rem;
}

/* Custom colors */
:root {
  --primary-color: #2780e3;
  --secondary-color: #6c757d;
}

/* Link styling */
a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Table styling */
table {
  margin: 1rem 0;
  font-size: 0.85rem;
}

th {
  background-color: #f8f9fa;
  font-weight: 600;
}

/* Dark mode overrides */
body.quarto-dark pre {
  background-color: #2b2b2b;
  border-color: #444;
  color: #f8f9fa;
}

body.quarto-dark th {
  background-color: #375a7f;
  /* Matches Darkly primary/header tone */
  color: #fff;
}

/* Ensure mobile nav visibility in dark mode */
body.quarto-dark .navbar-toggler-icon {
  filter: invert(1);
}

body.quarto-dark .navbar-brand {
  color: #fff !important;
}

body.quarto-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.75) !important;
}

body.quarto-dark .navbar-nav .nav-link:hover,
body.quarto-dark .navbar-nav .nav-link:focus {
  color: #fff !important;
}

/* Restore Cosmo font settings for navbar in dark mode */
body.quarto-dark .navbar {
  --bs-navbar-padding-y: 0.5rem;
  /* Standard Bootstrap padding */
  font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  font-size: 1rem !important;
}

body.quarto-dark .navbar-brand {
  font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
}

body.quarto-dark .navbar-nav .nav-link {
  font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
}

/* Tooltip styling */
abbr[data-tooltip] {
  text-decoration: underline dotted;
  cursor: help;
  position: relative;
}

abbr[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  white-space: normal;
  /* Allow text to wrap */
  max-width: 250px;
  /* Prevent it from getting too wide */
  width: max-content;
  /* Shrink to fit content if smaller than max-width */
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  text-align: center;
}

/* Dark mode tooltip adjustment */
body.quarto-dark abbr[data-tooltip]:hover::after {
  background-color: #f8f9fa;
  color: #333;
}

/* Reset columns that contain mermaid */
.column .mermaid,
.columns .mermaid {
  padding: 0 !important;
  margin: 0 !important;
}

/* Comprehensive Mermaid padding reset - target everything */
.mermaid,
.mermaid *,
.reveal .mermaid,
.reveal .mermaid *,
.mermaid svg,
.mermaid svg * {
  padding-left: 0 !important;
  margin-left: 0 !important;
  text-indent: 0 !important;
  transform: none !important;
}

/* Force text centering */
.mermaid svg text,
.mermaid svg tspan {
  text-anchor: middle !important;
}

/* Reset foreignObject */
.mermaid foreignObject {
  overflow: visible !important;
}

.mermaid foreignObject > div {
  width: 100% !important;
  text-align: center !important;
  padding: 3px 5px !important;
  box-sizing: border-box !important;
}
