/*
 * zivag/clients - client logos in circles around a centre, with the list of
 * client types beside them.
 *
 * This was two pictures per language: the diagram and, separately, the list.
 * The list is now text, and the circles are placed by CSS, so a logo can be
 * swapped or a fourth circle added without redrawing anything. The circles
 * are laid out by rotating each one around the centre and turning it back
 * upright, which needs no trigonometry.
 */

.section-clients {
    /* The complaint was that the picture reads grey, and an outline around a
       grey circle on a grey disc only draws the greyness more sharply. So the
       contrast comes from the fills instead: the circles go white, which lifts
       them off the disc where they overlap it and gives the logos a clean
       ground, and the disc takes a desaturated tint of the brand red rather
       than neutral grey. The edge is only there to hold a circle where it
       leaves the disc and meets the white page, so it can stay quiet. */
    --clients-bubble: #fff;
    --clients-core: #f1e9e8;
    --clients-bubble-edge: #dcd3d2;

    padding-top: 4vw;
    padding-bottom: 4vw;
}

.section-clients h2 {
    margin-bottom: 1rem;
}

.clients-subtitle {
    margin-bottom: 3rem;
    font-weight: 300;
}

.clients-body {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Close to the diagram, but clear of the circle that reaches furthest to
       the right, which sits at the height of the first line. */
    gap: 1rem;
}

.clients-diagram {
    container-type: inline-size;
    position: relative;
    flex: 0 1 30rem;
    max-width: 30rem;
    aspect-ratio: 1;
}

.clients-center,
.clients-bubble {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
}

/* The disc reaches to the middle of the circles, so they sit half on it and
   half off it. */
.clients-center {
    width: 71cqw;
    height: 71cqw;
    transform: translate(-50%, -50%);
    background: var(--clients-core);
    display: flex;
    align-items: center;
    justify-content: center;
}

.clients-center svg {
    width: 25%;
    height: auto;
}

.clients-bubble {
    width: 28cqw;
    height: 28cqw;
    background: var(--clients-bubble);
    /* #f2f2f2 on #ebebeb is a two-step difference, so where a circle crossed
       the disc its edge vanished and the three read as smudges rather than as
       circles. A hairline is enough to give them back their shape - the fill
       stays as quiet as it was. */
    border: 1px solid var(--clients-bubble-edge);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5cqw;
    padding: 2cqw;
    /* Turn to the circle's place, step out, then turn back so the logos stay
       upright. The first circle sits where the drawing had it. */
    --angle: calc(var(--i) * (360deg / var(--n)) - 51deg);
    transform:
        translate(-50%, -50%)
        rotate(var(--angle))
        translate(36cqw)
        rotate(calc(-1 * var(--angle)));
}

/* Both caps together reproduce the sizes the drawing gave the logos: a tall
   mark is held by its height, a long wordmark by its width. */
.clients-bubble img {
    display: block;
    width: auto;
    height: auto;
    max-width: 17cqw;
    max-height: 11cqw;
}

.clients-types {
    margin: 0;
    padding: 0;
    list-style: none;
    flex: 0 1 auto;
}

.clients-type {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 0;
    font-weight: 300;
    color: var(--black, #000);
}

/* The same mark the Fakten row sets on its rule - same size, same red - so
   the two sections are read as one family rather than two drawings that
   happen to sit on the same page. Kept as a pseudo-element: it is decoration,
   and a list marker would be read out by a screen reader. */
.clients-type::before {
    content: "";
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--main-color, #e73531);
}

@media screen and (max-width: 991.98px) {
    .clients-body {
        flex-direction: column;
        gap: 2.5rem;
    }

    .clients-diagram {
        flex: 0 0 auto;
        width: 100%;
        max-width: 26rem;
    }

    .clients-types {
        width: auto;
        text-align: center;
    }

    .clients-type {
        justify-content: center;
    }
}

@media screen and (max-width: 575.9px) {
    .section-clients {
        padding-top: 15vw;
        padding-bottom: 15vw;
    }

    .section-clients.normal,
    .section-clients.bck-grey-set {
        padding-left: 15px;
        padding-right: 15px;
    }

    .clients-type {
        padding: .6rem 0;
    }
}
