/* content-tables.css — таблицы внутри текста статей, гайдов и разделов.
   Скоуп: .article (новости, гайды) и .ap-longread (гайды разделов недвижимости/работы). */

.article table,
.ap-longread table {
    width: 100%;
    border-collapse: collapse;
    margin: 22px 0;
    font-size: 15px;
    line-height: 1.5;
    background: #fff;
    font-variant-numeric: tabular-nums;
}

.article th,
.article td,
.ap-longread th,
.ap-longread td {
    border: 1px solid #e2ded6;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

/* шапка: и с thead, и без него — бот и авторы пишут таблицы обоими способами */
.article thead th,
.article tr:first-child th,
.ap-longread thead th,
.ap-longread tr:first-child th {
    background: #f4f0e9;
    font-weight: 700;
    color: #141413;
    border-bottom: 2px solid #d9d3c8;
}

.article tbody tr:nth-child(even),
.ap-longread tbody tr:nth-child(even) {
    background: #faf8f5;
}

.article tbody tr:hover,
.ap-longread tbody tr:hover {
    background: #f2ede4;
}

.article table td:first-child,
.ap-longread table td:first-child {
    font-weight: 600;
    color: #141413;
}

/* узкий экран: таблица прокручивается внутри себя, страница вбок не едет */
@media (max-width: 700px) {
    .article table,
    .ap-longread table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .article table > thead,
    .article table > tbody,
    .ap-longread table > thead,
    .ap-longread table > tbody {
        display: table;
        width: 100%;
        min-width: 520px;
    }

    .article th,
    .article td,
    .ap-longread th,
    .ap-longread td {
        padding: 9px 10px;
        font-size: 14px;
    }
}
