/* ============================================
   BLOG ARTICLE PAGE – Consistent with Home Design
   Base styles, buttons, and blog content only.
   Include this AFTER your main homepage CSS, or
   use it standalone for a consistent look.
   ============================================ */

/* --------------------------------------------
   1. BASE STYLES (copied from homepage)
   -------------------------------------------- */
body {
  background-color: #FFFFFF;
  color: #2C3E50;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  margin: 0;
  line-height: 1.6;
}

/* --------------------------------------------
   2. MODERN BUTTON (reusable component)
   -------------------------------------------- */
.btn-modern {
  background-color: #FFFFFF;
  color: #E67E22;
  border: 1px solid #DEE2E6;
  border-radius: 2rem;
  padding: 0.75rem 2rem;
  font-weight: 600;
  font-size: 1rem;
  text-transform: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.btn-modern:hover {
  background-color: #F8F9FA;
  border-color: #E67E22;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.btn-modern:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(230,126,34,0.2);
}

/* --------------------------------------------
   3. BLOG PAGE LAYOUT
   -------------------------------------------- */
.blog-wrapper {
  background-color: #F8F9FA;
  padding: 4rem 0;
}
.blog-wrapper .container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --------------------------------------------
   4. MAIN ARTICLE CARD
   -------------------------------------------- */
.blog-article {
  background: #FFFFFF;
  border: 1px solid #DEE2E6;
  border-radius: 1.25rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  padding: 2.5rem;
}

/* --------------------------------------------
   5. TYPOGRAPHY & CONTENT STYLES
   -------------------------------------------- */
.page-title {
  font-size: 2.5rem;
  font-weight: 600;
  color: #2C3E50;
  margin-top: 0;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.blog-article h2 {
  font-size: 2rem;
  font-weight: 600;
  color: #2C3E50;
  margin: 2.5rem 0 1rem 0;
  position: static;
  display: block;
}
.blog-article h2::after {
  display: none;  /* Remove orange underline from global h2 */
}

.blog-article h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2C3E50;
  margin: 2rem 0 1rem;
}

.blog-article p {
  margin: 1.2rem 0;
  line-height: 1.7;
  color: #2C3E50;
}

.blog-article a {
  color: #E67E22;
  text-decoration: none;
  transition: color 0.2s ease;
}
.blog-article a:hover {
  color: #CA6A16;  /* accent darkened ~8% */
  text-decoration: underline;
}

/* Tables */
.blog-article table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
  background: #FFFFFF;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.blog-article th {
  background: #2C3E50;
  color: #FFFFFF;
  font-weight: 500;
  padding: 1rem;
  text-align: left;
  border: none;
}
.blog-article td {
  padding: 1rem;
  border-bottom: 1px solid #DEE2E6;
}
.blog-article tr:last-child td {
  border-bottom: none;
}
.blog-article tbody tr:hover {
  background: #F8F9FA;
}

/* Code blocks */
.blog-article pre,
.blog-article code {
  background: #F8F9FA;
  border: 1px solid #DEE2E6;
  border-radius: 0.5rem;
  padding: 0.2rem 0.4rem;
  font-family: 'SF Mono', 'Courier New', monospace;
  font-size: 0.9rem;
}
.blog-article pre {
  padding: 1rem;
  overflow-x: auto;
}
.blog-article pre code {
  background: transparent;
  border: none;
  padding: 0;
}

/* Blockquotes */
.blog-article blockquote {
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid #E67E22;
  background: #F8F9FA;
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
  color: #4a5d6e; /* lighten(#2C3E50,15%) */
}

/* Images */
.blog-article img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 1.5rem 0;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* Lists */
.blog-article ul,
.blog-article ol {
  margin: 1rem 0 1.5rem 2rem;
  color: #2C3E50;
}
.blog-article li {
  margin: 0.5rem 0;
}

/* Meta information */
.blog-article .meta {
  font-size: 0.9rem;
  color: #6c7a8d; /* lighten(#2C3E50,25%) */
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #DEE2E6;
}

/* Button inside article */
.blog-article .btn-modern {
  margin: 1rem 0;
}

/* --------------------------------------------
   6. RESPONSIVE ADJUSTMENTS
   -------------------------------------------- */
@media (max-width: 768px) {
  .blog-wrapper {
    padding: 2rem 0;
  }
  .blog-article {
    padding: 1.5rem;
  }
  .page-title {
    font-size: 2rem;
  }
  .blog-article h2 {
    font-size: 1.75rem;
  }
  .blog-article h3 {
    font-size: 1.25rem;
  }
}

@media (max-width: 576px) {
  .blog-wrapper {
    padding: 1.5rem 0;
  }
  .blog-article {
    padding: 1.25rem;
  }
}


/* ============================================
   BLOG SIDEBAR – Consistent with Home Design
   Add this to your blog.css file.
   Assumes HTML structure:
   <main class="container blog-with-sidebar">
     <div class="blog-content">...</div>
     <aside class="blog-sidebar">...</aside>
   </main>
   ============================================ */

/* --------------------------------------------
   1. SIDEBAR LAYOUT
   -------------------------------------------- */
.blog-with-sidebar {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Main content area */
.blog-content {
  min-width: 0; /* prevent overflow */
}

/* Sidebar area */
.blog-sidebar {
  min-width: 0;
}

/* Responsive: sidebar below on mobile */
@media (max-width: 992px) {
  .blog-with-sidebar {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

/* --------------------------------------------
   2. SIDEBAR WIDGETS (common styling)
   -------------------------------------------- */
.blog-sidebar .widget {
  background: #FFFFFF;
  border: 1px solid #DEE2E6;
  border-radius: 1.25rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.blog-sidebar .widget:last-child {
  margin-bottom: 0;
}

/* Widget title – uses the same accent underline as global h2 */
.blog-sidebar .widget-title {
  position: relative;
  display: inline-block;
  margin: 0 0 1.5rem 0;
  font-weight: 600;
  font-size: 1.3rem;
  color: #2C3E50;
}
.blog-sidebar .widget-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 40px;
  height: 3px;
  background: #E67E22;
  border-radius: 2px;
}

/* Widget text */
.blog-sidebar .widget p {
  color: #2C3E50;
  line-height: 1.6;
  margin: 0 0 1rem 0;
}
.blog-sidebar .widget p:last-child {
  margin-bottom: 0;
}

/* Lists in widgets */
.blog-sidebar .widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.blog-sidebar .widget ul li {
  margin: 0.75rem 0;
  padding: 0;
}
.blog-sidebar .widget ul li a {
  color: #E67E22;
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.2s;
  display: block;
}
.blog-sidebar .widget ul li a:hover {
  color: #CA6A16;
  padding-left: 4px;
}

/* Divider between items */
.blog-sidebar .widget ul li:not(:last-child) {
  border-bottom: 1px solid #DEE2E6;
  padding-bottom: 0.75rem;
}

/* --------------------------------------------
   3. EXAMPLE WIDGET TYPES
   -------------------------------------------- */

/* Author / Profile card */
.widget-author {
  text-align: center;
}
.widget-author .author-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  border: 3px solid #E67E22;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.widget-author .author-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2C3E50;
  margin: 0.5rem 0 0.25rem;
}
.widget-author .author-title {
  font-size: 0.9rem;
  color: #6c7a8d;
  margin-bottom: 1rem;
}
.widget-author .author-bio {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #2C3E50;
}

/* Course info card */
.widget-course {
  background: #F8F9FA; /* soft grey variant */
}
.widget-course .course-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.widget-course .meta-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.widget-course .meta-icon {
  width: 32px;
  height: 32px;
  background: rgba(230,126,34,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #E67E22;
  font-size: 1rem;
}
.widget-course .meta-text {
  font-size: 0.95rem;
  color: #2C3E50;
}
.widget-course .meta-text strong {
  color: #2C3E50;
  font-weight: 600;
}

/* CTA button inside sidebar – reuse .btn-modern */
.widget .btn-modern {
  width: 100%;
  margin-top: 1rem;
  text-align: center;
}

/* Tags / categories */
.widget-tags .tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.widget-tags .tag {
  background: #F8F9FA;
  border: 1px solid #DEE2E6;
  border-radius: 2rem;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  color: #2C3E50;
  text-decoration: none;
  transition: all 0.2s ease;
}
.widget-tags .tag:hover {
  background: #E67E22;
  border-color: #E67E22;
  color: #FFFFFF;
}

/* --------------------------------------------
   4. SIDEBAR ALIGNMENT WITH BLOG ARTICLE
   -------------------------------------------- */
.blog-sidebar .blog-article { /* if article styles leak, reset */
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

/* Course information table – consistent with the design system */
.course-table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  background: #FFFFFF;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.course-table tr {
  border-bottom: 1px solid #DEE2E6;
}
.course-table tr:last-child {
  border-bottom: none;
}

.course-table th {
  background: #2C3E50;        /* primary */
  color: #FFFFFF;
  font-weight: 500;
  padding: 1rem 1.2rem;
  text-align: left;
  width: 40%;                  /* adjust as needed */
  white-space: nowrap;         /* prevents wrapping on larger screens */
}

.course-table td {
  padding: 1rem 1.2rem;
  background: #FFFFFF;
  color: #2C3E50;
}

/* subtle hover effect */
.course-table tr:hover td {
  background: #F8F9FA;         /* light background */
}

/* for better readability on small screens, stack the columns */
@media (max-width: 600px) {
  .course-table,
  .course-table tbody,
  .course-table tr,
  .course-table th,
  .course-table td {
    display: block;
    width: 100%;
  }

  .course-table tr {
    margin-bottom: 1rem;
    border: 1px solid #DEE2E6;
    border-radius: 0.5rem;
    overflow: hidden;
  }

  .course-table th {
    background: #2C3E50;
    color: white;
    padding: 0.75rem 1rem;
    width: auto;
  }

  .course-table td {
    padding: 0.75rem 1rem;
    border: none;
  }

  .course-table tr:hover td {
    background: #F8F9FA;
  }
}


/* Force container full width on small screens */
@media (max-width: 576px) {
  .blog-wrapper .container {
    padding-left: 0;
    padding-right: 0;
  }

  /* Make the article card edge‑to‑edge */
  .blog-article {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  /* For pages with sidebar, remove side padding from the grid container */
  .blog-with-sidebar {
    padding-left: 0;
    padding-right: 0;
  }

  /* Optional: let sidebar widgets also go full width */
  .blog-sidebar .widget {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* Homepage Filter Section */
.filter-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
}

.filter-form {
    width: 100%;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    flex: 1 1 180px;
    min-width: 160px;
}

.filter-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    color: #495057;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.95rem;
    background-color: white;
    transition: border-color 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.filter-group .btn-modern {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    margin-right: 0.5rem;
}

.btn-reset {
    background-color: #6c757d !important;
}

.btn-reset:hover {
    background-color: #5a6268 !important;
}

/* Course List */
.course-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.course-item {
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background-color: white;
    transition: box-shadow 0.2s;
}

.course-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.course-item h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.course-item h2 a {
    color: #212529;
    text-decoration: none;
}

.course-item h2 a:hover {
    color: #007bff;
}

.course-meta {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
    border-bottom: 1px dashed #dee2e6;
    padding-bottom: 0.5rem;
}

.course-excerpt {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.read-more {
    display: inline-block;
    font-weight: 600;
    color: #007bff;
    text-decoration: none;
}

.read-more:hover {
    text-decoration: underline;
}

/* --------------------------------------------
   PAGINATION – Responsive Fix
   -------------------------------------------- */
.pagination {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;          /* consistent spacing, no horizontal overflow */
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;    /* ensure consistent tap targets */
  padding: 0.5rem 0.7rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  text-decoration: none;
  color: #007bff;
  transition: background-color 0.2s;
  white-space: nowrap;   /* keep numbers from breaking */
}

.pagination a:hover {
  background-color: #e9ecef;
  border-color: #ced4da;
}

.pagination .current {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
}

/* On very small screens, reduce padding and min-width */
@media (max-width: 480px) {
  .pagination a,
  .pagination span {
    min-width: 2rem;
    padding: 0.4rem 0.5rem;
    font-size: 0.9rem;
  }
}