/* Long-form blog guide: sticky TOC + colorful callouts */
.bg-guide {
  --bg-teal: #09b598;
  --bg-teal-dark: #067a68;
  --bg-blue: #3365c7;
  --bg-ink: #0f172a;
  --bg-muted: #64748b;
  --bg-border: #e2e8f0;
  --bg-header-offset: 110px;
}

.bg-guide__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

.bg-guide__toc-wrap {
  order: -1;
}

.bg-guide__toc {
  background: #fff;
  border: 1px solid var(--bg-border);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
  padding: 1rem 1rem 1.1rem;
}

.bg-guide__toc-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--bg-ink);
}

.bg-guide__toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: min(70vh, 520px);
  overflow-y: auto;
}

.bg-guide__toc-list a {
  display: block;
  padding: 0.45rem 0.65rem 0.45rem 0.75rem;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  color: var(--bg-muted);
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.35;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.bg-guide__toc-list a:hover {
  color: var(--bg-teal-dark);
  background: rgba(9, 181, 152, 0.08);
  text-decoration: none;
}

.bg-guide__toc-list a.is-active {
  color: var(--bg-teal-dark);
  font-weight: 600;
  border-left-color: var(--bg-teal);
  background: linear-gradient(90deg, rgba(9, 181, 152, 0.14), rgba(51, 101, 199, 0.06));
}

.bg-guide__toc-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--bg-border);
  background: linear-gradient(90deg, rgba(9, 181, 152, 0.12), rgba(51, 101, 199, 0.1));
  color: var(--bg-ink);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.bg-guide__toc-toggle i {
  transition: transform 0.2s ease;
}

.bg-guide__toc-wrap.is-open .bg-guide__toc-toggle i {
  transform: rotate(180deg);
}

/* Callout boxes */
.bg-callout {
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.15rem 1.05rem 1.2rem;
  border-radius: 12px;
  border: 1px solid transparent;
  border-left-width: 5px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

.bg-callout p {
  margin: 0;
}

.bg-callout__label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.bg-callout--answer {
  background: linear-gradient(135deg, #e8faf6 0%, #eef4ff 100%);
  border-color: rgba(9, 181, 152, 0.35);
  border-left-color: var(--bg-teal);
}

.bg-callout--answer .bg-callout__label {
  color: var(--bg-teal-dark);
}

.bg-callout--note {
  background: linear-gradient(135deg, #fff8e8 0%, #fff1e6 100%);
  border-color: rgba(217, 119, 6, 0.28);
  border-left-color: #d97706;
}

.bg-callout--note .bg-callout__label {
  color: #b45309;
}

.bg-callout--warn {
  background: linear-gradient(135deg, #fff1f2 0%, #fef2f2 100%);
  border-color: rgba(225, 29, 72, 0.22);
  border-left-color: #e11d48;
}

.bg-callout--warn .bg-callout__label {
  color: #be123c;
}

.bg-guide .blogdetailscontent h4[id] {
  scroll-margin-top: calc(var(--bg-header-offset) + 12px);
}

.bg-guide .blogdetailscontent .table {
  background: #fff;
}

.bg-guide .blogdetailscontent .table thead th {
  background: linear-gradient(90deg, rgba(9, 181, 152, 0.12), rgba(51, 101, 199, 0.1));
  color: var(--bg-ink);
  border-bottom-width: 1px;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 991.98px) {
  .bg-guide__toc-toggle {
    display: flex;
  }

  .bg-guide__toc {
    display: none;
    margin-top: 0.65rem;
  }

  .bg-guide__toc-wrap.is-open .bg-guide__toc {
    display: block;
  }

  .bg-guide__toc-list {
    max-height: 280px;
  }
}

@media (min-width: 992px) {
  .bg-guide__layout {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 2rem;
  }

  .bg-guide__toc-wrap {
    order: 0;
    position: sticky;
    top: var(--bg-header-offset);
    align-self: start;
  }

  .bg-guide__toc-list {
    max-height: calc(100vh - var(--bg-header-offset) - 90px);
  }
}

@media (min-width: 1200px) {
  .bg-guide__layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}
