/* ===================================================================
   MTS Corp — shared page components
   ===================================================================
   Components used on more than one page. Load order:
   theme style.css -> brand.css -> corp-brand.css -> THIS FILE.

   Every colour resolves to a brand token from
   /_content/Mts.Branding/branding/brand.css. Never introduce a hue
   here — if a value is missing, it belongs in the brand file.
*/

/* ── .cx-flow — the compliance evidence-trail figure ────────────────
   Used by Views/Shared/_ComplianceFlow.cshtml on the Compliance page
   (full container width, three stages across) and on the home page
   (two-thirds column, stacked). It sizes itself from its CONTAINER,
   not the viewport, which is what lets one component serve both:
   a viewport media query would read "desktop" and lay three cards
   across a 736px column.

   The media query below repeats the stacked rules as a fallback for
   browsers without container queries — there a phone still stacks,
   and only the home page's desktop column stays wide. */

.cx-flow {
    container: cxflow / inline-size;
    margin: 0;
}

.cx-stages {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: stretch;
}

/* ── the three stage cards ──────────────────────────────────────── */
.cx-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--mts-border);
    border-radius: var(--mts-radius-lg);
    padding: 1.15rem 1.25rem 1.05rem;
    box-shadow: 0 1px 2px rgba(22, 40, 60, .05);
}

.cx-card-label {
    margin: 0 0 .8rem;
    padding-bottom: .55rem;
    border-bottom: 1px solid var(--mts-border);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--mts-text-muted);
}

.cx-card-name {
    margin: 0 0 .45rem;
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--mts-navy);
    text-wrap: balance;
}

.cx-card-id {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin: 0 0 .35rem;
}

.cx-code {
    font-family: var(--mts-font-mono);
    font-size: .84rem;
    font-weight: 600;
    color: var(--mts-navy);
}

.cx-chip {
    border-radius: 3px;
    padding: .1rem .4rem;
    font-size: .7rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.cx-chip-done {
    background: var(--mts-green-tint);
    color: var(--mts-green-ink);
}

/* key/value rows — the product's own dense-table texture */
.cx-rows {
    margin: .55rem 0 0;
    padding: 0;
    font-size: .82rem;
    font-variant-numeric: tabular-nums;
}

.cx-rows > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .75rem;
    padding: .3rem 0;
    border-top: 1px solid var(--mts-surface);
}

.cx-rows dt {
    font-weight: 400;
    color: var(--mts-text-muted);
}

.cx-rows dd {
    margin: 0;
    font-weight: 500;
    color: var(--mts-text);
    text-align: right;
}

/* ── the labelled connectors ────────────────────────────────────── */
.cx-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: 0 .75rem;
    width: 9.5rem;
}

/* line + arrowhead, so the connector reads as a drawn arrow rather
   than a chevron floating in the gap */
.cx-link-arrow {
    display: flex;
    align-items: center;
    width: 100%;
}

.cx-link-arrow::before {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--mts-border);
}

/* Plain arrowheads, deliberately NOT the brand chevron. The style guide is
   explicit: the chevron device is "always one chevron", "never multiplies",
   "always terminal" (Master Spec), rotating it is listed under Misuse, and the
   forward-motion affordance in UI is the TYPED chevron, not the logo artwork.
   A figure with three of them rotated to taste is all three mistakes at once —
   so the arrows here are notation, drawn in the Registrar Blue that already
   names linkage in the semantic palette, and Heritage Red stays scarce. */
.cx-arrow {
    width: 9px;
    height: 11px;
    display: block;
    fill: var(--mts-blue);
    flex: none;
}

.cx-link-label {
    font-size: .74rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    color: var(--mts-blue);
}

/* ── convergence into the record ────────────────────────────────── */
.cx-converge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    padding-top: 1.1rem;
}

.cx-converge-rule {
    width: 1px;
    height: 1.6rem;
    background: var(--mts-border);
}

.cx-arrow-down { transform: rotate(90deg); }

/* ── the audit-trail record ─────────────────────────────────────── */
.cx-trail {
    margin-top: .5rem;
    background: var(--mts-navy);
    color: var(--mts-paper);
    border-radius: var(--mts-radius-lg);
    padding: 1.1rem 1.35rem;
}

.cx-trail-label {
    margin: 0 0 .55rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--mts-paper);
}

/* Each fact is its own field, so the row can wrap at any width without
   leaving a separator stranded at the start of a line. */
.cx-trail-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .35rem .45rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .9rem;
}

.cx-trail-facts > li {
    background: rgba(243, 238, 227, .10);
    border-radius: 3px;
    padding: .2rem .55rem;
}

.cx-code-inv { color: var(--mts-paper); }

.cx-flow-caption {
    margin-top: 1rem;
    max-width: 52rem;
    font-size: .88rem;
    line-height: 1.6;
    color: var(--mts-text-muted);
}

/* ── the figure's own heading block (Compliance page) ───────────── */
.cx-flow-head { max-width: 46rem; }

.cx-eyebrow {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--mts-text-muted);
    margin-bottom: .6rem;
}

.cx-flow-sub { color: var(--mts-text); }

/* ── stacked when the FIGURE is narrow: chevrons turn to point down
      the page. Same rules in both blocks — see the note at the top. */
@container cxflow (max-width: 62rem) {
    .cx-stages { grid-template-columns: 1fr; }

    .cx-link {
        flex-direction: row;
        justify-content: flex-start;
        gap: .6rem;
        width: auto;
        padding: .7rem .25rem;
    }

    .cx-link-arrow { width: auto; }
    .cx-link-arrow::before { display: none; }
    .cx-link .cx-arrow { transform: rotate(90deg); }
    .cx-link-label { text-align: left; }

    /* Stacked, the cards would otherwise stretch a label/value row across the
       full column and read as empty down the middle. No-op on a phone, where
       the available width is already under this cap. */
    .cx-stages,
    .cx-trail {
        max-width: 36rem;
        margin-inline: auto;
    }
}

@media (max-width: 991.98px) {
    .cx-stages { grid-template-columns: 1fr; }

    .cx-link {
        flex-direction: row;
        justify-content: flex-start;
        gap: .6rem;
        width: auto;
        padding: .7rem .25rem;
    }

    .cx-link-arrow { width: auto; }
    .cx-link-arrow::before { display: none; }
    .cx-link .cx-arrow { transform: rotate(90deg); }
    .cx-link-label { text-align: left; }

    /* Stacked, the cards would otherwise stretch a label/value row across the
       full column and read as empty down the middle. No-op on a phone, where
       the available width is already under this cap. */
    .cx-stages,
    .cx-trail {
        max-width: 36rem;
        margin-inline: auto;
    }
}

@media (max-width: 575.98px) {
    .cx-trail { padding: 1rem 1.05rem; }
    .cx-trail-facts { font-size: .85rem; }
}
