/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Verdana, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.8;
  color: #222;
  background: #fff;
}

a { color: #FF6719; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Fixed top bar */
.substack-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #FF6719;
  color: #fff;
  text-align: center;
  padding: 10px 20px;
  font-size: 15px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.substack-bar a {
  color: #fff;
  font-weight: bold;
  text-decoration: underline;
}

/* Site layout */
.site-wrapper {
  max-width: 680px;
  margin: 0 auto;
  padding: 80px 24px 60px; /* top padding clears the fixed bar */
}

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 32px 0 24px;
  border-bottom: 1px solid #eee;
  margin-bottom: 40px;
}

.site-title {
  font-size: 22px;
  font-weight: bold;
  color: #222;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.site-header nav a {
  margin-left: 20px;
  font-size: 15px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #555;
}

/* Post list */
.post-summary {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid #eee;
}

.post-summary {
  display: block;
}

.post-thumb-link { display: block; margin-bottom: 14px; text-align: center; }

.post-thumb {
  width: 66%;
  height: auto;
  max-height: 260px;
  object-fit: contain;
  object-position: center;
  border-radius: 4px;
  display: inline-block;
}

.post-summary h2 { font-size: 22px; margin-bottom: 6px; }
.post-summary h2 a { color: #222; }
.post-summary h2 a:hover { color: #FF6719; text-decoration: none; }
.post-summary time { font-size: 14px; color: #888; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.post-summary p { margin-top: 10px; color: #444; }

/* Single post */
.post-header { margin-bottom: 32px; }
.post-header h1 { font-size: 32px; line-height: 1.3; margin-bottom: 8px; }
.post-header time { font-size: 14px; color: #888; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

.post-body p { margin-bottom: 20px; }
.post-body h2, .post-body h3 { margin: 32px 0 12px; }
.post-body img { max-width: 100%; height: auto; }
.post-body pre,
.post-body .highlight pre {
  background: #f6f6f6 !important;
  color: #222 !important;
  border-radius: 4px;
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.5;
}
.post-body .highlight span {
  color: #222 !important;
  background: transparent !important;
}
.post-body code {
  font-family: 'Courier New', Courier, monospace;
}
.caption {
  font-size: 13px;
  color: #888;
  font-style: italic;
  margin-top: -8px;
  margin-bottom: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.post-body blockquote {
  border-left: 3px solid #FF6719;
  padding-left: 20px;
  margin: 24px 0;
  color: #555;
  font-style: italic;
}

/* End-of-post CTA */
.post-cta {
  margin-top: 60px;
  padding: 32px;
  background: #fff8f4;
  border: 1px solid #ffd4b8;
  border-radius: 6px;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.post-cta p {
  margin-bottom: 20px;
  font-size: 16px;
  color: #444;
}

.cta-button {
  display: inline-block;
  background: #FF6719;
  color: #fff;
  padding: 12px 28px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  text-decoration: none;
}

.cta-button:hover {
  background: #e55a0f;
  text-decoration: none;
}

/* Mid-post CTA — slightly more compact */
.post-cta-inline {
  margin: 32px 0;
  padding: 24px;
  font-size: 15px;
}

.post-cta-inline p { margin-bottom: 14px; }

/* Floating subscribe button */
.float-subscribe {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  background: #FF6719;
  color: #fff;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: bold;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  text-decoration: none;
}

.float-subscribe:hover {
  background: #e55a0f;
  text-decoration: none;
}

/* Archived comments */
.comments-archive {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid #eee;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.comments-archive h3 {
  font-size: 18px;
  margin-bottom: 24px;
  color: #222;
}

.comments-note {
  font-size: 13px;
  font-weight: normal;
  color: #999;
}

.comment {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f0f0f0;
}

.comment:last-child {
  border-bottom: none;
}

.comment-meta {
  font-size: 13px;
  color: #888;
  margin-bottom: 6px;
}

.comment-meta a { color: #888; }
.comment-meta strong { color: #555; }

.comment-meta time {
  margin-left: 10px;
}

.comment-body {
  font-size: 15px;
  color: #444;
  line-height: 1.6;
}

/* Comments CTA */
.comments-cta {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid #eee;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-align: center;
}

.comments-cta h3 {
  font-size: 18px;
  margin-bottom: 12px;
  color: #222;
}

.comments-cta p {
  font-size: 15px;
  color: #555;
  margin-bottom: 10px;
}

.comments-cta-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  justify-content: center;
}

.cta-button-secondary {
  background: #555;
}

.cta-button-secondary:hover {
  background: #333;
}

/* Ko-fi floating button (bottom-left) */
.float-kofi {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 999;
  background: #555;
  color: #fff;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: bold;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  text-decoration: none;
}

.float-kofi:hover {
  background: #333;
  text-decoration: none;
}

/* Footer */
.site-footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid #eee;
  font-size: 14px;
  color: #888;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.footer-kofi {
  margin-bottom: 16px;
  text-align: center;
}

.footer-kofi-label {
  margin-bottom: 8px;
  font-size: 15px;
  color: #444;
}

.footer-kofi-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 14px;
  color: #FF6719;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.footer-kofi-link:hover { text-decoration: underline; }

/* Ko-fi counter — centered, clip internal top whitespace and button */
.footer-kofi-counter {
  overflow: hidden;
  height: 52px;
  display: flex;
  justify-content: center;
}

.footer-kofi-counter iframe {
  width: 260px !important;
  min-width: 0 !important;
  max-width: 260px !important;
  height: 180px !important;
  margin-top: -38px;
  display: block;
  flex-shrink: 0;
}

/* Responsive embeds (YouTube, Maps, etc.) */
.embed-responsive {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 20px 0;
  aspect-ratio: 16 / 9;
}

.embed-responsive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  border: 0;
  display: block;
}

/* Mobile */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .post-header h1 { font-size: 24px; }
  .float-subscribe { bottom: 16px; right: 16px; }
  .float-kofi { bottom: 16px; left: 16px; }
  .site-header { flex-direction: column; gap: 12px; }
}
