/*
Theme Name: PPX Theme
Theme URI: https://ppx.com
Author: PPX Team
Author URI: https://ppx.com
Description: Custom WordPress theme for PPX blog — matches the Next.js site design.
Version: 1.0.0
Text Domain: ppx-theme
*/

/* =============================================
   BASE RESET — match Next.js output
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #111111;
  background: #FAFAFA;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Main content area pushes footer down */
.ppx-main-content {
  flex: 1;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

/* Override WordPress default avatar styles */
.avatar {
  border-radius: 50% !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  max-width: none !important;
}

/* Hide WordPress admin bar space */
html {
  margin-top: 0 !important;
}

/* Neutralise WP block-library defaults that leak into classic themes */
.blogpost-content p,
.blogpost-content ul,
.blogpost-content ol,
.blogpost-content blockquote,
.blogpost-content h2,
.blogpost-content h3 {
  max-width: none;
}

/* =============================================
   PRODUCT CATEGORY NAV BAR
   ============================================= */
.product-cat-nav {
  background: #4b0a98;
  padding: 0;
  overflow-x: auto;
  white-space: nowrap;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.product-cat-nav::-webkit-scrollbar {
  display: none;
}

.product-cat-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 0;
}

.product-cat-nav a {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.product-cat-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* =============================================
   BLOG PAGE
   ============================================= */

/* Hero */
.blog-hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 1.5rem;
}

.blog-hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #111;
  margin: 0 0 0.25rem;
}

.blog-hero p {
  font-size: 0.9375rem;
  color: #6B7280;
  margin: 0;
}

/* Blog Tabs / Category Filter */
.blog-tabs {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.blog-tab {
  padding: 0.4rem 1.125rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 2rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.blog-tab:hover {
  border-color: #c9a8e8;
  color: #4b0a98;
  background: #f3eafa;
}

.blog-tab.active {
  background: #4b0a98;
  color: #fff;
  border-color: #4b0a98;
}

.blog-tab:active {
  transform: scale(0.96);
}

/* Featured Post */
.blog-featured {
  max-width: 1280px;
  margin: 0 auto 2.5rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: center;
}

@media (max-width: 768px) {
  .blog-featured {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.blog-featured-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.blog-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-featured-image:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.blog-featured-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.blog-featured-tag {
  display: inline-block;
  width: fit-content;
  padding: 0.25rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4b0a98;
  background: #f3eafa;
  border-radius: 2rem;
  text-decoration: none;
}

.blog-featured-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111;
  margin: 0;
  line-height: 1.35;
  transition: color 0.15s;
  cursor: pointer;
}

.blog-featured-title a {
  color: inherit;
  text-decoration: none;
}

.blog-featured-title:hover,
.blog-featured-title a:hover {
  color: #4b0a98;
}

.blog-featured-excerpt {
  font-size: 0.875rem;
  color: #6B7280;
  line-height: 1.6;
  margin: 0;
}

.blog-featured-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.blog-featured-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #d5d5dc;
  flex-shrink: 0;
  overflow: hidden;
}

.blog-featured-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-featured-author {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #111;
  margin: 0;
}

.blog-featured-date {
  font-size: 0.75rem;
  color: #9CA3AF;
  margin: 0;
}

.blog-featured-readmore {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  width: fit-content;
  padding: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #4b0a98;
  border: 1.5px solid #4b0a98;
  border-radius: 0.375rem;
  background: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}

.blog-featured-readmore:hover {
  background: #f3eafa;
  transform: translateY(-1px);
}

.blog-featured-readmore:active {
  transform: translateY(1px) scale(0.97);
}

/* Divider */
.blog-divider {
  max-width: 1280px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
}

.blog-divider hr {
  border: none;
  border-top: 1px solid #E5E7EB;
}

.blog-divider-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111;
  margin: 0 0 1.5rem;
}

/* Blog Grid */
.blog-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

@media (max-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Blog Card */
.blog-card {
  border: 1px solid #E5E7EB;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #fff;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-color: #c9a8e8;
}

.blog-card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #e5e7eb;
  position: relative;
  overflow: hidden;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-card-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.05) 100%);
}

.blog-card-tag {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.2rem 0.625rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: #4b0a98;
  border-radius: 2rem;
  z-index: 1;
  text-decoration: none;
}

.blog-card-body {
  padding: 1rem 1.25rem 1.25rem;
}

.blog-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111;
  margin: 0 0 0.5rem;
  line-height: 1.4;
  transition: color 0.15s;
}

.blog-card-title a {
  color: inherit;
  text-decoration: none;
}

.blog-card:hover .blog-card-title,
.blog-card:hover .blog-card-title a {
  color: #4b0a98;
}

.blog-card-excerpt {
  font-size: 0.8125rem;
  color: #6B7280;
  line-height: 1.55;
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.blog-card-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-card-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #d5d5dc;
  flex-shrink: 0;
  overflow: hidden;
}

.blog-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-card-author-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #111;
  margin: 0;
}

.blog-card-author-date {
  font-size: 0.6875rem;
  color: #9CA3AF;
  margin: 0;
}

.blog-card-read {
  font-size: 0.75rem;
  font-weight: 600;
  color: #4b0a98;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  transition: gap 0.15s;
}

.blog-card:hover .blog-card-read {
  gap: 0.5rem;
}

.blog-card-read .material-symbols-outlined {
  font-size: 16px !important;
}

/* Pagination */
.cat-pagination {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: center;
  gap: 0.375rem;
}

.cat-pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  border: 1px solid #E5E7EB;
  border-radius: 0.375rem;
  text-decoration: none;
  background: #fff;
  transition: all 0.15s;
}

.cat-pagination-btn:hover {
  border-color: #c9a8e8;
  color: #4b0a98;
  background: #f3eafa;
}

.cat-pagination-btn.active {
  background: #4b0a98;
  color: #fff;
  border-color: #4b0a98;
}

.cat-pagination-btn .material-symbols-outlined {
  font-size: 18px;
}

/* Newsletter CTA */
.blog-newsletter {
  max-width: 680px;
  margin: 1rem auto 2.5rem;
  padding: 2.5rem 2rem;
  background: linear-gradient(135deg, #f3eafa 0%, #e8ddf7 100%);
  border-radius: 1rem;
  text-align: center;
}

.blog-newsletter h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111;
  margin: 0 0 0.375rem;
}

.blog-newsletter p {
  font-size: 0.875rem;
  color: #6B7280;
  margin: 0 0 1.25rem;
}

.blog-newsletter-form {
  display: flex;
  gap: 0.5rem;
  max-width: 440px;
  margin: 0 auto;
}

.blog-newsletter-input {
  flex: 1;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  border: 1px solid #E5E7EB;
  border-radius: 0.375rem;
  background: #fff;
  color: #111;
  outline: none;
  transition: border-color 0.15s;
}

.blog-newsletter-input:focus {
  border-color: #4b0a98;
  box-shadow: 0 0 0 3px rgba(75, 10, 152, 0.1);
}

.blog-newsletter-input::placeholder {
  color: #9CA3AF;
}

.blog-newsletter-btn {
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #5a1aad 0%, #4b0a98 100%);
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.15s;
}

.blog-newsletter-btn:hover {
  background: linear-gradient(180deg, #6b1ec0 0%, #5a1aad 100%);
  transform: translateY(-1px);
}

.blog-newsletter-btn:active {
  transform: translateY(1px) scale(0.97);
}

/* =============================================
   INDIVIDUAL BLOG POST PAGE
   ============================================= */

/* Hero Banner */
.blogpost-hero {
  background: #4b0a98;
  padding: 3rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.blogpost-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(90, 26, 173, 0.8) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(100, 30, 200, 0.6) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(60, 8, 120, 0.5) 0%, transparent 50%);
  pointer-events: none;
}

.blogpost-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h20v20H0zM20 20h20v20H20z' fill='rgba(255,255,255,0.015)'/%3E%3C/svg%3E");
  background-size: 400px 400px;
  pointer-events: none;
}

.blogpost-hero-inner {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.blogpost-tag {
  display: inline-block;
  padding: 0.3rem 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4b0a98;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 2rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

.blogpost-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 1.25rem;
  line-height: 1.3;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.blogpost-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.blogpost-author-info {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.blogpost-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

.blogpost-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blogpost-author-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.blogpost-author-role {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.blogpost-meta-details {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.8);
}

.blogpost-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.blogpost-meta-item .material-symbols-outlined {
  font-size: 16px !important;
  color: rgba(255, 255, 255, 0.6);
}

/* Featured Image */
.blogpost-image {
  max-width: 900px;
  margin: -2.5rem auto 2.5rem;
  padding: 0 1.5rem;
  position: relative;
  z-index: 2;
}

.blogpost-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.blogpost-image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Article Content */
.blogpost-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
}

.blogpost-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111;
  margin: 2.5rem 0 0.875rem;
  line-height: 1.35;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f3eafa;
}

.blogpost-content h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #4b0a98;
  margin: 2rem 0 0.625rem;
}

.blogpost-content p {
  font-size: 1rem;
  color: #374151;
  line-height: 1.85;
  margin: 0 0 1.25rem;
}

.blogpost-content ul,
.blogpost-content ol {
  padding-left: 1.5rem;
  margin: 0 0 1.25rem;
}

.blogpost-content li {
  font-size: 1rem;
  color: #374151;
  line-height: 1.85;
  margin-bottom: 0.5rem;
}

.blogpost-content ul li::marker {
  color: #4b0a98;
}

.blogpost-content ol li::marker {
  color: #4b0a98;
  font-weight: 600;
}

.blogpost-content blockquote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  border-left: 4px solid #4b0a98;
  background: linear-gradient(135deg, #f9f5ff 0%, #f3eafa 100%);
  border-radius: 0 0.75rem 0.75rem 0;
  box-shadow: 0 2px 8px rgba(75, 10, 152, 0.06);
}

.blogpost-content blockquote p {
  font-size: 1.0625rem;
  font-style: italic;
  color: #4b0a98;
  margin: 0;
  line-height: 1.7;
}

.blogpost-content a {
  color: #4b0a98;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}

.blogpost-content a:hover {
  color: #7c3aed;
}

.blogpost-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 2rem 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* Inline Image */
.blogpost-inline-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #e5e7eb;
  border-radius: 0.75rem;
  margin: 2rem 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* Tags */
.blogpost-tags {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.blogpost-tags-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #111;
  margin-right: 0.25rem;
}

.blogpost-tags a {
  padding: 0.3rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #374151;
  border: 1px solid #E5E7EB;
  border-radius: 2rem;
  text-decoration: none;
  transition: all 0.2s;
}

.blogpost-tags a:hover {
  background: #4b0a98;
  border-color: #4b0a98;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(75, 10, 152, 0.25);
}

/* Share Bar */
.blogpost-share {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid #E5E7EB;
}

.blogpost-share-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #111;
  margin-right: 0.25rem;
}

.blogpost-share-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f3eafa;
  cursor: pointer;
  color: #4b0a98;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}

.blogpost-share-btn:hover {
  background: #4b0a98;
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(75, 10, 152, 0.3);
}

.blogpost-share-btn:active {
  transform: translateY(0) scale(0.93);
}

.blogpost-share-btn .material-symbols-outlined {
  font-size: 18px !important;
}

/* Author Box */
.blogpost-author-box {
  max-width: 760px;
  margin: 0 auto 2.5rem;
  padding: 0 1.5rem;
}

.blogpost-author-box-inner {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 2rem;
  background: linear-gradient(135deg, #f9f5ff 0%, #f3eafa 100%);
  border-radius: 1rem;
  border: 1px solid #e8ddf7;
  transition: box-shadow 0.3s, transform 0.3s;
}

.blogpost-author-box-inner:hover {
  box-shadow: 0 8px 28px rgba(75, 10, 152, 0.1);
  transform: translateY(-2px);
}

.blogpost-author-box-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #d5d5dc;
  flex-shrink: 0;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.blogpost-author-box-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blogpost-author-box-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: #4b0a98;
  margin: 0;
}

.blogpost-author-box-role {
  font-size: 0.8125rem;
  color: #6B7280;
  margin: 0.125rem 0 0.625rem;
}

.blogpost-author-box-bio {
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.65;
  margin: 0 0 0.875rem;
}

.blogpost-author-box-socials {
  display: flex;
  gap: 0.5rem;
}

.blogpost-author-box-social {
  width: 32px;
  height: 32px;
  background: #4b0a98;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
}

.blogpost-author-box-social:hover {
  background: #7c3aed;
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 4px 12px rgba(75, 10, 152, 0.3);
}

/* Related Posts */
.blogpost-related {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
}

.blogpost-related-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111;
  margin: 0 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blogpost-related-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.25rem;
  background: #4b0a98;
  border-radius: 2px;
}

.blogpost-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

@media (max-width: 1024px) {
  .blogpost-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .blogpost-related-grid {
    grid-template-columns: 1fr;
  }
}

/* Table of Contents sidebar */
.blogpost-toc {
  position: fixed;
  left: max(calc((100vw - 760px) / 2 - 240px), 1rem);
  top: 120px;
  width: 200px;
  display: none;
  transition: opacity 0.3s ease;
}

@media (min-width: 1200px) {
  .blogpost-toc {
    display: block;
  }
}

.blogpost-toc h4 {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9CA3AF;
  margin: 0 0 0.75rem;
}

.blogpost-toc a {
  display: block;
  font-size: 0.75rem;
  color: #6B7280;
  text-decoration: none;
  padding: 0.3rem 0 0.3rem 0.75rem;
  border-left: 2px solid #E5E7EB;
  transition: all 0.15s;
}

.blogpost-toc a:hover,
.blogpost-toc a.active {
  color: #4b0a98;
  border-left-color: #4b0a98;
}

/* Progress bar */
.blogpost-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #4b0a98, #7c3aed, #1768AC);
  z-index: 100;
  transition: width 0.1s linear;
}

/* Mobile TOC */
.blogpost-toc-mobile {
  display: none;
}

@media (min-width: 768px) and (max-width: 1199px) {
  .blogpost-toc-mobile {
    display: block;
    max-width: 760px;
    margin: 0 auto 1rem;
    padding: 0 1.5rem;
  }

  .blogpost-toc-mobile-inner {
    display: flex;
    gap: 0;
    overflow-x: auto;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    background: #fff;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .blogpost-toc-mobile-inner::-webkit-scrollbar {
    display: none;
  }

  .blogpost-toc-mobile a {
    flex-shrink: 0;
    padding: 0.625rem 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6B7280;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
  }

  .blogpost-toc-mobile a:hover {
    color: #4b0a98;
    background: #f9f5ff;
  }

  .blogpost-toc-mobile a.active {
    color: #4b0a98;
    border-bottom-color: #4b0a98;
    font-weight: 600;
  }
}

/* =============================================
   BROWSE TAGS
   ============================================= */
.browse-tags {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.browse-tags-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #111111;
  margin: 0 0 1.25rem;
}

.browse-tags-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
}

@media (min-width: 640px) {
  .browse-tags-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .browse-tags-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .browse-tags-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.browse-tag-link {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0.875rem 1rem 0.875rem 1.25rem;
  text-decoration: none;
  border: 1px solid #E5E7EB;
  border-radius: 0.5rem;
  text-align: left;
  background: #ffffff;
  overflow: hidden;
  transition: all 0.25s ease;
}

.browse-tag-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #4b0a98;
  transform: scaleY(0);
  transition: transform 0.25s ease;
}

.browse-tag-link:hover {
  background: linear-gradient(135deg, #f5eefe 0%, #ece2fb 100%);
  border-color: #c9a8e8;
  box-shadow: 0 4px 12px rgba(75, 10, 152, 0.12);
  transform: translateY(-2px);
}

.browse-tag-link:hover::before {
  transform: scaleY(1);
}

.browse-tag-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: #4b0a98;
}

.browse-tag-subtitle {
  font-size: 0.75rem;
  color: #9CA3AF;
  margin-top: 0.25rem;
}

/* ---- MOBILE RESPONSIVE ---- */
@media (max-width: 767px) {
  .blog-hero {
    padding: 1.25rem 1rem 1rem;
  }

  .blog-hero h1 {
    font-size: 1.375rem;
  }

  .blog-tabs {
    padding: 0 1rem;
    gap: 0.375rem;
    margin-bottom: 1.5rem;
  }

  .blog-tab {
    padding: 0.35rem 0.875rem;
    font-size: 0.75rem;
  }

  .blog-featured {
    padding: 0 1rem;
    margin-bottom: 1.5rem;
  }

  .blog-featured-title {
    font-size: 1.25rem;
  }

  .blog-divider {
    padding: 0 1rem;
    margin-bottom: 1.5rem;
  }

  .blog-grid {
    padding: 0 1rem 1.5rem;
  }

  .blog-newsletter {
    margin: 0.5rem 1rem 2rem;
    padding: 1.75rem 1.25rem;
  }

  .blog-newsletter-form {
    flex-direction: column;
  }

  .blog-newsletter-btn {
    width: 100%;
  }

  .blogpost-hero {
    padding: 1.5rem 1rem 2.5rem;
  }

  .blogpost-title {
    font-size: 1.375rem;
    line-height: 1.35;
  }

  .blogpost-tag {
    font-size: 0.625rem;
    padding: 0.25rem 0.75rem;
    margin-bottom: 0.75rem;
  }

  .blogpost-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .blogpost-meta-details {
    gap: 0.75rem;
    font-size: 0.75rem;
  }

  .blogpost-avatar {
    width: 36px;
    height: 36px;
  }

  .blogpost-image {
    padding: 0 0.75rem;
    margin: -1.75rem auto 1.5rem;
  }

  .blogpost-image-placeholder {
    border-radius: 0.625rem;
  }

  .blogpost-content {
    padding: 0 1rem 1.5rem;
  }

  .blogpost-content h2 {
    font-size: 1.1875rem;
    margin-top: 2rem;
  }

  .blogpost-content h3 {
    font-size: 1rem;
  }

  .blogpost-content p,
  .blogpost-content li {
    font-size: 0.875rem;
    line-height: 1.75;
  }

  .blogpost-content blockquote {
    padding: 1rem 1rem;
    margin: 1.25rem 0;
  }

  .blogpost-content blockquote p {
    font-size: 0.9375rem;
  }

  .blogpost-inline-image {
    border-radius: 0.5rem;
    margin: 1.25rem 0;
  }

  .blogpost-tags {
    padding: 0 1rem 1rem;
    gap: 0.375rem;
  }

  .blogpost-tags a {
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
  }

  .blogpost-share {
    padding: 1rem 1rem 1.25rem;
    gap: 0.5rem;
  }

  .blogpost-share-btn {
    width: 36px;
    height: 36px;
  }

  .blogpost-author-box {
    padding: 0 1rem;
    margin-bottom: 1.5rem;
  }

  .blogpost-author-box-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem;
    gap: 1rem;
  }

  .blogpost-author-box-avatar {
    width: 60px;
    height: 60px;
  }

  .blogpost-author-box-name {
    font-size: 1rem;
  }

  .blogpost-author-box-bio {
    font-size: 0.8125rem;
  }

  .blogpost-author-box-socials {
    justify-content: center;
  }

  .blogpost-related {
    padding: 0 1rem 1.5rem;
  }

  .blogpost-related-title {
    font-size: 1.125rem;
  }

  .blogpost-related-grid {
    gap: 1.25rem;
  }
}

/* Small phones */
@media (max-width: 380px) {
  .blogpost-hero {
    padding: 1.25rem 0.75rem 2rem;
  }

  .blogpost-title {
    font-size: 1.1875rem;
  }

  .blogpost-content {
    padding: 0 0.75rem 1.25rem;
  }

  .blogpost-tags {
    padding: 0 0.75rem 0.75rem;
  }

  .blogpost-share {
    padding: 0.75rem 0.75rem 1rem;
  }

  .blogpost-author-box {
    padding: 0 0.75rem;
  }

  .blogpost-related {
    padding: 0 0.75rem 1.25rem;
  }
}
