@import url("index.css");

/* ── Reading progress bar ─────────────────────────────────────── */

.post-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #9660db, #ab80e2);
  box-shadow: 0 0 10px rgba(150, 96, 219, 0.8);
  z-index: 100;
  transition: width 0.1s linear;
}

/* ── Article shell ────────────────────────────────────────────── */

.post {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 56px;
  padding-top: 48px;
  padding-bottom: 96px;
}

.post__breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: #8a7f99;
  margin-bottom: 26px;
}

.post__breadcrumbs a {
  color: #ab80e2;
  font-weight: 500;
  transition: color 0.2s;
}

.post__breadcrumbs a:hover {
  color: #fff;
}

.post__breadcrumbs svg {
  width: 13px;
  height: 13px;
  color: #5a5168;
}

.post__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.post__tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(150, 96, 219, 0.14);
  border: 1px solid rgba(150, 96, 219, 0.3);
  color: #ab80e2;
  font-size: 12px;
  font-weight: 600;
}

.post__title {
  font-size: 46px;
  line-height: 1.15;
  margin-bottom: 22px;
}

.post__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 28px;
  margin-bottom: 34px;
  border-bottom: 1px solid rgba(150, 96, 219, 0.18);
  font-size: 14px;
  color: #8a7f99;
}

.post__avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #9660db, #443388);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.post__author {
  color: #fff;
  font-weight: 500;
}

.post__meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: #5a5168;
}

/* ── Series kicker + navigator ────────────────────────────────── */

.post__series-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #ab80e2;
  margin-bottom: 12px;
}

.post__series-kicker svg {
  width: 14px;
  height: 14px;
}

.post-series {
  margin-bottom: 34px;
  padding: 20px 22px;
  border-radius: 12px;
  border: 1px solid rgba(150, 96, 219, 0.3);
  background:
    radial-gradient(ellipse 90% 120% at 50% -30%, rgba(150, 96, 219, 0.12) 0%, transparent 70%),
    rgba(150, 96, 219, 0.05);
}

.post-series__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #8a7f99;
}

.post-series__name {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  margin: 4px 0 14px;
}

.post-series__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.post-series__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  color: #afa5bd;
  transition: border-color 0.2s, background 0.2s;
}

.post-series__item--current {
  background: rgba(150, 96, 219, 0.14);
  border-color: rgba(150, 96, 219, 0.4);
  color: #fff;
  font-weight: 500;
}

/* Published parts other than the current page render as links. */
a.post-series__item:hover {
  border-color: rgba(150, 96, 219, 0.4);
  background: rgba(150, 96, 219, 0.08);
  color: #fff;
}

.post-series__num {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #221632;
  border: 1px solid rgba(150, 96, 219, 0.35);
  font-size: 11.5px;
  font-weight: 600;
  color: #ab80e2;
}

.post-series__item--current .post-series__num {
  background: #9660db;
  border-color: #ab80e2;
  color: #fff;
}

.post-series__badge {
  margin-left: auto;
  flex-shrink: 0;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.post-series__item--current .post-series__badge {
  background: rgba(91, 211, 158, 0.15);
  border: 1px solid rgba(91, 211, 158, 0.4);
  color: #5bd39e;
}

/* ── Body typography ──────────────────────────────────────────── */

.post__body > * + * {
  margin-top: 20px;
}

.post__body h2 {
  font-size: 30px;
  margin-top: 52px;
  scroll-margin-top: 96px;
}

.post__body h3 {
  font-size: 21px;
  color: #fff;
  margin-top: 34px;
}

.post__body p {
  font-size: 16.5px;
  line-height: 1.75;
}

.post__body a {
  color: #ab80e2;
  border-bottom: 1px solid rgba(171, 128, 226, 0.4);
  transition: border-color 0.2s, color 0.2s;
}

.post__body a:hover {
  color: #fff;
  border-color: #fff;
}

.post__body ul,
.post__body ol {
  padding-left: 22px;
  display: block;
}

.post__body li {
  display: list-item;
  color: #afa5bd;
  font-size: 16.5px;
  line-height: 1.75;
  margin-top: 8px;
}

.post__body li::marker {
  color: #9660db;
}

.post__body strong {
  color: #fff;
  font-weight: 600;
}

.post__body code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 14.5px;
  background: rgba(150, 96, 219, 0.14);
  border: 1px solid rgba(150, 96, 219, 0.22);
  border-radius: 4px;
  padding: 1.5px 6px;
  color: #d8c9f2;
}

.post__body blockquote {
  border-left: 3px solid #9660db;
  padding: 6px 0 6px 20px;
  font-size: 18px;
  color: #d5cbe4;
  font-style: italic;
}

/* ── Code blocks ──────────────────────────────────────────────── */

.post-code {
  border: 1px solid rgba(150, 96, 219, 0.25);
  border-radius: 10px;
  overflow: hidden;
  background: #150c22;
}

.post-code__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #221632;
  border-bottom: 1px solid rgba(150, 96, 219, 0.18);
}

.post-code__lang {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #8a7f99;
}

.post-code__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #ab80e2;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid rgba(150, 96, 219, 0.3);
  transition: all 0.2s;
}

.post-code__copy:hover {
  background: rgba(150, 96, 219, 0.18);
  color: #fff;
}

.post-code__copy svg {
  width: 13px;
  height: 13px;
}

.post-code__copy--done {
  color: #5bd39e;
  border-color: rgba(91, 211, 158, 0.5);
}

.post-code pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
}

.post-code pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  line-height: 1.7;
  color: #d5cbe4;
  white-space: pre;
}

.post-code .tok-cmd { color: #ffffff; }
.post-code .tok-str { color: #a8d8b9; }
.post-code .tok-key { color: #ab80e2; }
.post-code .tok-com { color: #6a5f7d; }

/* ── Callout ──────────────────────────────────────────────────── */

.post-callout {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 10px;
  border: 1px solid rgba(150, 96, 219, 0.35);
  background: rgba(150, 96, 219, 0.08);
}

.post-callout svg {
  width: 20px;
  height: 20px;
  color: #ab80e2;
  flex-shrink: 0;
  margin-top: 2px;
}

.post-callout p {
  font-size: 15px;
  margin: 0;
}

/* ── Pipeline visual (build → deploy → route) ─────────────────── */

.post-pipeline {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 26px 22px;
  border-radius: 12px;
  border: 1px solid rgba(150, 96, 219, 0.25);
  background:
    radial-gradient(ellipse 80% 90% at 50% -20%, rgba(150, 96, 219, 0.16) 0%, transparent 70%),
    #1f1338;
}

.post-pipeline__step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 16px 10px;
  border-radius: 10px;
  background: #221632;
  border: 1px solid rgba(150, 96, 219, 0.2);
  transition: transform 0.2s, border-color 0.2s;
}

.post-pipeline__step:hover {
  transform: translateY(-3px);
  border-color: rgba(150, 96, 219, 0.6);
}

.post-pipeline__step svg {
  width: 26px;
  height: 26px;
  color: #ab80e2;
}

.post-pipeline__label {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.post-pipeline__sub {
  font-size: 12px;
  color: #8a7f99;
  line-height: 1.5;
}

.post-pipeline__arrow {
  align-self: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: #9660db;
}

/* ── Share row ────────────────────────────────────────────────── */

.post__share {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid rgba(150, 96, 219, 0.18);
}

.post__share-label {
  font-size: 14px;
  color: #8a7f99;
  font-weight: 600;
}

.post__share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(150, 96, 219, 0.3);
  background: #221632;
  color: #afa5bd;
  transition: all 0.2s;
}

.post__share-btn:hover {
  color: #fff;
  border-color: #9660db;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(150, 96, 219, 0.3);
}

.post__share-btn svg {
  width: 16px;
  height: 16px;
}

.post__share-toast {
  font-size: 13px;
  color: #5bd39e;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.25s;
}

.post__share-toast--visible {
  opacity: 1;
}

/* ── CTA card ─────────────────────────────────────────────────── */

.post-cta {
  margin-top: 40px;
  padding: 34px 36px;
  border-radius: 14px;
  text-align: center;
  border: 1px solid rgba(150, 96, 219, 0.35);
  background:
    radial-gradient(ellipse 90% 120% at 50% -30%, rgba(150, 96, 219, 0.28) 0%, transparent 70%),
    #221632;
}

.post-cta h3 {
  color: #fff;
  margin-bottom: 10px;
}

.post-cta p {
  max-width: 460px;
  margin: 0 auto 22px;
}

/* ── TOC sidebar ──────────────────────────────────────────────── */

.post__aside {
  position: relative;
}

.post-toc {
  position: sticky;
  top: 32px;
  padding: 20px 22px;
  border-radius: 12px;
  border: 1px solid rgba(150, 96, 219, 0.2);
  background: #221632;
}

.post-toc__title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #8a7f99;
  margin-bottom: 14px;
}

.post-toc__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-toc__link {
  display: block;
  padding: 7px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  font-size: 13.5px;
  color: #afa5bd;
  line-height: 1.4;
  transition: all 0.2s;
}

.post-toc__link:hover {
  color: #fff;
  background: rgba(150, 96, 219, 0.1);
}

.post-toc__link--active {
  color: #fff;
  font-weight: 600;
  border-left-color: #9660db;
  background: rgba(150, 96, 219, 0.12);
}

.post-toc__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: #ab80e2;
  transition: color 0.2s;
}

.post-toc__back:hover {
  color: #fff;
}

.post-toc__back svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 900px) {
  .post {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .post__aside {
    display: none;
  }
  .post__title {
    font-size: 34px;
  }
  .post-pipeline {
    flex-direction: column;
  }
  .post-pipeline__arrow {
    transform: rotate(90deg);
  }
}
