/* Blog Reading Experience CSS - Applied only to individual blog posts */

/* Typography improvements for better readability - only apply to content areas */
.blog-reading #content {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Override any background images on blog content */
.blog-reading main,
.blog-reading #content,
.blog-reading .blog-post-full,
.blog-reading .blog-post-full *,
.blog-reading .blog-entry-content,
.blog-reading .blog-entry-content * {
  background-image: none !important;
  background: transparent !important;
}

/* Restore off-white background for main content areas to match site */
.blog-reading main {
  background: #e8e8e8 !important;
}

.blog-reading #content {
  background: #fff !important;
}

/* Enhanced content styling for blog posts - work with new layout system */
.blog-reading #content {
  max-width: 700px !important; /* Match text width for optimal readability */
  line-height: 1.7;
  font-size: 18px;
  color: #1a1a1a;
  margin: 0 auto;
  padding: 2rem;
}

/* Optimal reading width for text content within blog posts */
.blog-reading .blog-entry-content p,
.blog-reading .blog-entry-content ul,
.blog-reading .blog-entry-content ol,
.blog-reading .blog-entry-content blockquote {
  max-width: 700px;
}

/* Blog post metadata */
.blog-reading .blog-meta {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e5e5e5;
  color: #666;
  font-size: 0.9rem;
  text-align: center;
}

.blog-reading .blog-meta time {
  font-weight: 500;
  color: #6b6b6b;
}

/* Enhanced typography for blog content */
.blog-reading .blog-entry-content h1,
.blog-reading .blog-entry-content h2,
.blog-reading .blog-entry-content h3,
.blog-reading .blog-entry-content h4,
.blog-reading .blog-entry-content h5,
.blog-reading .blog-entry-content h6 {
  font-family: 'Merriweather', serif;
  color: #1a1a1a;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  font-weight: 600;
}

.blog-reading .blog-entry-content h1 {
  font-size: 2rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.blog-reading .blog-entry-content h2 {
  font-size: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e5e5;
  margin-top: 3rem;
  position: relative;
  padding-left: 1rem;
}

.blog-reading .blog-entry-content h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: #8b8b8b;
  border-radius: 2px;
}

.blog-reading .blog-entry-content h3 {
  font-size: 1.5rem;
  color: #2a2a2a;
  margin-top: 2rem;
}

.blog-reading .blog-entry-content h4 {
  font-size: 1.25rem;
  color: #333;
}

/* Improved paragraph styling */
.blog-reading .blog-entry-content p {
  margin-bottom: 1.75rem;
  max-width: 100%;
  color: #2a2a2a;
  font-weight: 400;
}

/* Only style the first paragraph in the main content, not in headers or meta sections */
.blog-reading .blog-entry-content p:first-of-type {
  font-size: 1.15rem;
  color: #444;
  margin-bottom: 2.5rem;
  font-weight: 400;
  line-height: 1.6;
}

/* Drop cap for first letter of first paragraph - more specific targeting */
.blog-reading .blog-entry-content p:first-of-type::first-letter {
  float: left;
  font-family: 'Merriweather', serif;
  font-size: 3.2rem;
  line-height: 2.8rem;
  margin: 0.1rem 0.5rem 0 0;
  color: #6b6b6b;
  font-weight: 600;
}

/* Better list styling */
.blog-reading .blog-entry-content ul,
.blog-reading .blog-entry-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.blog-reading .blog-entry-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* Code blocks and inline code */
.blog-reading .blog-entry-content code {
  background-color: #f6f8fa;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.9rem;
  color: #e83e8c;
}

.blog-reading .blog-entry-content pre {
  background-color: #f6f8fa;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid #e1e4e8;
}

.blog-reading .blog-entry-content pre code {
  background: none;
  padding: 0;
  color: #24292e;
}

/* Blockquotes */
.blog-reading .blog-entry-content blockquote {
  border-left: 4px solid #ddd;
  margin: 1.5rem 0;
  padding-left: 1rem;
  font-style: italic;
  color: #666;
  background-color: #fafafa;
  padding: 1rem 1rem 1rem 2rem;
  border-radius: 0 4px 4px 0;
}

/* Links */
.blog-reading .blog-entry-content a {
  color: #6b6b6b;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.blog-reading .blog-entry-content a:hover {
  border-bottom-color: #6b6b6b;
}

/* Images */
.blog-reading .blog-entry-content img {
  max-width: 100%;
  height: auto;
  margin: 2rem auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Table styling */
.blog-reading .blog-entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.blog-reading .blog-entry-content th,
.blog-reading .blog-entry-content td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e5e5;
}

.blog-reading .blog-entry-content th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #1a1a1a;
}

/* Horizontal rules */
.blog-reading .blog-entry-content hr {
  margin: 3rem auto;
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, #ddd, transparent);
  max-width: 200px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .blog-reading #content {
    padding: 1.5rem 1rem;
    font-size: 16px;
  }
  
  .blog-reading .blog-entry-content h1 {
    font-size: 2rem;
  }
  
  .blog-reading .blog-entry-content h2 {
    font-size: 1.6rem;
  }
  
  .blog-reading .blog-entry-content h3 {
    font-size: 1.3rem;
  }
  
  .blog-reading .blog-entry-content pre {
    padding: 0.75rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .blog-reading #content {
    padding: 1rem 0.75rem;
    font-size: 16px;
  }
  
  .blog-reading .blog-entry-content h1 {
    font-size: 1.8rem;
  }
  
  .blog-reading .blog-entry-content h2 {
    font-size: 1.4rem;
  }
}

/* Smooth scroll for anchor links */
html {
  scroll-behavior: smooth;
}

/* Focus indicators for accessibility */
.blog-reading .blog-entry-content a:focus {
  outline: 2px solid #6b6b6b;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .blog-reading #content {
    font-size: 12pt;
    line-height: 1.5;
    color: black;
  }
  
  .blog-reading .blog-entry-content h1,
  .blog-reading .blog-entry-content h2,
  .blog-reading .blog-entry-content h3 {
    page-break-after: avoid;
  }
  
  .blog-reading .blog-entry-content blockquote,
  .blog-reading .blog-entry-content pre {
    page-break-inside: avoid;
  }
}