/* Docsify API Block styles */
.apiblock {
  margin: 1.25rem 0 2rem;
  border: 1px solid var(--theme-border, #e0e0e0);
  border-radius: 8px;
  background: var(--theme-background, #fff);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Summary acts as header */
.apiblock-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1rem;
  cursor: pointer;
  list-style: none; /* Safari */
}

/* Hide native marker to use a custom chevron */
.apiblock-header::-webkit-details-marker { display: none; }

/* Chevron indicator at end (SVG mask so it inherits color and is crisp) */
.apiblock-header::after {
  content: '';
  margin-left: auto;
  width: 18px;
  height: 18px;
  color: #6b7280; /* neutral-500 */
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='black'><path d='M7.293 14.707a1 1 0 0 1 0-1.414L10.586 10 7.293 6.707A1 1 0 0 1 8.707 5.293l4 4a1 1 0 0 1 0 1.414l-4 4a1 1 0 0 1-1.414 0Z'/></svg>") no-repeat center / contain;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='black'><path d='M7.293 14.707a1 1 0 0 1 0-1.414L10.586 10 7.293 6.707A1 1 0 0 1 8.707 5.293l4 4a1 1 0 0 1 0 1.414l-4 4a1 1 0 0 1-1.414 0Z'/></svg>") no-repeat center / contain;
  transition: transform 180ms ease, color 120ms ease;
}

.apiblock-header:hover::after {
  color: #374151; /* neutral-700 */
}

/* Divider only when open */
details.apiblock[open] .apiblock-header {
  border-bottom: 1px solid var(--theme-border, #eaeaea);
}

/* Rotate chevron when open */
details.apiblock[open] .apiblock-header::after {
  transform: rotate(90deg);
}

.apiblock-method {
  display: inline-block;
  font-weight: 700;
  font-size: .8rem;
  padding: .18rem .5rem;
  border-radius: 4px;
  color: #fff;
}
.apiblock-method.method-get    { background: #2d8fdd; }
.apiblock-method.method-post   { background: #2bb673; }
.apiblock-method.method-put    { background: #f39c12; }
.apiblock-method.method-delete { background: #e74c3c; }
.apiblock-method.method-patch  { background: #8e44ad; }

.apiblock-path {
  font-family: var(--code-font-family, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
  background: #f6f8fa;
  padding: .2rem .4rem;
  border-radius: 4px;
}

.apiblock-sections {
  padding: .5rem 1rem 1rem;
  overflow: hidden; /* enable height animation */
  transition: max-height 260ms cubic-bezier(.2,.8,.2,1), opacity 220ms cubic-bezier(.2,.8,.2,1), transform 260ms cubic-bezier(.2,.8,.2,1);
  opacity: 1;
  transform: translateY(0);
}

/* Collapsed state visuals */
.apiblock:not([open]) .apiblock-sections {
  max-height: 0;
  opacity: .0;
  padding-top: 0.25rem; /* keep a subtle buffer */
  transform: translateY(-4px);
}

.apiblock-section + .apiblock-section {
  margin-top: .75rem;
}

.apiblock-title {
  font-weight: 700;
  margin: .75rem 0 .5rem;
}

.apiblock-body {
  background: #f8f8f8;
  border: 1px solid var(--theme-border, #efefef);
  border-radius: 6px;
  padding: .75rem .9rem;
}

/* Ensure code blocks within API sections look consistent */
.apiblock .apiblock-body pre code {
  background: transparent !important;
}

/* Focus ring for accessibility */
.apiblock-header:focus {
  outline: 2px solid #2684ff;
  outline-offset: 2px;
}
