/* ==========================================================================
   BIMFLOW BLOG & ARTICLES DESIGN SYSTEM
   Theme-aware (Dark / Light Mode) & Glassmorphism Aesthetics
   ========================================================================== */

/* Container & Layout */
.blog-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

/* Hero Section */
.blog-hero {
  text-align: center;
  padding: 30px 16px 40px;
  max-width: 840px;
  margin: 0 auto;
}

.blog-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

body.light-mode .blog-hero-badge {
  background: rgba(2, 132, 199, 0.08);
  border-color: rgba(2, 132, 199, 0.2);
  color: #0284c7;
}

.blog-hero-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  color: var(--ink);
  background: linear-gradient(135deg, var(--ink) 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-mode .blog-hero-title {
  background: linear-gradient(135deg, #0f172a 40%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blog-hero-desc {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--muted);
  line-height: 1.6;
  margin: 0 auto 28px;
}

/* Controls: Search & Category Pills */
.blog-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
  align-items: center;
}

.blog-search-bar {
  position: relative;
  width: 100%;
  max-width: 520px;
}

.blog-search-input {
  width: 100%;
  padding: 14px 20px 14px 46px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.25s ease;
  outline: none;
  box-shadow: 0 4px 20px -6px rgba(0, 0, 0, 0.1);
}

.blog-search-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2), 0 8px 24px -6px rgba(0, 0, 0, 0.15);
  background: var(--glass-hover);
}

.blog-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.blog-filter-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 950px;
}

.blog-pill {
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.blog-pill:hover {
  background: var(--glass-hover);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.2);
}

body.light-mode .blog-pill:hover {
  border-color: rgba(0, 0, 0, 0.15);
}

.blog-pill.active {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

/* Featured Post Card */
.blog-featured-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 48px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
}

@media (min-width: 860px) {
  .blog-featured-card {
    grid-template-columns: 1.15fr 1fr;
  }
}

.blog-featured-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 16px 40px -12px rgba(14, 165, 233, 0.15);
}

.blog-featured-img-wrap {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

@media (min-width: 860px) {
  .blog-featured-img-wrap {
    height: 100%;
    min-height: 340px;
  }
}

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

.blog-featured-card:hover .blog-featured-img {
  transform: scale(1.04);
}

.blog-featured-content {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.blog-featured-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.blog-featured-title {
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin: 0 0 14px;
}

.blog-featured-excerpt {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 24px;
}

/* Articles Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

/* Article Card */
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-5px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 14px 32px -10px rgba(14, 165, 233, 0.15);
}

body.light-mode .blog-card {
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.04);
}

body.light-mode .blog-card:hover {
  box-shadow: 0 14px 30px -8px rgba(0, 0, 0, 0.1);
}

.blog-card-img-wrap {
  position: relative;
  width: 100%;
  height: 190px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

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

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

.blog-card-body {
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
}

.blog-cat-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body.light-mode .blog-cat-badge {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.08);
}

.blog-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-excerpt {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border);
  font-size: 13px;
  color: var(--muted);
}

.blog-read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #38bdf8;
  font-weight: 600;
  font-size: 13px;
  transition: gap 0.2s ease;
}

body.light-mode .blog-read-more {
  color: #0284c7;
}

.blog-card:hover .blog-read-more {
  gap: 9px;
}

/* ==========================================================================
   SINGLE ARTICLE PAGE STYLES
   ========================================================================== */

.article-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px 80px;
}

/* Breadcrumbs */
.blog-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}

.blog-breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-breadcrumbs a:hover {
  color: var(--ink);
}

.blog-breadcrumbs span.sep {
  opacity: 0.4;
}

.blog-breadcrumbs span.current {
  color: var(--ink);
  font-weight: 500;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.article-header-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.article-title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.025em;
  margin: 0 0 20px;
}

.article-author-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  color: var(--muted);
  font-size: 13.5px;
}

.article-author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.article-author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.article-author-name {
  font-weight: 600;
  color: var(--ink);
}

/* Featured Hero Image */
.article-hero-image-wrap {
  margin-bottom: 40px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
  box-shadow: 0 12px 36px -10px rgba(0, 0, 0, 0.2);
}

.article-hero-image {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  display: block;
}

/* Article Content Body */
.article-body {
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.78;
  font-weight: 400;
}

.article-body p {
  margin: 0 0 1.5em;
  word-break: break-word;
}

.article-body h2 {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 2em 0 0.75em;
  line-height: 1.3;
  color: var(--ink);
  letter-spacing: -0.02em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--glass-border);
}

.article-body h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 1.6em 0 0.6em;
  line-height: 1.35;
  color: var(--ink);
}

.article-body ul, .article-body ol {
  margin: 0 0 1.5em;
  padding-left: 1.5em;
}

.article-body li {
  margin-bottom: 0.5em;
}

.article-body strong {
  font-weight: 700;
  color: var(--ink);
}

.article-body a {
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

body.light-mode .article-body a {
  color: #0284c7;
}

.article-body a:hover {
  color: #7dd3fc;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 2em 0;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  text-align: left;
}

.article-body table tr {
  background: transparent !important;
}

.article-body table th {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--ink) !important;
  font-weight: 700;
  padding: 12px 16px;
  border: 1px solid var(--glass-border) !important;
}

body.light-mode .article-body table th {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #0f172a !important;
}

.article-body table td {
  padding: 12px 16px;
  border: 1px solid var(--glass-border) !important;
  color: var(--ink) !important;
  background: transparent !important;
}

.article-body table tr:hover td {
  background: rgba(255, 255, 255, 0.03) !important;
}

body.light-mode .article-body table tr:hover td {
  background: rgba(0, 0, 0, 0.02) !important;
}

/* Images inside content */
.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.5em 0;
  border: 1px solid var(--glass-border);
}

/* Blockquotes */
.article-body blockquote {
  margin: 1.8em 0;
  padding: 16px 20px;
  border-left: 4px solid #38bdf8;
  background: rgba(56, 189, 248, 0.06);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: var(--ink);
}

/* Share & Action Bar */
.article-share-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px 0;
  margin: 40px 0;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
}

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

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.share-btn:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

/* CTA Card inside article */
.article-bimflow-cta {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(99, 102, 241, 0.12));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 20px;
  padding: 32px;
  margin: 48px 0;
  text-align: center;
  backdrop-filter: blur(16px);
}

body.light-mode .article-bimflow-cta {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.08), rgba(99, 102, 241, 0.08));
  border-color: rgba(2, 132, 199, 0.25);
}

.article-bimflow-cta h3 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
}

.article-bimflow-cta p {
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 20px;
  font-size: 15px;
}

.article-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #fff;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 20px -4px rgba(2, 132, 199, 0.4);
  transition: all 0.2s ease;
}

.article-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -4px rgba(2, 132, 199, 0.5);
}

/* Related Posts Section */
.related-posts-section {
  margin-top: 60px;
}

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

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 16px;
  grid-column: 1 / -1;
}
