/* Actions Card — collapsible lc-card molecule — issue #596
 *
 * Extends .lc-card (defined in molecules/directory-card.css) with:
 *   .lc-card--collapsible — turns <summary> into the card header
 *   .lc-actions-card      — display title + inline subtitle + chevron toggle
 *
 * Consumes design tokens only; no hex codes, no --color-role-* tokens.
 */

/* ─── summary-as-header affordance ─── */

/* Zero out the base .lc-card padding so the summary owns all the spacing.
 * Two classes (.lc-card.lc-card--collapsible) so this wins over the base
 * .lc-card { padding: var(--sp-5) } regardless of stylesheet load order —
 * actions-card.css sorts before directory-card.css, so a single-class
 * override would lose on source order. */
.lc-card.lc-card--collapsible {
  padding: 0;
}

/* Separate the actions card from the metadata <dl> above it. The prior
 * .danger-zone block carried its own top margin; the v2 card replaces it. */
.lc-actions-card {
  margin-top: var(--sp-6);
}

.lc-card--collapsible > summary {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin: 0;
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer;
  list-style: none;
  user-select: none;
  border-radius: var(--r-3);
}

.lc-card--collapsible > summary::-webkit-details-marker {
  display: none;
}

.lc-card--collapsible[open] > summary {
  border-bottom: 1px solid var(--color-rule);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.lc-card--collapsible > summary ~ * {
  padding: var(--sp-4) var(--sp-5);
}

/* ─── header layout: title (left) · subtitle (center) · plus (right) ─── */

.lc-actions-card__title {
  flex-shrink: 0;
  font-family: var(--font-serif);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-18);
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
}

.lc-actions-card__subtitle {
  flex: 1;
  min-width: 0;
  margin: 0;
  text-align: center;
  color: var(--color-ink-muted);
  font-size: var(--fs-14);
}

/* The disclosure chevron is Pico's native `details summary::after`
 * (background-image, floated right, rotates on [open]) — no explicit icon
 * needed. As a flex item it lands at the end of the header, after the
 * subtitle. */

/* ─── body — action row: text (left) · danger button (right) ─── */

.lc-actions-card__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.lc-actions-card__action-text {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
}

.lc-actions-card__action-title {
  margin: 0;
  font-weight: var(--fw-semibold);
  font-size: var(--fs-15);
  color: var(--color-ink);
}

.lc-actions-card__action-desc {
  margin: 0;
  font-size: var(--fs-14);
  color: var(--color-ink-muted);
}

/* The trigger button lives inside its dialog-controller wrapper. Keep the
 * wrapper compact and right-aligned — never let it stretch to the row width
 * (the prior column layout stretched the button via align-items: stretch). */
.lc-actions-card__action {
  flex-shrink: 0;
}
