/* ================================================
   BLOGS & CONTENT PAGES - Modern Design
   Navy (#1b1d4e) & Gold (#d4a574) Theme
   ================================================ */

/* ================================================
   CSS VARIABLES - Light Mode (Default)
   ================================================ */
:root {
  /* Blog-specific colors using brand palette */
  --blog-primary: #1b1d4e;
  --blog-primary-light: #2a2d6e;
  --blog-gold: #d4a574;
  --blog-gold-light: #e4c5a4;
  --blog-cream: #fdf4e5;

  /* Backgrounds */
  --blog-bg: #ffffff;
  --blog-bg-secondary: #f8f9fc;
  --blog-bg-card: #ffffff;
  --blog-bg-hover: #f0f2f8;

  /* Text colors */
  --blog-text-primary: #1b1d4e;
  --blog-text-secondary: #5a5d7a;
  --blog-text-muted: #8b8fa8;

  /* Borders */
  --blog-border: #e5e7eb;
  --blog-border-light: #f0f1f5;

  /* Shadows */
  --blog-shadow-sm: 0 2px 8px rgba(27, 29, 78, 0.06);
  --blog-shadow-md: 0 4px 20px rgba(27, 29, 78, 0.08);
  --blog-shadow-lg: 0 8px 30px rgba(27, 29, 78, 0.12);
  --blog-shadow-hover: 0 12px 40px rgba(27, 29, 78, 0.15);

  /* Gradients */
  --blog-gradient-primary: linear-gradient(135deg, #1b1d4e 0%, #2a2d6e 100%);
  --blog-gradient-gold: linear-gradient(135deg, #d4a574 0%, #c49564 100%);
  --blog-gradient-subtle: linear-gradient(180deg, #f8f9fc 0%, #ffffff 100%);
}

/* ================================================
   DARK MODE VARIABLES
   ================================================ */
[data-theme="dark"] {
  --blog-bg: #0f1019;
  --blog-bg-secondary: #161824;
  --blog-bg-card: #1a1d2e;
  --blog-bg-hover: #242840;

  --blog-text-primary: #f0f1f5;
  --blog-text-secondary: #a8adc0;
  --blog-text-muted: #6b7090;

  --blog-border: #2a2d45;
  --blog-border-light: #1f2235;

  --blog-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --blog-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.25);
  --blog-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.35);
  --blog-shadow-hover: 0 12px 40px rgba(212, 165, 116, 0.15);

  --blog-gradient-subtle: linear-gradient(180deg, #161824 0%, #0f1019 100%);
}

/* ================================================
   BLOG LIST PAGE
   ================================================ */
.blog-page {
  background: var(--blog-bg);
  min-height: 100vh;
  padding-bottom: 4rem;
}

/* Hero Section */
.blog-hero {
  background: var(--blog-gradient-subtle);
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.blog-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(212, 165, 116, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

[data-theme="dark"] .blog-hero::before {
  background: radial-gradient(circle, rgba(212, 165, 116, 0.04) 0%, transparent 60%);
}

.blog-hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--blog-text-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

[data-theme="dark"] .blog-hero-title {
  background: var(--blog-gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-hero-subtitle {
  font-size: 1.1rem;
  color: var(--blog-text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

/* Search Bar */
.blog-search-container {
  max-width: 500px;
  margin: 1.5rem auto 0;
  position: relative;
}

.blog-search-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  border: 2px solid var(--blog-border);
  border-radius: 12px;
  background: var(--blog-bg-card);
  color: var(--blog-text-primary);
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-search-input:focus {
  outline: none;
  border-color: var(--blog-gold);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
}

.blog-search-input::placeholder {
  color: var(--blog-text-muted);
}

.blog-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: var(--blog-text-muted);
}

/* Create Blog Button */
.blog-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--blog-gradient-gold);
  color: var(--blog-primary);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: var(--blog-shadow-sm);
}

.blog-create-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(212, 165, 116, 0.3);
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

@media (min-width: 640px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Blog Card */
.blog-card {
  background: var(--blog-bg-card);
  border: 1px solid var(--blog-border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--blog-shadow-hover);
  border-color: var(--blog-gold);
}

[data-theme="dark"] .blog-card:hover {
  box-shadow: 0 12px 40px rgba(212, 165, 116, 0.1);
}

/* Card Image */
.blog-card-image {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: var(--blog-gradient-primary);
}

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

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

.blog-card-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blog-gradient-primary);
}

.blog-card-placeholder svg {
  width: 4rem;
  height: 4rem;
  color: rgba(255, 255, 255, 0.2);
}

/* Draft Badge */
.blog-badge-draft {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.35rem 0.75rem;
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Card Content */
.blog-card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--blog-text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

.blog-card:hover .blog-card-title {
  color: var(--blog-gold);
}

.blog-card-excerpt {
  font-size: 0.9rem;
  color: var(--blog-text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Meta */
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--blog-text-muted);
  margin-bottom: 1rem;
}

.blog-card-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.blog-card-meta-item svg {
  width: 0.9rem;
  height: 0.9rem;
}

/* Card Actions */
.blog-card-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
}

.blog-card-btn {
  flex: 1;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.blog-card-btn-primary {
  background: var(--blog-gradient-primary);
  color: white;
}

.blog-card-btn-primary:hover {
  box-shadow: 0 6px 20px rgba(27, 29, 78, 0.3);
  transform: translateY(-2px);
}

[data-theme="dark"] .blog-card-btn-primary {
  background: var(--blog-gradient-gold);
  color: var(--blog-primary);
}

.blog-card-btn-secondary {
  background: transparent;
  border: 1.5px solid var(--blog-border);
  color: var(--blog-text-primary);
}

.blog-card-btn-secondary:hover {
  border-color: var(--blog-gold);
  color: var(--blog-gold);
}

/* Empty State */
.blog-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
}

.blog-empty-icon {
  width: 5rem;
  height: 5rem;
  margin: 0 auto 1.5rem;
  color: var(--blog-text-muted);
  opacity: 0.4;
}

.blog-empty-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blog-text-primary);
  margin-bottom: 0.5rem;
}

.blog-empty-text {
  color: var(--blog-text-secondary);
  max-width: 400px;
  margin: 0 auto;
}

/* ================================================
   BLOG DETAIL PAGE
   ================================================ */
.blog-detail-page {
  background: var(--blog-bg);
  min-height: 100vh;
}

/* Detail Hero */
.blog-detail-hero {
  position: relative;
  padding: 4rem 1.5rem 3rem;
  background: var(--blog-gradient-primary);
  color: white;
  overflow: hidden;
}

.blog-detail-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
}

.blog-detail-hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.blog-detail-badge {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  background: rgba(212, 165, 116, 0.2);
  border: 1px solid rgba(212, 165, 116, 0.4);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blog-gold-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.blog-detail-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.blog-detail-description {
  font-size: 1.1rem;
  line-height: 1.6;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.blog-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
  opacity: 0.85;
}

.blog-detail-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-detail-meta-item svg {
  width: 1rem;
  height: 1rem;
}

.blog-author-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: var(--blog-gradient-gold);
  color: var(--blog-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Detail Content Layout */
.blog-detail-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .blog-detail-layout {
    grid-template-columns: 220px 1fr 280px;
    gap: 2.5rem;
  }
}

/* Table of Contents */
.blog-toc {
  display: none;
}

@media (min-width: 1024px) {
  .blog-toc {
    display: block;
    position: sticky;
    top: 5rem;
    height: fit-content;
  }
}

.blog-toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blog-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.blog-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-toc-item {
  margin-bottom: 0.5rem;
}

.blog-toc-link {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--blog-text-secondary);
  text-decoration: none;
  border-left: 2px solid var(--blog-border);
  transition: all 0.2s ease;
}

.blog-toc-link:hover,
.blog-toc-link.active {
  color: var(--blog-gold);
  border-left-color: var(--blog-gold);
  background: rgba(212, 165, 116, 0.08);
}

/* Main Article Content */
.blog-article {
  background: var(--blog-bg-card);
  border: 1px solid var(--blog-border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--blog-shadow-sm);
}

.blog-section {
  margin-bottom: 2.5rem;
}

.blog-section:last-child {
  margin-bottom: 0;
}

.blog-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blog-text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--blog-border);
  position: relative;
}

.blog-section-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--blog-gold);
}

/* Content Elements */
.blog-content p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--blog-text-secondary);
  margin-bottom: 1.25rem;
}

.blog-content img {
  max-width: 100%;
  border-radius: 12px;
  margin: 1.5rem 0;
}

.blog-content ul,
.blog-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
  color: var(--blog-text-secondary);
}

.blog-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.blog-content a {
  color: var(--blog-gold);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s ease;
}

.blog-content a:hover {
  opacity: 0.8;
}

/* Video Embed */
.blog-video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  margin: 1.5rem 0;
}

.blog-video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Tables */
.blog-table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 12px;
  border: 1px solid var(--blog-border);
}

.blog-table {
  width: 100%;
  border-collapse: collapse;
}

.blog-table th {
  background: var(--blog-bg-secondary);
  padding: 0.875rem 1rem;
  font-weight: 600;
  text-align: left;
  color: var(--blog-text-primary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.blog-table td {
  padding: 0.875rem 1rem;
  border-top: 1px solid var(--blog-border);
  color: var(--blog-text-secondary);
  font-size: 0.9rem;
}

.blog-table tr:hover td {
  background: var(--blog-bg-hover);
}

/* FAQ Accordion */
.blog-faq {
  margin: 1.5rem 0;
}

.blog-faq-item {
  border: 1px solid var(--blog-border);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.blog-faq-question {
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--blog-bg-secondary);
  border: none;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--blog-text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.blog-faq-question:hover {
  background: var(--blog-bg-hover);
}

.blog-faq-question svg {
  width: 1.25rem;
  height: 1.25rem;
  transition: transform 0.3s ease;
}

.blog-faq-item.open .blog-faq-question svg {
  transform: rotate(180deg);
}

.blog-faq-answer {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.blog-faq-item.open .blog-faq-answer {
  padding: 1rem 1.25rem;
  max-height: 500px;
}

.blog-faq-answer p {
  margin: 0;
  color: var(--blog-text-secondary);
}

/* Stats Card */
.blog-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.blog-stat-card {
  background: var(--blog-bg-secondary);
  border: 1px solid var(--blog-border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  transition: all 0.3s ease;
}

.blog-stat-card:hover {
  border-color: var(--blog-gold);
  transform: translateY(-4px);
}

.blog-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--blog-gold);
  margin-bottom: 0.25rem;
}

.blog-stat-label {
  font-size: 0.85rem;
  color: var(--blog-text-secondary);
}

/* Sidebar */
.blog-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .blog-sidebar {
    display: block;
  }
}

.blog-sidebar-section {
  background: var(--blog-bg-card);
  border: 1px solid var(--blog-border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.blog-sidebar-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--blog-text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--blog-border);
}

/* Related Posts */
.blog-related-item {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--blog-border-light);
}

.blog-related-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.blog-related-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.blog-related-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blog-text-primary);
  line-height: 1.4;
  margin-bottom: 0.25rem;
  transition: color 0.2s ease;
}

.blog-related-title:hover {
  color: var(--blog-gold);
}

.blog-related-date {
  font-size: 0.75rem;
  color: var(--blog-text-muted);
}

/* Newsletter Signup */
.blog-newsletter {
  background: var(--blog-gradient-primary);
  border-radius: 12px;
  padding: 1.5rem;
  color: white;
}

[data-theme="dark"] .blog-newsletter {
  background: var(--blog-bg-secondary);
  border: 1px solid var(--blog-border);
}

.blog-newsletter-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.blog-newsletter-text {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-bottom: 1rem;
}

.blog-newsletter-input {
  width: 100%;
  padding: 0.7rem 0.875rem;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.blog-newsletter-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .blog-newsletter-input {
  background: var(--blog-bg-card);
  color: var(--blog-text-primary);
}

.blog-newsletter-btn {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--blog-gradient-gold);
  color: var(--blog-primary);
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.blog-newsletter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 165, 116, 0.4);
}

/* ================================================
   USE CASE LIST - TAB FILTERS
   ================================================ */
.usecase-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.usecase-tab {
  padding: 0.6rem 1.25rem;
  background: var(--blog-bg-card);
  border: 1.5px solid var(--blog-border);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--blog-text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.usecase-tab:hover {
  border-color: var(--blog-gold);
  color: var(--blog-gold);
}

.usecase-tab.active {
  background: var(--blog-gradient-primary);
  color: white;
  border-color: transparent;
}

[data-theme="dark"] .usecase-tab.active {
  background: var(--blog-gradient-gold);
  color: var(--blog-primary);
}

/* ================================================
   RESPONSIVE ADJUSTMENTS
   ================================================ */
@media (max-width: 768px) {
  .blog-hero {
    padding: 2rem 1rem 1.5rem;
  }

  .blog-hero-title {
    font-size: 1.75rem;
  }

  .blog-hero-subtitle {
    font-size: 1rem;
  }

  .blog-grid {
    padding: 1.5rem 1rem;
  }

  .blog-card-image {
    height: 150px;
  }

  .blog-card-content {
    padding: 1.25rem;
  }

  .blog-detail-hero {
    padding: 3rem 1rem 2rem;
  }

  .blog-detail-title {
    font-size: 1.75rem;
  }

  .blog-detail-layout {
    padding: 1.5rem 1rem;
  }

  .blog-article {
    padding: 1.25rem;
  }

  .usecase-tabs {
    gap: 0.4rem;
  }

  .usecase-tab {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
}

/* ================================================
   ANIMATIONS
   ================================================ */
@keyframes blogFadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.blog-card {
  animation: blogFadeInUp 0.5s ease forwards;
}

.blog-card:nth-child(1) { animation-delay: 0.05s; }
.blog-card:nth-child(2) { animation-delay: 0.1s; }
.blog-card:nth-child(3) { animation-delay: 0.15s; }
.blog-card:nth-child(4) { animation-delay: 0.2s; }
.blog-card:nth-child(5) { animation-delay: 0.25s; }
.blog-card:nth-child(6) { animation-delay: 0.3s; }

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .blog-card {
    animation: none;
  }

  .blog-card,
  .blog-card-btn,
  .blog-search-input,
  .blog-toc-link,
  .usecase-tab {
    transition: none;
  }
}
