/* =========================================================
   Article / Prose
========================================================= */

.prose p {
  margin-bottom: 1.5rem;
  line-height: 1.75;
  color: var(--color-text-muted, #475569);
}

.prose h2,
.prose h3,
.prose h4 {
  color: var(--color-text, #0f172a);
  scroll-margin-top: 96px;
}

.prose h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  font-size: 1.5rem;
}

.prose h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 1.25rem;
}

.prose h4 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 1.125rem;
}

.prose ul {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  list-style-type: disc;
}

.prose li {
  margin-bottom: 0.5rem;
  color: var(--color-text-muted, #475569);
}

.prose blockquote {
  margin: 2rem 0;
  padding-left: 1rem;
  border-left: 4px solid var(--color-primary, #221a7f);
  color: var(--color-text-muted, #475569);
  font-style: italic;
}

.prose img,
#long-body img,
.post-image,
.thumbnail-image {
  border-radius: var(--radius-card, 20px);
  overflow: hidden;
}

/* =========================================================
   Expandable Long Content
========================================================= */

.long-content {
  display: block;
}

#remaining-text {
  position: relative;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

#remaining-text.is-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 160px;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    var(--color-background, #ffffff)
  );
}

#remaining-text.is-expanded {
  overflow: visible;
}

#toggle-button-wrap {
  display: none;
}

#toggle-button-wrap.is-visible {
  display: flex;
}

#toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.25rem;
  border: none;
  border-radius: var(--radius-button, 12px);
  background: var(--color-primary, #221a7f);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-soft, 0 10px 26px rgba(2, 6, 23, 0.06));
}

#toggle-button:hover {
  opacity: 0.92;
}

/* =========================================================
   TOC
========================================================= */

#toc-mobile-wrap,
#toc-sidebar-wrap {
  display: none;
}

#toc-list-mobile,
#toc-list-desktop {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

#toc-list-mobile li,
#toc-list-desktop li {
  margin: 0;
}

#toc-list-mobile a,
#toc-list-desktop a {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text-muted, #475569);
  text-decoration: none;
  transition: all 0.2s ease;
}

#toc-list-mobile a:hover,
#toc-list-desktop a:hover {
  color: var(--color-primary, #221a7f);
}

#toc-list-mobile a::before,
#toc-list-desktop a::before {
  content: "";
  display: block;
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 0.42rem;
  border-radius: 9999px;
  background: var(--color-border, #e2e8f0);
  transition: all 0.2s ease;
}

#toc-list-mobile a:hover::before,
#toc-list-mobile a.active::before,
#toc-list-desktop a:hover::before,
#toc-list-desktop a.active::before {
  background: var(--color-primary, #221a7f);
}

#toc-list-mobile a.active,
#toc-list-desktop a.active {
  color: var(--color-primary, #221a7f);
  font-weight: 600;
}

#toc-list-mobile li.toc-h3 a,
#toc-list-desktop li.toc-h3 a {
  padding-left: 1rem;
}

#toc-list-mobile li.toc-h3 a::before,
#toc-list-desktop li.toc-h3 a::before {
  width: 4px;
  height: 4px;
}

#toc-list-mobile li.toc-h4 a,
#toc-list-desktop li.toc-h4 a {
  padding-left: 2rem;
}

#toc-list-mobile li.toc-h4 a::before,
#toc-list-desktop li.toc-h4 a::before {
  width: 4px;
  height: 4px;
}

.toc-list-box.toc-limited {
  position: relative;
  overflow: hidden;
  max-height: 260px;
}

.toc-list-box.toc-limited::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    var(--color-background, #ffffff)
  );
}

.toc-list-box.toc-expanded {
  overflow: visible;
  max-height: none;
}

.toc-list-box.toc-expanded::after {
  display: none;
}

.toc-toggle-btn {
  display: none;
}

.toc-toggle-btn.is-visible {
  display: inline-flex;
}

.toc-card {
  padding: 1.5rem;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-card, 20px);
  background: var(--color-background, #ffffff);
  box-shadow: var(--shadow-soft, 0 10px 26px rgba(2, 6, 23, 0.06));
}

/* =========================================================
   Related Card
========================================================= */

.related-service-mini-card {
  transition: all 0.2s ease;
}

.related-service-mini-card:hover {
  transform: translateY(-2px);
}

/* =========================================================
   Responsive
========================================================= */

@media (max-width: 1023px) {
  #toc-mobile-wrap {
    display: block;
  }
}

@media (min-width: 1024px) {
  #toc-sidebar-wrap {
    display: block;
  }

  #toc-sidebar-wrap.is-sticky {
    position: sticky;
    top: 2rem;
  }
}