/*
 * Comparison table (template-parts/components/compare-table.php): features as rows, programs as columns, checks; on
 * phones each row as a card listing the programs that include it. Used by the PRO pricing page and the Programs &
 * Pricing page (MILESTONES #27, #29). Prefix amx-.
 */

.amx-table-wrap {
    --amx-navy: var(--amh-navy, #002a54);
    --amx-blue: #0a72f5;
    --amx-line: #e3ebf6;
    --amx-text: #33446a;

    overflow-x: auto;
    border: 1px solid var(--amx-line);
    border-radius: 16px;
    box-shadow: 0 16px 38px rgba(1, 33, 106, .06);
}

.amx-table {
    width: 100%;
    min-width: 720px;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    color: var(--amx-text);
    font-size: 15px;
}

.amx-table th,
.amx-table td {
    padding: 14px 18px;
    border: 0;
    border-bottom: 1px solid var(--amx-line);
    vertical-align: middle;
}

.amx-table tbody tr:last-child th,
.amx-table tbody tr:last-child td {
    border-bottom: 0;
}

.amx-table thead th {
    background: var(--amx-navy);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
}

.amx-table thead th:first-child {
    width: 40%;
}

.amx-table thead a {
    color: #fff;
    text-decoration: none;
}

.amx-table thead a:hover,
.amx-table thead a:focus-visible {
    text-decoration: underline;
}

.amx-col-meta {
    display: block;
    margin-top: 4px;
    color: #9cdeff;
    font-size: 13px;
    font-weight: 700;
}

.amx-table thead th.is-featured {
    background: var(--amx-blue);
}

.amx-table thead th.is-featured .amx-col-meta {
    color: #fff;
}

.amx-table tbody th {
    color: var(--amx-navy);
    font-weight: 600;
    text-align: left;
}

.amx-table tbody tr:nth-child(even) {
    background: #f8fbff;
}

.amx-table td {
    text-align: center;
}

.amx-table td.is-featured {
    background: rgba(10, 114, 245, .05);
}

.amx-check {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    margin-top: .12em;
    fill: var(--amx-blue);
}

.amx-table .amx-check {
    margin: 0 auto;
}

.amx-no {
    color: #a9b6cc;
    font-weight: 700;
}

/* "All programs": on phones only, for a row every program includes. */
.amx-all {
    display: none;
}

/* Tablets (RWD review 16.10): the table fits its column instead of scrolling inside it (720px minimum, the last
   program cut off at 768px); smaller cells, the names in the head wrap. */
@media (min-width: 701px) and (max-width: 1100px) {
    .amx-table {
        min-width: 0;
        font-size: 14px;
    }

    .amx-table th,
    .amx-table td {
        padding: 12px 8px;
    }

    .amx-table thead th {
        font-size: 13px;
        overflow-wrap: break-word;
    }
}

@media (max-width: 700px) {
    /* Phones: each row as a block, its programs listed under it. */
    .amx-table-wrap {
        overflow: visible;
        border: 0;
        box-shadow: none;
    }

    .amx-table,
    .amx-table tbody,
    .amx-table tr,
    .amx-table th,
    .amx-table td {
        display: block;
        width: auto;
        min-width: 0;
    }

    .amx-table thead {
        display: none;
    }

    .amx-table tbody tr {
        margin: 0 0 12px;
        padding: 14px 16px;
        border: 1px solid var(--amx-line);
        border-radius: 12px;
        background: #fff;
    }

    .amx-table tbody tr:nth-child(even) {
        background: #fff;
    }

    .amx-table tbody th {
        padding: 0 0 8px;
        border: 0;
    }

    .amx-table td {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin: 4px 6px 0 0;
        padding: 4px 10px;
        border: 0;
        border-radius: 999px;
        background: #f1f7fe;
        font-size: 13px;
        font-weight: 700;
    }

    .amx-table td::after {
        content: attr(data-program);
    }

    .amx-table td.is-no {
        display: none;
    }

    .amx-table td.is-featured {
        background: #f1f7fe;
    }

    .amx-table td .amx-check {
        width: 16px;
        height: 16px;
        margin: 0;
    }

    .amx-table tr.is-all td {
        display: none;
    }

    .amx-all {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin: 12px 0 0;
        padding: 4px 10px;
        border-radius: 999px;
        background: #f1f7fe;
        color: var(--amx-navy);
        font-size: 13px;
        font-weight: 700;
    }

    .amx-all .amx-check {
        width: 16px;
        height: 16px;
        margin: 0;
    }

    .amx-table tr.is-all th {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 0;
    }
}
