/* CSS Variables are now in main.css */

.blog-detail-hero-section .container {
  display: flex;
  justify-content: flex-start;
}

.blog-detail-hero-section {
  position: relative;
  min-height: 40vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(255, 255, 255, 0.95) 100%);
}

.blog-detail-hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.blog-detail-hero-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.9) contrast(1.1);
}

.blog-detail-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(255, 255, 255, 0.85) 40%,
      rgba(255, 255, 255, 0.6) 70%,
      rgba(255, 255, 255, 0.3) 100%);
  z-index: 2;
  backdrop-filter: blur(1px);
}

.blog-detail-hero-content {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: 2rem 0 2rem 0;
  text-align: left;
}

.blog-detail-hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--foreground);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.blog-detail-section {
  padding: 2rem 0 8rem 0;
}

.blog-detail-layout {
  display: grid;
  grid-template-columns: 4fr 2fr;
  gap: 3rem;
  align-items: start;
}

.blog-detail-content,
.sidebar {
  min-width: 0;
}

.blog-detail-content {
  max-width: 800px;
  padding-right: 1rem;
  overflow-wrap: break-word;
}

.blog-detail-content h1,
.blog-detail-content h2,
.blog-detail-content h3,
.blog-detail-content h4,
.blog-detail-content h5,
.blog-detail-content h6 {
  color: var(--foreground);
  margin-bottom: 1rem;
}

.blog-detail-content h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  background: linear-gradient(135deg,
      var(--foreground) 0%,
      var(--wood-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}

.blog-detail-content .post-meta {
  color: var(--muted-foreground);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.blog-detail-content p {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--muted-foreground);
  margin-bottom: 1.25rem;
  overflow-wrap: break-word;
}

.blog-detail-content *:not(table) {
  max-width: 100%;
}

.blog-detail-content img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 1rem;
  margin: 1.5rem 0;
  display: block;
}

.blog-detail-content figure {
  max-width: 100% !important;
  margin: 1.5rem 0;
}

.blog-detail-content table {
  width: 100% !important;
  max-width: 100% !important;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.blog-detail-content iframe,
.blog-detail-content video,
.blog-detail-content embed,
.blog-detail-content object {
  max-width: 100% !important;
  height: auto !important;
  margin: 1.5rem 0;
  border-radius: 0.5rem;
}

/* Modern Sidebar Styling */
.sidebar {
  padding: 1.5rem;
  background-color: rgb(242, 244, 246);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  border: 1px solid #e1e4eb;
  border-radius: 24px;
  box-shadow: 0 0 0 4px #fff, 0 10px 30px rgba(58, 64, 145, 0.08);
  position: sticky;
  top: 2rem;
  height: fit-content;
  max-width: 100%;
  overflow: hidden;
}

.sidebar-widget {
  margin-bottom: 0;
}

/* Card header styles (match about values card) */
.card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

/* Hide icon in blog detail cards per request */
.card-header .decorative-icon {
  display: none;
}

/* no icon */

.card-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--wood-primary);
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* Use value-card header styles; keep fallback if needed */
.sidebar-widget h4 {
  display: none;
}

/* Tag Cloud Styling */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.category-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.375rem 0.25rem;
  gap: 0.75rem;
}

.category-item:last-child {
  border-bottom: none;
}

.category-link {
  color: var(--foreground);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.4;
  word-break: break-word;
}

.category-link:hover {
  color: var(--wood-primary);
}

.category-count {
  color: var(--muted-foreground);
  font-weight: 500;
}

/* Spacing and separator between Category and Tags blocks */
.sidebar .value-card:first-child {
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(58, 64, 145, 0.12);
  margin-bottom: 1rem;
}

.tag-item {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  background-color: #fff;
  color: var(--wood-dark);
  text-decoration: none;
  border-radius: 2rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(58, 64, 145, 0.1);
  position: relative;
  overflow: hidden;
}

.tag-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg,
      var(--wood-primary) 0%,
      rgba(58, 64, 145, 0.8) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.tag-item:hover {
  /* Border tokens */
  border-style: solid;
  border-color: var(--token-86b988f3-17af-4503-acc6-643c927bee9a,
      rgb(225, 228, 235));

  /* Background token */
  background-color: var(--token-f5b9e5ae-d0c0-4fb2-a3f7-15e0d07a9318,
      rgb(242, 244, 246));

  /* Shape and subtle outline */
  border-radius: 16px;
  box-shadow: rgb(255, 255, 255) 0px 0px 0px 4px;

  /* Keep text color */
  color: var(--wood-dark);
}

.tag-item:hover::before {
  opacity: 0;
}

/* Related Posts Section */
.related-posts-section {
  padding: 5rem 0;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(58, 64, 145, 0.02) 100%);
  border-top: 1px solid rgba(58, 64, 145, 0.06);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--wood-primary);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.section-header p {
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.related-post-card {
  background: transparent;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  border: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.related-post-card:hover {
  transform: translateY(-4px);
}

.post-image {
  position: relative;
  height: 240px;
  overflow: hidden;
  border-radius: 1rem;
}

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

.related-post-card:hover .post-img {
  transform: scale(1.1);
}

.post-content {
  padding: 0;
  margin-top: 1rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.post-category {
  background: rgba(58, 64, 145, 0.08);
  color: var(--wood-primary);
  padding: 0.375rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-date {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  font-weight: 500;
}

.post-title {
  margin-bottom: 1rem;
  line-height: 1.4;
}

.post-title a {
  color: var(--foreground);
  text-decoration: none;
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  font-weight: 700;
  transition: color 0.3s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-title a:hover {
  color: var(--wood-primary);
}

.post-excerpt {
  color: var(--muted-foreground);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 992px) {
  .blog-detail-section {
    padding: 4.5rem 0;
  }

  .blog-detail-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sidebar {
    position: static;
    margin-top: 2rem;
  }

  .related-posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.75rem;
  }
}

@media (max-width: 768px) {
  .card-header {
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  /* no icon */
  .blog-detail-section {
    padding: 2rem 0 6rem 0;
  }

  .sidebar {
    padding: 1.25rem;
    margin-top: 1.5rem;
  }

  .sidebar-widget h4 {
    font-size: 1.375rem;
    margin-bottom: 1.5rem;
  }

  .tag-cloud {
    gap: 0.5rem;
  }

  .tag-item {
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
  }

  .related-posts-section {
    padding: 3rem 0;
  }

  .section-header {
    margin-bottom: 3rem;
  }

  .related-posts-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .post-content {
    padding: 0;
    margin-top: 1rem;
  }
}

@media (max-width: 480px) {
  .sidebar {
    padding: 1.25rem;
  }

  .sidebar-widget h4 {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
  }

  .tag-cloud {
    flex-direction: column;
    gap: 0.75rem;
  }

  .tag-item {
    text-align: center;
  }

  .related-posts-section {
    padding: 2.5rem 0;
  }

  .section-header h2 {
    font-size: 1.75rem;
  }

  .post-image {
    height: 200px;
  }

  .post-content {
    padding: 0;
    margin-top: 1rem;
  }

  .post-title a {
    font-size: 1.125rem;
  }
}

.blog-detail-content blockquote {
  border-left: 4px solid var(--wood-primary);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--muted-foreground);
}

.blog-detail-content ul,
.blog-detail-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.blog-detail-content ul li,
.blog-detail-content ol li {
  margin-bottom: 0.5rem;
}

.social-share {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social-share h4 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.share-buttons {
  display: flex;
  gap: 0.75rem;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--wood-light);
  color: var(--wood-dark);
  text-decoration: none;
  transition: all 0.3s ease;
}

.share-btn:hover {
  background: var(--wood-primary);
  color: white;
  transform: translateY(-2px);
}