/* ==========================================================================
   Single post – SEVI-inspired layout, coursepree branding
   ========================================================================== */

/* Sticky sidebar needs a visible overflow ancestor (.app is overflow:hidden globally). */
body.single-post .app,
.app:has(.sp-single) {
  overflow: visible;
}

.sp-single {
  --sp-primary: #33a1fd;
  --sp-primary-2: #2b9dfa;
  --sp-soft: #ebf6ff;
  --sp-soft-2: #f0f7fb;
  --sp-text: #282f3e;
  --sp-muted: #8d9bb6;
  --sp-line: #ebecf2;
  --sp-radius: 28px;
  --sp-radius-sm: 20px;
  --sp-shadow: 0 16px 40px rgba(102, 119, 141, 0.08);
  margin-top: 80px;
  padding: 28px 0 80px;
  background:
    radial-gradient(900px 420px at 100% 0%, rgba(51, 161, 253, 0.1), transparent 55%),
    #f5f5f5;
}

/* Progress */
.reading-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 5px;
  z-index: 1300;
  background: rgba(235, 236, 242, 0.75);
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7cc4ff 0%, #33a1fd 45%, #1f8feb 100%);
  box-shadow: 0 0 18px rgba(51, 161, 253, 0.55);
  transition: width .08s linear;
  transform-origin: right center;
}

.reading-progress-pill {
  position: fixed;
  top: 14px;
  left: 18px;
  z-index: 1301;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(51, 161, 253, 0.18);
  box-shadow: 0 10px 28px rgba(40, 47, 62, 0.12);
  font-size: 12px;
  color: var(--sp-muted);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease;
}

.reading-progress-pill.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reading-progress-pill[hidden] {
  display: none !important;
}

.reading-progress-pill span {
  font-weight: 800;
  color: var(--sp-primary);
  font-variant-numeric: tabular-nums;
}

.reading-progress-pill em {
  font-style: normal;
  font-size: 11px;
}

/* Shared card */
.sp-card,
.sp-side-card {
  background: #fff;
  border: 1px solid rgba(235, 236, 242, 0.95);
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow);
}

.sp-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--sp-soft);
  color: var(--sp-primary);
  font-size: 11px;
  font-weight: 700;
}

.sp-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--sp-line);
  background: #fff;
  color: #586889;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s ease;
  text-decoration: none;
}

.sp-icon-btn:hover,
.sp-icon-btn.is-copied {
  background: var(--sp-primary);
  border-color: var(--sp-primary);
  color: #fff;
}

.sp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sp-tags a {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: #f7f8fc;
  border: 1px solid transparent;
  color: #586889;
  font-size: 12px;
  font-weight: 600;
  transition: all .2s ease;
}

.sp-tags a:hover {
  background: var(--sp-soft);
  border-color: rgba(51, 161, 253, 0.2);
  color: var(--sp-primary);
}

/* -------------------------------------------------------------------------- */
/* Hero                                                                        */
/* -------------------------------------------------------------------------- */
.sp-hero {
  margin-bottom: 28px;
}

.sp-hero-media {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  border-radius: 32px;
  background: #1a2338;
}

.sp-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sp-hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14, 23, 51, 0.15) 0%, rgba(14, 23, 51, 0.35) 40%, rgba(14, 23, 51, 0.82) 100%);
}

.sp-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 420px;
  padding: 28px 32px 36px;
}

.sp-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.sp-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.sp-chip i {
  font-size: 14px;
  opacity: 0.9;
}

.sp-hero-title {
  max-width: 920px;
  margin: 0;
  color: #fff;
  font-size: clamp(26px, 3.4vw, 44px);
  line-height: 1.55;
}

.sp-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
}

.sp-hero-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sp-hero-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
}

.sp-hero-author-name {
  display: block;
  color: #fff;
  font-weight: 700;
}

.sp-hero-author-role {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

.sp-hero-divider {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.22);
}

.sp-hero-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}

.sp-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sp-breadcrumb a,
.sp-breadcrumb span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--sp-line);
  color: #586889;
  font-size: 12px;
  font-weight: 600;
  transition: all .2s ease;
}

.sp-breadcrumb a:hover {
  background: var(--sp-soft);
  color: var(--sp-primary);
  border-color: rgba(51, 161, 253, 0.2);
}

.sp-breadcrumb .is-current {
  background: var(--sp-primary);
  border-color: var(--sp-primary);
  color: #fff;
}

.sp-actions {
  display: flex;
  gap: 8px;
}

/* -------------------------------------------------------------------------- */
/* Layout                                                                      */
/* -------------------------------------------------------------------------- */
.sp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}

.sp-main {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.sp-layout > .sp-sidebar {
  align-self: start;
}

/* Intro */
.sp-intro {
  padding: 26px 28px;
}

.sp-intro-text {
  margin: 0;
  font-size: 15px;
  line-height: 32px;
  color: #586889;
}

.sp-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.sp-stat {
  padding: 16px;
  border-radius: 18px;
  background: #f7f8fc;
  border: 1px solid var(--sp-line);
}

.sp-stat span {
  display: block;
  font-size: 11px;
  color: var(--sp-muted);
}

.sp-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  color: var(--sp-text);
}

/* Mobile TOC */
.sp-toc-mobile {
  display: none;
  padding: 18px 20px;
}

.sp-toc-mobile summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  color: var(--sp-text);
  list-style: none;
}

.sp-toc-mobile summary::-webkit-details-marker {
  display: none;
}

.sp-toc-mobile .coursepree-toc,
.sp-toc-mobile .sp-toc-list {
  margin-top: 14px;
}

/* Article */
.sp-article {
  padding: 28px 32px 30px;
}

.sp-article-body h1,
.sp-article-body h2,
.sp-article-body h3,
.sp-article-body h4 {
  font-family: "Rokh", sans-serif;
  color: var(--sp-text);
  margin: 28px 0 14px;
}

.sp-article-body p {
  font-size: 16px;
  line-height: 32px;
  color: #586889;
  margin-bottom: 16px;
  text-align: justify;
}

.sp-article-body img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 28px 0;
  border-radius: 22px;
}

.sp-article-body blockquote {
  margin: 24px 0;
  padding: 18px 22px;
  border-right: 4px solid var(--sp-primary);
  border-radius: 16px;
  background: var(--sp-soft);
  color: #586889;
  font-size: 15px;
  line-height: 30px;
}

.sp-article-body ul,
.sp-article-body ol {
  margin: 0 0 18px;
  padding-right: 20px;
  color: #586889;
}

.sp-article-body li {
  margin-bottom: 8px;
  line-height: 28px;
}

.sp-article-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--sp-line);
}

.sp-share-row {
  display: flex;
  gap: 8px;
}

/* Author box */
.sp-author-box {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 26px 28px;
}

.sp-author-box-avatar {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  object-fit: cover;
  flex-shrink: 0;
}

.sp-author-box-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sp-author-box-name {
  font-size: 20px;
  color: var(--sp-text);
}

.sp-author-box-body p {
  margin: 0;
  font-size: 14px;
  line-height: 28px;
  color: #586889;
}

.sp-author-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--sp-primary);
}

.sp-author-link:hover i {
  transform: translateX(-3px);
}

.sp-author-link i {
  transition: transform .2s ease;
}

/* Related */
.sp-related-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.sp-related-head h2 {
  margin: 0;
  font-size: 24px;
  color: var(--sp-text);
}

.sp-related-head a {
  font-size: 13px;
  color: var(--sp-muted);
  font-weight: 600;
}

.sp-related-head a:hover {
  color: var(--sp-primary);
}

.sp-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.sp-related-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--sp-line);
  border-radius: 26px;
  box-shadow: var(--sp-shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}

.sp-related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 48px rgba(102, 119, 141, 0.12);
}

.sp-related-thumb {
  position: relative;
  display: block;
  height: 180px;
  overflow: hidden;
}

.sp-related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.sp-related-card:hover .sp-related-thumb img {
  transform: scale(1.05);
}

.sp-related-thumb span {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.sp-related-body {
  padding: 16px 18px 18px;
}

.sp-related-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--sp-muted);
}

.sp-related-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sp-related-body h3 {
  margin: 10px 0 14px;
  font-size: 14px;
  line-height: 24px;
  font-weight: 800;
}

.sp-related-body h3 a {
  color: var(--sp-text);
}

.sp-related-body h3 a:hover {
  color: var(--sp-primary);
}

.sp-related-more {
  font-size: 12px;
  font-weight: 700;
  color: var(--sp-text);
}

.sp-related-more:hover {
  color: var(--sp-primary);
}

/* Comments */
.sp-comments {
  margin-top: 8px;
}

.sp-comments-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.sp-comments-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--sp-primary);
}

.sp-comments-head h2 {
  margin: 0;
  font-size: 26px;
  color: var(--sp-text);
}

.sp-comments-sub {
  margin: 8px 0 0;
  max-width: 460px;
  font-size: 13px;
  line-height: 24px;
  color: #586889;
}

.sp-comments-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--sp-line);
  box-shadow: 0 8px 22px rgba(102, 119, 141, 0.06);
}

.sp-comments-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: #586889;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.sp-comments-tab em {
  font-style: normal;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2f8;
  color: #67788e;
  font-size: 11px;
}

.sp-comments-tab.is-active {
  background: var(--sp-primary);
  color: #fff;
  box-shadow: 0 10px 22px rgba(51, 161, 253, 0.28);
}

.sp-comments-tab.is-active em {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.sp-comments-panel {
  display: none;
}

.sp-comments-panel.is-active {
  display: block;
  animation: spFade .28s ease;
}

@keyframes spFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.sp-comment-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sp-comments-empty {
  padding: 36px 28px;
  text-align: center;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(51, 161, 253, 0.12), transparent 55%),
    #fff;
}

.sp-comments-empty .sp-newsletter-icon {
  margin-bottom: 6px;
}

.sp-comments-empty h3 {
  margin: 12px 0 8px;
  font-size: 20px;
  color: var(--sp-text);
}

.sp-comments-empty p {
  margin: 0 auto 18px;
  max-width: 360px;
  font-size: 13px;
  line-height: 26px;
  color: #586889;
}

.sp-comment {
  display: flex;
  gap: 16px;
  padding: 22px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.sp-comment:hover {
  border-color: rgba(51, 161, 253, 0.22);
  box-shadow: 0 18px 40px rgba(102, 119, 141, 0.1);
}

.sp-comment-avatar {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(51, 161, 253, 0.08);
}

.sp-comment-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.sp-comment-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sp-comment-top strong,
.sp-comment-name-row strong {
  display: block;
  color: var(--sp-text);
  font-size: 15px;
}

.sp-comment-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--sp-muted);
}

.sp-comment-actions .comment-reply-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #f7f8fc;
  border: 1px solid var(--sp-line);
  color: #586889;
  font-size: 12px;
  font-weight: 700;
  transition: all .2s ease;
}

.sp-comment-actions .comment-reply-link:hover {
  background: rgba(51, 161, 253, 0.08);
  color: var(--sp-primary);
  border-color: rgba(51, 161, 253, 0.2);
}

.sp-badge-green {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.sp-comment-body > p {
  margin: 0;
  font-size: 14px;
  line-height: 30px;
  color: #586889;
}

.sp-comment-reply {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(180deg, #f7f9fc, #f3f6fb);
  border: 1px solid var(--sp-line);
}

.sp-comment-reply .sp-comment-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.sp-comment-reply p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 28px;
  color: #586889;
}

.sp-comment-form {
  padding: 26px 28px;
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(51, 161, 253, 0.1), transparent 50%),
    #fff;
}

.sp-comment-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.sp-comment-form-head h3 {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--sp-text);
}

.sp-comment-form-head p {
  margin: 0;
  font-size: 13px;
  line-height: 24px;
  color: #586889;
}

.sp-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sp-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.sp-field-full {
  grid-column: 1 / -1;
}

.sp-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--sp-text);
}

.sp-field label em {
  color: #ef4444;
  font-style: normal;
}

.sp-field .form-control,
.sp-comment-form .form-control {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--sp-line);
  background: #f7f8fc;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--sp-text);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.sp-field .form-control:focus,
.sp-comment-form .form-control:focus {
  border-color: rgba(51, 161, 253, 0.4);
  box-shadow: 0 0 0 4px rgba(51, 161, 253, 0.1);
  background: #fff;
}

.sp-field textarea.form-control {
  min-height: 160px;
  resize: vertical;
  line-height: 28px;
}

.sp-comment-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.sp-char-count {
  font-size: 12px;
  color: var(--sp-muted);
}

.sp-char-count b {
  color: var(--sp-primary);
  font-weight: 800;
}

.sp-preview-btn {
  appearance: none;
  border: 1px solid var(--sp-line);
  background: #fff;
  color: #586889;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all .2s ease;
}

.sp-preview-btn:hover,
.sp-preview-btn.is-active {
  border-color: rgba(51, 161, 253, 0.3);
  color: var(--sp-primary);
  background: rgba(51, 161, 253, 0.06);
}

.sp-comment-preview {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f0f7fb;
  border: 1px dashed rgba(51, 161, 253, 0.35);
  font-size: 13px;
  line-height: 28px;
  color: #586889;
  white-space: pre-wrap;
}

.sp-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f7f8fc;
  border: 1px solid var(--sp-line);
  cursor: pointer;
}

.sp-check input {
  margin-top: 3px;
  accent-color: var(--sp-primary);
}

.sp-check strong {
  display: block;
  font-size: 13px;
  color: var(--sp-text);
}

.sp-check small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 22px;
  color: var(--sp-muted);
}

.sp-form-actions {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.sp-form-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--sp-muted);
}

.sp-form-hint i {
  color: var(--sp-primary);
}

.sp-cancel-reply {
  margin: 0 0 12px;
}

.sp-cancel-reply a {
  color: #ef4444;
  font-size: 13px;
  font-weight: 700;
}

.sp-submit {
  border-radius: 16px;
  padding: 12px 22px;
  min-width: 160px;
}

.sp-comment-list > #respond,
.sp-comment-body > #respond {
  margin-top: 16px;
  padding: 22px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(51, 161, 253, 0.2);
  box-shadow: var(--sp-shadow);
}

/* -------------------------------------------------------------------------- */
/* Sidebar                                                                     */
/* -------------------------------------------------------------------------- */
.sp-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: -webkit-sticky;
  position: sticky;
  top: 96px;
  align-self: start;
  width: 100%;
  height: max-content;
  z-index: 5;
}

.sp-side-card {
  padding: 22px;
}

.sp-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.sp-side-head h3 {
  margin: 0;
  font-size: 16px;
  color: var(--sp-text);
}

.sp-side-head > i {
  color: #c5ccd9;
  font-size: 16px;
}

/* TOC in sidebar */
.sp-side-toc .coursepree-toc__header,
.sp-toc-mobile .coursepree-toc__header {
  display: none;
}

.sp-side-toc .coursepree-toc__list,
.sp-side-toc .coursepree-toc__sublist,
.sp-toc-mobile .coursepree-toc__list,
.sp-toc-mobile .coursepree-toc__sublist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sp-side-toc .coursepree-toc__link,
.sp-toc-mobile .coursepree-toc__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: 16px;
  background: #f7f8fc;
  color: #586889;
  font-size: 13px;
  transition: all .2s ease;
}

.sp-side-toc .coursepree-toc__link:hover,
.sp-side-toc .coursepree-toc__link.is-active,
.sp-toc-mobile .coursepree-toc__link:hover {
  background: rgba(51, 161, 253, 0.08);
  color: var(--sp-primary);
}

.sp-side-toc .coursepree-toc__bullet {
  display: none;
}

/* Author widget */
.sp-side-author {
  padding: 0;
  overflow: hidden;
}

.sp-side-author-panel {
  padding: 22px;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(51, 161, 253, 0.18), transparent 55%),
    linear-gradient(160deg, #f4faff 0%, #eef7ff 45%, #fff 100%);
}

.sp-side-author-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sp-side-author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.55);
}

.sp-side-author-name {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--sp-text);
}

.sp-side-author-top span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #67788e;
}

.sp-side-author-panel > p {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 26px;
  color: #586889;
}

.sp-side-author-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.sp-side-author-stats > div {
  text-align: center;
  padding: 12px 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
}

.sp-side-author-stats strong {
  display: block;
  font-size: 16px;
  color: var(--sp-text);
}

.sp-side-author-stats span {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--sp-muted);
}

/* Search */
.sp-side-search {
  position: relative;
}

.sp-side-search i {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sp-muted);
  font-size: 15px;
  pointer-events: none;
}

.sp-side-search input {
  width: 100%;
  height: 48px;
  border-radius: 16px;
  border: 1px solid var(--sp-line);
  background: #f7f8fc;
  padding: 0 42px 0 14px;
  font-size: 12px;
  color: #586889;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.sp-side-search input:focus {
  border-color: rgba(51, 161, 253, 0.35);
  box-shadow: 0 0 0 4px rgba(51, 161, 253, 0.08);
  background: #fff;
}

/* Popular posts */
.sp-side-posts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sp-side-post {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.sp-side-post-thumb {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--sp-soft);
}

.sp-side-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.sp-side-post:hover .sp-side-post-thumb img {
  transform: scale(1.06);
}

.sp-side-post-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 22px;
  color: var(--sp-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.sp-side-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--sp-muted);
}

.sp-side-post-meta i {
  font-size: 12px;
  margin-left: 3px;
}

/* Newsletter / CTA */
.sp-side-newsletter,
.sp-side-cta {
  padding: 0;
  overflow: hidden;
}

.sp-newsletter-panel,
.sp-cta-panel {
  padding: 22px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(51, 161, 253, 0.16), transparent 50%),
    linear-gradient(165deg, #f3f9ff, #fff 60%);
}

.sp-newsletter-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--sp-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.sp-newsletter-panel h3,
.sp-cta-panel h3 {
  margin: 14px 0 8px;
  font-size: 18px;
  color: var(--sp-text);
}

.sp-newsletter-panel p,
.sp-cta-panel p {
  margin: 0;
  font-size: 13px;
  line-height: 26px;
  color: #586889;
}

.sp-newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.sp-newsletter-form input {
  height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.85);
  padding: 0 14px;
  font-size: 13px;
  outline: none;
}

.sp-newsletter-form .btn,
.sp-cta-panel .btn {
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sp-cta-panel .btn {
  margin-top: 16px;
  width: 100%;
}

/* Categories */
.sp-side-cats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sp-side-cats a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #f7f8fc;
  transition: background .2s ease;
}

.sp-side-cats a:hover {
  background: rgba(51, 161, 253, 0.08);
}

.sp-side-cat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--sp-line);
  color: var(--sp-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sp-side-cat-name {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--sp-text);
}

.sp-side-cats em {
  font-style: normal;
  font-size: 12px;
  color: var(--sp-muted);
}

/* Hide old detail-blog spacing if any remnant */
.sp-single .detail-blog-content {
  padding: 0;
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                  */
/* -------------------------------------------------------------------------- */
@media only screen and (max-width: 1199px) {
  .sp-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .sp-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media only screen and (max-width: 991px) {
  .sp-layout {
    grid-template-columns: 1fr;
  }

  .sp-sidebar {
    position: static;
    top: auto;
    height: auto;
  }

  .sp-side-toc {
    display: none;
  }

  .sp-toc-mobile {
    display: block;
  }

  .sp-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sp-hero-media,
  .sp-hero-content {
    min-height: 360px;
  }

  .sp-hero-divider {
    display: none;
  }

  .reading-progress-pill {
    top: auto;
    bottom: 18px;
    left: 50%;
    transform: translate(-50%, 8px);
  }

  .reading-progress-pill.is-visible {
    transform: translate(-50%, 0);
  }

  .sp-comments-tabs {
    width: 100%;
  }

  .sp-comments-tab {
    flex: 1;
    justify-content: center;
  }

  .sp-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .sp-submit {
    width: 100%;
  }
}

@media only screen and (max-width: 767px) {
  .sp-single {
    padding: 18px 0 56px;
  }

  .sp-hero-media,
  .sp-hero-content {
    min-height: 320px;
    border-radius: 24px;
  }

  .sp-hero-content {
    padding: 20px 18px 24px;
  }

  .sp-intro,
  .sp-article,
  .sp-author-box,
  .sp-comment,
  .sp-comment-form {
    padding: 18px;
    border-radius: 22px;
  }

  .sp-author-box {
    flex-direction: column;
  }

  .sp-related-grid {
    grid-template-columns: 1fr;
  }

  .sp-form-grid {
    grid-template-columns: 1fr;
  }

  .sp-comment {
    flex-direction: column;
  }
}
