/* ============================================
   BLOG FRONTEND STYLES
   Professional blog reading experience
   ============================================ */

/* Blog Layout - 2 Column */
.blog-list-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

.blog-sidebar {
  position: sticky;
  top: 80px;
}

.blog-main {
  min-width: 0;
}

@media (max-width: 991px) {
  .blog-list-layout {
    grid-template-columns: 1fr;
  }

  .blog-sidebar {
    position: static;
  }
}

.sidebar-widget {
  background: var(--rz-bg-alt, #fff);
  border-radius: var(--rz-radius-lg, 12px);
  padding: var(--rz-space-4, 16px);
  margin-bottom: var(--rz-space-4, 16px);
  border: 1px solid var(--rz-border, #e2e8f0);
}

.sidebar-widget__title {
  font-size: 0.875rem;
  font-weight: 700;
  margin: 0 0 var(--rz-space-3, 12px);
  color: var(--rz-ink, #0f172a);
}

/* Search Form */
.search-form {
  display: flex;
  gap: var(--rz-space-2, 8px);
}

.search-form input {
  flex: 1;
  padding: var(--rz-space-2, 8px) var(--rz-space-3, 12px);
  border: 1px solid var(--rz-border, #e2e8f0);
  border-radius: var(--rz-radius, 8px);
  font-size: 0.875rem;
}

/* Category List */
.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-list li {
  margin-bottom: var(--rz-space-1, 4px);
}

.category-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rz-space-2, 8px);
  padding: var(--rz-space-2, 8px) var(--rz-space-3, 12px);
  border-radius: var(--rz-radius, 8px);
  font-size: 0.875rem;
  color: var(--rz-ink, #0f172a);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.category-list a:hover {
  background: var(--rz-bg, #f8fafc);
  color: var(--rz-primary, #0ea5e9);
}

.category-list a.active,
.category-list li.is-active a {
  background: var(--rz-primary-light, #e0f2fe);
  color: var(--rz-primary, #0284c7);
  font-weight: 600;
}

.category-list .cat-name {
  flex: 1;
}

.category-list .count {
  font-size: 0.75rem;
  color: var(--rz-ink-light, #64748b);
  background: var(--rz-bg, #f8fafc);
  padding: 2px 8px;
  border-radius: var(--rz-radius-full, 999px);
}

.category-list a.active .count,
.category-list li.is-active .count {
  background: rgba(14, 165, 233, 0.2);
}

.category-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  color: #fff;
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--rz-space-5, 24px);
}

@media (max-width: 767px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

/* Blog Card */
.blog-card {
  background: var(--rz-bg-alt, #fff);
  border-radius: var(--rz-radius-lg, 12px);
  overflow: hidden;
  border: 1px solid var(--rz-border, #e2e8f0);
  transition: transform 0.2s, box-shadow 0.2s;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.12);
}

.blog-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.blog-card__image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--rz-bg, #f8fafc);
}

.blog-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.blog-card:hover .blog-card__image img {
  transform: scale(1.05);
}

.blog-card__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rz-ink-light, #94a3b8);
}

.blog-card__content {
  padding: var(--rz-space-4, 16px);
}

.blog-card__categories {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rz-space-1, 4px);
  margin-bottom: var(--rz-space-2, 8px);
}

.blog-card__category {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--rz-radius-full, 999px);
  background: color-mix(in srgb, var(--cat-color, var(--rz-primary)) 15%, transparent);
  color: var(--cat-color, var(--rz-primary));
}

.blog-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 var(--rz-space-2, 8px);
  color: var(--rz-ink, #0f172a);
}

.blog-card__excerpt {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--rz-ink-light, #64748b);
  margin: 0 0 var(--rz-space-3, 12px);
}

.blog-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rz-space-2, 8px);
  font-size: 0.75rem;
  color: var(--rz-ink-light, #94a3b8);
}

.blog-card__meta time::before {
  content: '•';
  margin-right: var(--rz-space-2, 8px);
}

.reading-time::before {
  content: '•';
  margin-right: var(--rz-space-2, 8px);
}

/* Search Results Header */
.search-results-header {
  margin-bottom: var(--rz-space-5, 24px);
}

.search-results-header h2 {
  font-size: 1.25rem;
  margin: 0 0 var(--rz-space-1, 4px);
}

.search-results-header p {
  font-size: 0.875rem;
  color: var(--rz-ink-light, #64748b);
  margin: 0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--rz-space-8, 48px) var(--rz-space-4, 16px);
  background: var(--rz-bg-alt, #fff);
  border-radius: var(--rz-radius-lg, 12px);
  border: 1px solid var(--rz-border, #e2e8f0);
}

.empty-state__icon {
  color: var(--rz-ink-light, #94a3b8);
  margin-bottom: var(--rz-space-4, 16px);
}

.empty-state__title {
  font-size: 1.5rem;
  margin: 0 0 var(--rz-space-2, 8px);
}

.empty-state__text {
  color: var(--rz-ink-light, #64748b);
  max-width: 400px;
  margin: 0 auto var(--rz-space-4, 16px);
}

.empty-state__actions {
  display: flex;
  gap: var(--rz-space-2, 8px);
  justify-content: center;
  flex-wrap: wrap;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--rz-space-2, 8px);
  margin-top: var(--rz-space-6, 32px);
  padding-top: var(--rz-space-6, 32px);
  border-top: 1px solid var(--rz-border, #e2e8f0);
}

.pagination__prev,
.pagination__next {
  display: flex;
  align-items: center;
  gap: var(--rz-space-1, 4px);
  padding: var(--rz-space-2, 8px) var(--rz-space-3, 12px);
  border-radius: var(--rz-radius, 8px);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rz-primary, #0ea5e9);
  text-decoration: none;
  transition: background 0.2s;
}

.pagination__prev:hover,
.pagination__next:hover {
  background: var(--rz-primary-light, #e0f2fe);
}

.pagination__pages {
  display: flex;
  gap: var(--rz-space-1, 4px);
}

.pagination__page {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--rz-radius, 8px);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rz-ink, #0f172a);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.pagination__page:hover {
  background: var(--rz-bg, #f8fafc);
}

.pagination__page.active {
  background: var(--rz-primary, #0ea5e9);
  color: #fff;
}

/* ============================================
   SINGLE POST STYLES
   ============================================ */

.article-container {
  max-width: 800px;
  margin: 0 auto;
}

.article-header {
  text-align: center;
  margin-bottom: var(--rz-space-6, 32px);
}

.article-header__categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--rz-space-1, 4px);
  margin-bottom: var(--rz-space-3, 12px);
}

.article-header__category {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--rz-radius-full, 999px);
  background: color-mix(in srgb, var(--cat-color, var(--rz-primary)) 15%, transparent);
  color: var(--cat-color, var(--rz-primary));
  text-decoration: none;
}

.article-header__title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 var(--rz-space-4, 16px);
}

.article-header__excerpt {
  font-size: 1.125rem;
  color: var(--rz-ink-light, #64748b);
  line-height: 1.6;
  margin: 0 0 var(--rz-space-4, 16px);
}

.article-header__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--rz-space-3, 12px);
  font-size: 0.875rem;
  color: var(--rz-ink-light, #64748b);
}

.article-header__author {
  display: flex;
  align-items: center;
  gap: var(--rz-space-2, 8px);
}

.article-header__author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--rz-primary-light, #e0f2fe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--rz-primary, #0ea5e9);
  font-size: 0.75rem;
}

.article-header__date::before,
.article-header__reading-time::before {
  content: '•';
  margin-right: var(--rz-space-3, 12px);
}

/* Featured Image */
.article-featured-image {
  margin-bottom: var(--rz-space-6, 32px);
  border-radius: var(--rz-radius-lg, 12px);
  overflow: hidden;
}

.article-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Article Body Layout */
.article-body-layout {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: var(--rz-space-6, 32px);
  align-items: start;
}

@media (max-width: 991px) {
  .article-body-layout {
    grid-template-columns: 1fr;
  }
}

/* Table of Contents */
.article-toc {
  position: sticky;
  top: 80px;
  background: var(--rz-bg-alt, #fff);
  border-radius: var(--rz-radius, 8px);
  padding: var(--rz-space-3, 12px);
  border: 1px solid var(--rz-border, #e2e8f0);
}

@media (max-width: 991px) {
  .article-toc {
    position: static;
    display: none;
  }
}

.article-toc__title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rz-ink-light, #64748b);
  margin: 0 0 var(--rz-space-2, 8px);
}

.article-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-toc__list li {
  margin-bottom: var(--rz-space-1, 4px);
}

.article-toc__list a {
  display: block;
  font-size: 0.75rem;
  color: var(--rz-ink-light, #64748b);
  text-decoration: none;
  padding: var(--rz-space-1, 4px) 0;
  border-left: 2px solid transparent;
  padding-left: var(--rz-space-2, 8px);
  transition: color 0.2s, border-color 0.2s;
}

.article-toc__list a:hover,
.article-toc__list a.active {
  color: var(--rz-primary, #0ea5e9);
  border-left-color: var(--rz-primary, #0ea5e9);
}

.article-toc__list li.level-3 a {
  padding-left: var(--rz-space-4, 16px);
  font-size: 0.6875rem;
}

/* Article Content */
.article-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--rz-ink, #0f172a);
  text-align: left;
}

/* Blog content wrapper for proper width */
.blog-content {
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: var(--rz-space-6, 32px) 0 var(--rz-space-3, 12px);
  scroll-margin-top: 80px;
}

.article-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: var(--rz-space-5, 24px) 0 var(--rz-space-2, 8px);
  scroll-margin-top: 80px;
}

.article-content h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: var(--rz-space-4, 16px) 0 var(--rz-space-2, 8px);
  scroll-margin-top: 80px;
}

.article-content p {
  margin: 0 0 var(--rz-space-4, 16px);
}

.article-content ul,
.article-content ol {
  margin: 0 0 var(--rz-space-4, 16px);
  padding-left: var(--rz-space-5, 24px);
}

.article-content li {
  margin-bottom: var(--rz-space-2, 8px);
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--rz-radius, 8px);
  margin: var(--rz-space-4, 16px) 0;
}

.article-content a {
  color: var(--rz-primary, #0ea5e9);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-content a:hover {
  text-decoration-thickness: 2px;
}

.article-content blockquote {
  border-left: 4px solid var(--rz-primary, #0ea5e9);
  padding-left: var(--rz-space-4, 16px);
  margin: var(--rz-space-5, 24px) 0;
  font-style: italic;
  color: var(--rz-ink-light, #64748b);
}

.article-content pre {
  background: var(--rz-ink, #0f172a);
  color: #e2e8f0;
  padding: var(--rz-space-4, 16px);
  border-radius: var(--rz-radius, 8px);
  overflow-x: auto;
  font-size: 0.875rem;
  margin: var(--rz-space-4, 16px) 0;
}

.article-content code {
  background: var(--rz-bg, #f8fafc);
  padding: 2px 6px;
  border-radius: var(--rz-radius-xs, 4px);
  font-size: 0.9em;
}

.article-content pre code {
  background: transparent;
  padding: 0;
}

.article-content hr {
  border: none;
  border-top: 2px solid var(--rz-border, #e2e8f0);
  margin: var(--rz-space-6, 32px) 0;
}

/* Article Tags */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rz-space-2, 8px);
  margin-top: var(--rz-space-6, 32px);
  padding-top: var(--rz-space-4, 16px);
  border-top: 1px solid var(--rz-border, #e2e8f0);
}

.article-tags__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rz-ink-light, #64748b);
  margin-right: var(--rz-space-2, 8px);
}

.article-tags a {
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: var(--rz-radius-full, 999px);
  background: var(--rz-bg, #f8fafc);
  color: var(--rz-ink, #0f172a);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.article-tags a:hover {
  background: var(--rz-primary-light, #e0f2fe);
  color: var(--rz-primary, #0ea5e9);
}

/* Author Box */
.author-box {
  display: flex;
  gap: var(--rz-space-4, 16px);
  background: var(--rz-bg-alt, #fff);
  border-radius: var(--rz-radius-lg, 12px);
  padding: var(--rz-space-5, 24px);
  margin-top: var(--rz-space-6, 32px);
  border: 1px solid var(--rz-border, #e2e8f0);
}

.author-box__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--rz-primary-light, #e0f2fe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--rz-primary, #0ea5e9);
  font-size: 1.5rem;
  flex-shrink: 0;
}

.author-box__info h4 {
  font-size: 1rem;
  margin: 0 0 var(--rz-space-1, 4px);
}

.author-box__info p {
  font-size: 0.875rem;
  color: var(--rz-ink-light, #64748b);
  margin: 0;
}

/* Related Posts */
.related-posts {
  margin-top: var(--rz-space-8, 48px);
}

.related-posts__title {
  font-size: 1.25rem;
  margin: 0 0 var(--rz-space-4, 16px);
}

.related-posts__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--rz-space-4, 16px);
}

/* Share Buttons */
.article-share {
  display: flex;
  align-items: center;
  gap: var(--rz-space-2, 8px);
  margin-top: var(--rz-space-4, 16px);
}

.article-share__label {
  font-size: 0.875rem;
  color: var(--rz-ink-light, #64748b);
}

.article-share__btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--rz-bg, #f8fafc);
  color: var(--rz-ink-light, #64748b);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.article-share__btn:hover {
  background: var(--rz-primary-light, #e0f2fe);
  color: var(--rz-primary, #0ea5e9);
}

/* ============================================
   BREADCRUMB STYLES
   ============================================ */

.breadcrumb {
  background: var(--rz-bg-alt, #fff);
  border-bottom: 1px solid var(--rz-border, #e2e8f0);
  padding: var(--rz-space-3, 12px) 0;
}

.breadcrumb__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
}

.breadcrumb__list li {
  display: inline-flex;
  align-items: center;
}

.breadcrumb__list li + li::before {
  content: "/";
  margin: 0 var(--rz-space-2, 8px);
  color: var(--rz-ink-lighter, #94a3b8);
}

.breadcrumb__list a {
  color: var(--rz-ink-light, #64748b);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb__list a:hover {
  color: var(--rz-primary, #0ea5e9);
  text-decoration: underline;
}

.breadcrumb__list li[aria-current="page"] {
  color: var(--rz-ink, #0f172a);
  font-weight: 500;
}
