/* ====================
   Blog Post Styles
   ==================== */

/* Post container */
.post-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Consistent bottom spacing on all post/project pages */
.post {
  padding-bottom: 4rem;
}

/* Post header — matches top padding of all other page containers */
.post-header {
  padding: 2rem 0 2rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #888;
  margin-bottom: 0.75rem;
}

.post-separator,
.post-meta-separator {
  color: #ccc;
}

/* Back link when used inline inside post-meta */
.post-meta .project-back {
  display: inline;
  margin-bottom: 0;
  line-height: inherit;
  font-size: inherit;
  color: #888;
}

.post-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: bold;
  color: #414141;
  line-height: 1.3;
  margin-bottom: 2rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.post-featured-image {
  width: 100%;
  max-height: 500px;
  overflow: hidden;
  border-radius: 8px;
  margin-top: 2rem;
  box-shadow: none;
}

.post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Table of contents */
.post-toc {
  position: sticky;
  top: 2rem;
  background: #f9f9f9;
  border-left: 4px solid #FF1A40;
  padding: 1.5rem;
  border-radius: 4px;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

.post-toc h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.post-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-toc li {
  margin-bottom: 0.5rem;
}

.post-toc li.h3 {
  padding-left: 1rem;
}

.post-toc a {
  color: #414141;
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-toc a:hover {
  color: #FF1A40;
}

/* Post main content area with sidebar */
.post-main {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2rem;
}

/* Post content */
.post-content {
  padding: 0;
  line-height: 1.8;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  width: 100%;
}

/* Make images in post content responsive */
.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Share buttons */
.post-share {
  padding: 2rem 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  margin: 2rem 0;
}

.post-share h3 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.share-buttons {
  display: flex;
  gap: 1rem;
}

.share-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  color: white;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.share-btn:hover {
  opacity: 0.8;
}

.share-btn.twitter {
  background-color: #1DA1F2;
}

.share-btn.linkedin {
  background-color: #0077B5;
}

/* Post navigation */
.post-nav {
  display: flex;
  justify-content: space-between;
  padding: 2rem 0;
}

.post-nav a {
  color: #414141;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.post-nav a:hover {
  color: #FF1A40;
}

/* Project navigation (prev/next) */
.project-back {
  display: inline-block;
  font-size: 0.875rem;
  color: #888;
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: color 0.2s ease;
  letter-spacing: 0.5px;
}

.project-back:hover {
  color: #FF1A40;
}

.project-nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 3rem 0 2rem;
  border-top: 1px solid #eee;
  gap: 2rem;
}

.project-nav-prev,
.project-nav-next {
  flex: 1;
}

.project-nav-next {
  text-align: right;
}

.project-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-decoration: none;
  color: #414141;
  transition: color 0.2s ease;
}

.project-nav-link:hover {
  color: #FF1A40;
}

.project-nav-label {
  font-size: 0.8rem;
  color: #888;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.project-nav-link:hover .project-nav-label {
  color: #FF1A40;
}

.project-nav-title {
  font-size: 1.125rem;
  font-weight: bold;
  line-height: 1.3;
}

.project-nav-link--right {
  align-items: flex-end;
}

@media (max-width: 768px) {
  .project-nav {
    flex-direction: column;
    gap: 1.5rem;
  }

  .project-nav-next {
    text-align: left;
  }

  .project-nav-link--right {
    align-items: flex-start;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .post-title {
    font-size: 2rem;
  }

  .post-featured-image {
    max-height: 300px;
  }

  /* Stack TOC on mobile */
  .post-main {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .post-toc {
    position: static;
    max-height: none;
  }

  .share-buttons {
    flex-direction: column;
  }

  .share-btn {
    text-align: center;
  }
}

/* Extra small screens (320px - 375px) */
@media (max-width: 375px) {
  .post-title {
    font-size: 1.5rem;
  }

  .post-container {
    padding: 0 1rem;
  }
}
