/* ==========================================================================
   components-post-detail.css
   Post Detail Content Styling, Legacy Feed & Side Catalog
   ========================================================================== */


header.intro-header {
  position: relative;
  background: var(--header-bg) !important;
  padding: 110px 0 75px !important;
  margin-bottom: 35px !important;
  overflow: hidden;
  transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

header.intro-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: linear-gradient(to top, var(--bg-page), transparent);
  pointer-events: none;
}

header.intro-header .site-heading h1,
header.intro-header .post-heading h1,
.hero-brand-title {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--header-title-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 14px;
  text-shadow: none;
}

header.intro-header .site-heading .subheading {
  font-size: 16px;
  font-weight: 400;
  color: var(--header-subtext) !important;
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto;
}

.hero-status-pill,
.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 5px 14px;
  border-radius: 9999px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid var(--nav-border);
  color: var(--primary-color);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
  animation: pulse-node 2s infinite ease-in-out;
}

/* --------------------------------------------------------------------------
   5. Legacy Post Cards (Adapted for Dark/Light)
   -------------------------------------------------------------------------- */
.postlist-container {
  padding-right: 25px;
}

.post-preview {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 30px 34px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
  transition: var(--transition-smooth);
  position: relative;
}

.post-preview:hover {
  transform: translateY(-4px);
  border-color: var(--card-hover-border);
  box-shadow: 0 16px 32px -8px rgba(124, 58, 237, 0.12);
}

.post-preview > a {
  text-decoration: none !important;
  color: inherit !important;
}

.post-preview .post-title {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 0;
  margin-bottom: 10px;
  line-height: 1.35;
  transition: color 0.2s ease;
}

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

.post-preview .post-subtitle {
  font-size: 15px;
  font-weight: 500;
  color: var(--primary-color);
  margin-bottom: 12px;
  line-height: 1.5;
}

.post-preview .post-content-preview {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

.post-preview .post-meta {
  font-size: 13px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.post-preview .post-meta i {
  color: var(--primary-light);
}

/* Remove ugly horizontal rules between posts */
.postlist-container > hr {
  display: none;
}

/* --------------------------------------------------------------------------
   4. Modern Sidebar Profile Card
   -------------------------------------------------------------------------- */
.sidebar-container {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
}

.sidebar-container hr {
  border-color: #f1f5f9;
  margin: 18px 0;
}

.sidebar-container h5 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.short-about img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-cyan));
  box-shadow: 0 8px 20px -4px rgba(124, 58, 237, 0.35);
  margin-bottom: 14px;
  transition: var(--transition-smooth);
}

.short-about img:hover {
  transform: rotate(5deg) scale(1.05);
}

.short-about p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Tech Badges in Sidebar */
.tech-stack-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 10px;
}

.tech-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  transition: var(--transition-smooth);
}

.tech-badge:hover {
  background: #ede9fe;
  color: var(--primary-color);
  border-color: #ddd6fe;
}

/* SNS Icon Links */
.short-about .list-inline > li {
  padding: 0 3px;
}

.short-about .fa-stack-2x {
  color: #f1f5f9;
  transition: var(--transition-smooth);
}

.short-about .fa-stack-1x {
  color: #475569;
  transition: var(--transition-smooth);
}

.short-about a:hover .fa-stack-2x {
  color: var(--primary-color);
}

.short-about a:hover .fa-stack-1x {
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   5. Post Detail & Content Styling (Adaptive Light & Dark Themes)
   -------------------------------------------------------------------------- */
.post-container {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  box-shadow: 0 4px 25px -4px rgba(15, 23, 42, 0.05);
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-main);
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Ensure all text elements inside post content inherit adaptive theme color */
.post-container p,
.post-container ul,
.post-container ol,
.post-container li {
  color: var(--text-main);
}

.post-container strong,
.post-container b {
  color: var(--text-main);
  font-weight: 700;
}

/* Headings inside post container - fully theme adaptive */
.post-container h1,
.post-container h2,
.post-container h3,
.post-container h4,
.post-container h5,
.post-container h6 {
  color: var(--text-main) !important;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.post-container h1 {
  font-size: 28px;
  margin-top: 40px;
  margin-bottom: 20px;
}

.post-container h2 {
  font-size: 24px;
  margin-top: 42px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--card-border) !important;
}

/* Remove default harsh #ececec separator line from hux-blog.css */
.post-container h2::before {
  display: none !important;
}

.post-container h3 {
  font-size: 19px;
  margin-top: 32px;
  margin-bottom: 14px;
}

.post-container h4,
.post-container h5,
.post-container h6 {
  font-size: 16px;
  opacity: 0.95;
}

/* Markdown Horizontal Rules */
.post-container hr {
  border: 0 !important;
  border-top: 1px solid var(--card-border) !important;
  margin: 36px 0;
  opacity: 0.8;
}

/* Links inside post content */
.post-container a {
  color: var(--primary-light, #a78bfa);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.post-container a:hover {
  color: var(--primary-color, #c084fc);
}

html[data-theme="light"] .post-container a {
  color: #7c3aed;
}

html[data-theme="light"] .post-container a:hover {
  color: #6d28d9;
}

/* MathJax Formulas container */
.MathJax_Display {
  padding: 16px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Code block enhancements */
pre {
  background: #0d1117 !important;
  color: #e6edf3 !important;
  border: 1px solid #30363d !important;
  border-radius: 12px !important;
  padding: 20px !important;
  font-family: "Fira Code", Consolas, "Courier New", monospace !important;
  font-size: 13.5px !important;
  line-height: 1.6 !important;
  position: relative;
}

/* Inline code tags */
.post-container p code,
.post-container li code,
.post-container td code {
  color: #c084fc;
  background: rgba(168, 85, 247, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: var(--font-mono, monospace);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

html[data-theme="light"] .post-container p code,
html[data-theme="light"] .post-container li code,
html[data-theme="light"] .post-container td code {
  color: #7c3aed;
  background: #f3e8ff;
  border-color: rgba(124, 58, 237, 0.2);
}

/* Callout blockquotes - adaptive for dark/light themes */
blockquote {
  border-left: 4px solid var(--primary-color) !important;
  background: rgba(168, 85, 247, 0.08) !important;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 20px;
  font-size: 15px;
  color: var(--text-main) !important;
  margin: 24px 0;
  transition: background 0.3s ease, color 0.3s ease;
}

html[data-theme="light"] blockquote {
  background: #f5f3ff !important;
  color: #4c1d95 !important;
  border-left-color: #7c3aed !important;
}

/* Markdown Tables styling */
.post-container table {
  width: 100%;
  max-width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg);
}

.post-container table th {
  background: rgba(168, 85, 247, 0.12);
  color: var(--text-main);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 2px solid var(--card-border);
  border-right: 1px solid var(--card-border);
  text-align: left;
}

.post-container table td {
  padding: 10px 16px;
  border-top: 1px solid var(--card-border);
  border-right: 1px solid var(--card-border);
  color: var(--text-main);
}

.post-container table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme="light"] .post-container table th {
  background: #f1f5f9;
}

html[data-theme="light"] .post-container table tr:nth-child(even) td {
  background: #f8fafc;
}

/* Side Catalog Dark Theme */
html[data-theme="dark"] .side-catalog .catalog-body li a {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .side-catalog .catalog-body li a:hover {
  color: #c084fc !important;
}

html[data-theme="dark"] .side-catalog .catalog-body .active {
  background-color: rgba(168, 85, 247, 0.15) !important;
}

html[data-theme="dark"] .side-catalog .catalog-body .active a {
  color: #c084fc !important;
}

html[data-theme="dark"] .side-catalog h5 a {
  color: #cbd5e1 !important;
}

/* --------------------------------------------------------------------------
   6. Pager / Pagination
   -------------------------------------------------------------------------- */
.pager li > a {
  border-radius: 9999px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-main);
  font-weight: 600;
  padding: 10px 22px;
  transition: var(--transition-smooth);
}

.pager li > a:hover {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

/* --------------------------------------------------------------------------
