/* post.css — single-post styling that matches the blog feed layout */

/* Outer container: same geometry as feed .blog-container */
.single-post.blog-container {
  display: flex;
  align-items: flex-start;
  box-sizing: border-box;
  position: relative;
  padding-left: 2.5%;  /* same as blog.css */
  padding-right: 5%;   /* same as blog.css */
  gap: 3rem;           /* same as blog.css */
  max-width: 1200px;   /* match blog index container width */
  margin: 0 auto;      /* center to align with blog index */
  font-size: 1rem;
  line-height: 1.6;
}

/* Main content column: match feed geometry, but add padding + centering */
.single-post .blog-main {
  flex: 1;
  margin-left: 0;
  margin-right: 5%;    /* same as blog.css */
  max-width: 70%;      /* same as blog.css */
  text-align: left;

  /* extra spacing from sidebar + center the inner container */
  padding-left: 1.5rem;
  display: flex;
  justify-content: center;
}

/* Cap readable line length inside the post only */
.single-post .blog-post-container {
  max-width: 820px;
  width: 100%;          /* so centering works well inside flex parent */
  padding: 0 0 3rem 0;
}

/* --- Single-post hard reset to avoid feed/style leaks --- */
.single-post .post-header,
.single-post .post-content,
.single-post .post-footer,
.single-post .post-title,
.single-post .post-date {
  position: static !important;
  float: none !important;
  transform: none !important;
  z-index: auto !important;
}

/* Title */
.single-post .post-title {
  display: block;
  width: 100%;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.4;
  margin: 0 0 0.5rem 0;
  color: var(--color-primary, #463935);
}

/* Spacing around header and content */
.single-post .post-header {
  margin-bottom: 1.25rem;
}

.single-post .post-content {
  margin-top: 0.5rem;
}

/* Content text */
.single-post .post-content {
  font-size: 1.06rem;
  line-height: 1.7;
  color: #333;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.single-post .post-content::after {
  content: "";
  display: block;
  clear: both;  /* in case markdown images are floated */
}

.single-post .post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}

/* Date and footer */
.single-post .post-date {
  font-size: 1rem;
  color: #666;
  margin-bottom: 1rem;
}

.single-post .post-footer {
  clear: both;
  margin-top: 2rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #ccc;
  font-size: 1rem;
}

.single-post .post-categories-feed {
  margin: 0.2rem 0 0.4rem;
}

.single-post .category-link {
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

/* Back link */
.single-post .back-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--color-primary, #463935);
  font-weight: 600;
  text-decoration: none;
}

.single-post .back-link:hover {
  text-decoration: underline;
}

/* IMPORTANT: sidebar layout is controlled by sidebar.css (.blog-sidebar) */

/* Responsive: match the feed’s stacking behavior (layout handled by sidebar.css) */
@media (max-width: 900px) {
  .single-post.blog-container {
    flex-direction: column;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .single-post .blog-post-container {
    max-width: 42rem;
  }
}

/* Dark mode touch-ups */
@media (prefers-color-scheme: dark) {
  .single-post .post-date {
    opacity: 0.9;
  }
}
.single-post .post-comments {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed #ccc;
}

.single-post .post-comments h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--color-primary, #463935);
}
