/* Jones Comparison Table - Figma "Website 3.0" node 10620:9919 (Jones vs. myCOI page). */

/* Fill the column even when the parent container does not stretch its children
   (align-items: flex-start shrank it to 668px of 730). A width set in Advanced still wins. */
.elementor-widget-jones-comparison:not([class*="elementor-widget__width-"]) {
    width: 100%;
}

.jcmp {
    --jcmp-border: rgba(213, 220, 233, 0.5);
    --jcmp-text: #363a43;
    --jcmp-muted: #606876;
    --jcmp-open-bg: #f9fafb;
    --jcmp-check: #00983d;
    --jcmp-accent: #0073ff;

    interpolate-size: allow-keywords; /* lets the open/close height animate, where supported */
    background: #fff;
    border: 1px solid var(--jcmp-border);
    border-radius: 8px;
    overflow: hidden;
    color: var(--jcmp-text);
    font-family: "sofia-pro", sans-serif;
}

/* Desktop columns read off the 730px design: 16 | 148 | 305 | 225 | 16 icon | 20 */
.jcmp__grid {
    display: grid;
    grid-template-columns: minmax(0, 148fr) minmax(0, 305fr) minmax(0, 225fr) 16px;
    align-items: center;
    padding: 0 20px 0 16px;
}

.jcmp__cell--label {
    font-size: 12px;
    line-height: 1.4;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--jcmp-muted);
    padding-right: 16px;
}

.jcmp__cell--jones,
.jcmp__cell--competitor {
    font-size: 18px;
    line-height: 1.5;
    letter-spacing: -0.01em;
    padding-right: 16px;
}

/* Header row */
.jcmp__head {
    min-height: 80px; /* first row, no border above */
}

.jcmp__head .jcmp__cell--jones {
    display: flex;
    align-items: center;
    gap: 17px;
}

/* .jcmp prefix: Elementor's `.elementor img { height: auto }` would win otherwise */
.jcmp .jcmp__logo {
    display: block;
    width: auto;
    max-width: 100%;
}

.jcmp .jcmp__logo--jones {
    height: 18px;
}

.jcmp .jcmp__logo--competitor {
    height: 28px;
}

.jcmp__name {
    font-size: 18px;
    font-weight: 600;
    color: #1f2023;
}

.jcmp__badge {
    font-size: 14px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: -0.05em;
    color: var(--jcmp-accent);
    background: #f5faff;
    border: 1px solid #c7e0ff;
    border-radius: 8px;
    padding: 4px 10px;
    white-space: nowrap;
}

/* Rows */
.jcmp__row {
    border-top: 1px solid var(--jcmp-border);
    margin: 0;
}

.jcmp__summary {
    display: block;
    list-style: none;
    cursor: pointer;
}

.jcmp__summary::-webkit-details-marker {
    display: none;
}

.jcmp__summary::marker {
    content: "";
}

.jcmp__summary > .jcmp__grid,
.jcmp__row--static > .jcmp__summary {
    min-height: 71px; /* + 1px row border = the design's 72px */
    padding-top: 12px;
    padding-bottom: 12px;
    box-sizing: border-box;
}

.jcmp__row--static > .jcmp__summary {
    cursor: default;
}

.jcmp__row[open] > .jcmp__summary,
.jcmp__summary:hover {
    background: var(--jcmp-open-bg);
}

.jcmp__summary:focus-visible {
    outline: 2px solid var(--jcmp-accent);
    outline-offset: -2px;
}

.jcmp__summary .jcmp__cell--jones,
.jcmp__row--static .jcmp__cell--jones {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.jcmp__check {
    flex: none;
    width: 11px;
    height: 8px;
    fill: none;
    stroke: var(--jcmp-check);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.jcmp__toggle {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--jcmp-text);
    stroke-width: 1.5;
    stroke-linecap: round;
    transition: transform 0.3s ease;
}

.jcmp__row[open] .jcmp__toggle {
    transform: rotate(45deg);
}

/* Opened content */
.jcmp__detail {
    border-top: 1px solid var(--jcmp-border);
    padding-top: 21px;
    padding-bottom: 34px;
    align-items: start;
}

.jcmp__detail .jcmp__cell--label {
    padding-top: 9px; /* centres the label on the first 30px line of the text */
}

.jcmp .jcmp__text {
    grid-column: 2 / 4;
    margin: 0;
    max-width: 480px;
    font-size: 18px;
    line-height: 30px;
    letter-spacing: -0.005em;
    color: var(--jcmp-text);
}

.jcmp__text a {
    color: var(--jcmp-accent);
}

.jcmp__row::details-content {
    block-size: 0;
    overflow-y: clip;
    transition: block-size 0.3s ease, content-visibility 0.3s allow-discrete;
}

.jcmp__row[open]::details-content {
    block-size: auto;
}

.jcmp__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Desktop-only optical offsets, measured against the design (sofia-pro sits low in its line box) */
@media (min-width: 768px) {
    .jcmp__summary .jcmp__cell--jones,
    .jcmp__summary .jcmp__cell--competitor,
    .jcmp__row--static .jcmp__cell--jones,
    .jcmp__row--static .jcmp__cell--competitor {
        position: relative;
        top: -3px;
    }

    .jcmp__head .jcmp__cell--jones {
        position: relative;
        top: 3px;
        gap: 16px;
    }

    .jcmp .jcmp__logo--jones {
        margin-left: -2.5px;
    }

    .jcmp .jcmp__logo--competitor {
        position: relative;
        top: -2.5px;
    }

    .jcmp__toggle {
        position: relative;
        left: 1px;
    }
}

/* Mobile: the label goes on its own line, the two values sit side by side under it */
@media (max-width: 767px) {
    .jcmp__grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 16px;
        column-gap: 12px;
        row-gap: 6px;
        padding: 0 16px;
    }

    .jcmp__head {
        min-height: 64px;
    }

    .jcmp__head .jcmp__cell--label {
        display: none;
    }

    .jcmp__head .jcmp__cell--jones {
        gap: 10px;
        flex-wrap: wrap;
    }

    .jcmp .jcmp__logo--competitor {
        height: 24px;
    }

    .jcmp__summary > .jcmp__grid,
    .jcmp__row--static > .jcmp__summary {
        align-items: start; /* values that wrap stay top-aligned with each other */
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .jcmp__summary .jcmp__cell--label,
    .jcmp__row--static .jcmp__cell--label {
        grid-column: 1 / 3;
        grid-row: 1;
    }

    .jcmp__toggle {
        grid-column: 3;
        grid-row: 1;
        align-self: center;
    }

    .jcmp__cell--jones,
    .jcmp__cell--competitor {
        font-size: 16px;
        padding-right: 0;
    }

    .jcmp__detail {
        padding-top: 16px;
        padding-bottom: 20px;
    }

    .jcmp__detail .jcmp__cell--label {
        grid-column: 1 / -1;
        padding-top: 0;
    }

    .jcmp .jcmp__text {
        grid-column: 1 / -1;
        max-width: none;
        font-size: 16px;
        line-height: 26px;
    }
}
