
/* Accordion – shared (front + editor) */

/* Wrapper and item rhythm */
.wbp-accordion__item {
  border-bottom: 1px solid var(--wp--preset--color--contrast-3, rgba(0,0,0,.08));
  padding: .25rem 0;
}
.wbp-accordion__heading { margin: 0; }

/* The control is a flex row so the icon can't overlap the label */
.wbp-accordion__button {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: .6rem 0;
  font: inherit;
  line-height: 1.4;
  cursor: pointer;
  overflow: visible; /* keep triangle visible regardless of theme clipping */
}

/* Fixed-size icon box; the triangle is drawn in ::before */
.wbp-accordion__icon {
  display: inline-flex;
  flex: 0 0 auto;
  width: 1.1em;   /* give the arrow some breathing room */
  height: 1.1em;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Border triangle lives in a pseudo-element so the box size is stable */
.wbp-accordion__icon::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: .35em 0 .35em .55em;      /* ▶ */
  border-color: transparent transparent transparent currentColor;
  transform-origin: 45% 50%;
  transform: rotate(0deg);
  transition: transform .18s ease;
}

/* Rotate when open */
.wbp-accordion__button[aria-expanded="true"] .wbp-accordion__icon::before,
.wbp-accordion__item.is-open .wbp-accordion__icon::before {
  transform: rotate(90deg);
}

/* Label should flex; long text won't crush the icon */
.wbp-accordion__label {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.wbp-accordion__panel { padding: .25rem 0 .75rem; }

/* Editor-only collapse: hide panel in editor when not open */
.wbp-accordion__panel[data-editor="1"][data-open="false"] { display: none; }

/* Focus visibility (SC 2.4.7, SC 2.4.11) */
.wbp-accordion__button:focus { outline: none; } /* suppress default; :focus-visible handles it */
.wbp-accordion__button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  .wbp-accordion__icon::before { transition: none; }
}

/* Editor-only nudges */
.editor-styles-wrapper .wbp-accordion__heading { margin: 0; }
.editor-styles-wrapper .wbp-accordion__button { overflow: visible; }
.editor-styles-wrapper .wbp-accordion__icon { transform: translateZ(0); } /* crisp arrow */