/* ============================================================
   Alchotech Solutions - Blog & Insights Stylesheet (blog.css)
   ============================================================ */

/* --- Blog Hero Banner --- */
.blog-hero-section {
  background: linear-gradient(135deg, #030712 0%, #0f172a 60%, #1e1b4b 100%);
  padding: 140px 0 85px;
  position: relative;
  overflow: hidden;
  color: #ffffff;
}

.blog-hero-section::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(13, 82, 243, 0.25) 0%,
    rgba(13, 82, 243, 0) 70%
  );
  pointer-events: none;
}

.blog-hero-title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #ffffff !important;
  margin-bottom: 18px;
}

/* Hero Banner Text Visibility Overrides */
.about-hero-section .about-hero-title,
.about-hero-title {
  color: #ffffff !important;
  font-weight: 700;
  line-height: 1.25;
}

.about-hero-section .sub-title-2 {
  color: #ffffff !important;
}

.about-hero-section p {
  color: #cbd5e1 !important;
}

.blog-hero-subtitle {
  font-size: 1.15rem;
  line-height: 1.7;
  color: #cbd5e1;
  max-width: 680px;
  margin: 0 auto;
}

/* --- Filter & Category Navigation Bar --- */
.blog-filter-section {
  padding: 30px 0 10px;
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  position: relative;
  z-index: 1000;
  overflow: visible !important;
}

.blog-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1000;
  overflow: visible !important;
}

.filter-categories {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  z-index: 1000;
  overflow: visible !important;
}

.filter-dropdown-wrap {
  position: relative;
  z-index: 1001;
}

.filter-item-btn {
  background: transparent;
  border: none;
  font-size: 0.98rem;
  font-weight: 600;
  color: #475569;
  padding: 10px 4px;
  cursor: pointer;
  position: relative;
  transition: color 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.filter-item-btn:hover,
.filter-item-btn.active,
.filter-dropdown-wrap:hover .filter-item-btn,
.filter-dropdown-wrap.show .filter-item-btn {
  color: #0d52f3;
}

.filter-item-btn.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2.5px;
  background-color: #0d52f3;
  border-radius: 2px;
}

/* Category Filter Dropdown Popover */
.filter-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 230px;
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.16);
  padding: 8px 0;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99999 !important;
}

.filter-dropdown-wrap:hover .filter-dropdown-menu,
.filter-dropdown-wrap.show .filter-dropdown-menu,
.filter-dropdown-wrap.active .filter-dropdown-menu {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

.filter-dropdown-menu li a {
  display: block;
  padding: 10px 18px;
  font-size: 0.91rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.filter-dropdown-menu li a:hover {
  background-color: #eff6ff;
  color: #0d52f3;
}

.blog-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.blog-search-input {
  padding: 10px 42px 10px 18px;
  font-size: 0.92rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 50px;
  outline: none;
  background-color: #f8fafc;
  color: #0f172a;
  transition: all 0.3s ease;
  width: 240px;
}

.blog-search-input:focus {
  width: 280px;
  border-color: #0d52f3;
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(13, 82, 243, 0.1);
}

.blog-search-btn-icon {
  position: absolute;
  right: 6px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #000000;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition:
    background 0.3s ease,
    transform 0.2s ease;
}

.blog-search-btn-icon:hover {
  background: #222222;
  transform: scale(1.05);
}

/* --- Main Articles Grid Section --- */
.blog-content-section {
  padding: 80px 0 120px;
  background-color: #ffffff;
  position: relative;
  z-index: 1;
}

.featured-row-spacing {
  margin-bottom: 70px !important;
}

/* Article Card Common */
.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  margin-bottom: 20px;
}

.blog-card-img-wrap {
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background-color: #f1f5f9;
  position: relative;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.blog-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  display: block;
}

.blog-card:hover .blog-card-img-wrap img {
  transform: scale(1.06);
}

/* Featured Large Cards (Top Row) */
.featured-card .blog-card-img-wrap {
  height: 340px;
}

.featured-card .blog-card-title {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.35;
  color: #0f172a;
  margin: 22px 0 14px;
  letter-spacing: -0.02em;
  transition: color 0.25s ease;
}

.blog-card:hover .blog-card-title {
  color: #0d52f3;
}

/* Secondary Grid Cards (Bottom Row) */
.grid-card .blog-card-img-wrap {
  height: 230px;
  border-radius: 16px;
}

.grid-card .blog-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.42;
  color: #0f172a;
  margin: 18px 0 12px;
  letter-spacing: -0.01em;
  transition: color 0.25s ease;
}

/* Meta Line Styling (Single line responsive layout) */
.blog-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #64748b;
  /* margin-top: auto; */
  padding-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blog-meta .meta-item {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.blog-meta .meta-item strong {
  color: #334155;
  font-weight: 600;
}

.blog-meta .meta-item.category {
  color: #0d52f3;
  font-weight: 600;
}

.blog-meta .meta-divider {
  color: #cbd5e1;
}

/* --- Pagination Component --- */
.blog-pagination-wrapper {
  margin-top: 60px;
  padding-top: 20px;
}

.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-pagination .page-item .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background-color: #ffffff;
  color: #334155;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: all 0.25s ease;
}

.blog-pagination .page-item:not(.active):not(.disabled) .page-link:hover {
  border-color: #0d52f3;
  color: #0d52f3;
  background-color: #eff6ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 82, 243, 0.12);
}

.blog-pagination .page-item.active .page-link {
  background-color: #0d52f3;
  border-color: #0d52f3;
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(13, 82, 243, 0.28);
}

.blog-pagination .page-item.disabled .page-link {
  color: #cbd5e1;
  border-color: #f1f5f9;
  background-color: #f8fafc;
  cursor: not-allowed;
}

.blog-pagination .page-item.ellipsis .page-link {
  border: none;
  background: transparent;
  color: #64748b;
  cursor: default;
}

/* Responsive Styles */
@media (max-width: 991px) {
  .blog-hero-title {
    font-size: 2.2rem;
  }
  .featured-card .blog-card-img-wrap {
    height: 270px;
  }
  .grid-card .blog-card-img-wrap {
    height: 200px;
  }
  .filter-categories {
    gap: 16px;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 8px;
  }
}

@media (max-width: 575px) {
  .blog-hero-section {
    padding: 110px 0 55px;
  }
  .blog-hero-title {
    font-size: 1.8rem;
  }
  .featured-card .blog-card-img-wrap {
    height: 210px;
  }
  .featured-card .blog-card-title {
    font-size: 1.2rem;
  }
  .grid-card .blog-card-title {
    font-size: 1.05rem;
  }
  .blog-pagination .page-item .page-link {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    font-size: 0.85rem;
  }
}

/* --- Table of Contents (TOC) Component --- */
.blog-toc-card {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 18px;
  padding: 24px 28px;
  margin: 35px 0 40px;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.03);
}

.blog-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* margin-bottom: 18px; */
}

.blog-toc-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.12rem;
  font-weight: 700;
  color: #0f172a;
}

.toc-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(13, 82, 243, 0.1);
  color: #0d52f3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.toc-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.toc-toggle-btn:hover {
  background: #0d52f3;
  border-color: #0d52f3;
  color: #ffffff;
}

.blog-toc-card.collapsed .toc-toggle-btn {
  transform: rotate(180deg);
}

.blog-toc-body {
  max-height: 800px;
  opacity: 1;
  overflow: hidden;
  margin-top: 18px;
  transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, margin-top 0.35s ease;
}

.blog-toc-card.collapsed .blog-toc-body {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.toc-list {
  padding-left: 20px;
  margin: 0;
  color: #0f172a;
}

.toc-list > li {
  font-weight: 700;
  font-size: 0.96rem;
  margin-bottom: 12px;
  color: #0f172a;
}

.toc-list > li:last-child {
  margin-bottom: 0;
}

.toc-list a {
  color: #0d52f3;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed rgba(13, 82, 243, 0.4);
  transition: all 0.2s ease;
}

.toc-list a:hover {
  color: #0284c7;
  border-bottom-style: solid;
}

.toc-sublist {
  padding-left: 22px;
  margin: 10px 0 10px;
  list-style-type: decimal;
}

.toc-sublist li {
  font-size: 0.92rem;
  margin-bottom: 8px;
  font-weight: 500;
}

/* --- Blog Details Page Styles (Full Width / No Sidebar) --- */
.blog-details-section {
  padding: 70px 0 110px;
  background-color: #ffffff;
}

.blog-details-header {
  margin-bottom: 35px;
}

.blog-details-category {
  display: inline-block;
  background: rgba(13, 82, 243, 0.08);
  border: 1px solid rgba(13, 82, 243, 0.2);
  color: #0d52f3;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 16px;
  border-radius: 50px;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.blog-details-main-title {
  font-size: 2.65rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}

.blog-details-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 35px;
  flex-wrap: wrap;
}

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

.author-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.author-meta-text .author-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: #0f172a;
  margin: 0;
}

.author-meta-text .post-date-info {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
}

.article-share-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.share-btn-pill {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.25s ease;
}

.share-btn-pill:hover {
  background: #0d52f3;
  color: #ffffff !important;
  transform: translateY(-2px);
}

.blog-featured-hero-img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 24px;
  margin-bottom: 40px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.blog-details-article-content {
  font-size: 1.1rem;
  line-height: 1.85;
  color: #334155;
}

.blog-details-article-content p {
  margin-bottom: 24px;
}

.blog-details-article-content h2 {
  font-size: 1.85rem;
  font-weight: 700;
  color: #0f172a;
  margin: 42px 0 18px;
  letter-spacing: -0.02em;
}

.blog-details-article-content h3 {
  font-size: 1.45rem;
  font-weight: 700;
  color: #0f172a;
  margin: 32px 0 16px;
}

.blog-blockquote {
  background: #f8fafc;
  border-left: 4px solid #0d52f3;
  border-radius: 0 16px 16px 0;
  padding: 28px 32px;
  margin: 36px 0;
  font-size: 1.2rem;
  font-weight: 500;
  font-style: italic;
  color: #0f172a;
  line-height: 1.6;
}

.blog-blockquote-author {
  font-size: 0.92rem;
  font-weight: 700;
  font-style: normal;
  color: #0d52f3;
  margin-top: 12px;
  display: block;
}

.article-tags-share-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0;
  margin-top: 50px;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.article-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.article-tags .tag-label {
  font-weight: 700;
  font-size: 0.92rem;
  color: #0f172a;
}

.tag-badge-link {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.25s ease;
}

.tag-badge-link:hover {
  background: #0d52f3;
  color: #ffffff !important;
}

/* Author Bio Box Card */
.author-bio-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 32px;
  margin: 45px 0;
  display: flex;
  gap: 22px;
  align-items: flex-start;
}

.author-bio-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-bio-content h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.author-bio-role {
  font-size: 0.88rem;
  color: #0d52f3;
  font-weight: 600;
  margin-bottom: 10px;
}

.author-bio-text {
  font-size: 0.96rem;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 0;
}

/* Post Navigation Links */
.post-navigation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 45px 0;
}

.post-nav-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.post-nav-card:hover {
  border-color: #0d52f3;
  box-shadow: 0 10px 25px rgba(13, 82, 243, 0.08);
  transform: translateY(-2px);
}

.post-nav-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-nav-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.4;
}

/* Comments Section */
.blog-comments-wrapper {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid #e2e8f0;
}

.comments-section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 30px;
}

.comments-list {
  list-style: none;
  padding: 0;
  margin: 0 0 50px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.comment-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 24px 28px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.03);
}

.comment-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

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

.comment-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-author-name {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.comment-date {
  font-size: 0.82rem;
  color: #64748b;
}

.comment-reply-btn {
  background: #f1f5f9;
  color: #0d52f3;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.25s ease;
}

.comment-reply-btn:hover {
  background: #0d52f3;
  color: #ffffff !important;
}

.comment-text {
  font-size: 0.98rem;
  line-height: 1.65;
  color: #334155;
  margin: 0;
}

/* Comment Form Box */
.comment-form-wrapper {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 40px;
}

.comment-form-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.comment-form-subtitle {
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 28px;
}

@media (max-width: 767px) {
  .blog-details-main-title {
    font-size: 1.95rem;
  }
  .author-bio-card {
    flex-direction: column;
    padding: 24px;
  }
  .post-navigation-grid {
    grid-template-columns: 1fr;
  }
  .comment-form-wrapper {
    padding: 24px;
  }
}

/* ---------------------------------------------------------------------
   AI-generated article content: lists, emphasis, and inline images.
   The rich-text body only guarantees h2/h3/p/ul/ol/li/strong/em, so
   these need explicit rules beyond the browser defaults.
--------------------------------------------------------------------- */
.blog-details-article-content ul,
.blog-details-article-content ol {
  margin: 0 0 26px;
  padding-left: 26px;
  color: #334155;
}

.blog-details-article-content li {
  margin-bottom: 12px;
  line-height: 1.75;
}

.blog-details-article-content li::marker {
  color: #0d52f3;
  font-weight: 700;
}

.blog-details-article-content strong {
  color: #0f172a;
  font-weight: 700;
}

.blog-details-article-content em {
  color: #475569;
}

.blog-details-article-content a {
  color: #0d52f3;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.blog-details-article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  margin: 28px 0;
  display: block;
}

.blog-details-article-content h2:first-child,
.blog-details-article-content h3:first-child {
  margin-top: 0;
}

/* Keep card titles to a consistent height regardless of AI title length */
.featured-card .blog-card-title a,
.grid-card .blog-card-title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-meta .category {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
