@layer cinder.tokens, cinder.foundation, cinder.components, cinder.utilities;
@layer cinder.components {
  /* ========================================
 * INSPECTOR
 *
 * A group of property rows for a detail page. When its own box is 700px or wider it is one tinted
 * surface; narrower, it reads as a grouped list, on the raised surface a grouped list uses. Each
 * label sits beside its value down to 23rem, and stacks above it below that (`inspector-row.css`).
 * The group carries the tone and clips its rows; the rows draw their own inset separators.
 * ======================================== */

  /* The inspector is the inline-size container its rows and its group query. It has no padding,
   * so a full-width inspector switches at the 700px viewport width it always did. */
  .cinder-inspector {
    container-type: inline-size;
    container-name: cinder-inspector;
    display: block;
    min-inline-size: 0;
  }

  .cinder-inspector__header {
    margin: 0;
    margin-block-end: var(--cinder-space-2);
    padding-inline: var(--cinder-space-4);
    font-size: var(--cinder-text-sm);
    font-weight: var(--cinder-font-semibold);
    color: var(--cinder-text-muted);
  }

  .cinder-inspector__group {
    position: relative;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: var(--cinder-radius-surface);
    background: var(--cinder-surface-inset);
  }

  /* A narrow inspector sits on the raised surface of a grouped list, parted from the white light page
     by the page hairline on an overlay that takes no layout (COR-2697). */
  @container cinder-inspector (width < 700px) {
    .cinder-inspector__group {
      background: var(--cinder-surface-raised);
    }

    .cinder-inspector__group::after {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: inherit;
      pointer-events: none;
      border: var(--cinder-border-width) solid var(--_cinder-page-edge);
    }
  }

  @media (forced-colors: active) {
    .cinder-inspector__group {
      border: 1px solid CanvasText;
    }
  }
}
