:root {
  --accent: #6366f1;
  --accent-2: rgb(17, 3, 49);
  --soft-bg: #f6f7fb;
  --card-border: rgba(15, 23, 42, 0.08);
  --radius: 1rem;
}

[data-bs-theme="dark"] {
  --soft-bg: #0f1220;
  --card-border: rgba(255, 255, 255, 0.09);
}

h1,
h2,
h3,
.brand {
}

/* Reading progress */
#progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 2000;
  transition: width 0.1s;
}

/* Hero */
.post-hero {
  padding: 4rem 0 2rem;
  text-align: center;
}

.category-pill {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 50rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent);
}

.post-title {
  font-weight: 800;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.15;
  margin: 1.2rem auto;
  max-width: 900px;
}

.post-meta {
  color: var(--bs-secondary-color);
  font-size: 0.95rem;
}

.post-meta img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.featured-img {
  width: 100%;
  height: clamp(240px, 45vw, 520px);
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 25px 60px -20px rgba(15, 23, 42, 0.35);
}

/* Article */
.article-card,
.side-card {
  background: var(--bs-body-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

.article-card {
  padding: clamp(1.25rem, 4vw, 3rem);
}

.article-body {
  font-size: 1.1rem;
  line-height: 1.85;
}

.article-body h2 {
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  scroll-margin-top: 90px;
}

.article-body p {
  margin-bottom: 1.4rem;
  color: var(--bs-body-color);
}

.article-body img {
  border-radius: 0.75rem;
}

.article-body blockquote {
  border-left: 4px solid var(--accent);
  background: rgba(99, 102, 241, 0.07);
  padding: 1.25rem 1.5rem;
  border-radius: 0 0.75rem 0.75rem 0;
  font-family: "Playfair Display", serif;
  font-size: 1.3rem;
  font-style: italic;
  margin: 2rem 0;
}

.article-body pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  overflow-x: auto;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 50rem;
  font-size: 0.85rem;
  border: 1px solid var(--card-border);
  color: var(--bs-body-color);
  text-decoration: none;
  transition: 0.2s;
}

.tag:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Share */
.share-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  color: var(--bs-body-color);
  transition: 0.25s;
  text-decoration: none;
  background: transparent;
}

.share-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-3px);
}

/* Author box */
.author-box {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.1),
    rgba(139, 92, 246, 0.1)
  );
  border-radius: var(--radius);
  padding: 1.75rem;
}

.author-box img {
  width: 90px;
  height: 90px;
  object-fit: cover;
}

/* Sidebar */
.sticky-side {
  position: sticky;
  top: 90px;
}

.side-card {
  padding: 1.5rem;
}

.toc a {
  display: block;
  padding: 0.45rem 0 0.45rem 1rem;
  color: var(--bs-secondary-color);
  text-decoration: none;
  border-left: 2px solid var(--card-border);
  font-size: 0.95rem;
  transition: 0.2s;
}

.toc a:hover,
.toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.mini-post {
  margin-bottom: 10px;
}

.mini-post img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 0.75rem;
  flex-shrink: 0;
}

.mini-post a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.35;
}

.mini-post a:hover {
  color: var(--accent);
}

/* Related cards */
.post-card {
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bs-body-bg);
  transition: transform 0.3s, box-shadow 0.3s;
  height: 100%;
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.25);
}

.post-card img {
  height: 200px;
  width: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.post-card:hover img {
  transform: scale(1.05);
}

.post-card .img-wrap {
  overflow: hidden;
}

.post-card a.stretched-link {
  color: inherit;
  text-decoration: none;
}

/* Comments */
.comment img {
  width: 52px;
  height: 52px;
  object-fit: cover;
}

.comment-reply {
  margin-left: 3.25rem;
}

@media (max-width: 575.98px) {
  .comment-reply {
    margin-left: 1rem;
  }
}

/* Newsletter */
.newsletter {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-radius: 1.5rem;
  padding: clamp(2rem, 5vw, 4rem);
}

.newsletter .form-control {
  border-radius: 50rem;
  padding: 0.8rem 1.4rem;
  border: 0;
}

footer {
  border-top: 1px solid var(--card-border);
}

.back-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  z-index: 1500;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}
