/**
 * Process section "So läuft es ab" (template-parts/home/process.php)
 *
 * Two lanes across the four steps: "Ihr Teil" and "Mein Teil". Shared by the
 * homepage, the offer page and the landing pages. The drawing-in of the bars
 * lives in home.css with the rest of the homepage motion; elsewhere they are
 * simply shown.
 *
 * @package Asivo
 */

:where(.home-process) p {
    margin: 0;
}

/* ================================
   Process - who does what
   ================================ */

.home-process {
    padding-block: var(--space-12);
    background-color: var(--color-card-bg);
}

.home-process__intro {
    max-width: 34rem;
    margin-bottom: var(--space-6);
}

.home-process__intro .home-h2 {
    margin-bottom: var(--space-2);
}

.home-process__lead {
    font-size: var(--text-base);
    line-height: 1.55;
}

.process-chart__legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-4);
    margin-bottom: var(--space-3);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-white);
}

.process-chart__key::before {
    content: "";
    display: inline-block;
    width: 2rem;
    height: 0.75rem;
    margin-right: var(--space-1);
    vertical-align: -0.05em;
    border-radius: 2px;
}

.process-chart__key--you::before { background-color: var(--color-text-body); }
.process-chart__key--me::before  { background-color: var(--color-primary); }

/* No gap between the steps: the lanes run through as one line each. */
.process-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.process-step__lanes {
    display: grid;
    gap: var(--space-1);
    margin-bottom: var(--space-3);
}

.process-step__lane {
    position: relative;
    display: block;
    height: 0.75rem;
    background-color: var(--color-surface-hover);
}

.process-step:first-child .process-step__lane { border-radius: 2px 0 0 2px; }
.process-step:last-child .process-step__lane  { border-radius: 0 2px 2px 0; }

.process-step__bar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--from) * 100%);
    width: calc((var(--to) - var(--from)) * 100%);
    transform-origin: left center;
}

.process-step__bar--you { background-color: var(--color-text-body); }
.process-step__bar--me  { background-color: var(--color-primary); }

.process-step__title,
.process-step__time,
.process-step__text {
    padding-right: var(--space-3);
}

.process-step__title {
    margin: 0 0 var(--space-1);
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    letter-spacing: 0;
}

.process-step__time {
    margin-bottom: var(--space-1);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-primary-light);
}

.process-step__text {
    max-width: 32ch;
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--color-text-body);
}

@media (max-width: 768px) {
    .home-process {
        padding-block: var(--space-10);
    }

    /* One step under the other, each with its own short lanes. */
    .process-steps {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }

    .process-step .process-step__lane {
        border-radius: 2px;
    }
}
