/* ── Blog Pages Styles ─────────────────────────────────────────────────────── */
/* Uses CSS variables from :root in header.css:
   --bg, --panel, --ink, --ink-2, --brand, --accent, --active-border, --active-bg,
   --radius, --radius-sm, --transition-normal, --transition-fast, --space-*, --text-*
*/

.blog-page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

/* Align with header/footer: same 1400px container */
.blog-page .main-content {
  padding: 0 20px 60px;
  max-width: 1400px;
  margin: 0 auto;
}

.blog-page .container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Blog — breadcrumb spacing / scrollbar (base in breadcrumb.css) */
.breadcrumb {
  flex-wrap: nowrap;
  padding: 16px 0;
  scrollbar-width: thin;
}

.breadcrumb::-webkit-scrollbar {
  height: 4px;
}

.breadcrumb::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 2px;
}

.breadcrumb::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 2px;
}

/* ── Blog Hero (gradient text like cat.css) ────────────────────────────────── */

.blog-hero {
  text-align: center;
  padding: 40px 0 32px;
}
.blog-hero h1 {
  font-size: clamp(1.375rem, 1.15vw + 1.1rem, 1.75rem);
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.03em;
  line-height: 1.35;
  background: linear-gradient(135deg, var(--ink) 0%, var(--active-border) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.blog-hero p {
  font-size: var(--text-lg, 16px);
  color: var(--ink-2);
  max-width: 65ch;
  margin: 0 auto;
  line-height: var(--sf-leading-body, 1.65);
}

/* ── Blog Filters (pill row, same chrome as cards) ─────────────────────────── */

.blog-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.blog-filter-btn {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(220, 216, 240, 0.88);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.blog-filter-btn:hover {
  border-color: rgba(91, 67, 234, 0.4);
  background: rgba(91, 67, 234, 0.1);
  color: var(--ink);
}
.blog-filter-btn.active {
  background: rgba(91, 67, 234, 0.35);
  border-color: rgba(167, 139, 250, 0.55);
  color: #fafafa;
}

/* Blog Search */
.blog-search {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  max-width: 420px;
  margin: 0 auto 22px;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm, 16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.blog-search:focus-within {
  border-color: rgba(91, 67, 234, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(91, 67, 234, 0.15);
}
.blog-search svg {
  width: 18px;
  height: 18px;
  opacity: 0.4;
  flex-shrink: 0;
}
.blog-search input {
  flex: 1;
  background: none;
  border: none;
  color: var(--ink);
  font-size: var(--text-base, 14px);
  outline: none;
}
.blog-search input::placeholder {
  color: rgba(255,255,255,0.35);
}

/* ── Blog List Layout (main + sidebar) ─────────────────────────────────────── */

.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 32px 36px;
  align-items: start;
}

@media (max-width: 960px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }
}

.blog-main {
  min-width: 0;
}

/* ── Blog Grid ────────────────────────────────────────────────────────────── */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}
@media (max-width: 600px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ── Blog List Sidebar (aligned with card chrome) ─────────────────────────── */

.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 100px;
}

.blog-sidebar .sidebar-widget {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm, 16px);
  padding: 16px 16px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.blog-sidebar .sidebar-widget-title {
  font-size: 11px;
  font-weight: 600;
  color: rgba(220, 216, 240, 0.72);
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.blog-sidebar .sidebar-category-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.blog-sidebar .sidebar-category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px;
  margin: 0 -4px;
  border-radius: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
  line-height: 1.35;
  color: rgba(235, 232, 252, 0.88);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.blog-sidebar .sidebar-category-item:last-child {
  border-bottom: none;
}
.blog-sidebar .sidebar-category-item:hover {
  background: rgba(91, 67, 234, 0.1);
  color: var(--ink);
}

.blog-sidebar .sidebar-recent-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.blog-sidebar .sidebar-recent-item {
  display: flex;
  gap: 12px;
  padding: 10px 4px;
  margin: 0 -4px;
  border-radius: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.blog-sidebar .sidebar-recent-item:last-child {
  border-bottom: none;
}
.blog-sidebar .sidebar-recent-item:hover {
  background: rgba(91, 67, 234, 0.08);
  opacity: 1;
}

.blog-sidebar .sidebar-recent-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.blog-sidebar .sidebar-recent-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.blog-sidebar .sidebar-recent-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(245, 243, 255, 0.95);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-sidebar .sidebar-recent-date {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.02em;
}

.blog-sidebar .sidebar-category-count {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(91, 67, 234, 0.2);
  color: rgba(230, 226, 252, 0.88);
  flex-shrink: 0;
}

/* ── Blog cards (minimal, consistent scan pattern) ─────────────────────────── */

.blog-card {
  height: 100%;
  min-height: 0;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm, 16px);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    background 0.2s ease;
}
.blog-card:hover {
  border-color: rgba(91, 67, 234, 0.38);
  background: rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 36px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(91, 67, 234, 0.12);
  transform: translateY(-2px);
}
.blog-card:focus-visible {
  outline: none;
  border-color: rgba(167, 139, 250, 0.55);
  box-shadow:
    0 0 0 2px rgba(10, 8, 24, 0.95),
    0 0 0 4px rgba(91, 67, 234, 0.35);
}

.blog-card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  min-height: 140px;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.blog-card-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 140px;
  height: auto;
  background: linear-gradient(145deg, rgba(45, 35, 72, 0.5), rgba(10, 8, 24, 0.65));
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.blog-card-image-placeholder svg {
  width: 36px;
  height: 36px;
  opacity: 0.9;
}
.blog-card-body {
  padding: 16px 16px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.blog-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  row-gap: 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin: 0 0 10px;
  line-height: 1.2;
}
.blog-card-meta > span:not(.blog-card-category):not(.blog-card-dot) {
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.44);
}
.blog-card-category {
  color: rgba(196, 181, 253, 0.95);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}
.blog-card-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}
.blog-card-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.02em;
  color: rgba(245, 243, 255, 0.98);
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-excerpt {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(218, 214, 238, 0.78);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}
.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.38);
}
.blog-card-author {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.blog-card-author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(91, 67, 234, 0.12);
  border: 1px solid rgba(91, 67, 234, 0.2);
  object-fit: contain;
  padding: 3px;
  box-sizing: border-box;
  flex-shrink: 0;
}
.blog-card-author span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Pagination (matches list chrome) ───────────────────────────────────────── */

.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 36px 0 8px;
}
.blog-pagination-btn {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(235, 232, 252, 0.88);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.blog-pagination-btn:hover:not(:disabled) {
  border-color: rgba(91, 67, 234, 0.45);
  background: rgba(91, 67, 234, 0.12);
  color: var(--ink);
}
.blog-pagination-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}
.blog-pagination-info {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  padding: 0 8px;
}

/* ── Single Post Page ─────────────────────────────────────────────────────── */

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 34px;
  width: 100%;
  max-width: none;
}

@media (max-width: 960px) {
  .post-layout {
    grid-template-columns: 1fr;
  }
}

.post-article {
  min-width: 0;
  max-width: 860px;
}

/* Post header */
.post-header {
  margin-bottom: var(--space-3xl, 32px);
}
.post-category {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  background: rgba(91,67,234,0.1);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(91,67,234,0.2);
  transition: border-color 0.15s ease;
  white-space: nowrap;
}
.post-category:hover {
  border-color: var(--brand);
}
.post-header h1 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-lg, 16px);
  letter-spacing: -0.02em;
  color: var(--ink);
}
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .post-header h1 {
    background-image: linear-gradient(
      100deg,
      rgba(196, 181, 253, 0.98) 0%,
      rgba(237, 233, 254, 0.96) 38%,
      rgba(255, 255, 255, 1) 78%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  flex-wrap: wrap;
}
.post-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.post-meta-item svg {
  width: 14px;
  height: 14px;
  opacity: 0.5;
  flex-shrink: 0;
}
.post-meta-divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
}

/* Featured image */
.post-featured-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  margin-bottom: 36px;
  object-fit: cover;
  max-height: 460px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

/* Post content — Enhanced Typography */
.post-content {
  line-height: 1.9;
  font-size: 17px;
  color: rgba(255,255,255,0.86);
  letter-spacing: 0.005em;
  max-width: 74ch;
}

/* Shared accent bar for in-article headings (logical props for RTL) */
.post-content :where(h2, h3, h4, h5, h6) {
  position: relative;
  padding-inline-start: 14px;
  scroll-margin-top: 90px;
}
.post-content :where(h2, h3, h4, h5, h6)::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 3px;
  border-radius: 4px;
  background: linear-gradient(
    180deg,
    rgba(196, 181, 253, 0.95) 0%,
    rgba(91, 67, 234, 0.55) 55%,
    rgba(91, 67, 234, 0.2) 100%
  );
  box-shadow: 0 0 12px rgba(91, 67, 234, 0.25);
}

.post-content h2 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 52px 0 16px;
  color: rgba(255, 255, 255, 0.96);
}
.post-content h3 {
  font-size: 23px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
  margin: 38px 0 12px;
  color: rgba(245, 243, 255, 0.95);
}
.post-content h4 {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  margin: 26px 0 10px;
  color: rgba(235, 232, 252, 0.92);
}
.post-content h5 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.45;
  margin: 22px 0 8px;
  color: rgba(228, 224, 248, 0.9);
  letter-spacing: -0.01em;
}
.post-content h6 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  margin: 18px 0 8px;
  color: rgba(218, 214, 240, 0.88);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
  .post-content h2 {
    background-image: linear-gradient(
      98deg,
      rgba(186, 170, 255, 0.98) 0%,
      rgba(237, 233, 254, 0.95) 40%,
      rgba(255, 255, 255, 1) 88%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
  .post-content h3 {
    background-image: linear-gradient(
      98deg,
      rgba(176, 159, 252, 0.95) 0%,
      rgba(244, 242, 255, 0.96) 48%,
      rgba(255, 255, 255, 0.98) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
  .post-content h4 {
    background-image: linear-gradient(
      98deg,
      rgba(165, 148, 245, 0.92) 0%,
      rgba(238, 236, 252, 0.94) 55%,
      rgba(255, 255, 255, 0.96) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
  .post-content h5 {
    background-image: linear-gradient(
      98deg,
      rgba(155, 138, 238, 0.9) 0%,
      rgba(232, 228, 250, 0.92) 60%,
      rgba(255, 255, 255, 0.94) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
  .post-content h6 {
    background-image: linear-gradient(
      98deg,
      rgba(148, 132, 228, 0.88) 0%,
      rgba(220, 216, 240, 0.9) 65%,
      rgba(250, 250, 255, 0.92) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}
.post-content p {
  margin: 0 0 18px;
  color: rgba(255,255,255,0.84);
}
.post-content p.lead,
.post-content .lead {
  font-size: 1.08em;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.88);
  padding: 14px 18px;
  margin: 20px 0 22px;
  border-radius: var(--radius-sm, 16px);
  background: linear-gradient(135deg, rgba(91, 67, 234, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(91, 67, 234, 0.18);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}
.post-content strong,
.post-content b {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.94);
}
.post-content em {
  font-style: italic;
  color: rgba(236, 232, 255, 0.92);
}
.post-content ul,
.post-content ol {
  margin: 14px 0 20px;
  padding-inline-start: 26px;
}
.post-content ul {
  list-style: none;
}
.post-content ul li {
  position: relative;
  padding-inline-start: 6px;
  margin-bottom: 8px;
  color: rgba(255,255,255,0.84);
  line-height: 1.75;
}
.post-content ul li::before {
  content: '';
  position: absolute;
  inset-inline-start: -15px;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.65;
}
.post-content ol {
  list-style: decimal;
}
.post-content ol li {
  margin-bottom: 8px;
  color: rgba(255,255,255,0.84);
  line-height: 1.75;
  padding-inline-start: 4px;
}
.post-content ol li::marker {
  color: rgba(180, 163, 255, 0.9);
  font-weight: 600;
}
.post-content ol ol {
  list-style: lower-alpha;
  margin-top: 8px;
}
.post-content ol ol li::marker {
  color: rgba(160, 140, 240, 0.75);
}
.post-content a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(91,67,234,0.38);
  transition: text-decoration-color var(--transition-fast);
}
.post-content a:hover {
  text-decoration-color: var(--brand);
}
.post-content .smart-link-section {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  vertical-align: middle;
}
.post-content .smart-link-chip {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-inline-start: 6px;
  vertical-align: middle;
  border-radius: 999px;
  border: 1px solid rgba(91, 67, 234, 0.38);
  background: linear-gradient(
    145deg,
    rgba(91, 67, 234, 0.22) 0%,
    rgba(45, 35, 72, 0.55) 45%,
    rgba(10, 8, 24, 0.65) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(0, 0, 0, 0.12);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast),
    background 0.2s ease;
}
.post-content .smart-link-chip:hover {
  border-color: rgba(167, 139, 250, 0.55);
  background: linear-gradient(
    145deg,
    rgba(110, 90, 230, 0.32) 0%,
    rgba(55, 42, 92, 0.58) 50%,
    rgba(14, 12, 28, 0.72) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 4px 14px rgba(0, 0, 0, 0.32),
    0 0 20px rgba(91, 67, 234, 0.18);
  transform: translateY(-1px);
}
.post-content .smart-link-chip svg {
  width: 15px;
  height: 15px;
  stroke: rgba(237, 233, 254, 0.92);
  stroke-width: 2;
  opacity: 0.95;
  filter: none;
}
.post-content .smart-link-chip svg path {
  stroke: rgba(245, 243, 255, 0.94);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.post-content blockquote {
  position: relative;
  margin: 28px 0;
  padding: 16px 20px;
  padding-inline-start: 24px;
  background: linear-gradient(
    135deg,
    rgba(91, 67, 234, 0.12) 0%,
    rgba(255, 255, 255, 0.04) 55%,
    rgba(10, 8, 24, 0.15) 100%
  );
  border-radius: var(--radius-sm, 16px);
  border: 1px solid rgba(91, 67, 234, 0.2);
  color: rgba(255,255,255,0.82);
  font-style: normal;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.post-content blockquote::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(
    180deg,
    rgba(196, 181, 253, 0.95) 0%,
    rgba(91, 67, 234, 0.55) 55%,
    rgba(91, 67, 234, 0.25) 100%
  );
  box-shadow: 0 0 10px rgba(91, 67, 234, 0.35);
}
html[dir='rtl'] .post-content blockquote::before {
  border-radius: 3px 0 0 3px;
}
.post-content blockquote p:last-child {
  margin-bottom: 0;
}

.post-content aside {
  margin: 26px 0;
  padding: 16px 20px;
  border-radius: var(--radius-sm, 16px);
  background: linear-gradient(145deg, rgba(54, 182, 255, 0.08), rgba(91, 67, 234, 0.1));
  border: 1px solid rgba(91, 67, 234, 0.22);
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.96em;
  line-height: 1.75;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}
.post-content aside p:last-child {
  margin-bottom: 0;
}

.post-content mark {
  background: linear-gradient(
    120deg,
    rgba(250, 204, 21, 0.35),
    rgba(196, 181, 253, 0.45)
  );
  color: rgba(255, 255, 255, 0.95);
  padding: 0.08em 0.28em;
  border-radius: 4px;
}
.post-content kbd {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.82em;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  color: rgba(235, 232, 252, 0.95);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(91, 67, 234, 0.35);
  border-radius: 6px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.post-content abbr[title] {
  text-decoration: underline dotted rgba(180, 163, 255, 0.65);
  text-underline-offset: 3px;
  cursor: help;
}
.post-content sup,
.post-content sub {
  font-size: 0.72em;
  color: rgba(200, 192, 235, 0.95);
}
.post-content dl {
  margin: 20px 0;
  padding: 16px 18px;
  border-radius: var(--radius-sm, 16px);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.post-content dt {
  font-weight: 700;
  color: rgba(220, 214, 248, 0.95);
  margin-top: 12px;
}
.post-content dt:first-child {
  margin-top: 0;
}
.post-content dd {
  margin: 4px 0 0;
  padding-inline-start: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
}
.post-content figure {
  margin: 28px 0;
  padding: 0;
}
.post-content figcaption {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.48);
  font-style: normal;
  text-align: center;
}
.post-content details {
  margin: 20px 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm, 16px);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(91, 67, 234, 0.18);
}
.post-content summary {
  cursor: pointer;
  font-weight: 600;
  color: rgba(230, 226, 252, 0.95);
  list-style: none;
}
.post-content summary::-webkit-details-marker {
  display: none;
}
.post-content summary::before {
  content: '▸';
  display: inline-block;
  margin-inline-end: 8px;
  color: rgba(167, 139, 250, 0.95);
  transition: transform var(--transition-fast);
}
.post-content details[open] summary::before {
  transform: rotate(90deg);
}
.post-content details[open] {
  background: rgba(91, 67, 234, 0.08);
}

.post-content img {
  max-width: 100%;
  border-radius: var(--radius-sm, 16px);
  margin: 26px 0;
  box-shadow: 0 6px 24px rgba(0,0,0,0.28);
}
.post-content video {
  max-width: 100%;
  border-radius: var(--radius-sm, 16px);
  margin: 26px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.post-content code {
  background: rgba(255,255,255,0.09);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.86em;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  color: rgba(255,255,255,0.9);
}
.post-content pre {
  background: linear-gradient(165deg, rgba(0, 0, 0, 0.48), rgba(22, 18, 42, 0.58));
  border: 1px solid rgba(91, 67, 234, 0.28);
  padding: 18px;
  border-radius: var(--radius-sm, 16px);
  overflow-x: auto;
  margin: 24px 0 28px;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 28px rgba(0, 0, 0, 0.25);
}
.post-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,0.85);
}
.post-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 34px 0;
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  border: 1px solid rgba(91, 67, 234, 0.2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.post-content table caption {
  caption-side: bottom;
  margin-top: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
}
.post-content thead {
  background: linear-gradient(
    180deg,
    rgba(91, 67, 234, 0.28) 0%,
    rgba(45, 35, 80, 0.45) 100%
  );
}
.post-content th,
.post-content td {
  padding: 12px 14px;
  text-align: start;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  font-size: 14px;
}
.post-content th {
  color: rgba(255, 255, 255, 0.94);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.post-content tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}
.post-content tbody tr:hover td {
  background: rgba(91, 67, 234, 0.06);
}
.post-content td {
  color: rgba(255,255,255,0.78);
}
.post-content tr:last-child td {
  border-bottom: none;
}
.post-content .blog-repaired-table th {
  text-transform: none;
}

/* Code block copy button */
.code-block-wrapper {
  position: relative;
}
.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-xs, 10px);
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 1;
  font-family: inherit;
}
.code-copy-btn:hover {
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.8);
}
.code-copy-btn.copied {
  color: #26c281;
  border-color: rgba(38,194,129,0.3);
}

/* Tags (pill badges) */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--accent);
}
.post-tags-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
}
.post-tags-label svg {
  width: 14px;
  height: 14px;
  opacity: 0.45;
}
.post-tag {
  padding: 5px 14px;
  border-radius: var(--radius);
  background: rgba(91,67,234,0.08);
  border: 1px solid rgba(91,67,234,0.2);
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-normal);
}
.post-tag:hover {
  color: var(--ink);
  border-color: var(--brand);
  background: rgba(91,67,234,0.14);
}

/* ── Post Sidebar (accent borders, same look as list page) ────────────────── */

.post-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl, 24px);
  position: sticky;
  top: 100px;
  width: 100%;
  max-width: 320px;
}

@media (min-width: 1200px) {
  .post-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 34px;
  }

  .post-sidebar {
    max-width: 360px;
  }

  .post-featured-image {
    max-height: 400px;
  }
}

.post-sidebar .sidebar-widget {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm, 16px);
  padding: 18px;
}

.post-sidebar .sidebar-widget-title {
  font-size: var(--text-xs, 11px);
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Related posts */
.related-post-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
  color: inherit;
  transition: opacity var(--transition-normal);
}
.related-post-item:last-child { border-bottom: none; }
.related-post-item:hover { opacity: 0.85; }
.related-post-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xs, 10px);
  object-fit: cover;
  background: var(--panel);
  flex-shrink: 0;
}
.related-post-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}
.related-post-title {
  font-size: var(--text-sm, 12px);
  font-weight: 500;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-post-date {
  font-size: var(--text-xs, 11px);
  color: rgba(255,255,255,0.4);
}

/* Categories (shared with list sidebar) */
.post-sidebar .sidebar-category-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.post-sidebar .sidebar-category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color var(--transition-normal);
}
.post-sidebar .sidebar-category-item:last-child { border-bottom: none; }
.post-sidebar .sidebar-category-item:hover { color: var(--brand); }
.post-sidebar .sidebar-category-count {
  font-size: var(--text-xs, 11px);
  padding: 1px 8px;
  border-radius: var(--radius-xs, 10px);
  background: var(--accent);
  color: rgba(255,255,255,0.6);
}

/* ── Share Buttons ────────────────────────────────────────────────────────── */

.post-share-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.post-share-bar .share-label {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
}
.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs, 10px);
  border: 1px solid var(--accent);
  background: rgba(255,255,255,0.02);
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}
.share-btn svg {
  width: 16px;
  height: 16px;
}
.share-btn:hover {
  border-color: var(--active-border);
  color: var(--ink);
  background: rgba(255,255,255,0.06);
}
.share-btn.copied {
  border-color: rgba(38,194,129,0.4);
  color: #26c281;
}


/* ── Table of Contents ───────────────────────────────────────────────────── */

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 50vh;
  overflow-y: auto;
  scrollbar-width: thin;
}
.toc-nav::-webkit-scrollbar {
  width: 3px;
}
.toc-nav::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 2px;
}
.toc-link {
  display: block;
  padding: 5px 0 5px 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all var(--transition-fast);
  line-height: 1.4;
}
.toc-link:hover {
  color: rgba(255,255,255,0.8);
}
.toc-link.active {
  color: var(--brand);
  border-left-color: var(--brand);
}
.toc-link.toc-h3 {
  padding-left: 24px;
  font-size: 11px;
}

/* ── Comments Section (accent borders) ────────────────────────────────────── */

.comments-section {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--accent);
  position: relative;
}
.comments-section h2 {
  font-size: var(--text-2xl, 20px);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-xl, 20px);
}

/* Comment form */
.comment-form {
  margin-bottom: var(--space-3xl, 32px);
}
.comment-form textarea {
  width: 100%;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm, 10px);
  color: var(--ink);
  font-size: var(--text-base, 14px);
  resize: vertical;
  min-height: 80px;
  outline: none;
  font-family: inherit;
  padding: 12px 16px;
  transition: border-color var(--transition-normal);
  box-sizing: border-box;
}
.comment-form textarea:focus {
  border-color: var(--active-border);
}
.comment-form button {
  margin-top: 10px;
  padding: 8px 20px;
  border-radius: var(--radius-sm, 16px);
  background: var(--brand);
  border: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
}
.comment-form button:hover { opacity: 0.9; }

/* Comment item */
.comment-item {
  padding: var(--space-lg, 16px) 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.comment-item:last-child { border-bottom: none; }
.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-sm, 8px);
}
.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
}
.comment-author {
  font-size: var(--text-base, 14px);
  font-weight: 500;
  color: var(--ink);
}
.comment-date {
  font-size: var(--text-sm, 12px);
  color: rgba(255,255,255,0.4);
}
.comment-body {
  font-size: var(--text-base, 14px);
  color: var(--ink-2);
  line-height: 1.6;
  padding-left: 42px;
}
.comment-reply-btn {
  background: none;
  border: none;
  color: var(--brand);
  font-size: var(--text-sm, 12px);
  cursor: pointer;
  padding-left: 42px;
  margin-top: 4px;
  transition: opacity var(--transition-normal);
}
.comment-reply-btn:hover {
  opacity: 0.8;
}

/* Reply comments */
.comment-replies {
  padding-left: 42px;
  margin-top: var(--space-sm, 8px);
}
.comment-replies .comment-item {
  border-left: 2px solid var(--accent);
  padding-left: var(--space-lg, 16px);
}

/* Comment form disabled state */
.comment-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Load more comments button */
.comments-load-more {
  display: block;
  width: 100%;
  margin-top: var(--space-lg, 16px);
  padding: 10px 0;
  border-radius: var(--radius-sm, 16px);
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-normal);
}
.comments-load-more:hover {
  border-color: var(--active-border);
  color: var(--ink);
}

/* Loading & Empty States */
.blog-loading,
.blog-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 20px;
  margin: 8px 0;
  border-radius: var(--radius-sm, 16px);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255, 255, 255, 0.42);
  font-size: 14px;
  letter-spacing: 0.02em;
}

/* Mobile TOC (collapsible) — only visible below 960px */
.toc-mobile {
  display: none;
  margin-bottom: 24px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm, 16px);
  background: rgba(255,255,255,0.02);
  overflow: hidden;
}
.toc-mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.toc-mobile-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
  opacity: 0.5;
}
.toc-mobile-toggle.open svg {
  transform: rotate(180deg);
}
.toc-mobile-nav {
  display: none;
  flex-direction: column;
  padding: 0 16px 14px;
  border-top: 1px solid var(--accent);
}
.toc-mobile-nav.open {
  display: flex;
}
.toc-mobile-nav .toc-link {
  padding: 6px 0 6px 12px;
}
.toc-mobile-nav .toc-link.toc-h3 {
  padding-left: 24px;
}

@media (max-width: 960px) {
  .toc-widget { display: none !important; }
  .toc-mobile { display: block; }
}

@media (max-width: 600px) {
  .post-header h1 { font-size: 26px; }
  .blog-hero h1 { font-size: 22px; }
  .post-content { font-size: 15px; }
  .post-content h2 { font-size: 22px; margin-top: 36px; }
  .post-content h3 { font-size: 19px; margin-top: 28px; }
  .post-content h4 { font-size: 17px; }
  .post-content h5 { font-size: 16px; }
  .post-content h6 { font-size: 13px; }
  .post-share-bar { flex-wrap: wrap; }
}
