/* Blog-specific styles extending the main CV styles */
/* Design tokens + a11y aligned with .cursor/skills/ui-ux-pro-max */

:root {
  --blog-color-text: #1e293b;
  --blog-color-text-muted: #64748b;
  --blog-color-surface: #ffffff;
  --blog-color-bg: #f1f5f9;
  --blog-color-border: #e2e8f0;
  --blog-color-primary: #2563eb;
  --blog-color-primary-hover: #1d4ed8;
  --blog-color-primary-soft: rgba(37, 99, 235, 0.12);
  --blog-color-accent-start: #4f46e5;
  --blog-color-accent-end: #7c3aed;
  --blog-radius-sm: 8px;
  --blog-radius-md: 12px;
  --blog-radius-lg: 16px;
  --blog-shadow-header: 0 1px 3px rgba(15, 23, 42, 0.08);
  --blog-shadow-card: 0 2px 8px rgba(15, 23, 42, 0.08);
  --blog-shadow-card-hover: 0 16px 32px rgba(15, 23, 42, 0.12);
  --blog-focus-ring: 2px solid var(--blog-color-primary);
  --blog-focus-offset: 2px;
  --blog-touch-min: 44px;
  --blog-font-body: "Roboto", system-ui, sans-serif;
  --blog-font-heading: "Montserrat", system-ui, sans-serif;
  --blog-hero-shadow: 0 12px 40px rgba(79, 70, 229, 0.22);
}

.blog-page {
  color: var(--blog-color-text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.blog-results-status {
  font-size: 0.9375rem;
  color: var(--blog-color-text-muted);
  margin-bottom: 1rem;
  min-height: 1.5em;
}

.blog-page .skip-link:focus {
  z-index: 10002;
}

/* Focus visible: keyboard users only (WCAG) */
.blog-page a:focus-visible,
.blog-page button:focus-visible,
.blog-page input:focus-visible,
.blog-page select:focus-visible {
  outline: var(--blog-focus-ring);
  outline-offset: var(--blog-focus-offset);
}

.blog-page .search-input:focus-visible,
.blog-page .filter-select:focus-visible {
  outline: none;
  border-color: var(--blog-color-primary);
  box-shadow: 0 0 0 3px var(--blog-color-primary-soft);
}

@media (prefers-reduced-motion: reduce) {
  .blog-post-card {
    transition: none;
  }

  .blog-post-card:hover {
    transform: none;
  }

  .blog-hero,
  .nav-link,
  .blog-title-link,
  .post-card-link {
    transition: none;
  }
}

/* ========== GLOBAL FIXES ========== */
body.blog-page,
body.blog-post-page {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  background-color: var(--blog-color-bg);
  position: relative;
}

html {
  overflow-x: hidden;
  max-width: 100%;
}

* {
  max-width: 100%;
  box-sizing: border-box;
}

img, video, iframe, embed, object {
  max-width: 100%;
  height: auto;
  display: block;
}

table {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  display: block;
  border-collapse: collapse;
}

table thead,
table tbody {
  display: block;
}

table tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

/* ========== CONTAINER FIXES ========== */
.blog-main .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .blog-main .container {
    padding: 0 24px;
  }
}

/* ========== BLOG HEADER ========== */
.blog-header {
  border-bottom: 1px solid var(--blog-color-border);
  padding: 20px 0;
  margin-bottom: 0;
  background: linear-gradient(
    135deg,
    var(--blog-color-surface) 0%,
    var(--blog-color-bg) 100%
  );
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--blog-shadow-header);
  width: 100%;
  box-sizing: border-box;
}

.blog-header .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .blog-header {
    padding: 16px 0;
  }
  
  .blog-header .container {
    padding: 0 16px;
  }
}

.blog-header .header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.blog-title {
  font-family: var(--blog-font-heading);
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 700;
  color: var(--blog-color-text);
  margin: 0;
  letter-spacing: -0.02em;
}

.blog-title-link {
  color: var(--blog-color-text);
  text-decoration: none;
  transition: color 0.2s ease;
  border-radius: var(--blog-radius-sm);
}

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

.blog-tagline {
  font-size: 0.8125rem;
  color: var(--blog-color-text-muted);
  margin: 6px 0 0 0;
  font-weight: 400;
}

.blog-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-link {
  font-size: 0.9375rem;
  color: var(--blog-color-text);
  text-decoration: none;
  padding: 0.625rem 1.25rem;
  min-height: var(--blog-touch-min);
  min-width: var(--blog-touch-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--blog-radius-sm);
  transition: color 0.2s ease, background-color 0.2s ease;
  font-weight: 500;
  box-sizing: border-box;
}

.nav-link:hover {
  color: var(--blog-color-primary);
  background-color: var(--blog-color-bg);
}

.nav-link.active {
  color: var(--blog-color-primary);
  font-weight: 600;
  background-color: var(--blog-color-primary-soft);
}

/* ========== BLOG MAIN ========== */
.blog-main {
  min-height: calc(100dvh - 200px);
  padding: 60px 0;
  background-color: var(--blog-color-bg);
  width: 100%;
}

.blog-post-main {
  min-height: calc(100vh - 200px);
  padding: 40px 0;
  background-color: #f8f9fa;
  width: 100%;
}

.blog-post-main .container {
  max-width: 1400px;
  padding: 0 40px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .blog-post-main .container {
    padding: 0 24px;
  }
}

/* ========== HERO SECTION ========== */
.blog-hero {
  text-align: center;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 3rem;
  background: linear-gradient(
    135deg,
    var(--blog-color-accent-start) 0%,
    var(--blog-color-accent-end) 100%
  );
  border-radius: var(--blog-radius-lg);
  color: #fff;
  box-shadow: var(--blog-hero-shadow);
}

.hero-title {
  font-family: var(--blog-font-heading);
  font-size: clamp(1.75rem, 5vw, 2.625rem);
  font-weight: 700;
  color: #fff;
  margin: 0 0 1rem 0;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-wrap: balance;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.hero-description {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  color: rgba(255, 255, 255, 0.95);
  max-width: 42rem;
  margin: 0 auto;
  line-height: 1.65;
  font-weight: 400;
}

@media (max-width: 768px) {
  .blog-hero {
    margin-bottom: 2.5rem;
  }
}

/* ========== BLOG CONTROLS ========== */
.blog-controls {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  align-items: center;
  background: var(--blog-color-surface);
  padding: 1.5rem;
  border-radius: var(--blog-radius-md);
  box-shadow: var(--blog-shadow-card);
  border: 1px solid var(--blog-color-border);
}

.search-container {
  position: relative;
  flex: 1;
  min-width: 250px;
  max-width: 500px;
}

.search-input {
  width: 100%;
  min-height: var(--blog-touch-min);
  padding: 0.75rem 1rem 0.75rem 3rem;
  font-size: 1rem;
  border: 2px solid var(--blog-color-border);
  border-radius: var(--blog-radius-sm);
  font-family: var(--blog-font-body);
  transition: border-color 0.2s ease, background-color 0.2s ease,
    box-shadow 0.2s ease;
  background-color: var(--blog-color-bg);
  color: var(--blog-color-text);
  touch-action: manipulation;
}

.search-input:focus {
  outline: none;
  border-color: var(--blog-color-primary);
  background-color: var(--blog-color-surface);
  box-shadow: 0 0 0 3px var(--blog-color-primary-soft);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  pointer-events: none;
}

.filter-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-label {
  font-size: 0.9375rem;
  color: var(--blog-color-text);
  font-weight: 600;
  white-space: nowrap;
}

.filter-select {
  min-height: var(--blog-touch-min);
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--blog-color-border);
  border-radius: var(--blog-radius-sm);
  font-family: var(--blog-font-body);
  background-color: var(--blog-color-surface);
  color: var(--blog-color-text);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-width: 10rem;
}

.filter-select:focus {
  outline: none;
  border-color: var(--blog-color-primary);
  box-shadow: 0 0 0 3px var(--blog-color-primary-soft);
}

/* ========== BLOG POSTS GRID ========== */
.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 32px;
  margin-bottom: 60px;
}

.blog-post-card {
  background-color: var(--blog-color-surface);
  border: 1px solid var(--blog-color-border);
  border-radius: var(--blog-radius-md);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--blog-shadow-card);
  height: 100%;
}

.blog-post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--blog-shadow-card-hover);
}

.post-card-content {
  padding: 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 10pt;
  color: #6c757d;
  flex-wrap: wrap;
  align-items: center;
}

.post-card-category {
  background: linear-gradient(
    135deg,
    var(--blog-color-accent-start) 0%,
    var(--blog-color-accent-end) 100%
  );
  color: #fff;
  padding: 0.35rem 0.875rem;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
}

.post-card-date {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6c757d;
}

.post-card-title {
  font-family: var(--blog-font-heading);
  font-size: clamp(1.125rem, 2.5vw, 1.25rem);
  font-weight: 700;
  color: var(--blog-color-text);
  margin: 0 0 1rem 0;
  line-height: 1.35;
}

.post-card-title a {
  color: var(--blog-color-text);
  text-decoration: none;
  transition: color 0.2s ease;
  border-radius: 4px;
}

.post-card-title a:hover {
  color: var(--blog-color-primary);
}

.post-card-excerpt {
  font-size: 0.9375rem;
  color: var(--blog-color-text-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
  flex: 1;
  max-width: 65ch;
}

.post-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
  margin-top: auto;
}

.post-card-reading-time {
  font-size: 10pt;
  color: #6c757d;
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-card-link {
  font-size: 0.9375rem;
  color: var(--blog-color-primary);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: var(--blog-touch-min);
  padding: 0.25rem 0;
  transition: color 0.2s ease, gap 0.2s ease;
}

.post-card-link:hover {
  gap: 0.5rem;
  color: var(--blog-color-primary-hover);
}

.no-posts-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: #6c757d;
  font-size: 14pt;
  background: white;
  border-radius: 12px;
}

/* ========== PAGINATION ========== */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 60px;
  padding: 30px 0;
}

.pagination-btn {
  min-height: var(--blog-touch-min);
  padding: 0.5rem 1.25rem;
  font-size: 0.9375rem;
  border: 2px solid var(--blog-color-border);
  background-color: var(--blog-color-surface);
  color: var(--blog-color-text);
  border-radius: var(--blog-radius-sm);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  font-family: var(--blog-font-body);
  font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--blog-color-primary);
  background-color: var(--blog-color-primary);
  color: #fff;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 11pt;
  color: #6c757d;
}

/* ========== BLOG POST PAGE ========== */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  width: 0%;
  z-index: 1001;
  transition: width 0.1s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.breadcrumb {
  margin-bottom: 30px;
  /* max-width: 1200px; */
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px;
}

.breadcrumb-list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 10pt;
}

.breadcrumb-list li {
  display: flex;
  align-items: center;
}

.breadcrumb-list li:not(:last-child)::after {
  content: "/";
  margin-left: 10px;
  color: #adb5bd;
}

.breadcrumb-list a {
  color: #6c757d;
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-list a:hover {
  color: #3498db;
}

.breadcrumb-list li[aria-current="page"] {
  color: #2c3e50;
  font-weight: 600;
}

/* ========== ARTICLE ========== */
.blog-post-article {
  /* max-width: 1200px; */
  width: 100%;
  margin: 0 auto 60px;
  background-color: transparent;
  padding: 40px 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 50px;
  align-items: start;
  position: relative;
  box-sizing: border-box;
  overflow: visible;
  grid-auto-rows: min-content;
}

@media (max-width: 1024px) {
  .blog-post-article {
    grid-template-columns: 200px 1fr;
    gap: 40px;
    padding: 30px 0;
  }
}

@media (max-width: 968px) {
  .blog-post-article {
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 40px;
    padding: 30px 0;
  }

  .table-of-contents {
    display: none;
  }

  .post-content {
    grid-column: 1 / -1;
  }
}

.post-header {
  margin-bottom: 50px;
  padding-bottom: 30px;
  border-bottom: 1px solid #e9ecef;
  grid-column: 1 / -1;
  grid-row: 1;
  background-color: transparent;
}

.post-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  font-size: 10pt;
  color: #6c757d;
  flex-wrap: wrap;
  align-items: center;
}

.post-category {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 9pt;
  letter-spacing: 0.5px;
}

.post-date {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-reading-time {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-title {
  font-family: "Montserrat", sans-serif;
  font-size: 36pt;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 20px 0;
  line-height: 1.2;
  word-wrap: break-word;
  overflow-wrap: break-word;
  letter-spacing: -1px;
}

@media (max-width: 968px) {
  .post-title {
    font-size: 28pt;
  }
}

.post-excerpt {
  font-size: 16pt;
  color: #495057;
  line-height: 1.7;
  margin: 0;
  font-weight: 300;
}

/* ========== DONATION / SUPPORT (Paytm QR) ========== */
.post-donation {
  grid-column: 1 / -1;
  grid-row: 4;
  margin: 40px 0 0 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

.post-donation-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 32px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f0fdfa 0%, #ecfeff 50%, #f8fafc 100%);
  border: 1px solid #99f6e4;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(13, 148, 136, 0.08);
}

.post-donation-text {
  flex: 1 1 220px;
  min-width: 0;
}

.post-donation-title {
  font-family: "Montserrat", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f766e;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.post-donation-message {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #475569;
  margin: 0;
}

.post-donation-qr-wrap {
  flex: 0 0 auto;
  text-align: center;
}

.post-donation-qr {
  width: 100%;
  max-width: 280px;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.post-donation-hint {
  margin: 8px 0 0 0;
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
}

.post-donation-upi {
  margin: 6px 0 0 0;
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.4;
}

.post-donation-upi-id {
  font-family: ui-monospace, "Cascadia Code", "Fira Code", monospace;
  user-select: all;
  word-break: break-all;
}

.post-donation-upi-link {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.post-donation-upi-link:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

@media (max-width: 968px) {
  .post-donation-inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .post-donation-text {
    text-align: center;
  }

  .post-donation-qr-wrap {
    margin: 0 auto;
  }
}

/* ========== TABLE OF CONTENTS ========== */
.table-of-contents {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  border: none;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  overflow-x: hidden;
  align-self: start;
  width: 100%;
  max-width: 240px;
  min-width: 0;
  box-sizing: border-box;
  box-shadow: none;
  grid-column: 1;
  grid-row: 2;
  z-index: 1;
  isolation: isolate;
  contain: layout style;
}

.toc-title {
  font-family: "Montserrat", sans-serif;
  font-size: 11pt;
  font-weight: 700;
  color: #495057;
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 10px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 8px;
}

.toc-list a {
  color: #495057;
  text-decoration: none;
  font-size: 10.5pt;
  transition: all 0.2s ease;
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  line-height: 1.5;
  position: relative;
}

.toc-list a:hover {
  color: #3498db;
  background-color: #f8f9fa;
}

.toc-list a.active {
  color: #3498db;
  background-color: #e3f2fd;
  font-weight: 600;
}

.toc-list a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background-color: #3498db;
  border-radius: 0 2px 2px 0;
}

/* Nested TOC items (h3 under h2) */
.toc-list li {
  position: relative;
}

.toc-list li li {
  margin-left: 0;
  margin-top: 2px;
  padding-left: 0;
}

.toc-list li li a {
  font-size: 10pt;
  padding: 6px 12px 6px 28px;
  color: #6c757d;
}

.toc-list li li a:hover {
  color: #3498db;
  background-color: #f8f9fa;
}

.toc-list li li a.active {
  color: #3498db;
  background-color: #e3f2fd;
}

.toc-list li li a.active::before {
  left: 16px;
}

.toc-list ul {
  list-style: none;
  padding: 0;
  margin: 4px 0 0 0;
}

/* Scrollbar styling for TOC */
.table-of-contents::-webkit-scrollbar {
  width: 6px;
}

.table-of-contents::-webkit-scrollbar-track {
  background: #f1f3f5;
  border-radius: 3px;
}

.table-of-contents::-webkit-scrollbar-thumb {
  background: #adb5bd;
  border-radius: 3px;
}

.table-of-contents::-webkit-scrollbar-thumb:hover {
  background: #6c757d;
}

@media (max-width: 1024px) {
  .table-of-contents {
    top: 90px;
    max-height: calc(100vh - 110px);
    padding: 0;
    max-width: 200px;
  }
}

@media (max-width: 968px) {
  .table-of-contents {
    display: none;
  }
}

/* ========== POST CONTENT ========== */
.post-content {
  font-size: 16px; /* Increased from 13pt for better readability */
  line-height: 1.8; /* Improved line spacing */
  color: #2c3e50;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  isolation: isolate;
  background-color: white;
  padding: 2rem 1.5rem; /* Using rem for better scalability */
}

@media (max-width: 968px) {
  .post-content {
    padding: 20px;
  }
}

/* Callout boxes for important information */
.callout {
  padding: 1.25rem 1.5rem; /* Using rem for better scalability */
  margin: 2rem 0; /* Better spacing */
  border-radius: 8px;
  border-left: 4px solid;
  box-shadow: none;
  background-color: #f8f9fa;
  font-size: 1rem; /* Ensure readable text */
  line-height: 1.7;
}

.callout-warning {
  background-color: #fff3cd;
  border-left-color: #ffc107;
}

.callout-success {
  background-color: #d1e7dd;
  border-left-color: #28a745;
}

.callout-info {
  background-color: #d1ecf1;
  border-left-color: #17a2b8;
}

.callout p {
  margin: 0;
  color: #495057;
}

.callout strong {
  display: block;
  margin-bottom: 0.75rem; /* Better spacing */
  font-size: 1.1rem; /* More readable */
  font-weight: 700;
}

/* Key Takeaways section */
.key-takeaways {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  border: none;
  border-top: 2px solid #e9ecef;
  border-bottom: 2px solid #e9ecef;
  margin: 3rem 0; /* Better spacing with rem */
  box-shadow: none;
  padding: 2rem 0; /* Better spacing */
}

.key-takeaways h3 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.25rem; /* Using rem */
  font-weight: 700;
  color: #2c3e50;
  margin: 1.5rem 0 1rem 0; /* Better spacing */
  line-height: 1.4;
}

.key-takeaways h3:first-child {
  margin-top: 0;
}

.key-takeaways ul,
.key-takeaways ol {
  margin: 1.25rem 0; /* Better spacing */
  padding-left: 2rem; /* Using rem */
  line-height: 1.8;
}

.key-takeaways li {
  margin-bottom: 0.875rem; /* Better spacing */
  line-height: 1.8;
  color: #495057;
  font-size: 1rem; /* Ensure readable text */
}

.post-content h2 {
  font-family: "Montserrat", sans-serif;
  font-size: 2rem; /* Using rem for better scalability */
  font-weight: 700;
  color: #2c3e50;
  margin: 3rem 0 1.5rem 0; /* Better spacing with rem */
  padding-top: 0;
  border-top: none;
  scroll-margin-top: 120px;
  letter-spacing: -0.5px;
  line-height: 1.3;
}

.post-content h2:first-of-type {
  margin-top: 0;
}

.post-content h3 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.5rem; /* Using rem for better scalability */
  font-weight: 600;
  color: #2c3e50;
  margin: 2.5rem 0 1.25rem 0; /* Better spacing with rem */
  scroll-margin-top: 120px;
  line-height: 1.4;
}

.post-content h4 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.25rem; /* Using rem for better scalability */
  font-weight: 600;
  color: #495057;
  margin: 2rem 0 1rem 0; /* Better spacing */
  line-height: 1.4;
}

.post-content p {
  margin-bottom: 1.5rem; /* Better spacing with rem */
  text-align: left;
  color: #495057;
  max-width: 100%;
  line-height: 1.8; /* Improved readability */
}

.post-content ul,
.post-content ol {
  margin: 1.5rem 0; /* Better spacing */
  padding-left: 2rem; /* Using rem */
  line-height: 1.8;
}

.post-content li {
  margin-bottom: 14px;
  line-height: 1.8;
  color: #495057;
}

.post-content a {
  color: #3498db;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
  font-weight: 500;
}

.post-content a:hover {
  color: #2980b9;
  border-bottom-color: #2980b9;
}

.post-content blockquote {
  border-left: 4px solid #3498db;
  padding-left: 24px;
  margin: 32px 0;
  font-style: italic;
  color: #6c757d;
  max-width: 100%;
  box-sizing: border-box;
  background-color: #f8f9fa;
  padding: 20px 24px;
  border-radius: 8px;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 32px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ========== CODE BLOCKS ========== */
.post-content pre {
  background: #1e1e1e;
  border-radius: 8px;
  padding: 1.5rem; /* Increased padding for better readability */
  padding-top: 3rem; /* Extra space for copy button */
  overflow-x: auto;
  margin: 2rem 0; /* Better spacing */
  position: relative;
  border: none;
  color: white;
  max-width: 100%;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  -webkit-overflow-scrolling: touch;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: 14px; /* Increased from 11pt for better code readability */
  line-height: 1.6;
}

/* Better spacing around code blocks */
.post-content h2 + pre,
.post-content h3 + pre {
  margin-top: 1.5rem;
}

.post-content pre + h2,
.post-content pre + h3 {
  margin-top: 2.5rem;
}

/* Add spacing after code blocks before paragraphs */
.post-content pre + p {
  margin-top: 1.5rem;
}

/* Copy button for code blocks */
.post-content pre .copy-code-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: #2d2d2d;
  color: #d4d4d4;
  border: 1px solid #404040;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-family: "Roboto", sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  opacity: 0.8;
}

.post-content pre:hover .copy-code-btn {
  opacity: 1;
}

.post-content pre .copy-code-btn:hover {
  background: #3d3d3d;
  border-color: #505050;
  color: #fff;
}

.post-content pre .copy-code-btn:active {
  background: #1d1d1d;
}

.post-content pre .copy-code-btn.copied {
  background: #28a745;
  border-color: #28a745;
  color: #fff;
}

.post-content pre code {
  font-family: "Fira Code", "Courier New", Courier, monospace;
  font-size: 14px; /* Increased from 11pt for better readability */
  line-height: 1.6;
  color: white;
  display: block;
  white-space: pre;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  /* Ensure syntax highlighting is visible - Prism.js will override colors */
  background: transparent !important;
}

/* HTML examples can look visually heavy; keep only HTML code blocks smaller. */
.post-content pre code.language-html {
  font-size: 12.5px;
}

/* Ensure Prism.js syntax highlighting is visible */
.post-content pre code[class*="language-"] {
  background: transparent !important;
}

.post-content pre code .token {
  /* Prism.js tokens will have their own colors */
}

.post-content code {
  background-color: #f1f3f5;
  padding: 0.2em 0.4em; /* Using em for better scaling */
  border-radius: 4px;
  font-family: "Fira Code", "Courier New", Courier, monospace;
  font-size: 0.9em; /* Relative to parent font size */
  color: #e83e8c;
  border: 1px solid #e9ecef;
  font-weight: 500;
}

.post-content pre code {
  background: none;
  padding: 0;
  border: none;
  color: inherit;
  font-weight: normal;
}

/* ========== POST FOOTER ========== */
.post-footer {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid #e9ecef;
  grid-column: 2 / -1;
  grid-row: 3;
  width: 100%;
  box-sizing: border-box;
  background-color: transparent;
}

@media (max-width: 968px) {
  .post-footer {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .post-donation {
    grid-column: 1 / -1;
    grid-row: 4;
  }
}

.post-tags {
  margin-bottom: 32px;
}

.tags-label {
  font-size: 11pt;
  font-weight: 600;
  color: #495057;
  margin-right: 12px;
}

.tags-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tags-list a {
  background-color: #f8f9fa;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 10pt;
  color: #495057;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid #e9ecef;
  font-weight: 500;
}

.tags-list a:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.post-share {
  margin-bottom: 40px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  border: none;
}

.share-label {
  font-size: 11pt;
  font-weight: 600;
  color: #495057;
  margin-right: 12px;
  display: block;
  margin-bottom: 16px;
}

.share-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.share-btn {
  padding: 12px 24px;
  font-size: 11pt;
  border: 2px solid #e9ecef;
  background-color: white;
  color: #495057;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Roboto", sans-serif;
  text-decoration: none;
  display: inline-block;
  font-weight: 500;
}

.share-btn:hover {
  border-color: #3498db;
  background-color: #3498db;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.post-author {
  display: flex;
  gap: 24px;
  padding: 30px 0;
  background: transparent;
  border-radius: 0;
  margin-top: 40px;
  width: 100%;
  box-sizing: border-box;
  border-top: 1px solid #e9ecef;
  border-bottom: 1px solid #e9ecef;
}

@media (max-width: 768px) {
  .post-author {
    flex-direction: column;
    text-align: center;
    padding: 28px 24px;
  }
}

.author-avatar {
  flex-shrink: 0;
}

.author-avatar img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.author-info {
  flex: 1;
}

.author-name {
  font-family: "Montserrat", sans-serif;
  font-size: 16pt;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 10px 0;
}

.author-bio {
  font-size: 11pt;
  color: #495057;
  line-height: 1.7;
  margin: 0 0 16px 0;
}

.author-links {
  display: flex;
  gap: 20px;
}

.author-links a {
  font-size: 11pt;
  color: #3498db;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.author-links a:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* ========== RELATED POSTS ========== */
.related-posts {
  margin-top: 80px;
  padding-top: 50px;
  border-top: 2px solid #e9ecef;
  /* max-width: 1200px; */
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
  padding-left: 24px;
  padding-right: 24px;
}

.related-posts-title {
  font-family: "Montserrat", sans-serif;
  font-size: 22pt;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 40px 0;
  letter-spacing: -0.5px;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
}

/* ========== POST NAVIGATION ========== */
.post-navigation {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid #e9ecef;
  /* max-width: 1200px; */
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
  padding-left: 24px;
  padding-right: 24px;
}

.nav-link-back {
  font-size: 11pt;
  color: #3498db;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  padding: 12px 20px;
  background-color: white;
  border-radius: 8px;
  border: 2px solid #e9ecef;
}

.nav-link-back:hover {
  gap: 14px;
  border-color: #3498db;
  background-color: #e3f2fd;
}

/* ========== BLOG FOOTER ========== */
.blog-footer {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  padding: 3rem 1.5rem;
  margin-top: 5rem;
  border-top: none;
  width: 100%;
  box-sizing: border-box;
  color: #fff;
}

.blog-footer .container {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.footer-text {
  font-size: 10pt;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 20px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration 0.2s ease;
  font-weight: 500;
  min-height: var(--blog-touch-min);
  padding: 0.5rem 0.75rem;
  display: inline-flex;
  align-items: center;
  border-radius: var(--blog-radius-sm);
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
  .blog-main,
  .blog-post-main {
    padding: 20px 0;
  }

  .blog-main .container,
  .blog-post-main .container {
    padding: 0 16px;
  }

  .blog-controls {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  .search-container {
    max-width: 100%;
  }

  .blog-posts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .blog-post-article {
    padding: 20px 0;
    margin-bottom: 30px;
    gap: 30px;
  }

  .post-title {
    font-size: 22pt;
    line-height: 1.3;
  }

  .post-excerpt {
    font-size: 13pt;
    line-height: 1.6;
  }

  .post-content {
    font-size: 15px; /* Increased from 10.5pt for better mobile readability */
    padding: 1rem; /* Using rem for better scalability */
    line-height: 1.75;
    grid-column: 1 / -1;
  }

  .post-content h2 {
    font-size: 1.75rem; /* Using rem */
    margin: 2.5rem 0 1.25rem 0; /* Better spacing */
    scroll-margin-top: 80px;
    line-height: 1.3;
  }

  .post-content h3 {
    font-size: 1.375rem; /* Using rem */
    margin: 2rem 0 1rem 0; /* Better spacing */
    scroll-margin-top: 80px;
    line-height: 1.4;
  }

  .post-content h4 {
    font-size: 1.125rem; /* Using rem */
    margin: 1.5rem 0 0.75rem 0; /* Better spacing */
  }

  .post-content p {
    margin-bottom: 1.25rem; /* Better spacing */
    line-height: 1.8;
  }

  .post-content ul,
  .post-content ol {
    padding-left: 1.5rem; /* Using rem */
    margin: 1.25rem 0; /* Better spacing */
  }

  .post-content li {
    margin-bottom: 0.75rem; /* Better spacing */
    line-height: 1.8; /* Improved readability */
  }

  .post-content pre {
    padding: 1rem; /* Using rem */
    padding-top: 2.5rem; /* Space for copy button */
    font-size: 13px; /* Increased from 9pt for better mobile readability */
    line-height: 1.6;
    margin: 1.5rem 0; /* Better spacing */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    word-wrap: break-word;
    white-space: pre-wrap;
  }

  .post-content pre .copy-code-btn {
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
  }

  .post-content pre code {
    font-size: 13px; /* Increased from 9pt */
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
  }

  .post-content code {
    font-size: 0.85em; /* Relative sizing */
    padding: 0.15em 0.35em; /* Using em */
  }

  .callout {
    padding: 1rem 1.125rem; /* Using rem */
    margin: 1.5rem 0; /* Better spacing */
    font-size: 0.95rem; /* More readable */
  }

  .callout strong {
    font-size: 1.05rem; /* More readable */
    margin-bottom: 0.5rem;
  }

  .key-takeaways {
    padding: 20px 0;
    margin: 40px 0;
  }

  .key-takeaways h3 {
    font-size: 14pt;
    margin: 20px 0 12px 0;
  }

  .key-takeaways ul,
  .key-takeaways ol {
    padding-left: 24px;
  }

  .related-posts-grid {
    grid-template-columns: 1fr;
  }

  .breadcrumb {
    padding: 0 16px;
    margin-bottom: 16px;
  }

  .breadcrumb-list {
    font-size: 9pt;
  }

  .table-of-contents {
    display: none;
  }

  .post-meta {
    font-size: 9pt;
    gap: 12px;
    flex-wrap: wrap;
  }

  .post-category {
    font-size: 8pt;
    padding: 6px 12px;
  }

  .post-share {
    padding: 20px 16px;
  }

  .post-share h3 {
    font-size: 12pt;
  }

  .share-buttons {
    gap: 10px;
  }

  .share-btn {
    padding: 10px 16px;
    font-size: 9.5pt;
  }
}

@media (max-width: 480px) {
  body.blog-page,
  body.blog-post-page {
    font-size: 10pt;
  }

  .blog-main,
  .blog-post-main {
    padding: 16px 0;
  }

  .blog-main .container,
  .blog-post-main .container {
    padding: 0 12px;
  }

  .blog-header .container {
    padding: 0 12px;
  }

  .blog-header {
    padding: 12px 0;
  }

  .blog-title {
    font-size: 18pt;
  }

  .blog-tagline {
    font-size: 10pt;
  }

  .nav-link {
    font-size: 10pt;
    padding: 8px 16px;
  }

  .blog-hero {
    padding: 40px 16px;
    margin-bottom: 24px;
  }

  .hero-title {
    font-size: 22pt;
    line-height: 1.2;
  }

  .hero-description {
    font-size: 12pt;
  }

  .blog-post-article {
    padding: 16px 0;
    margin-bottom: 20px;
    gap: 24px;
  }

  .post-title {
    font-size: 18pt;
    line-height: 1.2;
    margin-bottom: 16px;
  }

  .post-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
  }

  .post-excerpt {
    font-size: 12pt;
    line-height: 1.6;
  }

  .post-content {
    font-size: 10pt;
    padding: 12px;
    line-height: 1.7;
    grid-column: 1 / -1;
  }

  .post-content h2 {
    font-size: 16pt;
    margin: 32px 0 16px 0;
    scroll-margin-top: 70px;
    line-height: 1.3;
  }

  .post-content h3 {
    font-size: 14pt;
    margin: 24px 0 12px 0;
    scroll-margin-top: 70px;
    line-height: 1.3;
  }

  .post-content h4 {
    font-size: 12pt;
    margin: 20px 0 10px 0;
  }

  .post-content p {
    margin-bottom: 14px;
    line-height: 1.7;
  }

  .post-content ul,
  .post-content ol {
    padding-left: 20px;
    margin: 14px 0;
  }

  .post-content li {
    margin-bottom: 0.625rem; /* Better spacing */
    line-height: 1.75; /* Improved readability */
  }

  .post-content pre {
    padding: 0.875rem; /* Using rem */
    padding-top: 2.25rem; /* Space for copy button */
    font-size: 12px; /* Increased from 8.5pt for better readability */
    line-height: 1.6;
    margin: 1.25rem 0; /* Better spacing */
    border-radius: 6px;
  }

  .post-content pre .copy-code-btn {
    top: 0.4rem;
    right: 0.4rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.65rem;
  }

  .post-content pre code {
    font-size: 12px; /* Increased from 8.5pt */
    line-height: 1.6;
  }

  .post-content code {
    font-size: 0.875em; /* Relative sizing */
    padding: 0.15em 0.3em; /* Using em */
  }

  .callout {
    padding: 0.875rem 1rem; /* Using rem */
    margin: 1.25rem 0; /* Better spacing */
    border-radius: 6px;
    font-size: 0.9rem; /* More readable */
  }

  .callout strong {
    font-size: 1rem; /* More readable */
    margin-bottom: 0.5rem;
  }

  .callout p {
    font-size: 0.9rem; /* More readable */
  }

  .key-takeaways {
    padding: 16px 0;
    margin: 32px 0;
  }

  .key-takeaways h3 {
    font-size: 13pt;
    margin: 16px 0 10px 0;
  }

  .key-takeaways ul,
  .key-takeaways ol {
    padding-left: 20px;
    margin: 12px 0;
  }

  .key-takeaways li {
    margin-bottom: 8px;
    font-size: 10pt;
    line-height: 1.6;
  }

  .table-of-contents {
    display: none;
  }

  .post-meta {
    font-size: 8.5pt;
    gap: 10px;
  }

  .post-category {
    font-size: 7.5pt;
    padding: 5px 10px;
  }

  .post-date,
  .post-reading-time {
    font-size: 8.5pt;
  }

  .breadcrumb {
    padding: 0 12px;
    margin-bottom: 12px;
  }

  .breadcrumb-list {
    font-size: 8.5pt;
    gap: 8px;
  }

  .post-share {
    padding: 16px 12px;
  }

  .post-share h3 {
    font-size: 11pt;
  }

  .share-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .share-btn {
    padding: 10px 14px;
    font-size: 9pt;
    width: 100%;
    justify-content: center;
  }

  .post-footer {
    margin-top: 40px;
    padding-top: 24px;
  }

  .tags-list a {
    font-size: 9pt;
    padding: 6px 12px;
  }

  .author-card {
    padding: 16px;
  }

  .author-name {
    font-size: 13pt;
  }

  .author-title {
    font-size: 10pt;
  }

  .author-bio {
    font-size: 9.5pt;
  }
}

/* Extra small devices (320px and below) */
@media (max-width: 320px) {
  .blog-main .container,
  .blog-post-main .container {
    padding: 0 8px;
  }

  .blog-header .container {
    padding: 0 8px;
  }

  .post-content {
    padding: 10px;
    font-size: 9.5pt;
  }

  .post-title {
    font-size: 16pt;
  }

  .post-content h2 {
    font-size: 14pt;
  }

  .post-content h3 {
    font-size: 12pt;
  }

  .post-content pre {
    padding: 10px;
    font-size: 8pt;
  }

  .post-content pre code {
    font-size: 8pt;
  }
}

/* ========== PRINT STYLES ========== */
@media print {
  .blog-header,
  .blog-footer,
  .blog-controls,
  .table-of-contents,
  .post-share,
  .related-posts,
  .post-navigation,
  .reading-progress {
    display: none;
  }

  .blog-post-article {
    box-shadow: none;
    padding: 0;
  }

  .post-content {
    font-size: 10pt;
  }

  .post-content pre {
    page-break-inside: avoid;
  }
}
