/* post.css — scope to .single-post to avoid collisions with feed styles */

/* Shared sidebar styling (blog index + single posts) */
.blog-sidebar {
  position: sticky;
  top: 80px;
  background: #ffffff;
  padding: 2rem 1rem;
  box-sizing: border-box;
  font-size: 1rem;
  line-height: 1.4;
  border-right: 2px solid #ddd;
  flex: 0 0 240px;
  margin-left: calc(-1.25%);
}

/* Base font size / line-height for post area */
.single-post.blog-container {
  font-size: 1rem; /* base 16px */
  line-height: 1.6;
}

/* Ensure main column isn’t artificially constrained by feed rules */
.single-post .blog-main {
  max-width: none;
  margin: 0;
  padding: 0;
  text-align: left;
}

/* Cap readable line length inside the post only */
.single-post .blog-post-container {
  max-width: 820px;
  padding: 0 0 3rem 0;
}

/* Hard reset to avoid weird feed styles leaking in */
.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 flow / 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;
}

.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: 0;
  color: var(--color-primary, #463935);
  font-weight: 600;
  text-decoration: none;
}

.single-post .blog-sidebar {
  padding-top: 0.6rem;
  align-self: flex-start;
  margin-left: calc(-1.25%);
}

/* Recent posts: tighter typography + spacing */
.blog-sidebar .recent-posts {
  font-size: 0.9rem;
  line-height: 1.25;
  margin: 0.35rem 0 0;
  padding-left: 1rem;
}

.blog-sidebar .recent-posts li {
  margin: 0;
  padding: 0.12rem 0;
}

.blog-sidebar .recent-posts .recent-date {
  font-size: 0.82rem;
}

.sidebar-directory {
  margin-top: 1.75rem;
}

.post-directory {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.post-directory .directory-list {
  list-style: disc;
  padding-left: 1.1rem;
  margin: 0;
}

.post-directory .directory-list li {
  margin: 0.4rem 0;
}

.post-directory .directory-item-h4 {
  margin-left: 1.5rem;
  list-style: circle;
}

.post-directory .directory-item-subsection {
  margin-left: 1.5rem;
  list-style: none;
  position: relative;
  padding-left: 0.85rem;
}

.post-directory .directory-item-subsection::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.56em;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(70, 57, 53, 0.65);
  transform: translateY(-50%);
}

.post-directory .directory-item-section {
  font-weight: 400;
}

.post-directory a {
  text-decoration: none;
  color: var(--color-primary, #463935);
}

.post-directory a:hover {
  text-decoration: underline;
}

.directory-empty {
  margin: 0;
  color: #777;
  font-size: 0.95rem;
}

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

/* Remove underlines from sidebar links on post pages (normal + hover) */
.single-post .blog-sidebar a,
.single-post .blog-sidebar a:hover {
  text-decoration: none;
}

/* Responsive: content tweaks only; layout comes from .blog-container + sidebar.css */
@media (max-width: 980px) {
  .single-post .blog-post-container {
    max-width: 42rem;
  }

  .blog-sidebar {
    margin-left: 0;
  }
}

@media (max-width: 900px) {
  .blog-sidebar {
    position: static;
    top: auto;
    width: 100%;
    flex: none;
    margin-left: 0;
    padding: 0.75rem 0 0.6rem;
    border-right: none;
    border-bottom: 1px solid #ddd;
    background: transparent;
  }

  .single-post.blog-container {
    flex-direction: column;
    gap: 1rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .single-post .blog-main {
    width: 100%;
    max-width: 100%;
  }

  .single-post .blog-post-container {
    max-width: 100%;
    padding-bottom: 1.5rem;
  }

  .post-directory .directory-list {
    max-height: 40vh;
    overflow-y: auto;
  }
}

/* Dark mode touch-ups */
@media (prefers-color-scheme: dark) {
  .single-post .post-date {
    opacity: 0.9;
  }
}
