/* NOTE: COMPARISON TABLES (comparatie-fotolii-masaj.php: specifications per chair, dimensiuni-fotolii-masaj.php:
   dimensions per chair), the old .responsive-table of those pages with the same breakpoints. Phones (below 48em): no
   header row, each row is a red band (its th) followed by one line per cell (the cell's data-title on the left, the
   value on the right). From 48em: a usual table. */

/* tablets: a wide range (8 chairs) scrolls sideways in its own box instead of widening the page */
.kmd-compare-table__scroll {
    overflow-x: auto;
}

.kmd-compare-table {
    --kmd-compare-line: #CF5F65;
    width: 100%;
    margin-top: 8px;
    border-spacing: 0;
    font-size: 15px;
}

/* header row (chairs): hidden on phones, but still read by screen readers */
.kmd-compare-table thead {
    position: absolute;
    clip: rect(1px 1px 1px 1px);
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    overflow: hidden;
}

.kmd-compare-table thead th {
    background: var(--kmd-white);
    font-weight: 400;
    line-height: 1.2;
    text-align: center;
}

.kmd-compare-table thead th:first-of-type {
    font-size: 18px;
    font-weight: 700;
    text-align: left;
}

.kmd-compare-table__model {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.kmd-compare-table__model img {
    width: 100%;
    max-width: 130px;
}

.kmd-compare-table__model a:last-child {
    color: var(--kmd-ink);
    font-size: 16px;
    font-weight: 700;
}

.kmd-compare-table tbody,
.kmd-compare-table tr,
.kmd-compare-table th,
.kmd-compare-table td {
    display: block;
    padding: 0.5em;
    white-space: normal;
    text-align: left;
    vertical-align: middle;
}

.kmd-compare-table tbody tr {
    margin-bottom: 1em;
    padding: 0;
}

.kmd-compare-table tbody tr:last-of-type {
    margin-bottom: 0;
}

/* specification name: a red band on phones */
.kmd-compare-table tbody th[scope="row"] {
    background: var(--kmd-accent);
    color: var(--kmd-white);
    font-weight: 700;
    line-height: 1.3;
}

/* a linked row name (the chair in the dimensions table): white on the red band, dark on large screens */
.kmd-compare-table tbody th[scope="row"] a {
    color: inherit;
    text-decoration: none;
}

.kmd-compare-table tbody td {
    color: var(--kmd-text);
    line-height: 1.2;
    text-align: right;
}

/* the chair's name in front of the value (phones) */
.kmd-compare-table tbody td[data-title]::before {
    float: left;
    color: var(--kmd-muted);
    font-size: 15px;
    content: attr(data-title);
}

@media screen and (min-width: 30em) {
    .kmd-compare-table th,
    .kmd-compare-table td {
        padding: 0.75em 0.5em;
    }

    .kmd-compare-table tbody th[scope="row"] {
        min-width: 8em;
        border-bottom: 1px solid var(--kmd-compare-line);
        border-left: 1px solid var(--kmd-compare-line);
    }
}

@media screen and (min-width: 48em) {
    .kmd-compare-table {
        font-size: 16px;
    }

    .kmd-compare-table thead {
        position: relative;
        clip: auto;
        width: auto;
        height: auto;
        overflow: auto;
    }

    /* the header row framed like the cells under it, in bold */
    .kmd-compare-table thead th {
        font-weight: 700;
        border-top: 1px solid var(--kmd-compare-line);
        border-bottom: 1px solid var(--kmd-compare-line);
        border-left: 1px solid var(--kmd-compare-line);
    }

    .kmd-compare-table thead th:last-of-type {
        border-right: 1px solid var(--kmd-compare-line);
    }

    .kmd-compare-table tbody {
        display: table-row-group;
    }

    .kmd-compare-table tr,
    .kmd-compare-table tbody tr {
        display: table-row;
    }

    .kmd-compare-table th,
    .kmd-compare-table td {
        display: table-cell;
        padding: 0.5em;
    }

    .kmd-compare-table tbody tr:nth-of-type(even) {
        background: var(--kmd-bg-muted);
    }

    .kmd-compare-table tbody th[scope="row"] {
        background: transparent;
        color: var(--kmd-ink);
        text-align: left;
    }

    .kmd-compare-table tbody td {
        border-bottom: 1px solid var(--kmd-compare-line);
        border-left: 1px solid var(--kmd-compare-line);
        text-align: center;
    }

    .kmd-compare-table tbody td:last-of-type,
    .kmd-compare-table tbody th[colspan] {
        border-right: 1px solid var(--kmd-compare-line);
    }

    .kmd-compare-table tbody td[data-title]::before {
        content: none;
    }
}

@media screen and (min-width: 62em) {
    .kmd-compare-table th,
    .kmd-compare-table td {
        padding: 0.75em 0.5em;
    }
}

@media screen and (min-width: 75em) {
    .kmd-compare-table th,
    .kmd-compare-table td {
        padding: 0.75em;
    }
}
