/* Professional Book Styling */

/* Body and general text */
body {
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  line-height: 1.6;
  color: #333;
  max-width: 1000px;
  margin: 0 auto;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 500;
  color: #2c3e50;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

h1 {
  font-size: 2.5em;
  border-bottom: 1px solid #eaecef;
  padding-bottom: 0.3em;
}

h2 {
  font-size: 1.8em;
  border-bottom: 1px solid #eaecef;
  padding-bottom: 0.2em;
}

h3 {
  font-size: 1.4em;
}

/* Cover image styling */
.quarto-cover {
  box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
  border-radius: 5px;
  margin-bottom: 2em;
}

/* Code blocks */
pre, code {
  font-family: "Source Code Pro", Consolas, Monaco, "Andale Mono", monospace;
  background-color: #f8f8f8;
  border-radius: 3px;
}

pre {
  padding: 1em;
  border: 1px solid #e1e4e8;
  overflow: auto;
}

/* Tables */
table {
  width: 100%;
  margin-bottom: 1.5em;
  border-collapse: collapse;
  border-spacing: 0;
}

th, td {
  padding: 0.5em;
  border: 1px solid #ddd;
}

th {
  background-color: #f2f2f2;
  font-weight: bold;
  text-align: left;
}

/* Figures and captions */
figure {
  margin: 1.5em 0;
  text-align: center;
}

figcaption {
  font-style: italic;
  font-size: 0.9em;
  color: #666;
  margin-top: 0.5em;
}

/* Links */
a {
  color: #0366d6;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Blockquotes */
blockquote {
  margin: 1em 0;
  padding: 0 1em;
  color: #6a737d;
  border-left: 0.25em solid #dfe2e5;
}

/* Table of contents */
.sidebar-item-container .active {
  font-weight: bold;
  color: #0366d6;
}

.sidebar nav[role=doc-toc] ul {
  padding-left: 1em;
}

/* Navigation */
.navbar {
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Print-specific styles */
@media print {
  body {
    font-size: 12pt;
  }
  
  pre, code {
    font-size: 10pt;
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }
  
  img, table, figure {
    page-break-inside: avoid;
  }
}

/* Improve readability on mobile */
@media (max-width: 768px) {
  body {
    padding: 0 15px;
  }
  
  pre {
    padding: 0.5em;
  }
  
  table {
    display: block;
    overflow-x: auto;
  }
}
