/**
 * Vellis Table widget styles.
 *
 * Capability matrix: first "label" column (code + sub-label) plus capability
 * columns whose supported cells show a double-check. Alternating capability
 * columns receive a subtle tinted background.
 */

.vellis-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.vellis-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Header */
.vellis-table__col {
    padding: 20px 16px;
    color: #113F42;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}

.vellis-table__col--label {
    text-align: left;
    width: 220px;
    border-bottom: 1px solid rgba(17, 63, 66, 0.15);
}

.vellis-table__col-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.vellis-table__col-icon {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.vellis-table__col-icon svg {
    width: 20px;
    height: 20px;
    color: inherit;
}

/* Body cells */
.vellis-table__cell {
    padding: 20px 16px;
    text-align: center;
    vertical-align: middle;
}

.vellis-table__cell--label {
    text-align: left;
    width: 220px;
    border-bottom: 1px solid rgba(17, 63, 66, 0.12);
}

.vellis-table__code {
    display: block;
    color: #113F42;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.vellis-table__label {
    display: block;
    margin-top: 2px;
    color: rgba(17, 63, 66, 0.6);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
}

/* Check mark */
.vellis-table__check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #114042;
    line-height: 0;
}

.vellis-table__check svg {
    width: 22px;
    height: 22px;
    color: inherit;
    fill: currentColor;
}

/* Alternating capability-column tint (applied to both th and td) */
.vellis-table__col--tint,
.vellis-table__cell--tint {
    background-color: rgba(103, 165, 169, 0.08);
}

/* The id wrapper stacks code + label; toggle is desktop-hidden */
.vellis-table__id {
    display: block;
}

.vellis-table__toggle {
    display: none;
}

button.vellis-table__toggle:hover,
button.vellis-table__toggle:focus {
    background-color: #113F42;
}

/* ------------------------------------------------------------------ *
 * Mobile: collapse the grid into an accordion of currency cards
 * ------------------------------------------------------------------ */
@media (max-width: 767px) {
    .vellis-table-wrap {
        overflow-x: visible;
    }

    .vellis-table,
    .vellis-table__body,
    .vellis-table__row,
    .vellis-table__cell {
        display: block;
        width: 100%;
    }

    .vellis-table__head {
        display: none;
    }

    .vellis-table__row {
        border-bottom: 1px solid rgba(17, 63, 66, 0.12);
    }

    /* Card header: code + country on the left, chevron on the right */
    .vellis-table__cell--label {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: auto;
        border: 0;
        padding: 16px;
        cursor: pointer;
    }

    .vellis-table__toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 32px;
        height: 32px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #113F42;
        cursor: pointer;
        -webkit-appearance: none;
        appearance: none;
        transition: transform 0.25s ease;
    }

    .vellis-table__toggle svg {
        width: 20px;
        height: 20px;
        color: inherit;
    }

    .vellis-table__row.is-open .vellis-table__toggle {
        transform: rotate(180deg);
    }

    /* Capability cells: hidden until the card is open */
    .vellis-table__cell--on,
    .vellis-table__cell--off {
        display: none;
        background-color: transparent !important;
        text-align: left;
        padding: 10px 16px;
    }

    .vellis-table__row.is-open .vellis-table__cell--on,
    .vellis-table__row.is-open .vellis-table__cell--off {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .vellis-table__row.is-open .vellis-table__cell--on:last-child,
    .vellis-table__row.is-open .vellis-table__cell--off:last-child {
        padding-bottom: 16px;
    }

    /* Column title on the left (from data-label) */
    .vellis-table__cell--on::before,
    .vellis-table__cell--off::before {
        content: attr(data-label);
        color: rgba(17, 63, 66, 0.7);
        font-size: 15px;
        font-weight: 400;
    }

    /* Unsupported rows show a muted dash on the right */
    .vellis-table__cell--off::after {
        content: "—";
        color: rgba(17, 63, 66, 0.35);
        font-size: 16px;
    }
}