/* Extracted from blog/blog_detail.html */
.article-back-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}
.back-link:hover {
  color: var(--accent);
  opacity: 0.8;
  transform: translateX(-4px);
}
.back-link svg {
  transition: transform 0.2s ease;
}
.back-link:hover svg {
  transform: translateX(-4px);
}

.article {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.article-header {
  margin-bottom: 32px;
  position: sticky;
  top: 80px;
  z-index: 50000;
  background: var(--card-bg);
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}
.article-category {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--accent-strong) 0%, #075985 100%);
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}
.article-title {
  font-size: 2.5em;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text);
  letter-spacing: -0.02em;
}
.article-meta {
  display: flex;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
  flex-wrap: wrap;
}
.article-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.article-meta svg {
  width: 16px;
  height: 16px;
}

.article-image-wrapper {
  width: 100%;
  max-height: 500px;
  overflow: hidden;
  border-radius: 16px;
  margin-bottom: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.article-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-content {
  font-size: 1.1em;
  line-height: 1.8;
  color: var(--text);
}
.article-content p { margin-bottom: 20px; }
.article-content p:last-child { margin-bottom: 0; }

.article-content h1,
.article-content h2,
.article-content h3 {
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 16px;
  line-height: 1.3;
  color: var(--text);
}
.article-content h2 {
  font-size: 1.8em;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.article-content h3 {
  font-size: 1.4em;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.article-content img.align-left {
  float: left;
  margin: 0 24px 20px 0;
  max-width: 50%;
}
.article-content img.align-right {
  float: right;
  margin: 0 0 20px 24px;
  max-width: 50%;
}
.article-content img.align-center {
  display: block;
  margin: 24px auto;
}

.article-content ul,
.article-content ol {
  margin: 20px 0;
  padding-left: 32px;
}
.article-content li {
  margin-bottom: 8px;
  color: var(--text);
}

.article-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  margin: 24px 0;
  color: var(--muted);
  font-style: italic;
  font-size: 1.05em;
  background: var(--hover);
  border-radius: 0 12px 12px 0;
}

.article-content code {
  background: var(--hover);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: #f87171;
}
.article-content pre {
  background: rgba(0, 0, 0, 0.35);
  padding: 16px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--border);
}
.article-content pre code {
  background: none;
  padding: 0;
  color: #e2e8f0;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.article-tag {
  padding: 6px 14px;
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}
.article-tag:hover {
  background: var(--accent-strong);
  border-color: var(--accent);
  color: white;
}

.related-articles {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid var(--border);
}
.related-articles h3 {
  margin-bottom: 20px;
  font-size: 1.5em;
  font-weight: 800;
  color: var(--text);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 16px;
}
.related-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.related-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, #0284c7 100%);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: left;
}
.related-card:hover {
  transform: translateY(-4px);
  border-color: rgba(14, 165, 233, 0.3);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}
.related-card:hover::before {
  transform: scaleX(1);
}
.related-card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
  line-height: 1.4;
}
.related-card:hover .related-card-title {
  color: var(--accent);
}
.related-card-date {
  font-size: 12px;
  color: var(--muted);
}

.article-actions {
  display: flex;
  gap: 8px;
}
.article-actions .btn {
  padding: 8px 14px;
  font-size: 13px;
  min-height: 40px;
}

@media (max-width: 768px) {
  .article-title {
    font-size: 2em;
  }
  .article-meta {
    flex-direction: column;
    gap: 10px;
  }
  .article-back-nav {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .article-actions {
    width: 100%;
  }
  .article-actions .btn {
    flex: 1;
    justify-content: center;
  }
  .related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .article-header {
    position: static;
    padding: 12px;
  }
  .article-title {
    font-size: 1.75em;
  }
  .article-content {
    font-size: 1em;
  }
  .article-content h2 {
    font-size: 1.5em;
  }
  .article-content h3 {
    font-size: 1.2em;
  }
  .article-image-wrapper {
    max-height: 240px;
    border-radius: 12px;
  }
  .article-content img.align-left,
  .article-content img.align-right {
    float: none;
    max-width: 100%;
    margin: 16px 0;
  }
  .article-content blockquote {
    padding: 12px 14px;
    margin: 16px 0;
  }
  .article-content ul,
  .article-content ol {
    padding-left: 20px;
  }
  .article-content pre {
    border-radius: 8px;
    padding: 12px;
  }
}
