/* Blog-specific styles that complement the main site */

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 1rem 80px;
}

/* Blog home styles */
.blog-container {
  max-width: 800px;
  margin: 0 auto;
}

/* Removed redundant blog title styling */

/* Posts list */
.posts-list {
  margin-top: 0;
}

.post-preview {
  border-bottom: 1px solid #f0f0f0;
  padding: 25px 0;
}

.post-preview:first-child {
  padding-top: 10px;
}

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

.post-preview h3 {
  font-size: 24px;
  font-weight: 500;
  margin: 0 0 8px;
}

.post-preview h3 a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-preview h3 a:hover {
  color: var(--primary-hover);
}

.post-preview-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #555;
  font-weight: 400;
  margin-bottom: 12px;
}

.post-preview-meta .author {
  font-weight: 500;
}

.post-preview-meta time {
  color: inherit;
}

.post-preview-meta .meta-divider {
  color: #ccc;
}

/* Removed - now handled by .post-preview-meta time */

.post-preview p {
  font-size: 16px;
  line-height: 1.5;
  color: #444;
  margin: 0;
}

/* TLDR styling */
.tldr, .post-tldr {
  font-size: 16px;
  color: #333;
  padding: 12px 15px;
  border-left: 3px solid var(--primary);
  margin: 15px 0;
  line-height: 1.7;
}

.tldr strong, .post-tldr strong {
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0.5px;
}

/* Individual post styles */
.post {
  max-width: 700px;
  margin: 0 auto;
}

.blog-post-header {
  font-family:"palatino",serif;
  text-align:justify;
  margin-bottom: 35px;
  text-align: left;
}

.blog-post-header h1 {
  font-size: 36px;
  font-weight: 500;
  margin: 30px 0 12px;
  line-height: 1.2;
}

.post-meta {
  margin-bottom: 20px;
  font-size: 14px;
  color: #444;
}

.post-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.post-meta .author {
  font-weight: 500;
}

.post-meta time {
  color: inherit;
  font-weight: 400;
}

.meta-divider {
  color: #ccc;
}

.category {
  display: inline-block;
  color: inherit;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 5px;
  color: #777;
}

/* Post content */
.post-content {
  font-family:"palatino",serif;
  text-align:justify;
  font-size: 19px;
  line-height: 1.6;
  color: #222;
}

/* Bold text styles */
.post-content strong,
.post-content b {
  font-weight: 700;
  color: #111;
}

/* Footnotes styles */
.post-content .footnotes {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e5e5e5;
  font-size: 14px;
  color: #666;
}

.post-content .footnotes ol {
  padding-left: 20px;
}

.post-content .footnotes li {
  margin: 8px 0;
  line-height: 1.4;
}

.post-content .footnotes p {
  margin: 0;
  display: inline;
}

/* Footnote reference links */
.post-content sup a {
  text-decoration: none;
  color: var(--primary);
  font-size: 0.8em;
}

/* Code grid for side-by-side code examples */
.post-content .code-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}

.post-content .code-grid section {
  margin: 0;
  padding: 0;
}

.post-content .code-grid section h3 {
  font-size: 18px;
  margin: 0 0 10px 0;
  font-weight: 600;
  color: #333;
}

.post-content .code-grid pre {
  margin: 0;
  font-size: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
  /* padding: 0; */
}

pre code.hljs {
  padding: 0 !important;
}

.post-content .code-grid .prompt {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-left: 4px solid var(--primary);
  /* padding: 12px; */
}

/* Responsive: stack on smaller screens */
@media (max-width: 768px) {
  .post-content .code-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

.post-content h2 {
  font-size: 32px;
  font-weight: 500;
  margin: 40px 0 20px;
  color: #111;
}

.post-content h3 {
  font-size: 26px;
  font-weight: 500;
  margin: 30px 0 15px;
  color: #222;
}

.post-content p {
  margin: 20px 0;
  text-align: justify;
}

.post-content a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.post-content a:hover {
  color: var(--primary-hover);
  border-bottom-color: var(--primary-hover);
}

.post-content ul, .post-content ol {
  margin: 20px 0;
  padding-left: 30px;
}

.post-content li {
  margin: 10px 0;
  line-height: 1.6;
}

.post-content blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 20px;
  margin: 30px 0;
  color: #555;
  /* font-style: italic; */
}

/* Code blocks */
.post-content pre {
  background-color: #f8f8f8;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  padding: 15px;
  overflow-x: auto;
  margin: 20px 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.post-content code {
  background-color: #f3f3f3;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  word-wrap: break-word;
}

.post-content pre code {
  background-color: transparent;
  padding: 0;
}

/* Syntax highlighting */
.highlight {
  margin: 20px 0;
}

.highlight pre {
  background-color: #f8f8f8;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  padding: 15px;
  overflow-x: auto;
}

/* Images in posts */
.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 30px auto;
  border-radius: 4px;
}

/* Figure and caption styling */
.post-content figure {
  margin: 40px 0;
  text-align: center;
}

.post-content figure img {
  margin: 0 auto 15px auto;
  border-radius: 6px;
}

.post-content figcaption {
  font-size: 14px;
  color: #666;
  line-height: 1.4;
  margin-top: 10px;
  display: block;
  text-align: center;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

/* Post footer */
.post-footer {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid #eee;
  text-align: left;
}

.post-footer a {
  color: var(--primary);
  text-decoration: none;
  font-size: 16px;
  transition: color 0.2s ease;
}

.post-footer a:hover {
  color: var(--primary-hover);
}

/* Page layout (for About, etc.) */
.page {
  max-width: 700px;
  margin: 0 auto;
}

.blog-page-header {
  margin-bottom: 40px;
  text-align: center;
  padding-bottom: 30px;
  border-bottom: 2px solid var(--lightbg);
}

.blog-page-header h1 {
  font-size: 42px;
  font-weight: 500;
}

.page-content {
  font-size: 19px;
}

.page-content p {
  margin: 20px 0;
  text-align: justify;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .blog-container h1 {
    font-size: 35px;
  }
  
  .blog-post-header h1 {
    font-size: 32px;
  }
  
  .post-preview h3 {
    font-size: 24px;
  }
  
  .post-content {
    font-size: 17px;
  }
  
  main {
    padding: 20px 1rem 80px;
  }
}
