/* Robust CSS Enhancements for Blog Post Viewer Page */

/* === Typography Improvements === */
body { /* This is likely overridden by style.css, but good to have consistent font stack */
    font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-color, #212529);
    background-color: var(--background-color, #ffffff);
    transition: background-color 0.3s ease, color 0.3s ease; /* Added color transition */
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--heading-color, #212121);
    line-height: 1.4;
    margin-top: 1.5em; /* Add some default top margin */
    margin-bottom: 0.75em; /* Add some default bottom margin */
    font-weight: 600; /* Good default for Montserrat headings */
}

/* Reset top margin for the first heading in a section if needed */
section > h1:first-child, section > h2:first-child, section > h3:first-child { margin-top: 0; }


code, pre {
    font-family: "Fira Code", monospace;
}

/* === Responsive Enhancements === */
.container {
    width: 90%;
    /* max-width: 960px; /* Consider increasing for blog content, or match style.css */
    max-width: 1140px; /* Matching style.css for consistency */
    margin: 0 auto;
}

/* === Callouts & Info Boxes === */
.callout {
    border-left-width: 4px;
    border-left-style: solid;
    padding: 1.25em 1.5em; /* Increased padding */
    margin-bottom: 1.5em;
    border-radius: 6px;
    background-color: var(--card-bg-color-subtle, #f8f9fa); /* Default background */
}
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* Specific callout types */
.callout-info { border-left-color: var(--info-color, #17a2b8); background-color: #e7f3fe; }
.callout-info h1, .callout-info h2, .callout-info h3, .callout-info h4 { color: #0c5460; }
.callout-warning { border-left-color: var(--warning-color, #ffc107); background-color: #fff8e1; }
.callout-warning h1, .callout-warning h2, .callout-warning h3, .callout-warning h4 { color: #856404; }
.callout-success { border-left-color: var(--success-color, #28a745); background-color: #e8f5e9; }
.callout-success h1, .callout-success h2, .callout-success h3, .callout-success h4 { color: #155724; }
.callout-error { border-left-color: var(--error-color, #dc3545); background-color: #fdecea; }
.callout-error h1, .callout-error h2, .callout-error h3, .callout-error h4 { color: #721c24; }

/* === Accessibility Enhancements === */
a {
    outline: none;
    transition: color 0.2s ease, opacity 0.2s ease; /* Added opacity */
}
a:focus { /* Remove outline on click for anchor tags */
    outline: none;
}
a:focus-visible { /* Show outline for keyboard navigation */
    outline: 2px dashed var(--accent-color, #007bff);
    outline-offset: 2px;
}

img {
    max-width: 100%;
    height: auto;
}

/* === Reading Time and Metadata === */
.reading-meta {
    font-size: 0.9rem;
    color: var(--text-muted, #6c757d); /* Using --text-muted from style.css */
    margin-bottom: 15px;
    display: flex;
    gap: 1rem;
    line-height: 1.5; /* Ensure meta text isn't too cramped */
    flex-wrap: wrap;
    align-items: center;
}

/* === Tags === */
.post-tags a {
    display: inline-block;
    background-color: var(--tag-bg, #e9ecef);
    color: var(--tag-color, #007bff);
    padding: 0.3em 0.7em; /* Use em for padding relative to font size */
    margin: 0.2em; /* Use em for margin */
    font-size: 0.85rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s;
}
.post-tags a:hover {
    background-color: var(--tag-hover-bg, #d6eaff);
}

/* === Scroll Animations === */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Sticky Table of Contents === */
.table-of-contents-container {
    /* position: sticky; */ /* Removed sticky positioning */
    /* top: 120px; */
    /* max-height: 80vh; */ /* No longer needed if not sticky */
    /* overflow-y: auto; */ /* No longer needed if not sticky and constrained */
    /* scrollbar-width: thin; */
    margin-bottom: 2em; /* Add some space below the ToC before the main content */
    /* Consider adding some padding and background if it's just a list */
}

/* === Comment Section Enhancements === */
.comments-section {
    scroll-margin-top: 120px;
    background-color: var(--comment-bg, #f8f9fa);
    padding: 2em;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* === CTA Enhancements === */
.cta-block {
    background: var(--cta-bg, #fff3cd);
    color: #856404;
    border-left: 4px solid #ffeeba;
    padding: 1em 1.5em;
    margin-top: 2em;
    border-radius: 6px;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cta-block button {
    background-color: var(--button-bg-color, #007bff); /* Use button variable from style.css */
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cta-block button:hover {
    background-color: #0056b3;
}

/* Consistent focus styling for buttons in blog.css */
.cta-block button:focus,
.copy-btn:focus, /* Assuming .copy-btn is a button */
.feedback-btn:focus, /* Assuming .feedback-btn is a button */
.back-to-top-button:focus {
    outline: none;
}
.cta-block button:focus-visible,
.copy-btn:focus-visible,
.feedback-btn:focus-visible,
.back-to-top-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--background-color, #ffffff), 0 0 0 4px var(--heading-color, #212121);
}

/* === Lazy Loading Placeholder === */
img.lazyload {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

img.lazyloaded {
    opacity: 1;
}

/* === Blog Listing Page (blog.html) Specific Styles === */

.blog-listing-section {
  padding: 60px 0; /* Consistent with other sections, adjust if needed */
}

.blog-layout-container {
  display: flex;
  flex-direction: row;
  gap: 30px; /* Consistent with style.css for similar layouts */
}

.blog-sidebar {
  flex: 0 0 280px; /* Give sidebar a fixed width, don't grow, don't shrink */
  background-color: var(--card-bg-color-subtle, #f8f9fa); /* Use variable for light, will be overridden by dark */
  padding: 25px;
  border-radius: 8px;
  border: 1px solid var(--border-color-light, #e9ecef); /* Use variable */
  height: fit-content; /* Sidebar height adjusts to its content */
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.blog-sidebar h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.4rem; /* Slightly larger sidebar headings */
  color: var(--heading-color, #212121); /* Use variable */
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color-light, #e9ecef);
}

.blog-sidebar ul {
  list-style-type: none;
  padding: 0;
  margin: 0 0 20px 0; /* Space below each list */
}

.blog-sidebar li {
  margin: 0; /* Remove default li margin, control with link padding */
}

.blog-sidebar a {
  text-decoration: none;
  color: var(--link-color, #007bff);
  display: block;
  padding: 10px 12px; /* Good clickable area */
  border-radius: 5px;
  transition: background-color 0.2s ease, color 0.2s ease;
  font-size: 0.95rem;
}

.blog-sidebar a.active-filter {
  font-weight: bold;
  background-color: var(--accent-color, #007bff);
  color: var(--button-text-color, white);
}

.blog-sidebar a:hover:not(.active-filter) {
  background-color: var(--link-hover-bg-color, #e9ecef);
  color: var(--link-hover-color, #0056b3);
}

.posts-grid {
  flex-grow: 1; /* Takes up remaining space */
  display: grid;
  /* grid-template-columns: 1fr; /* Default to single column, adjust for wider screens */
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Responsive cards */
  gap: 2.5rem; /* Increased gap for better separation */
}

.post-summary-card {
  border: 1px solid var(--border-color-light, #e9ecef);
  border-radius: 10px;
  overflow: hidden;
  background-color: var(--card-bg-color, #ffffff); /* Use variable */
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column; /* Stack image and content */
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
/* Style for Featured Posts */
.post-summary-card.featured-post {
    border-left: 5px solid var(--accent-color, #007bff);
    /* background-color: #e6f7ff; /* Optional: slightly different background */
    position: relative; /* Needed for absolute positioning of the badge */
}

.post-summary-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-5px); /* Subtle lift effect */
}

.post-summary-image {
  width: 100%;
  height: 200px; /* Fixed height for consistency, or use aspect-ratio */
  object-fit: cover; /* Ensures image covers the area without distortion */
  display: block;
  border-bottom: 1px solid var(--border-color-light, #e9ecef);
}

.post-summary-content {
  padding: 1.25rem 1.5rem; /* More padding */
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Allow content to take available space */
}

.post-summary-content h3 {
    margin-top: 0;
    margin-bottom: 0.5em;
    font-size: 1.5rem;
}
.post-summary-content h3 a {
    text-decoration: none;
    color: var(--heading-color, #212121); /* Use variable */
    transition: color 0.2s ease;
}
.post-summary-content h3 a:hover {
    color: var(--accent-color, #007bff);
}

.post-meta {
  font-size: 0.85rem;
  color: var(--text-color, #212529); /* Changed to use main text color for light mode */
  margin-bottom: 0.75rem; /* More space below meta */
  line-height: 1.4;
}

.post-summary-content > p { /* Targeting the summary paragraph */
    margin-bottom: 1rem;
    flex-grow: 1; /* Pushes button to bottom */
    color: var(--text-color-secondary, #495057); /* Slightly lighter than main text */
}

.read-more-btn {
  display: inline-block;
  margin-top: auto; /* Pushes button to the bottom */
  padding: 0.6em 1.2em;
  background-color: var(--accent-color, #007bff);
  color: var(--button-text-color, white);
  text-decoration: none;
  border-radius: 50px; /* Pill shape */
  font-weight: 500;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
  align-self: flex-start; /* Align to the start of the cross axis */
}

.read-more-btn:hover {
  background-color: var(--accent-color-dark, #0056b3);
  transform: translateY(-2px);
}

.search-container {
  margin-bottom: 2.5rem; /* More space below search */
  display: flex;
  justify-content: center;
}

#search-blog-input {
  width: 100%;
  max-width: 600px; /* Wider search bar */
  padding: 0.75rem 1.25rem; /* More padding */
  font-size: 1rem;
  border: 1px solid var(--border-color, #ced4da);
  border-radius: 50px; /* Pill shape search bar */
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

#search-blog-input:focus {
    outline: none;
    border-color: var(--heading-color, #253544); /* Use a neutral dark color for border */
    /* Using a double ring box-shadow for consistency with other focused elements */
    box-shadow: 0 0 0 2px var(--background-color, #ffffff), 0 0 0 4px var(--heading-color, #253544);
}

.loading-posts { /* Style for the "Loading posts..." message */
    text-align: center;
    font-style: italic;
    color: var(--text-muted-color, #6c757d);
    padding: 20px;
    grid-column: 1 / -1; /* Ensure it spans full width if grid is active */
}

/* Individual Post Page (post.html) */
.blog-post-section {
    padding-top: 40px;
    padding-bottom: 80px; /* Increased bottom padding for more space before footer */
}

/* Breadcrumbs for post.html */
.breadcrumb-nav {
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.breadcrumb-nav ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.breadcrumb-nav li {
    display: inline;
}

.breadcrumb-nav li + li::before {
    content: ">";
    padding: 0 0.5em;
    color: var(--breadcrumb-separator-color, #f0f0f0); /* Light color for contrast on blue bg */
}

.breadcrumb-nav a {
    color: var(--breadcrumb-link-color, #ffffff); /* White for contrast on blue bg */
    text-decoration: none;
}

.breadcrumb-nav a:hover {
    text-decoration: underline;
}

#post-article-container h1 {
    font-size: 2.5rem;
    margin-top: 0; /* First element in article */
    margin-bottom: 0.5em; 
    color: var(--heading-color, #212121);
    line-height: 1.3; /* Slightly tighter for large headings */
    padding-bottom: 0.4em; /* More space for the border */
    border-bottom: 2px solid var(--border-color-light, #eee);
}

.post-featured-image {
    width: 100%;
    max-height: 500px; /* Optional: constrain max height */
    height: auto; /* Maintain aspect ratio */
    object-fit: cover;
    border-radius: 8px;
    margin-top: 1.5em; /* Space above featured image */
    margin-bottom: 2em; /* More space below featured image */
}

.post-meta-details {
    margin-bottom: 1.5em; /* Consistent spacing */
    font-size: 0.95rem; /* Slightly larger meta text */
    color: var(--text-color, #212529); /* Changed to use main text color for black in light mode */
}
.post-meta-details .post-meta { /* Target .post-meta specifically within .post-meta-details */
    margin-bottom: 0.5em; /* Space between lines of meta if they wrap */
}

.post-meta .reading-time {
    /* display: block; */ /* Uncomment if you want it on a new line */
    /* margin-top: 5px; */
}

.post-tags a:hover { text-decoration: underline; }
.post-body {
    line-height: 1.7; /* Good for readability */
    font-size: 1.05rem; /* Slightly larger body font for readability */
    color: var(--text-color, #333); /* Use variable */
}

.post-body p { margin-bottom: 1.2em; }
.post-body ul, .post-body ol { margin-bottom: 1.2em; padding-left: 2em; }
.post-body li { margin-bottom: 0.5em; }

.post-body blockquote {
  background-color: var(--card-bg-color-subtle, #f8f9fa); /* Light background for the blockquote */
  border-left: 5px solid var(--accent-color, #007bff);
  padding: 1em 1.5em; /* Padding on all sides */
  margin: 1.5em 0; /* Vertical margin, horizontal margin is 0 by default for block elements */
  font-style: italic;
  color: var(--text-muted-color, #555);
  border-radius: 4px; /* Optional: for rounded corners */
}
.post-body blockquote p:first-child {
  margin-top: 0;
}
.post-body blockquote p:last-child {
  margin-bottom: 0;
}

.post-body pre {
  display: block; 
  overflow-x: auto; 
  margin: 1.5em 0; /* Consistent vertical margin, matches blockquote */
  /* Reset any potential inherited or browser-default styling that might conflict with Prism */
  /* Prism's theme (e.g., Okaidia) is expected to provide these styles */
  background: transparent; /* Ensure our CSS doesn't add a background; Prism should. */
  padding: 0;            /* Ensure our CSS doesn't add padding; Prism should. */
  border: none;          /* Ensure our CSS doesn't add a border; Prism might. */
  border-radius: 0;      /* Ensure our CSS doesn't add radius; Prism should. */
  line-height: 1.5;      /* A common base line-height for code, Prism might override. */
  font-size: 1em;        /* Base font size, Prism might adjust. */
  text-align: left;      /* Default for LTR languages */
}
/* Styling for inline code (not inside <pre>) */
.post-body code:not(pre > code) {
    font-family: var(--font-mono, monospace);
    background-color: var(--inline-code-bg-color, #e9ecef);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em; 
}
/* Reset styles for <code> inside <pre> so Prism.js can take full control */
.post-body pre code {
    font-family: var(--font-mono, monospace); /* Ensure Fira Code or specified mono font */
    display: block; /* Helps the code block behave predictably within the pre */
    background-color: transparent !important; /* Crucial: Let Prism theme dictate background */
    padding: 0 !important; /* Crucial: Let Prism theme dictate padding */
    border-radius: 0 !important; /* Crucial: Let Prism theme dictate border-radius */
    font-size: 0.9em; /* Or inherit/match Prism's font size */
    color: inherit !important; /* Crucial: Let Prism theme dictate text color */
    white-space: pre; /* Preserve whitespace and newlines, crucial for code */
    text-align: left; /* Ensure code is left-aligned */
}


/* Styling for tables within post body */
.post-body table {
    width: 100%;
    margin-bottom: 1.5em;
    border-collapse: collapse;
    border: 1px solid var(--border-color-light, #ddd);
}
.post-body th, .post-body td {
    border: 1px solid var(--border-color-light, #ddd);
    padding: 0.75em 1em;
    text-align: left;
}
.post-body th {
    background-color: var(--card-bg-color-subtle, #f8f9fa);
    font-weight: 600;
}
/* Styling for details/summary elements in post body */
.post-body details {
    border: 1px solid var(--border-color-light, #e0e0e0);
    border-radius: 6px;
    padding: 1em;
    margin-bottom: 1.2em;
    background-color: var(--card-bg-color-subtle, #f9f9f9);
}
.post-body summary { cursor: pointer; font-weight: bold; margin-bottom: 0.5em; }
/* Post Interaction Section (Share buttons, Author Bio) */
.post-interaction-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color, #eee);
}

.share-buttons-section,
.author-bio-section {
    margin-bottom: 30px;
}

.share-buttons-section h4,
.author-bio-section h4 {
    margin-top: 0;
    margin-bottom: 1em;
    font-size: 1.2rem;
    color: var(--heading-color, #333); /* Use variable */
}

.share-btn {
    margin-right: 10px;
    margin-bottom: 10px; /* For wrapping on small screens */
    text-decoration: none;
    padding: 10px 18px; /* Increased padding for better sizing */
    font-size: 0.9rem;
    display: inline-flex; /* For consistent alignment of icon and text */
    align-items: center; /* Vertically align content (icon and text) */
    justify-content: center; /* Horizontally align content */
    min-width: 120px; /* Ensure a minimum width for visual consistency */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    line-height: 1.4; /* Added for consistent line height */
    border: 1px solid transparent; /* Normalize border to prevent differences between <a> and <button> */
    height: 42px; /* Explicit height for consistency */
    /* If your .button class already defines a border, this might not be needed or could be adjusted */
}

.share-btn i {
    margin-right: 6px;
}

/* LinkedIn Suggested Post & Copy Button */
.linkedin-suggested-post {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--card-bg-color-subtle, #f8f9fa);
    border: 1px solid var(--border-color-light, #e9ecef);
    border-radius: 6px;
}

.linkedin-suggested-post label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color, #333);
}

.linkedin-suggested-post textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color, #ced4da);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none; /* Prevent manual resize */
    background-color: var(--background-color, #fff); /* Ensure it's not transparent */
    color: var(--text-color, #333);
}

.copy-btn { margin-top: 10px; padding: 8px 12px; font-size: 0.9em; }
.copy-status { margin-left: 10px; font-size: 0.85em; color: var(--success-color, green); }

/* Specific button colors (optional) */
/* .twitter-share-btn { background-color: #1DA1F2; } */
/* .linkedin-share-btn { background-color: #0A66C2; } */
/* .email-share-btn { background-color: #777; } */

.author-bio-section p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color, #444); /* Use variable */
}

.author-bio-section strong {
    color: var(--heading-color, #333); /* Use variable */
}

/* Feedback Section */
.feedback-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color-light, #f0f0f0);
}

.feedback-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.feedback-btn {
    margin-right: 10px;
}

/* Comments Section Placeholder */
.comments-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color, #eee);
}

.back-to-blog {
    margin-top: 30px;
    margin-bottom: 30px; /* Added margin bottom */
    text-align: center;
}

/* Table of Contents */
.table-of-contents-container {
    background-color: var(--card-bg-color-subtle, #f9f9f9); /* Use variable */
    border: 1px solid var(--border-color-light, #e7e7e7);
    border-radius: 8px; /* Consistent rounding */
    padding: 15px 20px;
    margin-bottom: 30px;
}
.table-of-contents-container h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2rem; /* Slightly larger ToC title */
    color: var(--heading-color, #333); /* Use variable */
}

.table-of-contents-container ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.table-of-contents-container li a {
    text-decoration: none;
    color: var(--link-color, #007bff);
    display: inline-block; /* Allows padding but doesn't force full width */
    padding: 4px 0;
}

.table-of-contents-container li a:hover {
    text-decoration: underline;
}

.table-of-contents-container .toc-level-3 a { /* Assumes toc-level-2 for H2 */
    padding-left: 20px; /* Indent H3 links */
}

/* Previous/Next Post Navigation */
.post-navigation {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color, #eee);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

/* Footnotes Section Styling */
.footnotes-section {
    margin-top: 2.5em;
    padding-top: 1.5em;
    border-top: 1px solid var(--border-color-light, #eee);
}
.footnotes-section h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8em;
}
.footnotes-list {
    list-style-type: decimal;
    padding-left: 20px; /* Standard OL indent */
    font-size: 0.9em;
    color: var(--footnote-text-color, #f0f0f0); /* Light color for contrast on blue bg */
}
.footnotes-list li {
    margin-bottom: 0.5em;
    line-height: 1.5;
}
.footnotes-list li a { /* Backlink arrow */
    text-decoration: none;
    margin-left: 0.3em;
}

.post-navigation a {
    text-decoration: none;
    color: var(--post-nav-link-color, #ffffff); /* White for contrast on blue bg */
    font-weight: 500;
    padding: 10px 0;
}

.post-navigation a:hover {
    text-decoration: underline;
}

.prev-post {
    margin-right: auto; /* Pushes next-post to the right if only prev exists */
}

.next-post {
    margin-left: auto; /* Pushes prev-post to the left if only next exists */
    text-align: right;
}

/* Related Posts Section */
.related-posts-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color, #eee);
}

.related-posts-section h3 {
    text-align: center;
    margin-bottom: 2em; /* More space below "Related Posts" title */
    font-size: 1.8rem;
    color: var(--heading-color, #333); /* Use variable */
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.related-post-card {
    background-color: var(--card-bg-color-subtle, #f9f9f9); /* Use variable */
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color-light, #e7e7e7);
    transition: box-shadow 0.3s ease;
}
.related-post-card:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.07);
}

.related-post-card h4 a {
    text-decoration: none;
    color: var(--link-color, #007bff);
    font-size: 1.1rem;
}

.loading-posts, .loading-post {
    text-align: center;
    font-style: italic;
    color: var(--text-muted, #6c757d);
    padding: 20px;
    grid-column: 1 / -1; /* Ensure it spans full width if grid is active */
}

/* Responsive adjustments for blog layout */
@media (max-width: 992px) {
    .blog-layout-container {
        flex-direction: column;
    }
    .blog-sidebar {
        flex: 0 0 auto; /* Reset flex properties for stacking */
        width: 100%;
        margin-bottom: 30px;
    }
}


/* Add specific dark mode overrides for blog elements if not covered by global style.css */
.dark-mode .blog-sidebar { background-color: var(--card-bg-color-subtle); border-color: var(--border-color-light); }
.dark-mode .blog-sidebar h3 { color: var(--heading-color); border-bottom-color: var(--border-color-light); }
.dark-mode .blog-sidebar a { color: var(--link-color); }
.dark-mode .blog-sidebar a:hover:not(.active-filter) { background-color: var(--link-hover-bg-color); color: var(--link-hover-color); }
.dark-mode .blog-sidebar a.active-filter { background-color: var(--accent-color); color: var(--button-text-color); }

.dark-mode .post-summary-card { background-color: var(--card-bg-color); border-color: var(--border-color-light); }
.dark-mode .post-summary-image { border-bottom-color: var(--border-color-light); }
.dark-mode .post-summary-content h3 a { color: var(--heading-color); }
.dark-mode .post-summary-content h3 a:hover { color: var(--accent-color); }
.dark-mode .post-meta { color: var(--text-muted); }
.dark-mode .post-summary-content > p { color: var(--text-color-secondary); }
/* Dark mode for Featured Posts */
.dark-mode .post-summary-card.featured-post {
    border-left-color: var(--accent-color-dark, #3395ff); /* Brighter accent for dark mode */
    /* background-color: #2a2a3a; /* Optional: slightly different dark background */
}

.dark-mode .read-more-btn {
    background-color: var(--accent-color);
    color: var(--button-text-color);
    border: 1px solid rgba(255, 255, 255, 0.35); /* More visible faint white outline */
}
.dark-mode .featured-badge { /* Badge style for dark mode */
    background-color: var(--accent-color-dark, #3395ff);
    color: var(--dark-text-color, #e0e0e0); /* Ensure text is readable on accent color */
    /* If accent-color-dark is very light, you might need a darker text color for the badge */
    /* For example: color: #111; */
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.featured-badge { /* General badge style */
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--accent-color, #007bff);
    color: white;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1; /* Ensure it's above the image if overlapping */
}
.dark-mode .read-more-btn:hover {
    background-color: var(--accent-color-dark);
    border-color: rgba(255, 255, 255, 0.5); /* Even slightly more visible outline on hover */
    /* box-shadow will be inherited from .dark-mode .button:focus-visible if not overridden */
}

.dark-mode #search-blog-input { background-color: var(--dark-input-bg, #2a2a2a); border-color: var(--border-color, #444); color: var(--text-color, #e0e0e0); }
.dark-mode #search-blog-input:focus {
    border-color: var(--text-color, #e0e0e0); /* Light border for focus in dark mode */
    box-shadow: 0 0 0 2px var(--background-color, #0f0f0f), 0 0 0 4px var(--text-color, #e0e0e0); /* Consistent double ring */
}

/* Reading Progress Bar */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%; /* Initial width */
    height: 5px; /* Adjust height as needed */
    background-color: var(--accent-color, #007bff); /* Or your theme's primary color */
    z-index: 10000; /* Ensure it's above other content */
    transition: width 0.1s linear; /* Smooth transition for width changes */
}

/* Back to Top Button */
.back-to-top-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--button-bg-color, #007bff);
    color: var(--button-text-color, white);
    border: none;
    border-radius: 50%; /* Makes it circular */
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 9999; /* Ensure it's above most content but below progress bar if desired */
    display: flex; /* For centering icon */
    align-items: center; /* For centering icon */
    justify-content: center; /* For centering icon */
    transition: background-color 0.3s, opacity 0.3s;
}

.back-to-top-button:hover {
    background-color: var(--button-hover-bg-color, #0056b3);
}

/* Dark mode overrides for post.html specific elements */
.dark-mode .breadcrumb-nav li + li::before { color: var(--text-muted-color); }
.dark-mode .breadcrumb-nav a { color: var(--link-color); } /* Uses dark mode link color */
.dark-mode #post-article-container h1 { color: var(--heading-color); border-bottom-color: var(--border-color-light); }
.dark-mode .post-meta-details { color: var(--text-muted); }
.dark-mode .post-tags a { background-color: var(--tag-bg); color: var(--tag-color); }
.dark-mode .post-tags a:hover { background-color: var(--tag-hover-bg); }
.dark-mode .post-body { color: var(--text-color); }
.dark-mode .post-body blockquote {
  background-color: var(--card-bg-color, #1e1e1e); /* Darker background for blockquote in dark mode */
  border-left-color: var(--accent-color-dark, #3395ff);
  color: var(--text-muted, #a0aec0);
}
.dark-mode .post-body code:not(pre > code) { /* Inline code in dark mode */
  background-color: var(--dark-input-bg, #2a2a2a); /* Darker background for inline code */
  color: var(--text-color, #e0e0e0); /* Light text for inline code */
}
/* Ensure CTA block has dark background and contrasting text in dark mode */
.dark-mode .cta-block {
    background: var(--card-bg-color-subtle, #2a2a2a); /* Dark background */
    color: var(--text-color, #e0e0e0); /* Light text */
    border-left-color: var(--accent-color-dark, #3395ff); /* Dark mode accent */
}
.dark-mode .cta-block button {
    background-color: var(--accent-color-dark, #3395ff);
    color: var(--card-bg-color, #1a1a1a); /* Dark text on lighter button */
}
.dark-mode .cta-block button:hover {
    background-color: var(--primary-hover-color, #1f70c7); /* Consistent with other dark buttons */
}
/* Prism.js Okaidia theme is dark, so it should look fine. If you switch to a light Prism theme, you'd need dark mode overrides for it. */
.dark-mode .callout-info { background-color: #1c3a4f; border-left-color: #3b82f6; }
.dark-mode .callout-warning { background-color: #4d3803; border-left-color: #f59e0b; }
.dark-mode .callout-success { background-color: #1a3c1e; border-left-color: #10b981; }
.dark-mode .callout-error { background-color: #4f181b; border-left-color: #ef4444; }
.dark-mode .post-body table { border-color: var(--border-color, #444); }
.dark-mode .post-body th, .dark-mode .post-body td { border-color: var(--border-color, #444); }
.dark-mode .post-body th { background-color: var(--card-bg-color-subtle, #2a2a2a); }
.dark-mode .post-body details { background-color: var(--card-bg-color-subtle); border-color: var(--border-color); }
.dark-mode .footnotes-section { border-top-color: var(--border-color-light); }
.dark-mode .footnotes-list { color: var(--text-muted); } /* Uses dark mode muted text color */

.dark-mode .post-interaction-section { border-top-color: var(--border-color); }
.dark-mode .share-buttons-section h4, .dark-mode .author-bio-section h4, .dark-mode .feedback-section h4, .dark-mode .comments-section h4, .dark-mode .related-posts-section h3, .dark-mode .table-of-contents-container h4 { color: var(--heading-color); }
.dark-mode .author-bio-section p { color: var(--text-color); }
.dark-mode .author-bio-section strong { color: var(--heading-color); }
.dark-mode .feedback-section { border-top-color: var(--border-color-light); }
.dark-mode .comments-section, .dark-mode .post-navigation, .dark-mode .related-posts-section { border-top-color: var(--border-color); }
.dark-mode .table-of-contents-container { background-color: var(--card-bg-color-subtle); border-color: var(--border-color-light); }
.dark-mode .table-of-contents-container li a { color: var(--link-color); }
.dark-mode .related-post-card { background-color: var(--card-bg-color-subtle); border-color: var(--border-color-light); }
.dark-mode .related-post-card h4 a { color: var(--link-color); }
.dark-mode .loading-posts, .dark-mode .loading-post { color: var(--text-muted); }
