/* Typography */
body {
  font-family: "Palatino", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  line-height: 1.7;
  font-size: 1.1em;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 600;
}

/* Chapter number - small metadata */
.quarto-title .quarto-categories {
  font-size: 1.2em;
  color: #1e5090;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Chapter title - largest */
.quarto-title h1.title {
  font-size: 2.5em;
  color: #1e5090;
}

/* Section headings (## in markdown) - large */
h2, h2 .header-section-number {
  font-size: 1.8em;
  color: #1e5090;
  margin-top: 2em;
  margin-bottom: 0.8em;
  border-bottom: none;
}

/* Subsections (### in markdown) - moderate */
h3 {
  font-size: 1.3em !important;
  color: #1e5090;
  margin-top: 1.8em;
  margin-bottom: 0.6em;
}

h3 .header-section-number {
  font-size: 1.3em !important;
  color: #1e5090;
}

/* H4 headings - small */
h4, h4 .header-section-number {
  font-size: 1.1em;
  color: #1e5090;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

h4 .header-section-number {
  font-size: 1em;
  color: #1e5090;
}

/* Quotes with color bar */
blockquote {
  border-left: 4px solid #333;
  margin: 2em 3em 2.5em 3em;
  padding-left: 1.5em;
  padding-right: 1em;
  font-style: italic;
  color: #555;
  background: transparent;
}

/* Links - prevent overflow */
a {
  color: #4169e1;
  text-decoration: none;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

a:hover {
  text-decoration: underline;
}

/* Force long URLs to break */
p a, li a {
  word-break: break-all;
}

/* Bullet points - tighter spacing */
ul, ol {
  margin-bottom: 1em;
}

ul li, ol li {
  margin-bottom: 0.3em;
}

/* Footnotes - superscript style */
a.footnote-ref {
  font-size: 0.75em;
  vertical-align: super;
  text-decoration: none;
  padding: 0 0.1em;
}

/* Footnotes section */
.footnotes {
  font-size: 0.85em;
  margin-top: 3em;
  padding-top: 1em;
  border-top: 1px solid #ccc;
}

.footnotes ol {
  padding-left: 2em;
}

.footnotes li {
  margin-bottom: 0.5em;
}

/* Footnote backref */
.footnote-back {
  font-size: 0.9em;
  text-decoration: none;
}

/* Better spacing */
p {
  margin-bottom: 1em;
}

/* Main content max-width for readability */
.quarto-title {
  margin-bottom: 2em;
}

/* Left sidebar TOC - add hyphenation */
.sidebar nav[role="doc-toc"] ul li a {
  hyphens: auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Mobile: hide TOC and use full width */
@media (max-width: 768px) {
  #TOC {
    display: none !important;
  }
  
  .quarto-container {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  main {
    max-width: 100% !important;
    padding-left: 1em;
    padding-right: 1em;
  }
}

/* Desktop: show TOC on right */
@media (min-width: 769px) {
  #TOC {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 280px;
    font-size: 0.85em;
    border-left: 1px solid #ddd;
    padding-left: 1em;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    hyphens: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  #TOC a {
    hyphens: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  #TOC .active {
    color: #1e5090;
    font-weight: 600;
  }
  
  #toc-title {
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 0.5em;
  }
  
  #TOC ul {
    font-size: 0.9em;
  }
  
  .quarto-container {
    max-width: none !important;
    padding-right: 320px;
  }
  
  main.content {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Screenshot styling */
img[alt*="screenshot"],
img[alt*="navigation"],
img[alt*="TOC"] {
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin: 1.5em auto;
  display: block;
}