/* ==========================================================================
   Capability Progression Matrix block
   ========================================================================== */

.cpm {
    margin: 2rem 0;
}

.cpm__eyebrow {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #767676;
    margin: 0 0 1rem;
}

/* ==========================================================================
   Desktop table
   ========================================================================== */

.cpm__accordion {
    display: none;
}

.cpm__table-wrap {
    border: 1px solid #d6dce8;
    border-radius: 6px;
    overflow: hidden;
}

.cpm__table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.9rem;
    table-layout: fixed;
}

/* Header */

.cpm__th {
    padding: 0.875rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
    background: #fff;
    border-bottom: 1px solid #d6dce8;
    color: var(--dim-color, #3e57a3);
    vertical-align: bottom;
    transition: background 0.15s ease;
}

.cpm__th--area {
    width: 20%;
}

.cpm__th--professional,
.cpm__th--pathfinder {
    width: 26.67%;
}

.cpm__th--pacesetter {
    width: 26.67%;
}

/* Body cells */

.cpm__row:not(:last-child) .cpm__td {
    border-bottom: 1px solid #e8ecf2;
}

.cpm__td {
    padding: 1rem;
    vertical-align: top;
    line-height: 1.55;
    color: #1a1a1a;
    transition: background 0.15s ease;
}

.cpm__td p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

.cpm__td--area {
    font-weight: 700;
    font-size: 0.875rem;
}

/* Alternating row tint */
.cpm__row:nth-child(even) .cpm__td {
    background: #f8f9fc;
}

/* Column hover — JS sets data-hover-col on the table */
.cpm__table[data-hover-col="1"] .cpm__th:nth-child(2),
.cpm__table[data-hover-col="1"] .cpm__td:nth-child(2),
.cpm__table[data-hover-col="2"] .cpm__th:nth-child(3),
.cpm__table[data-hover-col="2"] .cpm__td:nth-child(3),
.cpm__table[data-hover-col="3"] .cpm__th:nth-child(4),
.cpm__table[data-hover-col="3"] .cpm__td:nth-child(4) {
    background: #e8edf6;
}

/* ==========================================================================
   Mobile accordion
   ========================================================================== */

@media (max-width: 680px) {
    .cpm__table-wrap {
        display: none;
    }

    .cpm__accordion {
        display: block;
        border: 1px solid #d6dce8;
        border-radius: 6px;
        overflow: hidden;
    }

    .cpm__acc-item + .cpm__acc-item {
        border-top: 1px solid #e8ecf2;
    }

    .cpm__acc-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 1rem 1.125rem;
        background: #fff;
        border: none;
        cursor: pointer;
        text-align: left;
        font-family: 'Open Sans', sans-serif;
        font-size: 0.9rem;
        font-weight: 700;
        color: #1a1a1a;
        gap: 0.75rem;
    }

    .cpm__acc-trigger:focus-visible {
        outline: 2px solid var(--dim-color, #3e57a3);
        outline-offset: -2px;
    }

    /* Chevron icon via border trick */
    .cpm__acc-icon {
        flex-shrink: 0;
        display: inline-block;
        width: 8px;
        height: 8px;
        border-right: 2px solid var(--dim-color, #3e57a3);
        border-bottom: 2px solid var(--dim-color, #3e57a3);
        transform: rotate(45deg);
        transition: transform 0.2s ease;
        margin-bottom: 2px;
    }

    .cpm__acc-item.is-open .cpm__acc-icon {
        transform: rotate(-135deg);
        margin-bottom: -2px;
    }

    .cpm__acc-item.is-open .cpm__acc-trigger {
        background: #f8f9fc;
    }

    .cpm__acc-body {
        padding: 0 1.125rem 1.125rem;
        background: #f8f9fc;
    }

    .cpm__acc-level {
        padding: 0.75rem 0;
    }

    .cpm__acc-level + .cpm__acc-level {
        border-top: 1px solid #e8ecf2;
    }

    .cpm__acc-level-label {
        font-family: 'Open Sans', sans-serif;
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        margin-bottom: 0.375rem;
        color: #1a1a1a;
    }

    .cpm__acc-level-label--professional,
    .cpm__acc-level-label--pathfinder {
        color: var(--dim-color, #3e57a3);
    }

    .cpm__acc-level-text {
        font-family: 'Open Sans', sans-serif;
        color: #1a1a1a;
    }

    .cpm__acc-level-text p {
        margin: 0;
        font-size: 1rem;
        line-height: 1.5;
    }
}
