/* Reading progress bar */
#reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #8BC34A, #F97316);
  z-index: 99999;
  transition: width 0.15s ease-out;
  pointer-events: none;
}

/* Blog specific modern styling */
.blog-hero {
  background: linear-gradient(135deg, #091a2f 0%, #0f2b48 50%, #163e65 100%);
  padding: 90px 0 50px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 80% 20%, rgba(139, 195, 74, 0.15), transparent 50%),
              radial-gradient(circle at 20% 80%, rgba(249, 115, 22, 0.12), transparent 50%);
  pointer-events: none;
}
.blog-search-box {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 580px;
  margin: 24px auto 0;
  transition: all 0.3s ease;
}
.blog-search-box:focus-within {
  background: #ffffff;
  border-color: #8BC34A;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}
.blog-search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 1rem;
  width: 100%;
  color: #ffffff;
  padding: 10px 0;
}
.blog-search-box:focus-within input {
  color: #0f172a;
}
.blog-search-box i {
  color: #94a3b8;
  font-size: 1.1rem;
}
.blog-search-box:focus-within i {
  color: #8BC34A;
}
.filter-pills-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 32px 0 10px;
}
.filter-pill {
  background: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.filter-pill:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}
.filter-pill.active {
  background: #0f2b48;
  color: #ffffff;
  border-color: #0f2b48;
  box-shadow: 0 4px 12px rgba(15, 43, 72, 0.25);
}
.filter-pill .pill-count {
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 12px;
}
.filter-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Article Cards Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 28px;
  margin: 30px 0;
}
.blog-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: relative;
}
.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(15, 43, 72, 0.12);
  border-color: #cbd5e1;
}
.blog-card-thumb {
  height: 180px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.blog-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.blog-card:hover .blog-card-thumb img {
  transform: scale(1.05);
}
.blog-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #94a3b8;
  font-size: 2.5rem;
}
.blog-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 12px;
}
.blog-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.blog-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
  color: #0f172a;
}
.blog-card-title a {
  color: #0f172a;
  text-decoration: none;
  transition: color 0.2s ease;
}
.blog-card-title a:hover {
  color: #2563eb;
}
.blog-card-excerpt {
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}
.blog-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}
.blog-card-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: #F97316;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s ease;
}
.blog-card-link:hover {
  gap: 10px;
  color: #ea580c;
}
.blog-cat-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #e0f2fe;
  color: #0369a1;
}

/* Spotlight Card */
.spotlight-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  margin-bottom: 40px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}
@media (max-width: 850px) {
  .spotlight-card {
    grid-template-columns: 1fr;
  }
}
.spotlight-thumb {
  min-height: 260px;
  background: #f8fafc;
  overflow: hidden;
  position: relative;
}
.spotlight-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.spotlight-body {
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.spotlight-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
  margin: 12px 0 16px;
}
.spotlight-title a {
  color: #0f172a;
  text-decoration: none;
}
.spotlight-title a:hover {
  color: #2563eb;
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 40px 0 20px;
  flex-wrap: wrap;
}
.page-btn {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.page-btn:hover:not(.disabled) {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}
.page-btn.active {
  background: #8BC34A;
  color: #ffffff;
  border-color: #8BC34A;
}
.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Single Article Layout */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  padding: 40px 0 80px;
}
@media (max-width: 980px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
}
.article-main {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 40px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}
@media (max-width: 640px) {
  .article-main {
    padding: 24px 18px;
  }
}
.article-content {
  color: #334155;
  font-size: 1.05rem;
  line-height: 1.8;
}
.article-content p {
  margin-bottom: 20px;
}
.article-content h2, .article-content h3, .article-content h4 {
  color: #0f172a;
  margin: 32px 0 16px;
  font-weight: 700;
  line-height: 1.35;
}
.article-content h2 { font-size: 1.55rem; border-bottom: 2px solid #f1f5f9; padding-bottom: 8px; }
.article-content h3 { font-size: 1.3rem; }
.article-content h4 { font-size: 1.15rem; }
.article-content ul, .article-content ol {
  margin: 16px 0 24px 24px;
}
.article-content li {
  margin-bottom: 10px;
}
.article-content blockquote {
  border-left: 4px solid #8BC34A;
  background: #f8fafc;
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #475569;
}
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}
.article-content th, .article-content td {
  border: 1px solid #e2e8f0;
  padding: 12px 16px;
  text-align: left;
}
.article-content th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 600;
}
.article-content a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-content a:hover {
  color: #1d4ed8;
}

/* Sidebar Widgets */
.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.sidebar-widget {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}
.widget-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid #8BC34A;
  display: flex;
  align-items: center;
  gap: 8px;
}
.recent-post-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}
.recent-post-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.recent-post-info h5 {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
}
.recent-post-info h5 a {
  color: #1e293b;
  text-decoration: none;
}
.recent-post-info h5 a:hover {
  color: #2563eb;
}
.recent-post-date {
  font-size: 0.78rem;
  color: #64748b;
}

/* Tag Cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-chip {
  background: #f1f5f9;
  color: #475569;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.2s ease;
}
.tag-chip:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Responsive Blog Elements & Overflow Protection */
.article-content {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.article-content table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.article-content pre,
.article-content code {
  max-width: 100%;
  overflow-x: auto;
  word-break: break-word;
}

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

@media (max-width: 768px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 0 50px;
  }
  .article-main {
    padding: 24px 16px;
    border-radius: 12px;
  }
  .blog-hero {
    padding: 40px 0 30px;
  }
  .blog-hero h1 {
    font-size: 1.75rem !important;
    line-height: 1.35 !important;
  }
}

@media (max-width: 480px) {
  .article-main {
    padding: 20px 14px;
  }
  .blog-hero h1 {
    font-size: 1.5rem !important;
  }
  .filter-pills-bar {
    gap: 6px;
  }
  .filter-pill {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}
