/* ===================================
   BLOG CMS — Styles
   Inherits Neumorphism design system
   from the main landing CSS
   =================================== */

/* ===== BLOG MAIN ===== */
.blog-main {
  padding-top: 100px;
  min-height: 100vh;
}

/* ===== BLOG HERO ===== */
.blog-hero {
  text-align: center;
  padding: 40px 0 50px;
}

.blog-hero__title {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 900;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.blog-hero__subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ===== BREADCRUMBS ===== */
.blog-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 20px 0 8px;
  font-size: var(--text-sm);
  color: var(--text-muted);
  flex-wrap: wrap;
}

.blog-breadcrumbs a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

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

.blog-breadcrumbs__sep {
  color: var(--text-muted);
  font-size: 12px;
}

/* ===== CATEGORY TABS ===== */
.blog-categories {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 40px;
}

.blog-category-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--nm-bg-card);
  box-shadow: var(--nm-shadow-sm);
  border-radius: var(--radius-2xl);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-base);
  cursor: pointer;
  text-decoration: none;
}

.blog-category-tab:hover,
.blog-category-tab--active {
  color: var(--color-primary);
  box-shadow: var(--nm-shadow-md);
  transform: translateY(-2px);
}

.blog-category-tab span {
  opacity: 0.5;
  font-weight: 400;
}

/* ===== BLOG GRID ===== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
  padding-bottom: 60px;
}

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

/* ===== BLOG CARD ===== */
.blog-card {
  background: var(--nm-bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--nm-shadow-md);
  overflow: hidden;
  transition: all var(--transition-base);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--nm-shadow-lg);
}

.blog-card__cover {
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: var(--nm-surface);
  position: relative;
}

.blog-card__cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  opacity: 0.3;
}

.blog-card__body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card__category {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.blog-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.blog-card__excerpt {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__footer {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: auto;
}

/* ===== ARTICLE PAGE ===== */
.blog-article {
  max-width: 760px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.blog-article__cover {
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: var(--nm-shadow-md);
}

.blog-article__cover img {
  width: 100%;
  height: auto;
  display: block;
}

.blog-article__header {
  margin-bottom: 36px;
}

.blog-article__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.blog-article__category {
  background: rgba(139, 92, 246, 0.1);
  color: var(--color-primary);
  padding: 4px 14px;
  border-radius: var(--radius-2xl);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.blog-article__date,
.blog-article__read-time {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.blog-article__title {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 900;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.blog-article__excerpt {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.7;
  font-style: italic;
}

/* ===== ARTICLE CONTENT (WYSIWYG output) ===== */
.blog-article__content {
  font-size: var(--text-base);
  line-height: 1.85;
  color: var(--text-primary);
}

.blog-article__content h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  margin: 40px 0 16px;
  color: var(--text-primary);
}

.blog-article__content h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--text-primary);
}

.blog-article__content p {
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.blog-article__content img {
  max-width: 100%;
  border-radius: var(--radius-lg);
  margin: 24px 0;
  box-shadow: var(--nm-shadow-sm);
}

.blog-article__content ul,
.blog-article__content ol {
  margin: 16px 0;
  padding-left: 24px;
  color: var(--text-secondary);
}

.blog-article__content ul {
  list-style: disc;
}

.blog-article__content ol {
  list-style: decimal;
}

.blog-article__content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.blog-article__content blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 16px 24px;
  margin: 24px 0;
  background: rgba(139, 92, 246, 0.05);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-secondary);
}

.blog-article__content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-article__content a:hover {
  color: var(--color-primary-dark);
}

.blog-article__content hr {
  border: none;
  height: 1px;
  background: var(--nm-shadow-dark);
  margin: 40px 0;
  opacity: 0.3;
}

/* ===== AUTHOR ===== */
.blog-article__author {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: var(--nm-bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--nm-shadow-sm);
  margin-top: 40px;
}

.blog-article__author-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--nm-surface);
  box-shadow: var(--nm-inset-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.blog-article__author-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text-primary);
}

.blog-article__author-role {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ===== BLOG CTA ===== */
.blog-cta {
  text-align: center;
  padding: 48px 32px;
  background: var(--nm-bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--nm-shadow-md);
  margin: 40px auto 60px;
  max-width: 760px;
}

.blog-cta__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.blog-cta__text {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ===== BLOG TOOLBAR (Search + Sort) ===== */
.blog-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.blog-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--nm-bg-card);
  box-shadow: var(--nm-inset-sm);
  border-radius: var(--radius-2xl);
  flex: 1;
  max-width: 400px;
  min-width: 220px;
  transition: box-shadow var(--transition-base);
}

.blog-search:focus-within {
  box-shadow: var(--nm-inset-sm), 0 0 0 2px rgba(139, 92, 246, 0.3);
}

.blog-search__icon {
  font-size: 16px;
  opacity: 0.5;
  flex-shrink: 0;
}

.blog-search__input {
  border: none;
  background: transparent;
  font-size: var(--text-sm);
  color: var(--text-primary);
  outline: none;
  width: 100%;
  font-family: inherit;
}

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

.blog-sort {
  padding: 10px 20px;
  background: var(--nm-bg-card);
  box-shadow: var(--nm-shadow-sm);
  border-radius: var(--radius-2xl);
  border: none;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%238b8b8b' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: all var(--transition-base);
}

.blog-sort:hover {
  box-shadow: var(--nm-shadow-md);
  color: var(--text-primary);
}

.blog-sort:focus {
  box-shadow: var(--nm-shadow-md), 0 0 0 2px rgba(139, 92, 246, 0.3);
}

/* ===== NO RESULTS ===== */
.blog-no-results {
  text-align: center;
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: var(--text-lg);
  padding: 60px 0 20px;
  font-style: italic;
}

/* ===== LOAD MORE ===== */
.blog-load-more-wrap {
  text-align: center;
  padding: 16px 0 60px;
}

.blog-load-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 40px;
  background: var(--nm-bg-card);
  box-shadow: var(--nm-shadow-md);
  border: none;
  border-radius: var(--radius-2xl);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-primary);
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: inherit;
}

.blog-load-more:hover {
  transform: translateY(-3px);
  box-shadow: var(--nm-shadow-lg);
  color: var(--color-primary-dark, #6d28d9);
}

.blog-load-more:active {
  transform: translateY(0);
  box-shadow: var(--nm-inset-sm);
}

/* ===== CARD VISIBILITY ANIMATION ===== */
.blog-card {
  animation: blog-card-in 0.4s ease both;
}

@keyframes blog-card-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for cards */
.blog-card:nth-child(1) { animation-delay: 0s; }
.blog-card:nth-child(2) { animation-delay: 0.05s; }
.blog-card:nth-child(3) { animation-delay: 0.1s; }
.blog-card:nth-child(4) { animation-delay: 0.15s; }
.blog-card:nth-child(5) { animation-delay: 0.2s; }
.blog-card:nth-child(6) { animation-delay: 0.25s; }
.blog-card:nth-child(7) { animation-delay: 0.3s; }
.blog-card:nth-child(8) { animation-delay: 0.35s; }
.blog-card:nth-child(9) { animation-delay: 0.4s; }

/* ===== RELATED ARTICLES ===== */
.blog-related {
  max-width: 760px;
  margin: 48px auto 0;
  padding-top: 40px;
  border-top: 2px solid rgba(139, 92, 246, 0.1);
}

.blog-related__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 24px;
  text-align: center;
}

.blog-grid--related {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding-bottom: 0;
}

.blog-grid--related .blog-card__cover {
  height: 140px;
}

.blog-grid--related .blog-card__body {
  padding: 16px;
}

.blog-grid--related .blog-card__title {
  font-size: var(--text-base);
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .blog-hero__title {
    font-size: var(--text-2xl);
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-article__title {
    font-size: var(--text-2xl);
  }

  .blog-card__cover {
    height: 160px;
  }

  .blog-categories {
    gap: 8px;
  }

  .blog-category-tab {
    padding: 8px 14px;
    font-size: var(--text-xs);
  }

  .blog-toolbar {
    flex-direction: column;
    gap: 12px;
  }

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

  .blog-sort {
    width: 100%;
  }

  .blog-grid--related {
    grid-template-columns: 1fr;
  }

  .blog-related__title {
    font-size: var(--text-xl);
  }
}
