@layer cinder.tokens, cinder.foundation, cinder.components, cinder.utilities;
@import '/assets/2d787c00d1964e7c031a8d5ee91591f471bfb3e389d446fb11d1f30dfea4779d/components/tooltip/tooltip.css';
@layer cinder.components {
  /* ========================================
 * TEXT
 * Color is inherited from the container so the run of text follows whatever
 * surface it sits on in both themes.
 * ======================================== */

  .cinder-text {
    margin: 0;
    color: currentColor;
    font-family: var(--cinder-font-sans);
    font-size: var(--cinder-text-base);
    font-weight: var(--cinder-font-normal);
    line-height: var(--cinder-leading-normal);
    letter-spacing: normal;
    overflow-wrap: break-word;
    text-wrap: wrap;
  }

  .cinder-text[data-cinder-variant='display'] {
    font-size: var(--cinder-text-display);
    font-weight: var(--cinder-font-semibold);
    line-height: var(--cinder-leading-tight);
    letter-spacing: var(--cinder-tracking-display);
    text-wrap: balance;
  }

  .cinder-text[data-cinder-variant='h1'] {
    font-size: var(--cinder-text-3xl);
    font-weight: var(--cinder-font-bold);
    line-height: var(--cinder-leading-tight);
    letter-spacing: var(--cinder-tracking-tight);
    text-wrap: balance;
  }

  .cinder-text[data-cinder-variant='h2'] {
    font-size: var(--cinder-text-heading);
    font-weight: var(--cinder-font-heading);
    line-height: var(--cinder-leading-heading);
    letter-spacing: var(--cinder-tracking-tight);
    text-wrap: balance;
  }

  .cinder-text[data-cinder-variant='h3'] {
    font-size: var(--cinder-text-xl);
    font-weight: var(--cinder-font-semibold);
    line-height: var(--cinder-leading-snug);
    letter-spacing: var(--cinder-tracking-tight);
    text-wrap: balance;
  }

  .cinder-text[data-cinder-variant='h4'] {
    font-size: var(--cinder-text-lg);
    font-weight: var(--cinder-font-semibold);
    line-height: var(--cinder-leading-snug);
    letter-spacing: var(--cinder-tracking-tight);
    text-wrap: balance;
  }

  .cinder-text[data-cinder-variant='h5'] {
    font-size: var(--cinder-text-md);
    font-weight: var(--cinder-font-semibold);
    line-height: var(--cinder-leading-snug);
    letter-spacing: var(--cinder-tracking-tight);
    text-wrap: balance;
  }

  .cinder-text[data-cinder-variant='caption'] {
    font-size: var(--cinder-text-xs);
  }

  /* An identifier inside a line of text: the monospace face at the size, weight and leading of the
     text around it. There is no em scaling, so it sits on the type scale instead of beside it. */
  .cinder-text[data-cinder-variant='code'] {
    font-family: var(--cinder-font-mono);
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
  }

  /* A clamped run holds to its lines until it is opened. */
  .cinder-text[data-cinder-clamp] {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--_cinder-text-lines);
    line-clamp: var(--_cinder-text-lines);
    overflow: hidden;
  }

  /* The line under a clamped run: "Show more", then whatever the page puts beside it. */
  .cinder-text__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--cinder-space-2);
    margin-block-start: var(--cinder-space-1);
    font-family: var(--cinder-font-sans);
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
  }

  .cinder-text__toggle {
    appearance: none;
    padding: 0;
    border: 0;
    border-radius: var(--cinder-radius-sm);
    background: none;
    color: var(--cinder-accent-text);
    font: inherit;
    font-weight: var(--cinder-font-medium);
    cursor: pointer;
  }

  .cinder-text__toggle:focus-visible {
    outline: var(--cinder-ring-width) solid transparent;
    box-shadow: var(--_cinder-focus-ring-shadow);
  }

  @media (hover: hover) {
    .cinder-text__toggle:hover {
      text-decoration: underline;
    }
  }

  /* The page's own action sits after "Show more" with a space and a weight and colour step ("Show
     more" is medium weight in the accent colour, the action is regular weight in the text's own
     colour, unless it brings its own, as a link does), and no glyph between them: no comma and no
     dot. The footer's own gap (space 2) is topped up to a space-3 step, so an action that is itself
     an accent link does not run on from "Show more" as one run of links. */
  .cinder-text__toggle + .cinder-text__actions {
    margin-inline-start: calc(var(--cinder-space-3) - var(--cinder-space-2));
    font-weight: var(--cinder-font-normal);
  }

  /* The tooltip's wrapper fills the line and may shrink, so the head can give way inside it. */
  .cinder-tooltip-wrapper.cinder-text__tooltip {
    display: block;
    min-inline-size: 0;
  }

  .cinder-text[data-cinder-truncate]:focus-visible {
    outline: var(--cinder-ring-width) solid transparent;
    border-radius: var(--cinder-radius-sm);
    box-shadow: var(--_cinder-focus-ring-shadow);
  }

  /* Cut at the end: one line of whatever holds it, ending with an ellipsis when it is too long. */
  .cinder-text[data-cinder-truncate='end'] {
    display: block;
    min-inline-size: 0;
    max-inline-size: 100%;
    overflow: hidden;
    font: inherit;
    letter-spacing: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Cut in the middle: the head gives way with an ellipsis and the tail always shows. */
  .cinder-text[data-cinder-truncate='middle'] {
    display: flex;
    min-inline-size: 0;
    white-space: nowrap;
  }

  .cinder-text__head {
    flex: 0 1 auto;
    min-inline-size: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .cinder-text__tail {
    flex: none;
  }
}
