/* ===== Blog Detail Page Styles ===== */

/* Main Article Container */
.blog-detail-article {
  position: relative;
}

/* Fade-in animations */
.fade-in-delay-1 {
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.fade-in-delay-2 {
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.fade-in-delay-3 {
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.fade-in-delay-4 {
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header (Hero) */
.blog-detail-header {
  position: relative;
  padding: 5rem 0 3rem;
  background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--tech)) 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: hsl(var(--primary-foreground));
  overflow: hidden;
}

/* Оверлей с градиентом поверх фонового изображения */
.blog-detail-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, hsl(var(--primary) / 0.85) 0%, hsl(var(--tech) / 0.85) 100%);
  z-index: 0;
}

/* Паттерн сетки поверх оверлея */
.blog-detail-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.06)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.35;
  z-index: 0;
}

.blog-detail-header .container {
  position: relative;
  z-index: 1;
}

.blog-detail-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.blog-date,
.blog-category,
.blog-read-time {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
}

.blog-detail-title {
  margin: 0.25rem 0 0.75rem;
  color: hsl(var(--primary-foreground));
  font-weight: 800;
  line-height: 1.15;
}

.blog-detail-excerpt {
  color: rgba(255, 255, 255, 0.95);
  max-width: 900px;
  font-size: 1.125rem;
  line-height: 1.7;
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.blog-tag {
  background: rgba(255, 255, 255, 0.2);
  color: hsl(var(--primary-foreground));
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 0.825rem;
  font-weight: 700;
}


/* Typography for article */
.blog-detail-content {
  padding: 3rem 0 4rem;
}

.blog-content {
  max-width: 900px;
  margin: 0 auto;
  color: hsl(var(--foreground));
  font-size: 1.125rem;
  line-height: 1.8;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
  color: hsl(var(--foreground));
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 800;
  line-height: 1.25;
}

.blog-content h1 { font-size: 2rem; }
.blog-content h2 { font-size: 1.75rem; }
.blog-content h3 { font-size: 1.5rem; }
.blog-content h4 { font-size: 1.25rem; }

.blog-content p { margin: 1rem 0; }
.blog-content ul,
.blog-content ol { margin: 1rem 0 1.5rem 1.5rem; }
.blog-content li { margin: 0.35rem 0; }

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

.blog-content img {
  border-radius: var(--radius-lg);
  max-width: 100%;
  height: auto;
  box-shadow: var(--shadow-lg);
}

.blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius);
  overflow: hidden;
}

.blog-content th,
.blog-content td {
  border: 1px solid hsl(var(--border));
  padding: 0.75rem 1rem;
  text-align: left;
}

.blog-content thead th {
  background: hsl(var(--muted));
  font-weight: 700;
  color: hsl(var(--foreground));
}

.blog-content tbody tr:nth-child(even) {
  background: hsl(var(--muted) / 0.3);
}

.blog-content tbody tr:hover {
  background: hsl(var(--muted) / 0.5);
}

/* Code blocks */
.blog-content pre {
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  position: relative;
}

.blog-content pre code {
  background: transparent;
  padding: 0;
  border: none;
  font-size: inherit;
  color: hsl(var(--foreground));
}

.blog-content code:not(pre code) {
  background: hsl(var(--muted));
  color: hsl(var(--primary));
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  font-family: 'Courier New', monospace;
}

/* Links in content */
.blog-content a {
  color: hsl(var(--primary));
  text-decoration: underline;
  text-decoration-color: hsl(var(--primary) / 0.3);
  transition: all 0.2s ease;
}

.blog-content a:hover {
  color: hsl(var(--primary) / 0.8);
  text-decoration-color: hsl(var(--primary) / 0.6);
}

/* Lists styling */
.blog-content ul,
.blog-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
  padding-left: 1.5rem;
}

.blog-content ul {
  list-style-type: disc;
}

.blog-content ol {
  list-style-type: decimal;
}

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

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

/* Strong and emphasis */
.blog-content strong {
  font-weight: 700;
  color: hsl(var(--foreground));
}

.blog-content em {
  font-style: italic;
  color: hsl(var(--muted-foreground));
}

/* Horizontal rule */
.blog-content hr {
  border: none;
  border-top: 2px solid hsl(var(--border));
  margin: 2rem 0;
}

/* Images in content */
.blog-content img {
  border-radius: var(--radius-lg);
  max-width: 100%;
  height: auto;
  box-shadow: var(--shadow-lg);
  margin: 1.5rem 0;
}

.blog-content figure {
  margin: 1.5rem 0;
  text-align: center;
}

.blog-content figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
  font-style: italic;
}

/* Author Card */
.blog-detail-footer {
  padding: 0 0 4rem;
}

.blog-author-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.blog-author-avatar {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--tech)));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: var(--shadow-md);
}

.blog-author-name {
  margin: 0 0 0.25rem 0;
}

.blog-author-role {
  margin: 0;
  color: hsl(var(--muted-foreground));
}

/* Blog Detail Meta (Tags, Category) - Bottom section */
.blog-detail-content .blog-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--border));
}

.blog-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.blog-meta-label {
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  min-width: 100px;
}

.blog-category-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--tech)) 100%);
  color: white;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.blog-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.blog-tag-link {
  display: inline-block;
  padding: 0.5rem 0.875rem;
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.blog-tag-link:hover {
  background-color: hsl(var(--primary));
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.blog-read-time-value {
  color: hsl(var(--foreground));
  font-weight: 500;
}

/* Related Posts Section */
.blog-related-posts {
  background-color: hsl(var(--muted) / 0.3);
  padding: 4rem 0;
}

.blog-related-posts .section-title {
  margin-bottom: 2rem;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  color: hsl(var(--foreground));
}

.blog-grid-related {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.blog-grid-related .blog-card {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.blog-card-link:hover {
  text-decoration: none;
  color: inherit;
}

.blog-grid-related .blog-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: hsl(var(--muted));
}

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

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

.blog-grid-related .image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.blog-grid-related .image-placeholder svg {
  width: 48px;
  height: 48px;
}

.blog-grid-related .blog-category-tag {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--tech)) 100%);
  color: white;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 1;
}

.blog-grid-related .blog-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
}

.blog-grid-related .blog-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

.blog-grid-related .blog-date,
.blog-grid-related .blog-read-time {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.blog-grid-related .blog-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  color: hsl(var(--foreground));
}

.blog-grid-related .blog-excerpt {
  flex: 1;
  margin: 0 0 1rem 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-grid-related .blog-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--border));
}

.blog-grid-related .read-more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: hsl(var(--primary));
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.blog-grid-related .read-more-link:hover {
  color: hsl(var(--primary) / 0.8);
  gap: 0.75rem;
}

.blog-grid-related .read-more-link::after {
  content: '→';
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.blog-grid-related .read-more-link:hover::after {
  transform: translateX(4px);
}

/* Author card improvements */
.blog-author-meta {
  flex: 1;
}

.blog-author-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.blog-author-role {
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Section spacing */
.section {
  padding: 2rem 0;
}

.section-large {
  padding: 4rem 0;
}

.section-small {
  padding: 1.5rem 0;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .blog-detail-header {
    padding: 3rem 0 2rem;
  }
  
  .blog-detail-title {
    font-size: 1.5rem;
  }
  
  .blog-detail-excerpt {
    font-size: 1rem;
  }
  
  .blog-content {
    font-size: 1rem;
  }
  
  .blog-content h1 { font-size: 1.75rem; }
  .blog-content h2 { font-size: 1.5rem; }
  .blog-content h3 { font-size: 1.25rem; }
  .blog-content h4 { font-size: 1.125rem; }
  
  .blog-detail-meta {
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
  }
  
  .blog-detail-content .blog-detail-meta {
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
  }
  
  .blog-meta-item {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
  
  .blog-meta-label {
    min-width: auto;
  }
  
  .blog-tags-list {
    width: 100%;
  }
  
  .blog-related-posts {
    padding: 2.5rem 0;
  }
  
  .blog-related-posts .section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .blog-grid-related {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .blog-grid-related .blog-image {
    height: 180px;
  }
  
  .blog-author-card {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }
  
  .section-large {
    padding: 2.5rem 0;
  }
  
  .section {
    padding: 1.5rem 0;
  }
  
  .container {
    padding: 0 1rem;
  }
}
