* {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  max-width: 1000px;
  margin: 0 auto;
  font-weight: 300;
}

a {
  color: inherit;
}

.bold {
  font-weight: 500;
}

/* Header — matches main site contact bar */
#header {
  padding: 16px;
  font-size: 16pt;
  font-weight: 100;
  text-align: center;
  background: #232931;
  color: white;
}

#header a {
  color: white;
}

/* Post list */
#posts {
  padding: 16px 32px;
  background: #eaeaeb;
}

.post-item {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid #d0d0d0;
  text-decoration: none;
  color: inherit;
}

.post-item:last-child {
  border-bottom: none;
}

.post-item:hover .post-title {
  text-decoration: underline;
}

.post-title {
  font-weight: 500;
  font-size: 1.1rem;
  margin: 0;
}

.post-meta {
  font-size: 0.8rem;
  color: #666;
  margin: 4px 0 0 0;
}

.post-summary {
  font-size: 0.9rem;
  color: #444;
  margin: 4px 0 0 0;
}

/* Reader */
#reader {
  padding: 16px 32px 48px;
  background: #d7d6cb;
}

#reader[hidden] {
  display: none;
}

#reader-nav {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding-bottom: 16px;
  border-bottom: 1px solid #bbb;
  margin-bottom: 16px;
}

#reader-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 4px 0;
}

#reader-date {
  font-size: 0.8rem;
  color: #666;
  margin: 0 0 24px 0;
}

#reader-body {
  line-height: 1.7;
  font-size: 1rem;
}

#reader-body h1, #reader-body h2, #reader-body h3, #reader-body h4 {
  margin-top: 28px;
  margin-bottom: 8px;
  font-weight: 700;
}

/* Hero image — full bleed if it's the first image before any subheading */
#reader-body > p:has(> img):not(h2 ~ p):not(p:has(> img) ~ p) img,
#reader-body > img:first-child {
  display: block;
  width: calc(100% + 64px);
  max-width: none;
  height: auto;
  margin: 0 -32px 4px -32px;
}

/* Other images — flow with text, constrained size */
#reader-body img {
  max-width: 80%;
  height: auto;
  margin: 12px auto 4px;
  display: block;
}

/* Image captions — italic-only paragraphs (separate <p>) */
#reader-body > p:has(> em:only-child) {
  text-align: center;
  margin-top: 0;
  font-size: 0.8rem;
  color: #666;
}

/* Image captions — italic text inside same paragraph as image */
#reader-body > p:has(> img) > em {
  display: block;
  text-align: center;
  margin-top: 0;
  font-size: 0.8rem;
  color: #666;
}

#reader-body ul, #reader-body ol {
  padding-left: 24px;
}

#reader-body li {
  margin-bottom: 8px;
}

#reader-body a {
  color: black;
  text-decoration: underline;
}

/* Prev / Next post navigation — top of post */
#post-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px 16px;
  margin: 0 -32px 16px;
  border-bottom: 1px solid #bbb;
  font-size: 0.8rem;
}

.post-nav-link {
  flex: 1;
}

.post-nav-link a {
  text-decoration: none;
  color: #666;
}

.post-nav-link a:hover {
  color: black;
}

.post-nav-prev {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 8px;
}

.post-nav-center {
  flex: 0 0 auto;
  text-align: center;
}

.post-nav-next {
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 8px;
}
