/*
 * CONTENT BLOCK STEPS (cb_steps, "So läuft das Verfahren")
 * Numbered steps: the number in a circle above the title and text. One below the other on small widths, from 45rem
 * element width on side by side in equal columns, with an arrow between the numbers.
 * Number and arrow are decorative (the list announces the position), the number has an empty alternative text, so
 * it isn't read twice. Both are drawn in the text color, so they follow the surface and the contrast mode.
 * The arrow is angular like the arrows of the Inter font (flat ends, pointed tip), not rounded.
 */

.cb-steps {
    --cb-steps--marker-size: 3.5rem;
    --cb-steps--arrow      : url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.3333' stroke-linecap='butt' stroke-linejoin='miter'%3E%3Cpath d='M2 8h10M9 4l4 4-4 4'/%3E%3C/svg%3E");

    counter-reset: cb-steps;

    display: grid;
    gap: var(--content-element--gap--large);
    list-style: none;
}

.cb-steps__item {
    counter-increment: cb-steps;

    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Title and text follow each other directly (design), the number has the distance */
.cb-steps__marker {
    display: flex;
    align-items: center;
    gap: var(--layout--gap--small);
    margin-bottom: var(--layout--gap--default);
}

/* Number in the circle, empty alternative text (the list announces the position) */
.cb-steps__marker::before {
    content: counter(cb-steps);
    content: counter(cb-steps) / "";

    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: var(--cb-steps--marker-size);
    height: var(--cb-steps--marker-size);
    border: var(--border-width--strong) solid currentColor;
    border-radius: var(--border-radius--round);
    font-size: var(--font-size--h2);
    line-height: var(--line-height--single);
}

/* Long words are hyphenated or broken, so they don't overflow the narrow columns side by side */
.cb-steps__title,
.cb-steps__text {
    hyphens: auto;
    overflow-wrap: break-word;
}

.cb-steps__title {
    font-size: var(--font-size--text-small);
    font-weight: var(--font-weight--bold);
    line-height: var(--line-height--text-small);
    text-wrap: balance;
}

.cb-steps__text {
    font-size: var(--font-size--text-small);
    line-height: var(--line-height--text-small);
    text-wrap: pretty;
}


/* Side by side: equal columns for any number of steps, arrow centered between the numbers */
@container content-element (min-width: 45rem) {
    .cb-steps {
        grid-auto-columns: minmax(0, 1fr);
        grid-auto-flow: column;
        gap: var(--layout--gap--large);
    }

    .cb-steps__item:not(:last-child) .cb-steps__marker::after {
        content: "";
        flex-grow: 1;
        height: 3rem;
        /* Reaches into the gap, so the arrow is centered between the numbers */
        margin-right: calc(var(--layout--gap--large) * -1);
        background-color: currentColor;
        mask: var(--cb-steps--arrow) center / 3rem no-repeat;
    }
}

/* Backgrounds are replaced in forced colors mode, keep the arrow in the text color */
@media (forced-colors: active) {
    .cb-steps__marker::after {
        forced-color-adjust: none;
        background-color: CanvasText;
    }
}
