/* ---------- cs-takeaways: a case study's Learnings ----------------------
   Each learning is one line set at statement size, the line the reader
   should leave with, and a sentence or two of body copy under it. A short
   bar in the company accent marks each one. No numbers: the order is the
   order of the story, not a ranking.

   <ul class="cs-takeaways" aria-label="Learnings">
     <li>
       <p class="cs-takeaways__line">Trust must be inspectable.</p>
       <p>Ownership, validation state, and a last-updated date ...</p>
     </li>
   </ul>

   A learning may also carry a row of chips (.cs-takeaways__sources) joined
   by one line, for "these things together" (AI Native UX Workflow). Loaded
   on every case study that has a Learnings section. */

.main > ul.cs-takeaways,
.main > .caseStudyInProgress > ul.cs-takeaways {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 34px;
    width: calc(var(--content-col) - var(--gap) / 2);
    max-width: none;
    margin-top: var(--space-6);
    margin-right: 0;
    margin-bottom: var(--space-5);
    margin-left: calc(var(--heading-col) + var(--gap) / 2);
    padding: 0;
    list-style: none;
    text-align: left;
}
@media only screen and (max-width: 768px) {
    .main > ul.cs-takeaways,
    .main > .caseStudyInProgress > ul.cs-takeaways {
        width: 100%;
        margin-left: 0;
    }
}

.main .cs-takeaways > li {
    position: relative;
    margin: 0;
    padding: 20px 0 0;
    list-style: none;
}
.main .cs-takeaways > li::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 28px;
    height: 4px;
    border-radius: 2px;
    background: var(--caseAccent, var(--frgd));
    transform-origin: left center;
}
.main .cs-takeaways p {
    margin: 0;
    text-align: left;
    hyphens: manual;
}
.main .cs-takeaways__line {
    margin-bottom: 8px;
    font-family: var(--font-display);
    font-size: var(--text-statement);
    font-weight: var(--weight-statement);
    line-height: 1.2;
    letter-spacing: -0.005em;
    color: var(--frgd);
    text-wrap: balance;
}
.main .cs-takeaways > li > p:not(.cs-takeaways__line) {
    margin-top: 8px;
    line-height: var(--leading-body);
    color: color-mix(in srgb, var(--frgd) 82%, var(--bkgd));
}
.main .cs-takeaways > li > .cs-takeaways__line + p {
    margin-top: 0;
}

/* chips joined by one line */
.main .cs-takeaways__sources {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0 14px;
    padding: 0;
    list-style: none;
}
.main .cs-takeaways__sources::before {
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    top: 50%;
    height: 2px;
    border-radius: 1px;
    background: color-mix(in srgb, var(--caseAccent, var(--frgd)) 60%, transparent);
}
.main .cs-takeaways__sources > li {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    padding: 9px 8px;
    background: var(--bkgd);
    border: 1px solid color-mix(in srgb, var(--frgd) 20%, transparent);
    border-radius: 99px;
    box-shadow:
        0 1px 2px color-mix(in srgb, var(--frgd) 6%, transparent),
        0 14px 32px -18px color-mix(in srgb, var(--frgd) 30%, transparent);
    font-size: var(--text-functional);
    font-weight: var(--weight-ui);
    line-height: 1.2;
    white-space: nowrap;
}
.cs-takeaways__sources svg {
    flex: none;
    width: 15px;
    height: 15px;
    fill: currentColor;
}
.cs-takeaways__sources svg[fill="none"] {
    fill: none;
}
@media only screen and (max-width: 560px) {
    .main .cs-takeaways__sources {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .main .cs-takeaways__sources::before {
        display: none;
    }
}

/* Each learning settles as it is read, tied to scroll where the browser can
   (as the page's highlighter already is), and is simply there where not. */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .main .cs-takeaways > li,
        .main .cs-takeaways__sources > li {
            animation: cs-takeaways-settle linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 70%;
        }
        .main .cs-takeaways > li::before {
            animation: cs-takeaways-grow linear both;
            animation-timeline: view();
            animation-range: entry 30% cover 30%;
        }
    }
}
@keyframes cs-takeaways-settle {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}
@keyframes cs-takeaways-grow {
    from { transform: scaleX(0.2); opacity: 0.4; }
    to { transform: none; opacity: 1; }
}

@media print {
    .main .cs-takeaways__sources > li {
        box-shadow: none;
    }
}
