@layer cinder.tokens, cinder.foundation, cinder.components, cinder.utilities;
/* ShareCard's value field composes Input, so its sidecar has to travel with this one.
   Without this, a consumer importing only `@lostgradient/cinder/share-card` à la carte
   gets an unstyled input. Same chaining search-field.css does for the same reason. */
@import '/assets/b156259ecf951ea64c145aa0f54c7115e89156d2e5434dff5584e0328b19afe7/components/input/input.css';
@layer cinder.components {
  .cinder-share-card {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-space-2);
    padding: var(--cinder-space-3);
    border: 1px solid var(--cinder-border);
    border-radius: var(--cinder-radius-md);
    background-color: var(--cinder-surface);
    color: var(--cinder-text-default);
  }

  .cinder-share-card__preview {
    border-radius: var(--cinder-radius-sm);
    overflow: hidden;
    border: 1px solid var(--cinder-border);
  }

  .cinder-share-card__meta {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-space-1);
  }

  .cinder-share-card__title {
    font-weight: var(--cinder-font-semibold);
    font-size: var(--cinder-text-sm);
    margin: 0;
    color: var(--cinder-text-default);
  }

  .cinder-share-card__description {
    font-size: var(--cinder-text-xs);
    color: var(--cinder-text-muted);
    margin: 0;
  }

  /* The value field composes the `Input` primitive (`variant="code"`, with the
     copy/share actions as its `trailing` addon), so the bordered/inset well, the
     monospace metrics, and the focus ring all come from the primitive — hand-rolling
     any of those here would just fight it (the mistake CIN-328 flagged on Kanban).
     Truncation is the exception: `variant="code"` changes font metrics only and
     supplies no overflow behaviour, so without these three declarations a value wider
     than the field ends in a hard clip with no signal that it continues. An earlier
     revision dropped them on the assumption `Input` provided them; it does not. */
  .cinder-share-card__value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cinder-share-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--cinder-space-1);
  }

  /* Matches component-page.svelte's `.dx-import__copy`: a comfortable square
     icon-only hit target. `action.label` still carries the accessible name
     via `aria-label` in the markup — this is a purely visual change. */
  .cinder-share-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--cinder-space-1);
    inline-size: 2.25rem;
    min-block-size: 2.25rem;
    padding: 0 var(--cinder-space-2);
    border: 1px solid var(--cinder-border);
    border-radius: var(--cinder-radius-sm);
    background-color: var(--cinder-surface);
    color: var(--cinder-text-default);
    cursor: pointer;
    font-size: var(--cinder-text-sm);
    font-weight: var(--cinder-font-medium);
    transition:
      background-color var(--cinder-duration-fast) var(--cinder-ease-standard),
      border-color var(--cinder-duration-fast) var(--cinder-ease-standard);
    white-space: nowrap;
  }

  /* A consumer-supplied `labelSnippet` renders visible rich content next to
     the icon (the CIN-358-ratified escape hatch) — let the button grow to
     fit it instead of clipping to the icon-only square. */
  .cinder-share-card__action[data-cinder-has-label] {
    inline-size: auto;
    padding: var(--cinder-space-1) var(--cinder-space-2);
  }

  @media (hover: hover) {
    .cinder-share-card__action:hover {
      background-color: var(--cinder-surface-raised);
      border-color: var(--cinder-border-strong);
    }
  }

  .cinder-share-card__action:focus-visible {
    outline: var(--cinder-ring-width) solid transparent;
    box-shadow:
      0 0 0 var(--cinder-ring-offset) var(--cinder-ring-offset-color),
      0 0 0 calc(var(--cinder-ring-offset) + var(--cinder-ring-width)) var(--cinder-ring-color);
  }

  @media (forced-colors: active) {
    .cinder-share-card__action:focus-visible {
      outline: var(--cinder-ring-width) solid ButtonText;
      /* 3px separates the outline from ButtonBorder (which renders in forced-colors
         on all bordered controls and shares the ButtonText color family in HCM);
         at 2px the ring and border can visually merge. */
      outline-offset: 3px;
      box-shadow: none;
    }
  }

  .cinder-share-card__action[data-cinder-copied] {
    color: var(--cinder-status-success-text);
    border-color: var(--cinder-status-success-border);
  }

  .cinder-share-card__action-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
  }

  .cinder-share-card__icon {
    width: 1em;
    height: 1em;
  }
}
