@layer components {
    /* what the studio does: one cell per discipline, in the colours of the work tags */
    @scope (.services) to (.tag > *) {
        :scope {
            --services-pad-x: 28px;
            --services-pad-y: 36px;
            --services-gap: 14px;
            width: var(--content-width);
            margin-block-start: 102px;
            margin-inline: auto;

            @media (width < 768px) {
                --services-pad-x: var(--card-pad-phone);
                --services-pad-y: 30px;
                margin-block-start: 72px;
            }
        }

        .services-title {
            margin-block-end: 30px;
        }

        /* the 1px gap over a line-coloured background draws the dividers between cells */
        .services-list {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1px;
            /* reaches past the content edges by the cell padding so the text lines up with them, as far as the edge gutter allows */
            margin-inline: calc(-1 * min(var(--services-pad-x), max(0px, (100cqi - var(--content)) / 2 - var(--edge))));
            border: var(--border);
            border-radius: 32px;
            overflow: hidden;
            background: var(--line);

            @media (width < 768px) {
                grid-template-columns: 1fr;
            }
        }

        .services-item {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: var(--services-gap);
            padding: var(--services-pad-y) var(--services-pad-x);
            background: var(--bg);
            font-size: var(--text-sm);

            > p {
                margin-block-end: 16px;
            }

            /* at the bottom, so the tags line up across the row */
            > .tag {
                margin-block-start: auto;
            }
        }
    }
}
