/* ---------------------------------------------------------------------------
   Custom blocks (design system)

   Shared between the public site (loaded via main.css) and the Gutenberg
   editor canvas (loaded via editor-style.css through add_editor_style()).
   Editing this file updates both contexts.
   --------------------------------------------------------------------------- */

/* ── Callout ─────────────────────────────────────────────────────────────── */
.hs-callout {
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 0 0 1.5rem;
  border: 1px solid;
  display: block;
}

.hs-callout__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.hs-callout__icon {
  display: inline-flex;
  flex-shrink: 0;
}

.hs-callout__title {
  font-size: 0.9375rem;
  line-height: 1.4;
}

.hs-callout__body> :first-child {
  margin-top: 0;
}

.hs-callout__body> :last-child {
  margin-bottom: 0;
}

.hs-callout__body p {
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Variants */
.hs-callout--info {
  background: #f9fbff;
  border-color: #cfe0ff;
  color: var(--color-text);
}

.hs-callout--info .hs-callout__icon {
  color: var(--color-text);
}

.hs-callout--tip {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.hs-callout--tip .hs-callout__icon {
  color: #059669;
}

.hs-callout--warning {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.hs-callout--warning .hs-callout__icon {
  color: #dc2626;
}

.hs-callout--prerequisites {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.hs-callout--prerequisites .hs-callout__icon {
  color: #d97706;
}

/* ── Badge (inline) ──────────────────────────────────────────────────────── */
/* Single-class format types (registerFormatType requires one class), so the
   shared styling is hung off any [class*="hs-badge--"] match. */
[class*="hs-badge--"] {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 999px;
  border: 1px solid;
  vertical-align: baseline;
  letter-spacing: 0.01em;
  position: relative;
}

.hs-badge--neutral {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #374151;
}

.hs-badge--success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.hs-badge--warning {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.hs-badge--beta {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #5b21b6;
}

.hs-badge--new {
  background: #eef4ff;
  border-color: #cfe0ff;
  color: #0a3a8c;
}

/* Optional hover tooltip — only when [data-tooltip] is set on the badge. */
[class*="hs-badge--"][data-tooltip] {
  cursor: help;
}

[class*="hs-badge--"][data-tooltip]:hover::after,
[class*="hs-badge--"][data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 0.4rem 0.55rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  max-width: 240px;
  width: max-content;
  white-space: normal;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

[class*="hs-badge--"][data-tooltip]:hover::before,
[class*="hs-badge--"][data-tooltip]:focus-visible::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #1f2937;
  pointer-events: none;
  z-index: 20;
}

/* ── Step list ───────────────────────────────────────────────────────────── */
.hs-step-list {
  counter-reset: hs-step;
  list-style: none;
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--color-border-light, #e5e7eb);
  border-radius: 8px;
  background: #fff;
}

.hs-step-list__items {
  display: block;
}

.hs-step-item {
  counter-increment: hs-step;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.hs-step-item+.hs-step-item {
  border-top: 1px solid var(--color-border-light, #f3f4f6);
}

.hs-step-item__pill {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #1f2937;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.125rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.hs-step-item__pill::before {
  content: counter(hs-step);
}

.hs-step-item__text {
  flex: 1;
}

.hs-step-item__text code {
  background: #f3f4f6;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.875em;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.hs-tabs {
  margin: 1.5rem 0;
}

/* Two Tabs blocks back-to-back read as one confused block; give the second
   extra breathing room so each registers as its own switcher. */
.hs-tabs + .hs-tabs {
  margin-top: 3rem;
}

.hs-tabs__bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1rem;
}

.hs-tabs__tab {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}

.hs-tabs__tab:hover {
  color: #111827;
}

.hs-tabs__tab.is-active {
  color: #111827;
  border-bottom-color: var(--color-accent, #0057ff);
}

.hs-tabs__tab:focus-visible {
  outline: 2px solid var(--color-accent, #0057ff);
  outline-offset: 2px;
}

.hs-tab[hidden] {
  display: none;
}

.hs-tab>div> :first-child {
  margin-top: 0;
}

.hs-tab>div> :last-child {
  margin-bottom: 0;
}

/* ── FAQ accordion ───────────────────────────────────────────────────────── */
.hs-faq-accordion {
  margin: 1.5rem 0;
  border: 1px solid var(--color-border-light, #e5e7eb);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.hs-faq+.hs-faq {
  border-top: 1px solid var(--color-border-light, #f3f4f6);
}

.hs-faq>summary {
  list-style: none;
  cursor: pointer;
  padding: 0.875rem 1.125rem;
  font-weight: 500;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hs-faq>summary::-webkit-details-marker {
  display: none;
}

.hs-faq>summary::after {
  content: '';
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 150ms ease;
  flex-shrink: 0;
  opacity: 0.5;
}

.hs-faq[open]>summary::after {
  transform: rotate(-135deg);
}

.hs-faq__question {
  flex: 1;
}

.hs-faq__answer {
  padding: 0 1.125rem 1rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text-faint, #4b5563);
}

.hs-faq__answer> :first-child {
  margin-top: 0;
}

.hs-faq__answer> :last-child {
  margin-bottom: 0;
}
