/* ==========================================================================
   timelineSectionElement  (over mij: Aanvraag → Gesprek → Planning → Shoot!)

   Desktop: 4 columns in a row, dotted connectors between the circles.
   Mobile:  zigzag. Circles alternate left / right, the text sits beside
            its circle and the connector runs diagonally from one circle
            centre to the next.
   The colour comes from the element config (currentColor everywhere).
   ========================================================================== */
#main > section.timelineSectionElement {
    --tl-circle: calc(var(--d) * 260);
    --tl-stroke: calc(var(--d) * 5);
    --tl-dot: calc(var(--d) * 12);
    --tl-dots-length: calc(var(--d) * 84);
    margin-bottom: calc(var(--d) * 231);

    @media (max-width: 999px) {
        /* --bp-timeline */
        --fs-body: var(--fs-body-m);
        /* one design pixel of the 412 mobile design, but the zigzag stops
           growing at 1.5x (618px wide): scaled further it gets huge */
        --tl-u: min(var(--m), 1.5px);
        --tl-circle: calc(var(--tl-u) * 128);
        --tl-stroke: max(2px, calc(var(--tl-u) * 4));
        --tl-dot: calc(var(--tl-u) * 5.5);
        --tl-dots-length: calc(var(--tl-u) * 32);
        margin-bottom: calc(var(--m) * 83);
    }
}

.timelineSectionElement {
    a {
        color: inherit;
        font-weight: inherit;
    }

    > .container {
        display: flex;
        flex-direction: row;
        width: calc(var(--d) * 1656);
        margin: 0 auto;
    }

    .column {
        position: relative;
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .circle-box {
        width: var(--tl-circle);
    }

    .circle {
        box-sizing: border-box;
        width: 100%;
        aspect-ratio: 1;
        border: var(--tl-stroke) solid currentColor;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;

        > img {
            display: block;
            width: 46%;
            height: 46%;
            object-fit: contain;
        }
    }

    .title,
    .alinea {
        display: block;
        font-size: var(--fs-body);
        line-height: var(--lh-body);
    }

    .title-box {
        margin-top: calc(var(--d) * 22);
    }

    .text-box {
        margin-top: calc(var(--d) * 25);
        max-width: calc(var(--d) * 360);
        text-wrap: balance;
    }

    /* the dotted connector, centred between this circle and the next one */
    .column:not(:last-child)::after {
        content: "";
        position: absolute;
        left: 100%;
        top: calc(var(--tl-circle) / 2);
        width: var(--tl-dots-length);
        height: var(--tl-dot);
        transform: translate(-50%, -50%);
        background-image: radial-gradient(circle closest-side,
                currentColor calc(100% - 1px),
                transparent 100%);
        /* three cells, one dot in the middle of each */
        background-size: calc(100% / 3) 100%;
        background-repeat: repeat-x;
    }

    @media (max-width: 999px) {
        /* --bp-timeline */
        > .container {
            flex-direction: column;
            width: calc(var(--tl-u) * 412);
            gap: calc(var(--tl-u) * 14);
        }

        .column {
            display: grid;
            grid-template-columns: var(--tl-circle) 1fr;
            grid-template-areas:
                "circle text"
                "title  .";
            column-gap: calc(var(--tl-u) * 16);
            align-items: center;
            padding: 0 calc(var(--tl-u) * 36) 0 calc(var(--tl-u) * 49);
            text-align: left;
        }

        .column:nth-child(even) {
            grid-template-columns: 1fr var(--tl-circle);
            grid-template-areas:
                "text  circle"
                ".     title";
            padding: 0 calc(var(--tl-u) * 48) 0 calc(var(--tl-u) * 36);
            text-align: right;
        }

        .circle-box {
            grid-area: circle;
        }

        .title-box {
            grid-area: title;
            margin-top: calc(var(--tl-u) * 6);
            text-align: center;
        }

        .text-box {
            grid-area: text;
            margin-top: 0;
            max-width: none;
            text-wrap: pretty;
        }

        .title,
        .alinea {
            line-height: 1.4;
        }

        /* Halfway between the centre of this circle and the next one, on the
           line through both centres: (circle centre + column height + gap +
           next circle centre) / 2 = 50% + (gap + circle) / 2 */
        .column:not(:last-child)::after {
            left: 50%;
            top: calc(50% + (var(--tl-u) * 14 + var(--tl-circle)) / 2);
            transform: translate(-50%, -50%) rotate(43deg);
        }

        .column:nth-child(even):not(:last-child)::after {
            transform: translate(-50%, -50%) rotate(-43deg);
        }
    }
}
