/* --- Styles for the Blog Pages --- */

.blog-hero {
  padding: 4rem 1rem;
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
   background-size: cover;
  background-position: center;
  color: var(--text-light);
  text-align: center;
  border-radius: var(--border-radius);
  margin-bottom: 2.5rem;
}

.blog-hero h1 {
  margin: 0;
  font-size: 3rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.blog-hero p {
  margin-top: 0.5rem;
  font-size: 1.2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.blog-layout {
  display: grid;
  /* Default layout for larger screens (desktop) */
  grid-template-columns: 3fr 1fr; /* 3/4 and 1/4 layout */
  gap: 2.5rem;
}
.blog-layout-center {
  display: grid;
  grid-template-columns: 1fr;
  max-width:70%;
  margin-left: auto;
  margin-right: auto;
}

.blog-main {
  grid-column: 1 / 2;
}

.blog-sidebar {
  grid-column: 2 / 3;
}

/* --- Article Preview (on main blog page) --- */
.article-preview {
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 2.5rem;
  overflow: hidden; /* Ensures image corners are rounded */
}

.article-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.article-preview .article-content {
  padding: 1.5rem 2rem;
}
.article-author {
  font-size: 1re;
  font-weight: bold;
  margin-bottom: 0;
}
.article-meta {
  font-size: 0.9rem;
  color: #777;
  margin-top: 0;
  margin-bottom: 1rem;
}

.article-preview h2 {
  margin-top: 0;
  color: var(--primary-color);
}

/* --- Full Article (on single article page) --- */
.article-full h1 {
  color: var(--primary-color);
  font-size: 2.5rem;
  margin-top: 0;
}

.article-full > img {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
}

.article-body {
  font-size: 1.1rem;
  line-height: 1.8;
}

.article-body h2 {
  color: var(--primary-hover);
  margin-top: 2.5rem;
}
.article-body code {
  font-family: var(--tamil-font);
  background-color: var(--secondary-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 1.2rem;
}

/* --- Sidebar Styling --- */
.sidebar-widget {
  background-color: var(--secondary-color);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  height: auto;
}

.sidebar-widget h3 {
  margin-top: 0;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
  color: var(--primary-color);
}

.recent-posts,
.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recent-posts li,
.category-list li {
  margin-bottom: 0.75rem;
}

.recent-posts a,
.category-list a {
  text-decoration: none;
  color: var(--text-color);
  transition: color 0.2s;
}

.recent-posts a:hover,
.category-list a:hover {
  color: var(--primary-color);
}
.recent-posts a.active {
  color: var(--primary-color);
  font-weight: bold;
}
.article-full table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 1em;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.article-full table thead tr {
  background-color: #3b82f6; /* A nice blue matching the image */
  color: #ffffff;
  text-align: left;
  font-weight: bold;
}
.article-full table th,
.article-full table td {
  padding: 12px 15px;
  text-align: left;
}
.article-full table tbody tr {
  border-bottom: 1px solid #dddddd;
  background-color: #f9f9f9;
}
.article-full table tbody tr:nth-of-type(even) {
  background-color: #ffffff;
}
.article-full table tbody tr:last-of-type {
  border-bottom: 2px solid #3b82f6;
}
.article-full table tbody tr:hover {
  background-color: #e2e8f0;
  color: #1e3a8a;
  cursor: pointer;
}
/* Ensure Tamil font is used where needed */
.article-full table td:nth-child(2) {
  font-family: 'Latha', 'Catamaran', sans-serif;
}

/* Styles for the new example list */
.example-list {
  margin-top: 1.5em;
  padding: 0;
  list-style-type: none;
}
.example-item {
  background-color: #f8f9fa;
  border-left: 4px solid #1e88e5;
  padding: 15px;
  margin-bottom: 1em;
  border-radius: 0 8px 8px 0;
}
.example-item .equation {
  font-weight: bold;
  font-size: 1.1em;
  color: #333;
  font-family: 'Latha', 'Catamaran', sans-serif;
}
.example-item .explanation {
  color: #2e7d32;
  margin: 0.5em 0;
}
.example-item .meaning {
  color: #555;
  font-style: italic;
}

/* --- Responsive Layout for Blog (Mobile-first approach) --- */
@media (max-width: 768px) {
  .blog-layout {
    /* On mobile, switch to a single-column layout using flexbox */
    display: flex;
    flex-direction: column;
  }
.blog-layout-center {
 
  max-width:100%;
 
}
  .blog-sidebar {
    /* Re-order the sidebar to appear before the main content on mobile */
    order: 2;
  }
  .article-content h2 {
    font-size: 1.3rem;
  }
}
