/* =============================================== */
/* General Blog Styles (List Page, Search, etc.) */
/* =============================================== */

.blog-container {
  /* Primarily for the blog list page */
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.search-bar {
  /*margin-bottom: 20px;*/

  width: 60vw; /* Width of the container */
  margin-bottom: 30px;
  padding: 20px;
  background-color: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  text-align: center;
  margin-left: auto;
  margin-right: auto; /* Centers the container */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px; /* Adds spacing between input and button */
}

.search-bar form {
  display: flex;
  align-items: center;
}

.search-bar input[type="text"] {
  /*flex-grow: 1; 
  height: 40px;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-right: none; 
  border-radius: 5px 0 0 5px;*/
  width: 80%; /* 70% of .search-container */
  padding: 12px 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-bar button[type="submit"] {
  /* width: 20%; /* Avoid fixed width, let it size naturally */
  /*flex-shrink: 0; 
  height: 40px;
  background-color: #0056b3;
  color: #fff;
  padding: 0 20px; 
  border: none;
  border-radius: 0 5px 5px 0;
  cursor: pointer;
  font-size: 16px;*/
  width: 15%; /* 10% of .search-container */
  min-width: fit-content; /* Prevent collapse on small screens */
  padding: 12px 25px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: background-color 0.3s ease, transform 0.1s ease;
}

.blog-cards {
  /* Container for blog previews on list page */
  display: flex;
  flex-wrap: wrap;
  /* justify-content: center; */ /* Or space-around/space-between */
  gap: 20px; /* Use gap for spacing */
  margin: 0 -10px; /* Offset for card margins if needed or remove card margins */
}

.blog-card {
  /* Individual preview card on list page */
  /* margin: 20px; /* Replaced by gap in container */
  width: calc(33.333% - 14px); /* Adjust width considering gap, approx */
  background-color: #fff;
  padding: 20px;
  border: 1px solid #ddd;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-5px); /* Slightly less jumpy */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.blog-card h2 {
  /* Title within the preview card */
  font-size: 1.5rem; /* 24px */
  margin-bottom: 10px;
  color: #333; /* Ensure consistent color */
}

.blog-card p {
  /* Excerpt within the preview card */
  font-size: 1rem; /* 16px */
  margin-bottom: 20px;
  color: #555; /* Slightly lighter text */
  flex-grow: 1; /* Pushes button to bottom */
}

.read-more {
  /* Button on the preview card */
  background-color: #007bff;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  display: inline-block; /* Fits content */
  align-self: flex-start; /* Align to start of card bottom */
  transition: background-color 0.2s ease;
}
.read-more:hover {
  background-color: #0056b3; /* Darker pink on hover */
}

.pagination {
  margin-top: 40px; /* More space */
  text-align: center;
}

.pagination a {
  margin: 0 5px; /* Less margin */
  padding: 8px 15px; /* Adjust padding */
  border: 1px solid #ddd;
  background-color: #f9f9f9;
  color: #333;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
  border-radius: 4px; /* Slight rounding */
}

.pagination a.active {
  background-color: #0056b3;
  color: #fff;
  border-color: #0056b3;
}

.pagination a:hover:not(.active) {
  /* Hover only on non-active */
  background-color: #eee;
  border-color: #ccc;
  color: #0056b3;
}

/* =============================================== */
/* Individual Blog Post Content Styles            */
/* =============================================== */

.blog-post-content {
  /* Styles applied to the main wrapper of a single blog post */
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; /* Assuming this is desired for posts */
  color: #333;
  line-height: 1.6;
  text-align: justify; /* Inherited from NRI style */
  background-color: #fff; /* Individual posts usually have white bg */
  margin: 40px auto; /* Center the content block */
  padding: 30px 0; /* Add padding top/bottom to the block */
  max-width: 1200px; /* Set a max-width for readability */
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.08); /* Subtle shadow for post area */
  border-radius: 5px; /* Optional rounding */
}

/* Container within the blog post for padding */
.blog-post-content .container {
  padding-left: 20px; /* Inner padding */
  padding-right: 20px;
  max-width: 100%; /* Let wrapper control width */
}

/* Typography within the blog post */
.blog-post-content h1,
.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4 {
  color: #1e3a8a; /* Dark blue from NRI */
  margin-bottom: 1rem;
  text-align: left; /* Override justify for headings */
  line-height: 1.3;
}

.blog-post-content h1 {
  /* Main Blog Post Title */
  font-size: 2.25rem; /* text-4xl */
  font-weight: 700;
  color: #312e81; /* text-indigo-900 */
  margin-bottom: 1.5rem; /* More space below main title */
  text-align: center; /* Center main title */
  border-bottom: 2px solid #0056b3; /* Add theme color underline */
  padding-bottom: 0.75rem;
}

.blog-post-content h2 {
  /* Major Section Headings */
  font-size: 1.75rem; /* Slightly larger than card H2 */
  font-weight: 700;
  color: #312e81; /* text-indigo-900 */
  margin-top: 2.5rem; /* More space above H2 */
  margin-bottom: 1rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
}

.blog-post-content h3 {
  /* Sub-Section Headings */
  font-size: 1.4rem; /* text-xl */
  font-weight: 600;
  color: #3730a3; /* text-indigo-800 */
  margin-top: 2rem; /* More space above H3 */
  margin-bottom: 0.75rem;
}

.blog-post-content h4 {
  /* Minor Headings / Card Titles within post */
  font-size: 1.15rem;
  font-weight: 700;
  color: #4338ca; /* text-indigo-700 */
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.blog-post-content p {
  margin-bottom: 1rem;
}

.blog-post-content ul,
.blog-post-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
  padding-left: 1rem; /* Add padding for better indentation */
}

.blog-post-content ul li,
.blog-post-content ol li {
  margin-bottom: 0.5rem;
}
.blog-post-content ul {
  list-style-type: disc;
}
.blog-post-content ol {
  list-style-type: decimal;
}
.blog-post-content ul ul,
.blog-post-content ol ol,
.blog-post-content ul ol,
.blog-post-content ol ul {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem; /* Less margin for nested lists */
}

/* Specific Elements from NRI Guide, now generic for blog posts */
.blog-post-content .page-header {
  /* Header section within the post (like the NRI guide's intro) */
  margin-bottom: 3rem;
  text-align: center;
}
.blog-post-content .page-header h1 {
  /* Ensure page header H1 matches main H1 style */
  border-bottom: none; /* Remove double border if H1 is inside */
  margin-bottom: 1rem;
  padding-bottom: 0;
  color: var(--secondary);
}

.blog-post-content .header-subtitle {
  font-size: 1.25rem;
  color: var(--secondary);
}

.blog-post-content .tag-container {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem; /* Use gap */
  flex-wrap: wrap; /* Allow tags to wrap */
  align-items: center;
}

.blog-post-content .tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  /* margin-right: 0.5rem; /* Replaced by gap */
  white-space: nowrap;
}

.blog-post-content .tag i {
  margin-right: 0.25rem;
}

/* Match tag colors from NRI styles */
.blog-post-content .tag-legal {
  background-color: #e0e7ff;
  color: #3730a3;
}
.blog-post-content .tag-nri {
  background-color: #dbeafe;
  color: #1e40af;
}
.blog-post-content .tag-family {
  background-color: #d1fae5;
  color: #065f46;
}
/* Add more tag styles as needed */
.blog-post-content .tag-default {
  background-color: #f3f4f6;
  color: #4b5563;
} /* Example default */

.blog-post-content .table-of-contents {
  background-color: #f8fafc; /* Slightly off-white */
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin: 2rem 0; /* Add vertical margin */
}

.blog-post-content .table-of-contents h2 {
  /* TOC Title */
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 0; /* Remove top margin */
  margin-bottom: 1rem;
  color: #312e81;
  border-bottom: none; /* Remove inherited border */
  padding-bottom: 0;
}

.blog-post-content .table-of-contents ol {
  list-style-position: inside;
  margin-left: 0.5rem;
  margin-bottom: 0; /* Remove bottom margin */
}
.blog-post-content .table-of-contents li {
  margin-bottom: 0.5rem;
}
.blog-post-content .table-of-contents ul {
  /* Nested lists in TOC */
  list-style-type: disc;
  margin-left: 1.5rem;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.blog-post-content .table-of-contents a {
  text-decoration: none;
  color: #4f46e5;
  font-weight: 500;
}
.blog-post-content .table-of-contents a:hover {
  text-decoration: underline;
}

.blog-post-content section {
  /* Spacing between logical sections */
  margin-bottom: 2.5rem;
}

/* Unique Case Law Styling */
.blog-post-content .case-law {
  border-left: 4px solid #4f46e5; /* Indigo border */
  background-color: #f8fafc; /* Light gray background */
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin: 1.5rem 0; /* Vertical margin */
  border: 1px solid #e5e7eb; /* Subtle outer border */
}

.blog-post-content .case-law h4 {
  /* Case Law title */
  margin-top: 0; /* Remove top margin */
  margin-bottom: 0.75rem;
  color: #3730a3; /* Indigo */
  font-size: 1.2rem; /* Slightly larger */
}

.blog-post-content .case-law-meta {
  /* Citation/Date */
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
  font-style: italic;
}

.blog-post-content .case-law strong {
  /* Fact/Judgment labels */
  font-weight: 600;
  color: #3730a3;
  display: block; /* Make labels stand out */
  margin-top: 0.5rem;
}

.blog-post-content .case-law p {
  margin-bottom: 0.5rem;
} /* Tighter spacing inside */
.blog-post-content .case-law ul {
  margin: 0.5rem 0 0.5rem 1.5rem;
}
.blog-post-content .case-law ul li {
  margin-bottom: 0.25rem;
}

/* Dividers */
.blog-post-content .section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, #cbd5e1, transparent);
  margin: 2.5rem auto; /* Center and add vertical space */
  max-width: 80%;
}

/* Blockquotes */
.blog-post-content blockquote {
  font-style: italic;
  color: #4b5563;
  border-left: 4px solid #d1d5db;
  padding: 0.5rem 1rem; /* Adjust padding */
  margin: 1.5rem 0; /* Vertical margin */
  background-color: #f9fafb; /* Slight background */
}
.blog-post-content blockquote p {
  margin-bottom: 0;
} /* Remove extra space */

/* Grid Layouts within posts */
.blog-post-content .grid-container {
  display: grid;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

@media (min-width: 768px) {
  .blog-post-content .grid-cols-md-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .blog-post-content .grid-cols-md-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Card Styling within posts */
.blog-post-content .card {
  background-color: #ffffff;
  padding: 1.25rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); /* Slightly stronger shadow */
  border: 1px solid #e5e7eb;
}

.blog-post-content .card h4 {
  /* Title inside card */
  color: #4338ca;
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.blog-post-content .card ul {
  margin-left: 1rem;
  margin-bottom: 0;
}
.blog-post-content .card ul li {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
.blog-post-content .card p {
  font-size: 0.95rem;
}

/* Highlight Box Styling within posts */
.blog-post-content .highlight-box {
  background-color: #f0f5ff; /* Light indigo bg */
  padding: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid #c7d2fe;
  border-left: 4px solid #6366f1; /* Add theme border */
  margin: 1.5rem 0;
}
.blog-post-content .highlight-box h3,
.blog-post-content .highlight-box h4 {
  /* Titles inside highlight */
  color: #3730a3;
  margin-top: 0;
  margin-bottom: 0.75rem;
}
.blog-post-content .highlight-box ul {
  margin-left: 1.5rem;
  margin-bottom: 0;
}
.blog-post-content .highlight-box ul li {
  margin-bottom: 0.25rem;
}

/* Footer Section within the blog post */
.blog-post-content .page-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
  text-align: center;
  color: #ffffff; /* Lighter gray */
  font-size: 0.9rem;
}
.blog-post-content .page-footer p {
  margin-bottom: 0.5rem;
}
.blog-post-content .page-footer .copyright {
  font-size: 0.875rem;
}

/* Responsive Adjustments for Blog Post Content */
@media (max-width: 768px) {
  .blog-post-content {
    margin: 20px 10px; /* Less margin on smaller screens */
    padding: 20px 0;
  }
  .blog-post-content h1 {
    font-size: 1.8rem;
  }
  .blog-post-content h2 {
    font-size: 1.5rem;
  }
  .blog-post-content h3 {
    font-size: 1.25rem;
  }
  .blog-post-content h4 {
    font-size: 1.1rem;
  }

  .blog-post-content .grid-cols-md-2,
  .blog-post-content .grid-cols-md-3 {
    grid-template-columns: 1fr; /* Stack grids on mobile */
  }
  /* Adjust card width for blog list on mobile */
  .blog-card {
    width: calc(50% - 10px); /* Two columns */
  }
}

@media (max-width: 576px) {
  /* Single column for blog list cards on small mobile */
  .blog-card {
    width: calc(100% - 0px); /* Full width, adjust if margin/gap exists */
  }
  .blog-post-content h1 {
    font-size: 1.6rem;
  }
  .blog-post-content h2 {
    font-size: 1.3rem;
  }
  .blog-post-content h3 {
    font-size: 1.15rem;
  }
}

/* Print Styles (Apply to blog post content) */
@media print {
  body {
    background-color: #fff;
    color: #000;
    font-size: 10pt;
  }
  .no-print {
    display: none !important;
  } /* Hide elements marked no-print */

  .blog-container,
  .blog-post-content {
    box-shadow: none;
    border: none;
    margin: 0;
    padding: 0;
    max-width: 100%;
    background-color: #fff;
  }
  .blog-post-content .container {
    padding: 0;
  }

  .blog-post-content h1,
  .blog-post-content h2,
  .blog-post-content h3,
  .blog-post-content h4 {
    color: #000;
    border: none;
    margin-top: 1.5rem;
    padding-bottom: 0;
  }
  .blog-post-content h1 {
    text-align: left;
    font-size: 18pt;
  }
  .blog-post-content h2 {
    font-size: 14pt;
  }
  .blog-post-content h3 {
    font-size: 12pt;
  }
  .blog-post-content h4 {
    font-size: 11pt;
  }

  .blog-post-content .table-of-contents,
  .blog-post-content .section-divider {
    display: none;
  }

  .blog-post-content a {
    color: #000;
    text-decoration: none;
  }
  .blog-post-content a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 90%;
  } /* Show URLs */
  .blog-post-content a[href^="#"]:after {
    display: none;
  } /* Hide internal links */

  .blog-post-content .case-law,
  .blog-post-content .card,
  .blog-post-content .highlight-box,
  .blog-post-content blockquote {
    border: 1px solid #ccc;
    background-color: #fdfdfd;
    page-break-inside: avoid;
    padding: 0.5rem;
    margin: 1rem 0;
  }
  .blog-post-content .case-law {
    border-left: 3px solid #999;
  }
  .blog-post-content blockquote {
    border-left: 3px solid #aaa;
  }

  .blog-post-content .grid-container {
    display: block;
  } /* Avoid grid issues in print */
}

/* =============================================== */
/* Utility Styles (e.g., Move to Top Button)      */
/* =============================================== */

#moveToTopBtn {
  /* display: block; Use JS to control visibility via class */
  position: fixed; /* Fixed position relative to viewport */
  bottom: 30px; /* Distance from bottom */
  right: 30px; /* Distance from right */
  z-index: 999; /* Ensure it's above most other content */
  border: none;
  outline: none;
  background-color: #e40492; /* Use your theme pink */
  color: white;
  cursor: pointer;
  padding: 0; /* Remove padding if sizing with width/height */
  border-radius: 50%; /* Make it circular */
  width: 50px; /* Button width */
  height: 50px; /* Button height */
  font-size: 18px; /* Size of the arrow icon */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Add a shadow */
  opacity: 0; /* Start hidden */
  visibility: hidden; /* Start hidden */
  transition: opacity 0.4s ease, visibility 0.4s ease,
    background-color 0.2s ease;
  line-height: 50px; /* Helps center icon vertically */
  text-align: center; /* Helps center icon horizontally */
}

#moveToTopBtn.show {
  /* Class added by JavaScript when visible */
  opacity: 1;
  visibility: visible;
}

#moveToTopBtn:hover {
  background-color: #c3037e; /* Darker pink on hover */
}

/* Ensure it's hidden when printing (using existing no-print class) */
@media print {
  #moveToTopBtn {
    display: none !important;
  }
}
/* Custom styles beyond the predefined blog_styles.css */
.case-law {
  border-left: 4px solid #4f46e5;
  background-color: #f8fafc;
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin: 1.5rem 0;
  border: 1px solid #e5e7eb;
}

.highlight-box {
  background-color: #f0f5ff;
  padding: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid #c7d2fe;
  border-left: 4px solid #6366f1;
  margin: 1.5rem 0;
}

.timeline-item {
  border-left: 2px solid #4f46e5;
  padding-left: 20px;
  padding-bottom: 25px;
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 0;
  width: 14px;
  height: 14px;
  background: #4f46e5;
  border-radius: 50%;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.tag-legal {
  background-color: #e0e7ff;
  color: #3730a3;
}

.tag-family {
  background-color: #d1fae5;
  color: #065f46;
}

.tag-case {
  background-color: #dbeafe;
  color: #1e40af;
}

.fade-in {
  animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
