/* ============================================================
   Blog Page Light Mode Styling
   ============================================================ */

@import url('modern-light.css');

html, body {
  overflow-x: hidden !important;
  max-width: 100vw;
}

/* Blog Listing Page */
.blog-listing-section {
  padding: 60px 20px;
  background: var(--bg-primary);
  min-height: 100vh;
}

.blog-listing-image {
  will-change: background-image;
  background-attachment: scroll;
  text-align: center;
  margin-bottom: 60px;
  animation: slideUp 0.8s ease-out;
}

.blog-listing-header h1 {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.blog-listing-header h1 strong {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-listing-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.blog-listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: stretch;
}

@media (max-width: 680px) {
  .blog-listing-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.blog-listing-card {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  contain: layout style paint;
  width: 100%;
  box-sizing: border-box;
}

.blog-listing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(108, 76, 245, 0.05), transparent);
  transition: left 0.5s ease;
}

.blog-listing-card:hover::before {
  left: 100%;
}

.blog-listing-card:hover {
  border-color: var(--primary);
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.blog-tag {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(108, 76, 245, 0.1);
  border-radius: 6px;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 16px;
  width: fit-content;
  position: relative;
  z-index: 1;
}

.blog-listing-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

.blog-listing-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 16px;
  flex: 1;
  position: relative;
  z-index: 1;
}

.blog-meta {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-light);
  position: relative;
  z-index: 1;
}

.blog-cta {
  color: var(--primary);
  font-weight: 600;
  margin-top: 16px;
  display: inline-block;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.blog-listing-card:hover .blog-cta {
  gap: 8px;
}

/* Blog Post Page */
.post-header {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  padding: 60px 20px;
  text-align: center;
  border-bottom: 1px solid var(--glass-border);
}

.post-header-wrap {
  max-width: 900px;
  margin: 0 auto;
}

.post-breadcrumb {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.post-breadcrumb a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-breadcrumb a:hover {
  color: var(--secondary);
}

.post-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--text-primary);
  line-height: 1.2;
}

.post-meta-group {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

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

/* Post Body */
.post-body {
  padding: 40px 20px 60px;
  background: var(--bg-primary);
}

.post-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .post-header .post-wrap {
    max-width: 1240px;
  }
  .post-body .post-wrap {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 48px;
    align-items: start;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid var(--line, #e2e8f0);
    box-shadow: 0 8px 30px rgba(0,0,0,0.04);
    padding: 44px 50px;
  }
  .post-main-column {
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .post-wrap {
    padding: 0 16px;
  }
}

/* Sponsor banner ads (e.g. Gadgetsmandu) are ultra-wide (~12:1) source
   images designed for desktop. The old approach fixed the height and let
   the banner scroll horizontally — but on real phones that inner scroll
   fought with the page's own scroll/rubber-band, making both the banner
   AND unrelated content above it appear to jump and get cut off at the
   edges. Simplest and most reliable fix: let it scale down like a normal
   responsive image (full width, auto height). It reads thinner on small
   phones, but it's always fully visible and never causes scroll glitches. */
a[href*="gadgetsmandu.com"] {
  display: block;
  text-align: center;
}
a[href*="gadgetsmandu.com"] img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 0 auto;
}
@media (max-width: 600px) {
  a[href*="gadgetsmandu.com"] img {
    max-height: 120px;
    object-fit: contain;
  }
}

/* Safety net for Google Auto ads / AdSense iframes: whatever Google injects
   automatically must never be wider than the viewport on mobile. Without
   this, an ad unit sized for desktop can force horizontal scroll on the
   whole page. */
ins.adsbygoogle,
.post-body iframe,
.post-wrap iframe {
  max-width: 100% !important;
  overflow: hidden;
}
@media (max-width: 600px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
  }
  ins.adsbygoogle {
    width: 100% !important;
  }
}

.post-wrap img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
}

.post-wrap p {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 24px;
  color: var(--text-secondary);
}

.post-wrap h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 16px;
  color: var(--text-primary);
  border-left: 4px solid var(--primary);
  padding-left: 16px;
}

.post-wrap h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.post-wrap ul,
.post-wrap ol {
  margin-bottom: 24px;
  margin-left: 24px;
}

.post-wrap li {
  margin-bottom: 12px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.post-wrap strong {
  color: var(--text-primary);
  font-weight: 700;
}

.post-wrap em {
  color: var(--primary);
  font-style: italic;
}

.post-wrap blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 20px;
  margin: 32px 0;
  color: var(--text-secondary);
  font-style: italic;
  background: rgba(108, 76, 245, 0.05);
  padding: 20px;
  border-radius: 8px;
}

.post-wrap code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
}

.post-wrap pre {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 24px;
}

.post-wrap pre code {
  padding: 0;
  background: none;
  color: var(--text-primary);
}

/* Checklist Styling */
.checklist-item {
  background: rgba(16, 185, 129, 0.05);
  border-left: 4px solid var(--success);
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 8px;
  display: flex;
  gap: 12px;
}

.checklist-item::before {
  content: '✓';
  color: var(--success);
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.checklist-item p {
  margin: 0;
}

/* Share Section */
.post-share {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 24px;
  margin-top: 40px;
  text-align: center;
}

.post-share h4 {
  margin-bottom: 16px;
  color: var(--text-primary);
}

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

.share-btn {
  padding: 10px 16px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 0.9rem;
}

.share-btn:hover {
  background: rgba(108, 76, 245, 0.1);
  border-color: var(--primary);
}

/* Related Posts */
.related-posts {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--glass-border);
}

.related-posts h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.related-card {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.related-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.related-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.related-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .post-title {
    font-size: 1.8rem;
  }
  
  .blog-listing-title {
    font-size: 1.1rem;
  }
  
  .post-meta-group {
    flex-direction: column;
    gap: 12px;
  }
  
  .post-wrap h2 {
    font-size: 1.4rem;
  }
}

/* ============================================================
   Modern 2-Column Reader Layout (Eliminating Wide Side Gaps)
   ============================================================ */
.article-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 30px 24px 60px;
}

.article-layout-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  align-items: start;
}

.article-main-content {
  min-width: 0;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid var(--line, #e2e8f0);
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  padding: 40px 48px;
}

@media (max-width: 768px) {
  .article-container {
    padding: 16px 14px 40px;
  }
  .article-main-content {
    padding: 24px 20px;
    border-radius: 14px;
  }
}

.article-header {
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line, #e2e8f0);
  padding-bottom: 24px;
}

.article-breadcrumb {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.article-breadcrumb a {
  color: var(--primary, #6c4cf5);
  text-decoration: none;
}

.article-breadcrumb a:hover {
  text-decoration: underline;
}

.article-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(108, 76, 245, 0.1);
  color: var(--primary, #6c4cf5);
  margin-bottom: 14px;
}

.article-title {
  font-family: 'Fraunces', serif;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink, #0f172a);
  margin: 0 0 16px;
}

.article-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: #64748b;
}

.article-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.article-featured-banner {
  width: 100%;
  height: auto;
  max-height: 480px;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 14px;
  margin: 20px 0 32px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.06);
  display: block;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #334155;
}

.article-body h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink, #0f172a);
  margin: 36px 0 14px;
  padding-left: 14px;
  border-left: 4px solid var(--primary, #6c4cf5);
}

.article-body h3 {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--ink, #0f172a);
  margin: 24px 0 10px;
}

.article-body p {
  margin: 0 0 18px;
}

.article-body ul, .article-body ol {
  margin: 0 0 20px;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.article-callout {
  background: #f8faff;
  border: 1px solid #e0e7ff;
  border-left: 4px solid var(--primary, #6c4cf5);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 28px 0;
  color: #1e293b;
  font-size: 0.96rem;
  line-height: 1.7;
}

.article-callout strong {
  color: var(--primary, #6c4cf5);
}

/* Sticky Companion Sidebar */
.article-sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (max-width: 1023px) {
  .article-layout-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .article-sidebar {
    position: static;
  }
}

.sidebar-widget {
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
}

.sidebar-widget-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink, #0f172a);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-tool-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-tool-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  text-decoration: none;
  color: #1e293b;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.sidebar-tool-link:hover {
  background: #ffffff;
  border-color: var(--primary, #6c4cf5);
  box-shadow: 0 4px 12px rgba(108,76,245,0.12);
  transform: translateX(4px);
  color: var(--primary, #6c4cf5);
}

.sidebar-tool-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.sidebar-mock-test-cta {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.25);
  text-align: center;
}

.sidebar-mock-test-cta h4 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: #ffffff;
}

.sidebar-mock-test-cta p {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: #e0e7ff;
  line-height: 1.5;
}

.sidebar-mock-test-btn {
  display: block;
  background: #ffffff;
  color: #4338ca;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.sidebar-mock-test-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* ============================================================
   Modern SaaS Blog Search & Category Filters
   ============================================================ */
.blog-search-container {
  max-width: 840px;
  margin: 28px auto 0;
  position: relative;
}

.blog-search-box {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 6px 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  transition: all 0.25s ease;
}

.blog-search-box:focus-within {
  border-color: var(--primary, #6c4cf5);
  box-shadow: 0 8px 28px rgba(108, 76, 245, 0.16);
}

.blog-search-icon {
  width: 20px;
  height: 20px;
  color: #94a3b8;
  flex-shrink: 0;
  margin-right: 12px;
}

.blog-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  color: #0f172a;
  padding: 10px 0;
  font-family: inherit;
}

.blog-search-input::placeholder {
  color: #94a3b8;
}

.blog-search-clear {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  display: none;
}

.blog-filter-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.filter-pill {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.filter-pill:hover {
  border-color: var(--primary, #6c4cf5);
  color: var(--primary, #6c4cf5);
  background: rgba(108, 76, 245, 0.04);
}

.filter-pill.active {
  background: var(--primary, #6c4cf5);
  border-color: var(--primary, #6c4cf5);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(108, 76, 245, 0.25);
}

.blog-results-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 28px 0 16px;
  color: #64748b;
  font-size: 0.9rem;
}

.blog-results-meta strong {
  color: #0f172a;
}

/* ============================================================
   PROMINENT IN-CONTENT BLOG SHARING BOX & FLOATING DOCK
   ============================================================ */

/* 1. End-of-article Call-to-action Share Card */
.blog-end-share-box {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 22px 24px;
  margin: 40px 0 28px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.blog-end-share-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.blog-share-lead-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ede9fe;
  color: #6c4cf5;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.blog-share-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px;
  line-height: 1.4;
}

.blog-share-desc {
  font-size: 0.86rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.blog-end-share-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.blog-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.blog-share-btn.share-wa {
  background: #25D366;
  color: #ffffff !important;
  border-color: #25D366;
}
.blog-share-btn.share-wa svg {
  fill: #ffffff;
}
.blog-share-btn.share-wa:hover {
  background: #1eb855;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
  transform: translateY(-2px);
}

.blog-share-btn.share-fb {
  background: #1877F2;
  color: #ffffff !important;
  border-color: #1877F2;
}
.blog-share-btn.share-fb svg {
  fill: #ffffff;
}
.blog-share-btn.share-fb:hover {
  background: #1464cc;
  box-shadow: 0 4px 14px rgba(24, 119, 242, 0.4);
  transform: translateY(-2px);
}

.blog-share-btn.share-copy {
  background: #ffffff;
  color: #334155 !important;
  border-color: #cbd5e1;
}
.blog-share-btn.share-copy:hover {
  background: #6c4cf5;
  color: #ffffff !important;
  border-color: #6c4cf5;
  box-shadow: 0 4px 14px rgba(108, 76, 245, 0.3);
  transform: translateY(-2px);
}

/* 2. Floating Mobile & Desktop Quick-Share Dock */
.blog-floating-share-dock {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  padding: 8px 12px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.blog-floating-label {
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 2px;
}

.floating-share-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.floating-share-icon:hover {
  transform: scale(1.12);
}
.floating-share-wa {
  background: #25D366;
  color: #fff;
}
.floating-share-wa svg {
  fill: #fff;
}
.floating-share-fb {
  background: #1877F2;
  color: #fff;
}
.floating-share-fb svg {
  fill: #fff;
}
.floating-share-copy {
  background: #334155;
  color: #fff;
}

@media (max-width: 600px) {
  .blog-end-share-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .blog-end-share-actions {
    flex-direction: column;
    width: 100%;
  }
  .blog-share-btn {
    width: 100%;
    justify-content: center;
  }
  .blog-floating-share-dock {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    right: 14px;
    left: auto;
    padding: 6px 12px;
  }
}
