/* Editorial theme enhancements for blog-specific features */
:root {
  --blog-accent-color: #f56565; /* Editorial theme compatible accent */
  --blog-secondary-color: #5e42a6; /* Editorial theme purple */
  --blog-text-color: #333; /* Editorial compatible text color */
}

/* Fix breadcrumb visibility - override Editorial theme white links */
.breadcrumb a,
.breadcrumb-nav a,
nav.breadcrumb a,
ol.breadcrumb a {
  color: #f56a6a !important; /* Editorial theme accent color */
  text-decoration: none !important;
  border-bottom: dotted 1px rgba(245, 106, 106, 0.3) !important;
  transition: color 0.2s ease-in-out, border-bottom-color 0.2s ease-in-out !important;
}

.breadcrumb a:hover,
.breadcrumb-nav a:hover,
nav.breadcrumb a:hover,
ol.breadcrumb a:hover {
  color: #e55555 !important;
  border-bottom-color: #e55555 !important;
}

.breadcrumb li,
.breadcrumb-nav li,
nav.breadcrumb li,
ol.breadcrumb li {
  color: #7f888f !important; /* Editorial theme text color */
}

.breadcrumb li:last-child,
.breadcrumb-nav li:last-child,
nav.breadcrumb li:last-child,
ol.breadcrumb li:last-child {
  color: #3d4449 !important; /* Darker text for current page */
  font-weight: 600 !important;
}

/* Blog-specific styling that works with Editorial theme structure */

/* Category buttons - pill-style design matching main site popular links */
.button.small {
  display: inline-block !important;
  background-color: transparent !important;
  border-radius: 0.375em !important;
  border: 0 !important;
  box-shadow: inset 0 0 0 1px #f56a6a !important;
  color: #f56a6a !important;
  cursor: pointer !important;
  font-family: "Roboto Slab", serif !important;
  font-size: 0.65em !important;
  font-weight: 700 !important;
  height: auto !important;
  letter-spacing: 0.075em !important;
  line-height: 1 !important;
  margin: 0 0.5em 0.5em 0 !important;
  padding: 0.6em 1.2em !important;
  text-align: center !important;
  text-decoration: none !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out !important;
}

.button.small:hover {
  background-color: rgba(245, 106, 106, 0.05) !important;
  color: #f56a6a !important;
}

.button.small:active {
  background-color: rgba(245, 106, 106, 0.15) !important;
}

/* Post meta grid layout - categories and share side by side on desktop */
.post-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2em;
  align-items: start;
  margin-top: 1em;
}

.post-categories {
  order: 1;
}

.post-share {
  order: 2;
}

/* Consistent styling for both categories and share sections */
.post-categories p,
.post-share p {
  margin: 0 !important;
  font-size: 1em !important;
  line-height: 1.6 !important;
}

.post-categories strong,
.post-share strong {
  font-weight: 600 !important;
  color: #3d4449 !important;
}

/* Ensure buttons in both sections have consistent spacing */
.post-categories .button.small,
.post-share .button.small {
  margin: 0 0.4em 0.4em 0 !important;
}

/* Mobile responsive - stack vertically on smaller screens */
@media screen and (max-width: 768px) {
  .post-meta-grid {
    grid-template-columns: 1fr;
    gap: 1.5em;
  }
  
  .post-categories {
    order: 1;
  }
  
  .post-share {
    order: 2;
  }
}

/* Enhanced post meta styling */
.post-meta {
  color: rgba(85, 85, 85, 0.7);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.post-meta a {
  color: var(--blog-secondary-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.post-meta a:hover {
  border-bottom-color: var(--blog-secondary-color);
}

/* Enhanced post category buttons */
.post-footer .button.small {
  background: var(--blog-secondary-color);
  color: #fff;
  padding: 0.4rem 0.8rem;
  margin: 0.2rem;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.post-footer .button.small:hover {
  background: var(--blog-accent-color);
  transform: translateY(-1px);
}

/* Enhanced social sharing section */
.post-footer .social-share {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(94, 66, 166, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(94, 66, 166, 0.1);
}

.post-footer .social-share h3 {
  margin-bottom: 1rem;
  color: var(--blog-secondary-color);
  font-size: 1.25rem;
  text-align: center;
}

.post-footer .social-share .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.post-footer .social-share .actions li {
  list-style: none;
}

.post-footer .social-share .actions a {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: var(--blog-accent-color);
  color: #fff;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  border: none;
}

.post-footer .social-share .actions a:hover {
  background: #c53030;
  transform: translateY(-2px);
}

/* Enhanced banner/hero section for blog home */
#banner .content {
  padding-right: 2rem;
}

#banner .content h1 {
  color: var(--blog-secondary-color);
  margin-bottom: 1rem;
}

#banner .content p {
  color: rgba(85, 85, 85, 0.8);
  line-height: 1.6;
}

/* Enhanced posts grid styling */
.posts article h3 a {
  color: var(--blog-secondary-color);
  transition: color 0.3s ease;
}

.posts article h3 a:hover {
  color: var(--blog-accent-color);
}

.posts article .post-meta {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Enhanced features grid for categories */
.features article {
  transition: transform 0.3s ease;
}

.features article:hover {
  transform: translateY(-3px);
}

.features article h3 {
  color: var(--blog-secondary-color);
}

.features article .content p {
  color: rgba(85, 85, 85, 0.8);
}

/* Enhanced mini-posts in sidebar */
.mini-posts article h4 a {
  color: var(--blog-secondary-color);
  transition: color 0.3s ease;
}

.mini-posts article h4 a:hover {
  color: var(--blog-accent-color);
}

.mini-posts article p {
  color: rgba(85, 85, 85, 0.7);
  font-size: 0.9rem;
}

/* Enhanced sidebar contact section */
#sidebar .contact li.icon:before {
  color: var(--blog-accent-color);
}

/* About section enhancements */
.about-preview {
  margin: 3rem 0;
  padding: 2rem;
  background: rgba(94, 66, 166, 0.03);
  border-radius: 8px;
  border-left: 4px solid var(--blog-secondary-color);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.about-text h2 {
  color: var(--blog-secondary-color);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.about-text p {
  color: rgba(85, 85, 85, 0.8);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.about-image {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(94, 66, 166, 0.15);
  transition: transform 0.3s ease;
}

.about-image:hover {
  transform: scale(1.02);
}

.about-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Responsive adjustments */
@media (max-width: 980px) {
  .about-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  #banner .content {
    padding-right: 0;
  }
}

@media (max-width: 640px) {
  .post-footer .social-share {
    padding: 1rem;
  }
  
  .about-preview {
    margin: 2rem 0;
    padding: 1.5rem;
  }
}

/* Accessibility enhancements */
:focus {
  outline: 2px solid var(--blog-accent-color);
  outline-offset: 2px;
}

a:focus,
button:focus {
  outline: 2px solid var(--blog-accent-color);
  outline-offset: 2px;
}

/* Pagination Styles */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 3em 0 2em 0;
  padding: 2em 0;
  border-top: 1px solid rgba(85, 85, 85, 0.2);
}

.pagination .button {
  background: var(--blog-secondary-color);
  color: #fff;
  border: none;
  padding: 0.75em 1.5em;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
  border-radius: 0.375em;
}

.pagination .button:hover {
  background: var(--blog-accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pagination .button.prev::before {
  content: "←";
  margin-right: 0.5em;
}

.pagination .button.next::after {
  content: "→";
  margin-left: 0.5em;
}

.pagination-info {
  color: rgba(85, 85, 85, 0.7);
  font-weight: 500;
  font-size: 0.9em;
}

/* Responsive pagination */
@media screen and (max-width: 480px) {
  .pagination {
    flex-direction: column;
    gap: 1em;
    text-align: center;
  }
  
  .pagination .button {
    width: 100%;
    max-width: 200px;
  }
  
  .pagination-info {
    order: -1;
    margin-bottom: 1em;
  }
}

/* Print styles */
@media print {
  .post-footer .social-share,
  #sidebar,
  .pagination {
    display: none;
  }
}

/* ===== READABILITY ENHANCEMENTS ===== */

/* Enhanced Typography for Better Readability */
.post-content {
  font-size: 16px !important;
  line-height: 1.7 !important;
  color: #333 !important;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Better paragraph spacing and typography */
.post-content p {
  margin: 0 0 1.5em 0 !important;
  font-size: 16px !important;
  line-height: 1.7 !important;
  color: #444 !important;
}

/* Enhanced heading hierarchy with better spacing */
.post-content h1,
.post-title {
  font-size: 2.2em !important;
  line-height: 1.3 !important;
  margin: 0 0 0.8em 0 !important;
  color: #2c3e50 !important;
  font-weight: 700 !important;
}

.post-content h2 {
  font-size: 1.8em !important;
  line-height: 1.4 !important;
  margin: 2em 0 0.8em 0 !important;
  color: #2c3e50 !important;
  font-weight: 600 !important;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 0.3em;
}

.post-content h3 {
  font-size: 1.4em !important;
  line-height: 1.4 !important;
  margin: 1.8em 0 0.6em 0 !important;
  color: #34495e !important;
  font-weight: 600 !important;
}

.post-content h4 {
  font-size: 1.2em !important;
  line-height: 1.4 !important;
  margin: 1.5em 0 0.5em 0 !important;
  color: #34495e !important;
  font-weight: 600 !important;
}

.post-content h5 {
  font-size: 1.1em !important;
  line-height: 1.4 !important;
  margin: 1.3em 0 0.4em 0 !important;
  color: #34495e !important;
  font-weight: 600 !important;
}

.post-content h6 {
  font-size: 1em !important;
  line-height: 1.4 !important;
  margin: 1.2em 0 0.3em 0 !important;
  color: #34495e !important;
  font-weight: 600 !important;
}

/* Enhanced lists with better spacing */
.post-content ul,
.post-content ol {
  margin: 0 0 1.5em 0 !important;
  padding-left: 1.5em !important;
  line-height: 1.7 !important;
}

.post-content li {
  margin: 0 0 0.5em 0 !important;
  color: #444 !important;
}

.post-content ul ul,
.post-content ol ol,
.post-content ul ol,
.post-content ol ul {
  margin: 0.5em 0 0.5em 0 !important;
}

/* Enhanced blockquotes */
.post-content blockquote {
  background: #f8f9fa !important;
  border-left: 4px solid #f56a6a !important;
  margin: 2em 0 !important;
  padding: 1.5em 2em !important;
  font-style: italic !important;
  font-size: 1.05em !important;
  line-height: 1.6 !important;
  color: #555 !important;
  border-radius: 0 4px 4px 0;
}

.post-content blockquote p {
  margin: 0 0 1em 0 !important;
}

.post-content blockquote p:last-child {
  margin-bottom: 0 !important;
}

/* Enhanced code blocks */
.post-content code {
  background: #f1f3f4 !important;
  color: #d63384 !important;
  padding: 0.2em 0.4em !important;
  border-radius: 3px !important;
  font-size: 0.9em !important;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
}

.post-content pre {
  background: #f8f9fa !important;
  border: 1px solid #e9ecef !important;
  border-radius: 6px !important;
  padding: 1.5em !important;
  margin: 1.5em 0 !important;
  overflow-x: auto !important;
  font-size: 0.9em !important;
  line-height: 1.5 !important;
}

.post-content pre code {
  background: none !important;
  color: #333 !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

/* Enhanced links */
.post-content a {
  color: #f56a6a !important;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(245, 106, 106, 0.3) !important;
  transition: all 0.2s ease !important;
}

.post-content a:hover {
  color: #e55555 !important;
  border-bottom-color: #e55555 !important;
  background: rgba(245, 106, 106, 0.05) !important;
}

/* Better emphasis */
.post-content strong {
  font-weight: 700 !important;
  color: #2c3e50 !important;
}

.post-content em {
  font-style: italic !important;
  color: #555 !important;
}

/* Enhanced tables */
.post-content table {
  width: 100% !important;
  margin: 2em 0 !important;
  border-collapse: collapse !important;
  background: #fff !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

.post-content th,
.post-content td {
  padding: 0.8em 1em !important;
  text-align: left !important;
  border-bottom: 1px solid #e9ecef !important;
}

.post-content th {
  background: #f8f9fa !important;
  font-weight: 600 !important;
  color: #2c3e50 !important;
}

.post-content tr:hover {
  background: #f8f9fa !important;
}

/* Reading progress and metadata enhancements */
.post-meta {
  font-size: 0.9em !important;
  color: #6c757d !important;
  margin-bottom: 2em !important;
  padding-bottom: 1em !important;
  border-bottom: 1px solid #e9ecef;
}

.post-meta time {
  font-weight: 500 !important;
}

/* Add reading time display */
.reading-time {
  color: #6c757d !important;
  font-size: 0.9em !important;
  font-weight: 500 !important;
}

.reading-time::before {
  content: "📖 ";
}

/* Responsive typography adjustments */
@media screen and (max-width: 768px) {
  .post-content {
    font-size: 15px !important;
    padding: 0 0.5rem;
  }
  
  .post-content h1,
  .post-title {
    font-size: 1.8em !important;
  }
  
  .post-content h2 {
    font-size: 1.5em !important;
  }
  
  .post-content h3 {
    font-size: 1.3em !important;
  }
  
  .post-content blockquote {
    padding: 1em 1.5em !important;
    margin: 1.5em 0 !important;
  }
  
  .post-content pre {
    padding: 1em !important;
    font-size: 0.85em !important;
  }
}

@media screen and (max-width: 480px) {
  .post-content {
    font-size: 14px !important;
  }
  
  .post-content h1,
  .post-title {
    font-size: 1.6em !important;
  }
  
  .post-content h2 {
    font-size: 1.4em !important;
  }
  
  .post-content blockquote {
    padding: 0.8em 1em !important;
    margin: 1em 0 !important;
  }
}

/* Enhanced content wrapper for better layout */
.post-content-wrapper {
  max-width: 900px;
  margin: 0;
  position: relative;
}

/* Table of Contents styling */
.table-of-contents {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5em;
  max-width: 800px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.table-of-contents h3 {
  margin: 0 0 1em 0 !important;
  font-size: 1.1em !important;
  color: #2c3e50 !important;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 0.5em;
  text-align: center;
}

.table-of-contents ul {
  list-style: none !important;
  padding-left: 0 !important;
  margin: 0 !important;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.5em;
}

.table-of-contents li {
  margin: 0.3em 0 !important;
}

.table-of-contents a {
  color: #6c757d !important;
  text-decoration: none !important;
  border-bottom: none !important;
  padding: 0.4em 0.8em;
  border-radius: 6px;
  display: block;
  transition: all 0.2s ease !important;
  font-size: 0.9em;
  border: 1px solid transparent;
}

.table-of-contents a:hover {
  background: #e9ecef !important;
  color: #f56a6a !important;
  border-color: #f56a6a;
  transform: translateY(-1px);
}

.table-of-contents .toc-h2 {
  padding-left: 0.8em;
  font-weight: 600;
}

.table-of-contents .toc-h3 {
  padding-left: 1.2em;
  font-size: 0.85em;
}

.table-of-contents .toc-h4 {
  padding-left: 1.6em;
  font-size: 0.8em;
  color: #868e96 !important;
}

/* Responsive TOC adjustments */
@media screen and (max-width: 768px) {
  .table-of-contents {
    margin: 0 0.5rem 2em 0.5rem;
    padding: 1em;
  }
  
  .table-of-contents ul {
    grid-template-columns: 1fr;
  }
  
  .table-of-contents h3 {
    font-size: 1em !important;
  }
}

/* Enhanced focus styles for accessibility */
.post-content a:focus,
.post-content button:focus {
  outline: 2px solid #f56a6a !important;
  outline-offset: 2px !important;
  border-radius: 2px;
}

/* Better spacing between content elements */
.post-content > * + * {
  margin-top: 1.5em !important;
}

.post-content > h2 + *,
.post-content > h3 + *,
.post-content > h4 + * {
  margin-top: 0.8em !important;
}

/* Enhanced image captions */
.post-content figure {
  margin: 2em 0 !important;
  text-align: center;
}

.post-content figcaption {
  font-size: 0.9em !important;
  color: #6c757d !important;
  font-style: italic !important;
  margin-top: 0.5em !important;
  line-height: 1.4 !important;
}

/* Enhanced hr styling */
.post-content hr {
  border: none !important;
  border-top: 2px solid #e9ecef !important;
  margin: 3em auto !important;
  width: 50% !important;
  max-width: 200px !important;
}

/* Better footnote styling */
.post-content .footnote {
  font-size: 0.8em !important;
  vertical-align: super !important;
  color: #f56a6a !important;
}

.post-content .footnotes {
  border-top: 1px solid #e9ecef !important;
  margin-top: 3em !important;
  padding-top: 2em !important;
  font-size: 0.9em !important;
}

/* Enhanced definition lists */
.post-content dl {
  margin: 1.5em 0 !important;
}

.post-content dt {
  font-weight: 600 !important;
  color: #2c3e50 !important;
  margin: 1em 0 0.2em 0 !important;
}

.post-content dd {
  margin: 0 0 0.8em 1.5em !important;
  color: #555 !important;
}

/* Better keyboard navigation */
.post-content *:target {
  animation: highlight 3s ease;
}

@keyframes highlight {
  0% { background-color: rgba(245, 106, 106, 0.3); }
  100% { background-color: transparent; }
}

/* Print optimizations */
@media print {
  .post-content {
    font-size: 12pt !important;
    line-height: 1.5 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .table-of-contents {
    display: none !important;
  }
  
  .post-content a {
    color: #000 !important;
    border-bottom: none !important;
  }
  
  .post-content a::after {
    content: " (" attr(href) ")" !important;
    font-size: 0.8em !important;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .post-content {
    color: #e9ecef !important;
  }
  
  .post-content h1,
  .post-content h2,
  .post-content h3,
  .post-content h4,
  .post-content h5,
  .post-content h6 {
    color: #fff !important;
  }
  
  .post-content blockquote {
    background: #2d3748 !important;
    color: #cbd5e0 !important;
  }
  
  .post-content pre,
  .post-content code {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
  }
  
  .table-of-contents {
    background: #2d3748 !important;
    border-color: #4a5568 !important;
    color: #e2e8f0 !important;
  }
}

/* Responsive image fixes - ensure all images in post content are responsive */
.post-content img,
article img,
section img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 1.5rem auto;
  border-radius: 4px;
  box-sizing: border-box;
}

/* Fix for images that might have explicit width/height attributes */
.post-content img[width],
.post-content img[height],
article img[width],
article img[height] {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
}

/* Featured images at top of posts */
.image.fit img,
.image.main img {
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
}

/* Ensure container doesn't overflow */
.post-content,
article {
  overflow-x: hidden;
  word-wrap: break-word;
}