.filter-btn[data-filter="all"].active {
  background: #ede9fe;
  color: #7c3aed;
  font-weight: 700;
  transform: scale(1.07);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.1);
}

/* -----------------------------
   Single blog post (blog-post.html)
   Styles for the actual post page: header, meta, featured image, content
   ----------------------------- */
.blog-post-main {
  background: var(--bg);
}
.modern-blog-post {
  max-width: var(--container);
  margin: 0 auto;
}
.modern-categories {
  margin-bottom: 6px;
}
.modern-categories span {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #475569;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid rgba(10, 46, 92, 0.04);
  margin-right: 8px;
}

/* Hero area meta & description (rendered into #blog-post-hero) */
#blog-post-hero .modern-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #9ca3af; /* fainter */
  font-size: 0.95rem;
  padding-bottom: 12px; /* gap to image */
}

/* Tighten spacing between the date icon and date text. Inline styles in JS
   set a gap; override it here to bring icon and date closer together. */
#blog-post-hero .modern-date {
  display: inline-flex;
  align-items: center;
  gap: 2px !important; /* override inline gap:6px */
}
#blog-post-hero .modern-date svg {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  flex: 0 0 auto;
}

@media (max-width: 700px) {
  /* Bring date icon and text closer on mobile and reduce left spacing */
  #blog-post-hero .modern-date {
    gap: 2px !important;
    margin-left: 8px !important; /* smaller than desktop inline 12px */
  }
  #blog-post-hero .modern-date svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 480px) {
  #blog-post-hero .modern-date {
    gap: 2px !important;
    margin-left: 6px !important;
  }
  #blog-post-hero .modern-date svg {
    width: 14px;
    height: 14px;
  }
}

/* Very small phones: tighten date spacing further */
@media (max-width: 360px) {
  #blog-post-hero .modern-date {
    gap: 1px !important;
    margin-left: 4px !important;
  }
  #blog-post-hero .modern-date svg {
    width: 12px;
    height: 12px;
  }
  /* slightly lower the meta font size so lines don't wrap awkwardly */
  #blog-post-hero .modern-meta {
    font-size: 0.92rem;
  }
  /* cap hero cover height on very small devices */
  #blog-post-hero .modern-cover {
    max-height: 300px;
  }
}
#blog-post-hero .modern-description {
  color: #818181;
  margin-bottom: 24px;
  max-width: 820px;
}

#blog-post-hero .modern-cover {
  width: 100%;
  display: block;
  box-shadow: 0 16px 40px rgba(10, 30, 70, 0.08);
  max-height: 800px; /* larger desktop visual */
  object-fit: cover;
  margin-bottom: 24px;
}
.blog-post-container {
  max-width: 820px;
  margin: 24px auto 84px;
  padding: 0 16px;
  box-sizing: border-box;
}
.blog-post-container h1,
.blog-post-container .post-title {
  color: var(--primary-600);
  font-size: clamp(26px, 4.6vw, 38px);
  line-height: 1.06;
  margin: 0 0 10px 0;
  font-weight: 800;
}
.blog-post-container .post-meta {
  color: #818181; /* slightly fainter grey for meta */
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.25rem;
  margin-bottom: 18px;
  padding-bottom: 24px; /* create gap between meta and featured image */
}
.blog-post-container .featured-image {
  margin: 24px 0 28px 0; /* slightly larger vertical spacing */
}
.blog-post-container .featured-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(10, 30, 70, 0.08);
  max-height: 800px; /* larger desktop visual */
  object-fit: cover;
}
.blog-post-container .post-content {
  color: #374151;
  font-size: 1.05rem;
  line-height: 1.72;
}
.blog-post-container .post-content p {
  margin: 0 0 18px 0;
}
.blog-post-container .post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 18px 0;
  border-radius: 8px;
}

/* Category pill for single post meta */
.blog-post-container .post-meta .post-category {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #475569;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid rgba(10, 46, 92, 0.04);
}
.blog-post-container .post-content blockquote {
  margin: 18px 0;
  padding: 12px 18px;
  border-left: 4px solid var(--accent);
  background: rgba(56, 189, 248, 0.03);
  color: #0b3b8c;
  border-radius: 6px;
}
.blog-post-container .post-content ul,
.blog-post-container .post-content ol {
  margin: 0 0 18px 1.25rem;
}
.blog-post-container .post-content pre,
.blog-post-container .post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono",
    "Courier New", monospace;
  background: #f8fafc;
  padding: 10px;
  border-radius: 6px;
  overflow: auto;
}

@media (max-width: 700px) {
  .blog-post-container {
    max-width: 92vw;
    margin: 18px auto 56px;
    padding: 0 12px;
  }
  .blog-post-container .post-title,
  .blog-post-container h1 {
    font-size: 1.5rem;
  }
  .blog-post-container .post-content {
    font-size: 1rem;
    line-height: 1.6;
  }
  .blog-post-container .featured-image img {
    max-height: 360px; /* smaller cap on mobile */
  }
}

/* Blog Filter Buttons - Modern Pills */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

/* Make blog hero full-bleed (edge-to-edge) while keeping text constrained */
.page-blog .hero {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  /* keep existing vertical padding from .hero but ensure no horizontal extra padding */
  padding-left: 0;
  padding-right: 0;
}
.page-blog .hero .container {
  max-width: 1200px; /* constrain text */
  margin: 0 auto;
  padding: 0 24px; /* breathing room */
}

/* On very small screens, avoid horizontal scroll caused by 100vw */
@media (max-width: 640px) {
  .page-blog .hero {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}
.page-blog .section-head h2 {
  color: var(--primary); /* make "Latest Articles" navy */
}
.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0;
  justify-content: flex-end;
  align-items: center;
}
.filter-btn {
  border: none;
  outline: none;
  padding: 0.45rem 1.2rem; /* smaller pill */
  border-radius: 2rem;
  font-size: 0.95rem; /* reduced size */
  font-weight: 500;
  background: #f4f4f8;
  color: #4b4b6b;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.04);
  cursor: pointer;
  margin: 0;
  transition: background 0.25s, color 0.25s, transform 0.18s;
  position: relative;
}
.filter-btn.active {
  background: #ede9fe;
  color: #7c3aed;
  font-weight: 700;
  transform: scale(1.07);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.1);
}
.filter-btn[data-filter="branding"].active {
  background: #fef9c3;
  color: #b45309;
}
.filter-btn[data-filter="content"].active {
  background: #dcfce7;
  color: #15803d;
}
.filter-btn[data-filter="social"].active {
  background: #dbeafe;
  color: #2563eb;
}
.filter-btn[data-filter="tips"].active {
  background: #f3e8ff;
  color: #9333ea;
}
.filter-btn:active {
  transform: scale(0.97);
}
@media (max-width: 700px) {
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
  }
  .blog-filters {
    gap: 0.4rem;
    margin-bottom: 0.7rem;
    justify-content: flex-start;
  }
  .filter-btn {
    font-size: 0.92rem;
    padding: 0.5rem 0.9rem;
  }
}
/* Blog-specific styles moved from main.css */

.page-blog .blog-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: stretch;
  padding: 0 32px;
  width: 100%;
  grid-auto-rows: 1fr;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 1100px) {
  .page-blog .blog-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    max-width: 1200px;
  }
}
.page-blog .blog-card {
  display: flex;
  flex-direction: column;
  max-width: 340px;
  min-width: 0;
  margin: 0 auto;
  border-radius: 16px;
  position: relative;
  background: #ffffff;
  border: 1px solid rgba(10, 46, 92, 0.06); /* subtle border to separate from bg */
  box-shadow: 0 12px 30px rgba(10, 46, 92, 0.12); /* stronger boxed shadow so card reads as distinct */
  overflow: visible; /* allow image-wrapper to control clipping so bottom corners stay square */
  transition: transform 200ms cubic-bezier(0.2, 0.9, 0.2, 1),
    border-color 180ms ease;
  will-change: transform;
}
.page-blog .blog-card-image {
  width: 100%;
  height: 220px;
  overflow: hidden;
  position: relative;
}
.page-blog .blog-card {
  color: inherit;
  text-decoration: none;
}
.page-blog .blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.page-blog .blog-card:hover .blog-card-image img {
  transform: scale(1.04);
}

/* Enforce top-only corner rounding for images across all states (normal/hover/focus/active).
   Adds higher specificity to ensure browsers like Brave/Chromium render square bottoms. */
.page-blog .blog-card .blog-card-image img,
.page-blog .blog-card:hover .blog-card-image img,
.page-blog .blog-card:focus .blog-card-image img,
.page-blog .blog-card:active .blog-card-image img,
.blog-grid .blog-card .blog-card-image img,
.blog-grid .blog-card:hover .blog-card-image img,
.blog-grid .blog-card:focus .blog-card-image img,
.blog-grid .blog-card:active .blog-card-image img {
  border-radius: 16px 16px 0 0 !important;
  -webkit-clip-path: inset(0 0 0 0 round 16px 16px 0 0) !important;
  clip-path: inset(0 0 0 0 round 16px 16px 0 0) !important;
}

/* Card hover elevation and subtle lift */
.page-blog .blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(10, 46, 92, 0.14);
}
.page-blog .blog-card:active {
  transform: translateY(-2px) scale(0.998);
  box-shadow: 0 8px 18px rgba(10, 46, 92, 0.08);
}

/* Make card show pointer and a visible focus ring for keyboard users */
.page-blog .blog-card {
  cursor: pointer;
}
.page-blog .blog-card:focus {
  outline: none;
  box-shadow: 0 8px 20px rgba(10, 46, 92, 0.06),
    0 0 0 4px rgba(56, 189, 248, 0.08);
  transform: translateY(-4px) scale(1.003);
}

/* Heading color change on hover / focus (also for linked headings) */
.page-blog .blog-card-content h3,
.page-blog .blog-card-content h3 a {
  transition: color 180ms ease, transform 180ms ease;
}
.page-blog .blog-card:hover .blog-card-content h3,
.page-blog .blog-card:hover .blog-card-content h3 a,
.page-blog .blog-card-content h3 a:hover,
.page-blog .blog-card-content h3 a:focus {
  color: var(--primary-600);
  transform: translateY(-1px);
}
.page-blog .blog-card-content {
  position: relative;
  background: transparent;
  padding: 20px 22px 18px 22px;
  box-shadow: none;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Mobile: ensure blog listing cards look like elevated cards with radius */
@media (max-width: 700px) {
  .page-blog .blog-card {
    border-radius: 16px !important;
    overflow: visible !important;
    background: #ffffff !important;
    border: 1px solid rgba(10, 46, 92, 0.06) !important;
    box-shadow: 0 12px 30px rgba(10, 46, 92, 0.12) !important;
    margin-bottom: 0 !important; /* rely on grid gap for spacing */
  }

  .page-blog .blog-card-image img {
    border-top-left-radius: 16px !important;
    border-top-right-radius: 16px !important;
  }
}
.page-blog .blog-card .post-meta {
  color: #6b7280;
  margin-bottom: 8px;
}
.page-blog .blog-card-content h3 {
  color: #0a2e5c;
  margin-top: 6px;
  font-size: 1.15rem;
  font-weight: 700;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  -webkit-text-fill-color: unset;
}

/* Make the "Read more" link use the purple accent on the blog listing */
.page-blog .read-more {
  color: #7c3aed;
  font-weight: 600;
}

/* Ensure images respect card radius on larger viewports too */
.page-blog .blog-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-top-left-radius: 16px !important;
  border-top-right-radius: 16px !important;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  -webkit-clip-path: inset(0 0 0 0 round 16px 16px 0 0) !important;
  clip-path: inset(0 0 0 0 round 16px 16px 0 0) !important;
}
/* Ensure the blog section and grid use the same page background so the
   gap between stacked cards doesn't show a different color. */
.page-blog .section,
.page-blog .blog-grid {
  background: var(--bg, #ffffff);
}
@media (max-width: 700px) {
  .page-blog .blog-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 20px;
  }
  .page-blog .blog-card {
    max-width: 98vw;
  }
  .page-blog .blog-card-content {
    padding: 14px;
  }

  /* Use grid gap rather than extra bottom margin so the background between
     cards matches the page background (prevents colored stripes). */
  .page-blog .blog-card {
    margin-bottom: 0 !important;
  }
}

/* Pagination Styling */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0 3rem 0;
  font-size: 1.1rem;
}
.pagination a,
.pagination span {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  color: #1976d2;
  text-decoration: none;
  background: #f5f5f5;
  margin: 0 2px;
  transition: background 0.2s, color 0.2s;
}
.pagination a:hover {
  background: #1976d2;
  color: #fff;
}
.pagination .active {
  background: #1976d2;
  color: #fff;
  font-weight: bold;
}
.pagination .disabled {
  color: #bdbdbd;
  pointer-events: none;
  background: #e0e0e0;
}

body {
  overflow-x: hidden !important;
}

/* Related posts: ensure cards stack vertically on small screens */
@media (max-width: 700px) {
  .related-posts-list {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .related-posts-list .related-post-card {
    max-width: 100%;
    width: 100%;
    margin: 0;
    display: block;
  }
}

/* Pagination: mobile tweaks so buttons align and keep consistent sizing */
@media (max-width: 700px) {
  .pagination {
    gap: 0.6rem;
    padding: 8px 12px;
    justify-content: center;
    flex-wrap: nowrap;
  }

  .pagination a,
  .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.6rem;
    min-width: 24px;
    height: 30px;
    border-radius: 7px;
    font-size: 0.65rem;
    box-sizing: border-box;
  }

  .pagination .pagination-number {
    width: 24px;
    height: 30px;
    padding: 0;
  }

  .pagination .pagination-btn {
    padding: 0.45rem 0.9rem;
  }
}

/* Ensure tablet and mobile consistently show rounded card corners
   (covers tablet widths where some earlier rules may remove radius). */
@media (max-width: 1024px) {
  .page-blog .blog-card,
  .page-blog .blog-card-image img {
    border-radius: 16px !important;
    overflow: hidden !important;
  }

  .page-blog .blog-card {
    border: 1px solid rgba(10, 46, 92, 0.06) !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }
}
