/* Gwern-Inspired Typography & Styling */

/* Typography - adapted from Gwern's excellent font choices */
body {
  font-family: "Source Serif 4", "Source Serif Pro", "Baskerville", "Georgia", serif;
  font-size: 18px;
  line-height: 1.8;
  color: #2B2B2B;
  background-color: #FAF8F5;
  max-width: 45em;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  color: #8B2635;
}

h1 { font-size: 2.0em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.25em; }

/* Links - Burgundy style with sophisticated underline */
a {
  color: #8B2635;
  text-decoration: underline;
  text-decoration-color: rgba(139, 38, 53, 0.4);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

a:hover {
  text-decoration-color: rgba(139, 38, 53, 1);
  color: #6B1D28;
}

a:visited {
  color: #6B1D28;
}

/* Code blocks */
code {
  font-family: "SF Mono", "Monaco", "Inconsolata", "Consolas", monospace;
  font-size: 0.9em;
  background: #f5f5f5;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

pre {
  background: #f5f5f5;
  padding: 1em;
  overflow-x: auto;
  border-left: 3px solid #ddd;
  margin: 1.5em 0;
}

pre code {
  background: none;
  padding: 0;
}

/* Blockquotes */
blockquote {
  margin: 1.5em 0;
  padding-left: 1.5em;
  border-left: 3px solid #ccc;
  font-style: italic;
  color: #555;
}

/* Footnotes/Sidenotes */
.footnotes {
  margin-top: 3em;
  padding-top: 1em;
  border-top: 1px solid #ddd;
  font-size: 0.9em;
}

.footnotes-list {
  padding-left: 1.5em;
}

sup {
  line-height: 0;
}

/* Lists */
ul, ol {
  padding-left: 1.5em;
  margin: 1em 0;
}

li {
  margin: 0.5em 0;
}

/* Horizontal rules */
hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 2em 0;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  margin: 1.5em 0;
}

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

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

th {
  background: #f5f5f5;
  font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 760px) {
  body {
    font-size: 16px;
    padding: 1rem;
  }
  
  h1 { font-size: 1.75em; }
  h2 { font-size: 1.35em; }
  h3 { font-size: 1.15em; }
}
