/* Blog page styles */
.blog-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

/* Blog header */
.blog-header {
  text-align: center;
  margin-bottom: 3rem;
}

.blog-header h1 {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.blog-header p {
  max-width: 700px;
  margin: 0 auto;
  color: var(--text-light);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Tab navigation */
.blog-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border-color);
}

.blog-tab {
  padding: 1rem 1.5rem;
  color: var(--text-light);
  text-decoration: none;
  font-size: 1rem;
  position: relative;
  transition: all 0.3s ease;
  margin: 0 0.5rem;
}

.blog-tab:hover {
  color: var(--primary-color);
}

.blog-tab.active {
  color: var(--primary-color);
  font-weight: 500;
}

.blog-tab.active:after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary-color);
}

/* Blog category sections */
/* Make sure these rules are present and not overridden elsewhere */
.blog-category-section {
  display: none !important;
}

.blog-category-section.active {
  display: block !important;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 2.5rem;
  color: var(--text-white);
  position: relative;
  display: inline-block;
}

.section-title:after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--primary-color);
}

/* Blog Grid Layout */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

/* Blog Cards */
.blog-card {
  /* UPDATED: Set this to your DEFAULT card background color */
  background-color: var(
    --card-bg
  ); /* Or var(--bg-main) if that's your default */
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease,
    background-color 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* REMOVE or COMMENT OUT this rule that made linked cards dark black */
/*
.blog-card:has(a.blog-card-link) {
  background-color: var(--bg-darkest);
}
*/

/* NEW or ENSURE THIS IS PRESENT: Style for non-linked (placeholder) cards to be grey */
.blog-card:not(:has(a.blog-card-link)) {
  background-color: var(--bg-light); /* Grey background for non-linked cards */
  cursor: default; /* Optional: indicates non-interactivity */
}

/* MODIFIED: Hover effect ONLY for cards WITH a link */
.blog-card:has(a.blog-card-link):hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.blog-card h3 {
  font-size: 1.4rem;
  line-height: 1.4;
  margin: 1rem 0;
  color: var(--text-white); /* Uniform title color */
}

/* Ensure these conflicting rules for title colors remain commented out or removed */
/*
.blog-card a.blog-card-link h3 {
  color: var(--primary-color);
  transition: color 0.3s ease;
}

.blog-card a.blog-card-link:hover h3 {
  color: var(--primary-hover);
}

.blog-card:not(:has(a.blog-card-link)) h3 {
  color: var(--text-white);
}
*/

.blog-card p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  line-height: 1.6;
  flex-grow: 1; /* Helps push meta to bottom */
}

.blog-tag {
  display: inline-block;
  background-color: rgba(var(--primary-color-rgb), 0.1);
  color: var(--primary-color);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-light); /* Default meta text color */
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  margin-top: auto; /* Pushes meta to the bottom */
}

/* Style for the hidden author name */
.blog-author-hidden {
  display: block; /* Or inline, depending on desired flow */
  font-size: 1px; /* Extremely small font size */
  color: var(--card-bg); /* Match the card background color */
  opacity: 0; /* Ensure it's fully transparent */
  position: absolute; /* Take it out of normal flow */
  /* left: -9999px; Move it off-screen */
  /* Alternative: Use clip-path for modern screen readers */
  /* clip-path: inset(50%); */
  /* height: 1px; */
  /* width: 1px; */
  /* overflow: hidden; */
}

/* Section description */
.section-description {
  color: var(--text-light);
  text-align: center;
  max-width: 700px;
  margin: -1rem auto 3rem;
}

/* Miscellaneous content container */
.misc-container {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

/* Individual miscellaneous content sections */
.misc-content {
  background-color: var(--bg-card);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-color);
}

.misc-content-title {
  font-size: 1.8rem;
  color: var(--text-white);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.misc-content-title i {
  color: var(--primary-color);
}

.misc-content-intro {
  color: var(--text-light);
  margin-bottom: 2rem;
  font-size: 1rem;
}

/* Reading List Styles - Add these to your existing blog.css file */

/* Reading List Tab Navigation */
.reading-list-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.reading-tab {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.reading-tab:hover {
  color: var(--primary-color);
}

.reading-tab.active {
  background-color: var(--primary-color);
  color: white;
}

/* Book Categories */
.reading-category {
  display: none;
}

.reading-category.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

/* Override any inherited center alignment with !important */
.blog-header .blog-navigation {
  text-align: left !important;
  width: 100%;
  display: block;
}

.blog-header .blog-navigation .btn.back {
  float: left;
  margin-right: auto;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Book Grid Layout */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* Book Cards */
.book-card {
  background-color: var(--bg-main);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.book-card h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: var(--text-white);
}

.book-author {
  color: var(--primary-color);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  font-style: italic;
}

.book-description {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Quick Thoughts Styles */
.quick-thoughts-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.quick-thought {
  background-color: var(--bg-main);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

.quick-thought-date {
  font-size: 0.85rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.quick-thought-content {
  color: var(--text-light);
  font-size: 1rem;
  line-height: 1.6;
}

/* Optional: Style for published dates to ensure they are readable but not overly prominent */
.blog-card:has(a.blog-card-link) .blog-meta .blog-date {
  color: var(--text-muted); /* Subtle color */
}

/* --- START: Blog Post Content Styles --- */

/* Adjustments for the main article container within a blog post page */
.blog-container article {
  max-width: 800px; /* Narrows content for better readability & wider side margins on desktop */
  margin-left: auto;
  margin-right: auto;
}

/* Spacing for the 'Back to All Blogs' button container */
.blog-navigation-top {
  max-width: 800px; /* Align with article content */
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem; /* Space below the button */
}

/* Styling for the header within a single blog post (title, meta, intro) */
article .blog-header {
  /* Make it wider, potentially full width of its container or a bit less than page max-width */
  max-width: 950px; /* Adjust as needed, or remove if you want it to span the full width of .blog-container article */
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 3.5rem; /* Increased space between post header and main content */
  text-align: left;
  /* border: 1px solid var(--border-color-light); */ /* REMOVE THE BORDER */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* ADD A SUBTLE SHADOW */
  padding: 2rem; /* Add padding inside the border */
  border-radius: 8px; /* Direct value for rounded corners */
  background-color: var(
    --bg-card-header
  ); /* Use defined background for header */
}

article .blog-header h1 {
  font-size: 2.4rem;
  color: var(--text-white);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

article .blog-header .blog-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  border-top: none;
  padding-top: 0;
  justify-content: flex-start;
  gap: 1rem;
}

article .blog-header .blog-intro {
  font-size: 1.15rem;
  color: var(--text-light);
  line-height: 1.7;
  /* margin-bottom: 2.5rem; */ /* Removed bottom margin here as padding on .blog-header handles it */
}

/* General styling for the main blog post content area */
.blog-content {
  font-size: 1.05rem; /* Base font size for post content, adjust as needed */
  line-height: 1.8; /* Generous line height for readability */
  color: var(--text-light);
}

.blog-content p {
  margin-bottom: 1.75rem; /* Space after paragraphs */
}

.blog-content h2 {
  font-size: 1.9rem; /* Size for H2 headings within the post */
  color: var(--text-white);
  margin-top: 3.5rem; /* More space before H2 */
  margin-bottom: 1.5rem; /* Space after H2 */
  line-height: 1.3;
}

.blog-content h3 {
  /* If you use H3s within posts */
  font-size: 1.6rem;
  color: var(--text-white);
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  line-height: 1.3;
}

/* Bullet point formatting */
.blog-content ul {
  list-style-type: disc; /* Standard disc bullets */
  margin-left: 1.5rem; /* Indentation from the left */
  padding-left: 1rem; /* Additional padding for the bullet itself */
  margin-bottom: 1.75rem; /* Space after the entire list */
}

.blog-content ul li {
  margin-bottom: 0.85rem; /* Space between individual list items */
  padding-left: 0.5rem; /* Small padding to align text nicely after bullet */
}

/* Styling for emphasized (italic) text within blog content */
.blog-content em,
.blog-content i {
  /* Target both <em> and <i> for italics */
  font-style: italic;
  /* Optional: make emphasized text stand out more, e.g., with a subtle color change */
  /* color: var(--primary-color); */
}

/* Style for highlighted standalone statements */
.highlighted-statement {
  text-align: center;
  margin-top: 2.5rem; /* Increased top margin */
  margin-bottom: 2.5rem; /* Increased bottom margin */
  padding-left: 1rem; /* Horizontal padding for better centering of multi-line text */
  padding-right: 1rem; /* Horizontal padding */
  font-size: 1.2em; /* Slightly larger than surrounding paragraph text */
  font-weight: 500; /* Medium weight to make it stand out */
  line-height: 1.6; /* Adjust line height for readability if multi-line */
  /* Optional: Add a distinct color or keep it inherited */
  /* color: var(--primary-color); */
}

/* Ensure em within highlighted statement retains its style or adjust as needed */
.highlighted-statement em {
  font-style: italic; /* Explicitly set if needed, though usually inherited */
}

/* --- Ensure Heading Hierarchy in Blog Content --- */

/* H1 is typically the main blog post title, styled in article .blog-header h1 */
/* article .blog-header h1 { font-size: 2.4rem; ... } */ /* Already exists */

.blog-content h2 {
  font-size: 1.9rem; /* Size for H2 headings within the post */
  color: var(--text-white);
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.blog-content h3 {
  font-size: 1.6rem; /* Size for H3 headings within the post */
  color: var(--text-white);
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  line-height: 1.3;
}

.blog-content h4 {
  /* Style for H4 headings if you use them */
  font-size: 1.4rem;
  color: var(--text-white);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  font-weight: 600; /* H4 usually bolder than paragraph but less than H3 */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-tabs {
    flex-direction: column;
    align-items: center;
  }

  .blog-tab {
    margin-bottom: 0.5rem;
  }

  .reading-item {
    flex-direction: column;
  }

  .reading-item-cover {
    width: 100px;
    margin: 0 auto;
  }
}
