.series-page {
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* Skeleton */
.series-skeleton {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.series-skeleton-block {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1.5rem;
}

.series-skeleton-block .skeleton-heading {
  height: 28px;
  width: 200px;
  margin-bottom: 0.75rem;
}

.series-skeleton-block .skeleton-item {
  height: 52px;
  margin-bottom: 0.75rem;
  border-radius: 8px;
}

/* Header */
.series-header {
  margin-top: 24px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.series-header h2::before {
  display: none;
}

.series-header h2 {
  margin: 12px 0;
}

/* Series container */
.series-container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* Series block card */
.series-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: visible;
}

.series-block-header {
  padding: 1.5rem 1.75rem;
  background: linear-gradient(135deg, var(--bg-soft) 0%, var(--bg-card) 100%);
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.series-block-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.series-block-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.series-chevron {
  transition: transform 0.25s ease;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.series-block.collapsed .series-chevron {
  transform: rotate(-90deg);
}

.series-block.collapsed .series-posts,
.series-block.collapsed .show-more-bar {
  display: none;
}

.series-block.collapsed .series-block-header {
  border-bottom: none;
  border-radius: 12px;
}

/* Split start button */
.series-start-split {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  border-radius: 999px;
  border: 1px solid var(--primary);
  overflow: visible;
}

.series-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 0.35rem 0.7rem 0.35rem 0.85rem;
  border: none;
  border-radius: 999px 0 0 999px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.series-start-btn:hover {
  background: var(--primary);
  color: #fff;
}

.series-start-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.55rem;
  border: none;
  border-left: 1px solid var(--primary);
  border-radius: 0 999px 999px 0;
  background: none;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.series-start-chevron:hover {
  background: var(--primary);
  color: #fff;
}

.series-start-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
  overflow: hidden;
}

.series-start-dropdown.open {
  display: block;
}

.series-start-dropdown a {
  display: block;
  padding: 0.55rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.15s ease;
}

.series-start-dropdown a:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.series-start-dropdown a:hover {
  background: var(--bg-soft);
  color: var(--primary);
}

.series-block-title {
  margin: 0;
  font-size: 1.3rem;
}

.series-block-title::before {
  display: none !important;
}

.series-block-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.5rem;
}

.series-block-description {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.series-block-title .tag-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  background: var(--primary);
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  margin-left: 0.4rem;
  vertical-align: middle;
  line-height: 1;
}

/* Timeline post list */
.series-posts {
  list-style: none;
  padding: 1.5rem 1.75rem;
  margin: 0;
  position: relative;
}

.series-posts::before {
  content: '';
  position: absolute;
  left: calc(1.75rem + 0.875rem - 1px);
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), #06b6d4, #8b5cf6);
  opacity: 0.35;
}

.series-posts li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  position: relative;
}

.series-posts li .step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  z-index: 1;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 0 12px rgba(59, 130, 246, 0.25);
  transition: all 0.3s ease;
}

.series-posts li:nth-child(10n+2) .step-indicator {
  background: #06b6d4;
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.15), 0 0 12px rgba(6, 182, 212, 0.25);
}
.series-posts li:nth-child(10n+3) .step-indicator {
  background: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15), 0 0 12px rgba(139, 92, 246, 0.25);
}
.series-posts li:nth-child(10n+4) .step-indicator {
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15), 0 0 12px rgba(16, 185, 129, 0.25);
}
.series-posts li:nth-child(10n+5) .step-indicator {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15), 0 0 12px rgba(245, 158, 11, 0.25);
}
.series-posts li:nth-child(10n+6) .step-indicator {
  background: #ec4899;
  box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.15), 0 0 12px rgba(236, 72, 153, 0.25);
}
.series-posts li:nth-child(10n+7) .step-indicator {
  background: #0d9488;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15), 0 0 12px rgba(13, 148, 136, 0.25);
}
.series-posts li:nth-child(10n+8) .step-indicator {
  background: #f97316;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15), 0 0 12px rgba(249, 115, 22, 0.25);
}
.series-posts li:nth-child(10n+9) .step-indicator {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15), 0 0 12px rgba(239, 68, 68, 0.25);
}
.series-posts li:nth-child(10n+10) .step-indicator {
  background: #7c3aed;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15), 0 0 12px rgba(124, 58, 237, 0.25);
}

.series-posts li:hover .step-indicator {
  transform: scale(1.2);
}

.series-posts li .step-content {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.series-posts li:hover .step-content {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transform: translateX(4px);
}

.series-posts li:nth-child(10n+2):hover .step-content { border-color: #06b6d4; }
.series-posts li:nth-child(10n+3):hover .step-content { border-color: #8b5cf6; }
.series-posts li:nth-child(10n+4):hover .step-content { border-color: #10b981; }
.series-posts li:nth-child(10n+5):hover .step-content { border-color: #f59e0b; }
.series-posts li:nth-child(10n+6):hover .step-content { border-color: #ec4899; }
.series-posts li:nth-child(10n+7):hover .step-content { border-color: #0d9488; }
.series-posts li:nth-child(10n+8):hover .step-content { border-color: #f97316; }
.series-posts li:nth-child(10n+9):hover .step-content { border-color: #ef4444; }
.series-posts li:nth-child(10n+10):hover .step-content { border-color: #7c3aed; }

.series-posts li .step-content a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.925rem;
  flex: 1;
  transition: color 0.2s ease;
}

.series-posts li:hover .step-content a {
  color: var(--primary);
}

.series-posts li:nth-child(10n+2):hover .step-content a { color: #06b6d4; }
.series-posts li:nth-child(10n+3):hover .step-content a { color: #8b5cf6; }
.series-posts li:nth-child(10n+4):hover .step-content a { color: #10b981; }
.series-posts li:nth-child(10n+5):hover .step-content a { color: #f59e0b; }
.series-posts li:nth-child(10n+6):hover .step-content a { color: #ec4899; }
.series-posts li:nth-child(10n+7):hover .step-content a { color: #0d9488; }
.series-posts li:nth-child(10n+8):hover .step-content a { color: #f97316; }
.series-posts li:nth-child(10n+9):hover .step-content a { color: #ef4444; }
.series-posts li:nth-child(10n+10):hover .step-content a { color: #7c3aed; }

.series-posts .post-date {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .series-block-header {
    padding: 1rem;
    display: flex;
    flex-direction: column;
  }

  .series-block-header-top {
    flex-wrap: wrap;
  }

  .series-block-title {
    font-size: 1rem;
  }

  .series-block-title-wrap {
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
  }

  .series-block-title {
    word-break: break-word;
  }

  .series-block-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .series-start-split {
    align-self: flex-end;
  }
  .series-start-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.55rem 0.3rem 0.7rem;
  }
  .series-start-chevron {
    padding: 0.3rem 0.45rem;
  }

  .series-posts {
    padding: 0.75rem 1rem;
  }

  .series-posts::before {
    left: calc(1rem + 0.75rem - 1px);
  }

  .series-posts li {
    gap: 0.75rem;
  }

  .series-posts li .step-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding: 0.5rem 0.75rem;
  }

  .series-posts .post-date {
    align-self: flex-end;
  }

  .series-posts li .step-indicator {
    min-width: 1.5rem;
    height: 1.5rem;
    font-size: 0.65rem;
  }

  .series-legend {
    gap: 1rem;
  }
}

@media (min-width: 769px) {
  .series-legend {
    margin-bottom: 2rem;
  }

  .series-description {
    font-size: 0.85rem;
  }
}

/* Series Legend */
.series-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Description with bold support */
.series-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-top: -0.25rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.series-description strong {
  color: var(--text-primary);
}

.series-description p {
  margin: 0;
}

/* Domain color coding */
.domain-ai-engineering {
  border-left: 4px solid var(--domain-ai);
}

.domain-infrastructure {
  border-left: 4px solid var(--domain-infra);
}

.domain-platform {
  border-left: 4px solid var(--domain-platform);
}

.series-block-title .tag-count {
  -webkit-text-fill-color: #fff;
  background: var(--domain-accent);
}

.dot-ai {
  background: var(--domain-ai);
}

.dot-infra {
  background: var(--domain-infra);
}

.dot-platform {
  background: var(--domain-platform);
}

/* New post badge */
.post-new-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(90deg, var(--primary, #2563eb), var(--crimson, #ff009c));
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  vertical-align: middle;
  -webkit-background-clip: unset;
  background-clip: unset;
}

.post-new-badge > span {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  -webkit-text-fill-color: #fff;
  -webkit-background-clip: unset;
  background-clip: unset;
}
