/*
 * CRD reference pages (generated by main.py from docs/crds/*.yaml).
 */

.crd-doc {
  --crd-text: rgba(0, 0, 0, 0.85);
  --crd-text-light: rgba(0, 0, 0, 0.7);
  --crd-muted: rgba(0, 0, 0, 0.6);
  --crd-border: rgba(0, 0, 0, 0.2);
  --crd-header-bg: #f7f7f7;
  --crd-panel-bg: transparent;
  --crd-kbd-bg: #ffffff;
  --crd-badge-bg: #ffffff;
  --crd-button-bg: #ffffff;
  --crd-button-border: rgba(0, 0, 0, 0.2);
  --crd-button-shadow: 0 2px 0 rgba(0, 0, 0, 0.05);
  --crd-button-hover-bg: #f7f7f7;
  --crd-primary: #6563ff;
  --crd-on-primary: #ffffff;
  --crd-hr: rgba(0, 0, 0, 0.05);
  --crd-arrow: rgba(0, 0, 0, 0.6);
  font-size: 14px;
  line-height: 1.5;
  color: var(--crd-text);
}

[data-md-color-scheme="slate"] .crd-doc {
  --crd-text: rgba(255, 255, 255, 0.8);
  --crd-text-light: rgba(255, 255, 255, 0.65);
  --crd-muted: rgba(255, 255, 255, 0.6);
  --crd-border: #47494d;
  --crd-header-bg: rgba(255, 255, 255, 0.02);
  --crd-kbd-bg: transparent;
  --crd-badge-bg: transparent;
  --crd-button-bg: rgba(255, 255, 255, 0.05);
  --crd-button-border: rgba(255, 255, 255, 0.025) transparent transparent transparent;
  --crd-button-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
  --crd-button-hover-bg: rgba(255, 255, 255, 0.1);
  --crd-hr: rgba(255, 255, 255, 0.05);
  --crd-arrow: rgba(255, 255, 255, 0.6);
}

/* Header: Kind / Group / Version (.parts .d-md-flex .justify-content-between) */
.md-typeset .crd-doc .parts {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 20px;
  margin: 20px 0;
}

.md-typeset .crd-doc .part-value {
  font-size: 24px;
  font-weight: 600;
}

.md-typeset .crd-doc .part-label {
  font-size: 12px;
}

.md-typeset .crd-doc hr {
  margin: 0 0 20px;
  border: 0;
  border-top: 1px solid var(--crd-hr);
}

.md-typeset .crd-doc .crd-description {
  font-size: 18px;
}

/* Descriptions are verbatim Go-comment text: keep line breaks and indents */
.md-typeset .crd-doc .crd-description,
.md-typeset .crd-doc .property-description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.md-typeset .crd-doc .crd-description {
  margin: 0 0 10px;
}

.md-typeset .crd-doc .crd-source {
  margin: 0 0 10px;
  font-size: 12px;
}

.md-typeset .crd-doc .text-muted {
  color: var(--crd-muted);
}

/* Toolbar (.d-flex .flex-row-reverse): expand all sits right-most */
.md-typeset .crd-doc .crd-toolbar {
  display: flex;
  flex-direction: row-reverse;
  gap: 10px;
  margin: 10px 0;
}

/* Halfmoon .btn / .btn-sm */
.md-typeset .crd-doc .btn {
  display: inline-block;
  height: 32px;
  padding: 0 15px;
  margin: 0;
  font-family: inherit;
  font-size: 14px;
  line-height: 32px;
  color: var(--crd-text-light);
  background: var(--crd-button-bg);
  border: 1px solid;
  border-color: var(--crd-button-border);
  border-radius: 4px;
  box-shadow: var(--crd-button-shadow);
  cursor: pointer;
  white-space: nowrap;
}

.md-typeset .crd-doc .btn:hover {
  background: var(--crd-button-hover-bg);
  text-decoration: none;
}

.md-typeset .crd-doc .btn-sm {
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 26px;
}

/* Halfmoon kbd */
.md-typeset .crd-doc kbd {
  padding: 1px 5px;
  margin: 0 1px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--crd-text);
  background: var(--crd-kbd-bg);
  border: 1px solid var(--crd-border);
  border-radius: 4px;
  box-shadow: none;
  user-select: none;
}

.md-typeset .crd-doc kbd.text-muted {
  color: var(--crd-muted);
}

/* Halfmoon .badge / .badge-primary */
.md-typeset .crd-doc .badge {
  display: inline-block;
  position: relative;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.2;
  color: var(--crd-text);
  background: var(--crd-badge-bg);
  border: 1px solid var(--crd-border);
  border-radius: 4px;
}

.md-typeset .crd-doc .badge.badge-primary {
  color: var(--crd-on-primary);
  background: var(--crd-primary);
  border-color: var(--crd-primary);
}

/*
 * Halfmoon collapse panels. Material styles every <details>/<summary> as an
 * admonition, so each property is reset explicitly.
 */
.md-typeset .crd-doc details.collapse-panel {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 14px;
  color: var(--crd-text);
  background: transparent;
  overflow: visible;
}

.md-typeset .crd-doc summary.collapse-header {
  display: block;
  position: relative;
  min-height: 0;
  margin: 0;
  padding: 12px 20px 12px 44px;
  font-size: 14px;
  font-weight: 400;
  color: var(--crd-text);
  background-color: var(--crd-header-bg);
  border: 1px solid var(--crd-border);
  border-radius: 4px;
  box-shadow: none;
  cursor: pointer;
  list-style: none;
  /* Scope the z-index of .crd-actions to the header so the buttons never
     paint over Material's sticky top bar (.md-header, z-index 4). */
  isolation: isolate;
}

.md-typeset .crd-doc summary.collapse-header::-webkit-details-marker,
.md-typeset .crd-doc summary.collapse-header::marker {
  display: none;
}

/* Chevron at 20px from the left: right-pointing when closed, down when open */
.md-typeset .crd-doc summary.collapse-header::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 20px;
  width: 6px;
  height: 6px;
  margin: -5px 0 0;
  border-right: 2px solid var(--crd-arrow);
  border-bottom: 2px solid var(--crd-arrow);
  transform: rotate(-45deg);
  background: none;
  mask: none;
  -webkit-mask: none;
}

.md-typeset .crd-doc details.collapse-panel[open] > summary.collapse-header::before {
  width: 8px;
  height: 8px;
  margin: -7px 0 0 -1px;
  transform: rotate(45deg);
}

.md-typeset .crd-doc summary.collapse-header::after {
  display: none;
}

.md-typeset .crd-doc details.collapse-panel[open] > summary.collapse-header {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.md-typeset .crd-doc .collapse-content {
  padding: 20px;
  font-size: 14px;
  color: var(--crd-text);
  background: var(--crd-panel-bg);
  border: 1px solid var(--crd-border);
  border-top: 0;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

/* .collapse-group: stacked panels share borders and square inner corners */
.md-typeset .crd-doc .collapse-group > .collapse-panel:not(:first-child) {
  margin-top: -1px;
}

.md-typeset .crd-doc .collapse-group > .collapse-panel:not([open]):not(:last-child) > .collapse-header {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.md-typeset .crd-doc .collapse-group > .collapse-panel:not(:first-child) > .collapse-header,
.md-typeset .crd-doc .collapse-group > .collapse-panel[open]:not(:first-child) > .collapse-content {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.md-typeset .crd-doc .collapse-group > .collapse-panel[open]:not(:last-child) > .collapse-content {
  border-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* Per-field actions, top right of the header: copy path, copy link */
.md-typeset .crd-doc .crd-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 5px;
  z-index: 1;
}

/* Copy-link button: .btn-sm (original .position-absolute .right-0 .top-0 .m-5) */
.md-typeset .crd-doc .copy-url {
  margin: 0;
}

/* Copy-path button, drawn with the same icon as Material's code-block copy */
.md-typeset .crd-doc .crd-clipboard {
  width: 26px;
  height: 26px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--crd-muted);
  cursor: pointer;
  transition: color 0.25s;
}

.md-typeset .crd-doc .crd-clipboard::after {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  margin: 0 auto;
  background-color: currentcolor;
  -webkit-mask-image: var(--md-clipboard-icon);
  mask-image: var(--md-clipboard-icon);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.md-typeset .crd-doc .crd-clipboard:hover,
.md-typeset .crd-doc .crd-clipboard:focus {
  color: var(--md-accent-fg-color);
}

.md-typeset .crd-doc .crd-clipboard.crd-clipboard--done {
  color: var(--crd-primary);
}

.md-typeset .crd-doc .crd-clipboard.crd-clipboard--done::after {
  -webkit-mask-image: none;
  mask-image: none;
  background: none;
  content: "\2713";
  font-size: 14px;
  line-height: 16px;
  text-align: center;
  color: var(--crd-primary);
}

.md-typeset .crd-doc .property-description code,
.md-typeset .crd-doc .crd-description code {
  white-space: pre;
}

.md-typeset .crd-doc .property-meta {
  margin-top: 6px;
  font-size: 13px;
}

.md-typeset .crd-doc .collapse-content > br {
  display: block;
  content: "";
  margin-top: 10px;
}

.md-typeset .crd-doc code {
  font-size: 12px;
}

.md-typeset .crd-doc details.collapse-panel[id] {
  scroll-margin-top: 3.5rem;
}

.md-typeset .crd-doc details.crd-field--target > summary.collapse-header {
  box-shadow: 0 0 0 2px var(--crd-primary) inset;
}

@media (max-width: 576px) {
  .md-typeset .crd-doc .collapse-content {
    padding: 15px;
  }
}

/* Fenced ```blocks``` in descriptions, rendered by _description() as
   <pre><code>, and object/list/multiline `example` values */
.md-typeset .crd-doc .property-description pre,
.md-typeset .crd-doc .property-example pre,
.md-typeset .crd-doc .crd-description pre {
  margin: 8px 0;
  white-space: pre;
}

.md-typeset .crd-doc .property-description pre code,
.md-typeset .crd-doc .property-example pre code,
.md-typeset .crd-doc .crd-description pre code {
  white-space: pre;
}
