/* Blog System Styling */

/* ═══════════════ BLOG LISTING HERO ═══════════════ */
.blog-hero {
  position: relative;
  padding: 160px 0 80px;
  background: radial-gradient(circle at 20% 30%, rgba(42, 169, 255, 0.06) 0%, transparent 60%),
              radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.05) 0%, transparent 60%);
  text-align: center;
  overflow: hidden;
}

.blog-hero h1 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(36px, 5vw, 54px);
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 16px;
}

.blog-hero p {
  font-size: clamp(15px, 2vw, 18px);
  color: rgba(255, 255, 255, 0.6);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ═══════════════ CONTROLS (SEARCH & FILTER) ═══════════════ */
.blog-controls {
  padding: 40px 0;
  background: #060b19;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.controls-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  padding-left: 8%;
  padding-right: 8%;
}

/* Category Filter Pills */
.filter-pills {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 20px;
  border-radius: 25px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-btn:hover {
  border-color: rgba(42, 169, 255, 0.3);
  background: rgba(42, 169, 255, 0.04);
  color: #ffffff;
}

.filter-btn.active {
  background: linear-gradient(135deg, #2aa9ff 0%, #0d6efd 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

/* Search Box */
.search-box {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.search-box i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: 16px;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 16px 12px 46px;
  border-radius: 30px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: #2aa9ff;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 15px rgba(42, 169, 255, 0.2);
}

/* ═══════════════ BLOG GRID ═══════════════ */
.blog-list-section {
  padding: 80px 0;
  background: #060b19;
  min-height: 400px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  padding-left: 8%;
  padding-right: 8%;
}

/* Blog Card */
.blog-card {
  position: relative;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(42, 169, 255, 0.2), transparent, rgba(16, 185, 129, 0.2));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 0.4s ease;
}

.blog-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(42, 169, 255, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.blog-card:hover::before {
  opacity: 1;
}

/* Card Image */
.blog-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.05);
}

.blog-card-category {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(10, 22, 42, 0.9);
  border: 1px solid rgba(42, 169, 255, 0.3);
  color: #2aa9ff;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(10px);
}

/* Card Content */
.blog-card-content {
  padding: 30px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 15px;
  font-weight: 600;
}

.blog-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.blog-card-content h3 {
  font-family: 'Sora', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.4;
  margin-bottom: 12px;
  transition: color 0.3s ease;
}

.blog-card:hover .blog-card-content h3 {
  color: #2aa9ff;
}

.blog-card-content p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  margin-bottom: 25px;
  flex-grow: 1;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 20px;
}

.blog-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.blog-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2aa9ff 0%, #10b981 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.blog-author span {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.read-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2aa9ff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.3s ease;
}

.read-btn i {
  transition: transform 0.3s ease;
}

.read-btn:hover i {
  transform: translateX(4px);
}

/* Empty/No Results state */
.no-results {
  text-align: center;
  grid-column: 1 / -1;
  padding: 60px 0;
  color: rgba(255, 255, 255, 0.4);
}

.no-results i {
  font-size: 48px;
  margin-bottom: 15px;
  display: block;
}

/* ═══════════════ BLOG DETAILS PAGE LAYOUT ═══════════════ */
.details-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 140px 24px 100px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 24px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  transition: all 0.3s ease;
}

.back-link:hover {
  color: #2aa9ff;
  border-color: rgba(42, 169, 255, 0.3);
  background: rgba(42, 169, 255, 0.05);
  transform: translateX(-4px);
}

/* Two-Column Detail Grid */
.blog-detail-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 48px;
  align-items: start;
}

/* ═══════════════ TABLE OF CONTENTS SIDEBAR ═══════════════ */
.toc-sidebar {
  position: sticky;
  top: 100px;
  z-index: 10;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.3) transparent;
}

.toc-sidebar::-webkit-scrollbar {
  width: 4px;
}

.toc-sidebar::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.3);
  border-radius: 4px;
}

.toc-card {
  background: rgba(10, 18, 36, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
  transition: border-color 0.3s ease;
}

.toc-card:hover {
  border-color: rgba(16, 185, 129, 0.25);
}

/* TOC Header */
.toc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 20px;
}

.toc-header i {
  color: #10b981;
  font-size: 18px;
}

/* TOC Nav List */
.toc-nav {
  display: flex;
  flex-direction: column;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-item {
  position: relative;
}

.toc-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 24px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toc-number {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.25s ease;
}

.toc-title {
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toc-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.toc-link:hover .toc-number {
  border-color: #10b981;
  color: #10b981;
}

/* Active State */
.toc-item.active > .toc-link {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  font-weight: 700;
}

.toc-item.active > .toc-link .toc-number {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

/* Nested Sub-lists */
.toc-sublist {
  list-style: none;
  padding: 6px 0 6px 22px;
  margin: 4px 0 6px 26px;
  border-left: 2px solid rgba(16, 185, 129, 0.2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-subitem a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: all 0.2s ease;
}

.toc-subitem a::before {
  content: '•';
  color: #10b981;
  font-weight: bold;
  font-size: 14px;
}

.toc-subitem a:hover,
.toc-subitem.active a {
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

/* Tip Box at bottom of TOC */
.toc-tip-box {
  margin-top: 24px;
  padding: 14px 16px;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.18);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.4;
}

.toc-tip-box i {
  font-size: 20px;
  color: #10b981;
  flex-shrink: 0;
}

/* ═══════════════ MAIN ARTICLE CONTENT ═══════════════ */
.article-main {
  min-width: 0; /* Prevents overflow in flex/grid */
}

/* Article Header */
.article-header {
  margin-bottom: 35px;
}

.article-category {
  display: inline-block;
  background: rgba(42, 169, 255, 0.08);
  border: 1px solid rgba(42, 169, 255, 0.2);
  color: #2aa9ff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.article-header h1 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
  margin-bottom: 24px;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.meta-info {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}

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

/* Social Share Links */
.article-share {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
}

.share-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #2aa9ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
}

.share-btn:hover {
  background: #2aa9ff;
  color: #ffffff;
  transform: translateY(-2px);
}

/* Article Cover */
.article-cover {
  width: 100%;
  aspect-ratio: 16/8.5;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 45px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

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

/* Article Content Body */
.article-body {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.85;
}

.article-body p {
  margin-bottom: 24px;
}

/* Heading with numbered badge styling */
.article-body h2,
.article-body h3 {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  color: #ffffff;
  margin: 45px 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  scroll-margin-top: 110px; /* Offset for smooth scroll under topbar */
}

.article-body h2 {
  font-size: clamp(22px, 3vw, 28px);
}

.article-body h3 {
  font-size: clamp(19px, 2.5vw, 22px);
}

.heading-number-badge {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.article-body blockquote {
  margin: 35px 0;
  padding: 24px 30px;
  background: rgba(42, 169, 255, 0.04);
  border-left: 4px solid #2aa9ff;
  border-radius: 0 12px 12px 0;
  font-size: 19px;
  line-height: 1.7;
  font-style: italic;
  color: #ffffff;
}

.article-body ul {
  margin-bottom: 28px;
  padding-left: 10px;
  list-style: none;
}

.article-body ul li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
  line-height: 1.6;
}

.article-body ul li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

/* Related Posts Section */
.related-posts-section {
  padding: 60px 0;
  background: rgba(255, 255, 255, 0.01);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.related-posts-section h2 {
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 40px;
  padding-left: 8%;
}

/* ═══════════════ RESPONSIVE ADJUSTMENTS ═══════════════ */
@media (max-width: 992px) {
  .blog-detail-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .toc-sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
  }

  .toc-card {
    padding: 20px;
  }
  
  .toc-title {
    white-space: normal;
  }
}

@media (max-width: 768px) {
  .controls-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

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

  .details-container {
    padding-top: 120px;
  }

  .article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}
