/* Modern Blog Design System */
:root {
  --blog-primary: #818cf8;
  /* Lighter indigo for dark mode */
  --blog-secondary: #c084fc;
  /* Lighter purple */
  --blog-accent: #f472b6;
  /* Lighter pink */
  --blog-bg: #0f172a;
  /* Slate 900 */
  --blog-text: #e2e8f0;
  /* Slate 200 */
  --blog-heading: #f8fafc;
  /* Slate 50 */
  --blog-card-bg: #1e293b;
  /* Slate 800 */
  --blog-border: #334155;
  /* Slate 700 */
}

body {
  background-color: var(--blog-bg);
  color: var(--blog-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Bento Grid System */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.bento-card {
  background: var(--blog-card-bg);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.6);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.bento-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.05);
  border-color: rgba(99, 102, 241, 0.2);
}

.bento-card__media {
  position: relative;
  overflow: hidden;
  padding-top: 56.25%;
  /* 16:9 aspect ratio for better visual balance */
}

.bento-card__media img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.bento-card:hover .bento-card__media img {
  transform: scale(1.05);
}

.bento-card__body {
  padding: 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blog-primary);
  margin-bottom: 0.75rem;
  display: block;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--blog-heading);
  margin-bottom: 0.75rem;
}

.card-title a {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(to right, var(--blog-primary) 0%, var(--blog-primary) 100%);
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 0.3s ease;
}

.bento-card:hover .card-title a {
  background-size: 100% 2px;
}

.card-text {
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* Feature Layouts */
@media (min-width: 992px) {
  .bento-card--feature {
    grid-column: span 2;
    flex-direction: row;
  }

  .bento-card--feature .bento-card__media {
    width: 50%;
    padding-top: 0;
    min-height: 400px;
    /* Ensure reasonable height */
  }

  .bento-card--feature .bento-card__media img {
    aspect-ratio: 2/1;
    /* Wider aspect for feature images */
    object-fit: cover;
  }

  .bento-card--feature .bento-card__body {
    width: 50%;
    justify-content: center;
    padding: 3rem;
  }

  .bento-card--feature .card-title {
    font-size: 2rem;
  }
}

/* Sidebar Styling */
.sidebar-card {
  background: var(--blog-card-bg);
  border-radius: 16px;
  border: 1px solid var(--blog-border);
  overflow: hidden;
  margin-bottom: 2rem;
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--blog-border);
  font-weight: 700;
  color: var(--blog-heading);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-item {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--blog-text);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.category-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--blog-primary);
  border-left-color: var(--blog-primary);
}

.category-count {
  background: rgba(255, 255, 255, 0.1);
  color: var(--blog-text);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Article Page Styling - Black Design */
.article-page {
  background-color: #000000;
  color: #e2e8f0;
}

.article-header {
  position: relative;
  padding: 8rem 0 4rem;
  text-align: center;
  overflow: hidden;
}

.article-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: radial-gradient(circle at center, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.article-breadcrumb {
  position: relative;
  z-index: 1;
  margin-bottom: 2rem;
}

.article-breadcrumb a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.article-breadcrumb a:hover {
  color: #fff;
}

.article-cover {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto 2rem;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--blog-border);
  background: var(--blog-card-bg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.article-cover img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 16/9;
}

.article-meta {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 2rem;
  padding: 0.75rem 2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  backdrop-filter: blur(10px);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 500;
}

.meta-item i {
  color: var(--blog-primary);
}



.article-content {
  font-size: 1.25rem;
  line-height: 1.8;
  color: #cbd5e1;
  width: 100%;
}

.article-content img {
  max-width: 100%;
  max-height: 500px;
  width: auto;
  object-fit: contain;
  border-radius: 12px;
  margin: 2rem auto;
  display: block;
}

.article-content p {
  margin-bottom: 2rem;
}

.article-content h2 {
  font-size: 2.25rem;
  font-weight: 700;
  color: #fff;
  margin: 4rem 0 2rem;
  letter-spacing: -0.02em;
}

.article-content h3 {
  font-size: 1.75rem;
  font-weight: 600;
  color: #f8fafc;
  margin: 3rem 0 1.5rem;
}

.article-content blockquote {
  border-left: 4px solid var(--blog-primary);
  background: linear-gradient(to right, rgba(99, 102, 241, 0.1), transparent);
  padding: 2.5rem;
  margin: 3rem 0;
  font-size: 1.5rem;
  font-style: italic;
  color: #e2e8f0;
  border-radius: 0 16px 16px 0;
}

.article-content ul,
.article-content ol {
  margin-bottom: 2rem;
  padding-left: 2rem;
}

.article-content li {
  margin-bottom: 1rem;
  padding-left: 0.5rem;
}

.article-content li::marker {
  color: var(--blog-primary);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  margin-top: 4rem;
}

.back-link:hover {
  background: #fff;
  color: #000;
  transform: translateY(-2px);
}

/* Mobile Optimization */
@media (max-width: 768px) {
  .article-header {
    padding: 3rem 0 1rem;
    /* Reduced from 6rem 0 2rem */
  }

  .article-meta {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    width: calc(100% - 2rem);
    margin: 0 auto 1.5rem;
    border-radius: 20px;
  }

  .meta-item {
    font-size: 0.85rem;
  }



  .article-content {
    padding: 0 1.25rem;
    font-size: 1.05rem;
  }

  .article-content h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
  }

  .article-content h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
  }

  .article-content blockquote {
    padding: 1.25rem;
    margin: 1.5rem 0;
    font-size: 1.1rem;
    border-left-width: 3px;
  }

  .article-content ul,
  .article-content ol {
    padding-left: 1.25rem;
  }

  .back-link {
    width: 100%;
    justify-content: center;
    margin-top: 2rem;
  }
}

/* Navigation */
.pagination {
  gap: 0.5rem;
}

.pagination .page-link {
  border: 1px solid var(--blog-border);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin: 0;
  color: var(--blog-text);
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--blog-card-bg);
}

.pagination .page-link:hover {
  background: var(--blog-border);
  color: #fff;
  transform: translateY(-2px);
  border-color: var(--blog-text);
}

.pagination .page-item.disabled .page-link {
  background: transparent;
  border-color: transparent;
  color: var(--blog-border);
  pointer-events: none;
}

.pagination .active .page-link {
  background: var(--blog-primary);
  border-color: var(--blog-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.4);
}

.pagination .active .page-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(129, 140, 248, 0.5);
}

/* Utilities */
.text-gradient {
  background: linear-gradient(135deg, #4f46e5, #ec4899);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-sticky-cta {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1.25rem;
  z-index: 1050;
  display: none;
}

.blog-sticky-cta .btn {
  border-radius: 999px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  padding: 1rem 1.25rem;
}

@media (max-width: 991.98px) {
  .blog-sticky-cta {
    display: block;
  }
}
