/*
 * Forum Xiaomi Blog — tableaux globaux des articles
 * Portée volontairement limitée aux articles WordPress.
 */

.single-post .entry-content .wp-block-table,
.single-post .et_pb_post_content .wp-block-table,
.single-post .et_pb_text_inner .wp-block-table {
    margin: 1.6rem 0 1.9rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e6e8eb;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(18, 24, 33, .06);
    scrollbar-width: thin;
    scrollbar-color: #b8bec6 #f2f3f5;
}

.single-post .entry-content table,
.single-post .et_pb_post_content table,
.single-post .et_pb_text_inner table {
    width: 100%;
    max-width: 100%;
    margin: 1.6rem 0 1.9rem;
    border: 1px solid #e6e8eb;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(18, 24, 33, .06);
    color: #2b3138;
    font-size: 15px;
    line-height: 1.45;
    overflow: hidden;
}

.single-post .entry-content .wp-block-table table,
.single-post .et_pb_post_content .wp-block-table table,
.single-post .et_pb_text_inner .wp-block-table table {
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.single-post .entry-content table th,
.single-post .entry-content table td,
.single-post .et_pb_post_content table th,
.single-post .et_pb_post_content table td,
.single-post .et_pb_text_inner table th,
.single-post .et_pb_text_inner table td {
    padding: 13px 15px;
    border: 0;
    border-right: 1px solid #eceef1;
    border-bottom: 1px solid #eceef1;
    text-align: left;
    vertical-align: middle;
}

.single-post .entry-content table tr > *:last-child,
.single-post .et_pb_post_content table tr > *:last-child,
.single-post .et_pb_text_inner table tr > *:last-child {
    border-right: 0;
}

.single-post .entry-content table tbody tr:last-child > *,
.single-post .et_pb_post_content table tbody tr:last-child > *,
.single-post .et_pb_text_inner table tbody tr:last-child > * {
    border-bottom: 0;
}

.single-post .entry-content table thead th,
.single-post .et_pb_post_content table thead th,
.single-post .et_pb_text_inner table thead th {
    background: #202124;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: .01em;
}

.single-post .entry-content table tbody th,
.single-post .et_pb_post_content table tbody th,
.single-post .et_pb_text_inner table tbody th {
    background: #fff;
    color: #202124;
    font-weight: 800;
}

.single-post .entry-content table tbody tr:nth-child(even) > *,
.single-post .et_pb_post_content table tbody tr:nth-child(even) > *,
.single-post .et_pb_text_inner table tbody tr:nth-child(even) > * {
    background: #f8f9fa;
}

@media (hover: hover) {
    .single-post .entry-content table tbody tr:hover > *,
    .single-post .et_pb_post_content table tbody tr:hover > *,
    .single-post .et_pb_text_inner table tbody tr:hover > * {
        background: #fff8f3;
    }
}

.single-post .entry-content table a,
.single-post .et_pb_post_content table a,
.single-post .et_pb_text_inner table a {
    color: #f56600;
    font-weight: 700;
    text-decoration: none;
}

.single-post .entry-content table a:hover,
.single-post .et_pb_post_content table a:hover,
.single-post .et_pb_text_inner table a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.single-post .entry-content table caption,
.single-post .et_pb_post_content table caption,
.single-post .et_pb_text_inner table caption {
    caption-side: top;
    padding: 0 0 10px;
    color: #6b7280;
    font-size: 13px;
    text-align: left;
}

@media (max-width: 767px) {
    .single-post .entry-content .wp-block-table,
    .single-post .et_pb_post_content .wp-block-table,
    .single-post .et_pb_text_inner .wp-block-table {
        position: relative;
        margin: 1.35rem 0 1.6rem;
        border-radius: 12px;
    }

    .single-post .entry-content .wp-block-table::before,
    .single-post .et_pb_post_content .wp-block-table::before,
    .single-post .et_pb_text_inner .wp-block-table::before {
        content: "↔ Faites glisser pour voir tout le tableau";
        display: block;
        position: sticky;
        left: 0;
        width: 100%;
        box-sizing: border-box;
        padding: 8px 10px;
        border-bottom: 1px solid #ffe0cc;
        background: #fff4ec;
        color: #b54700;
        font-size: 12px;
        font-weight: 800;
        text-align: center;
    }

    .single-post .entry-content .wp-block-table table,
    .single-post .et_pb_post_content .wp-block-table table,
    .single-post .et_pb_text_inner .wp-block-table table {
        width: max-content;
        min-width: 620px;
    }

    .single-post .entry-content table:not(.has-fixed-layout),
    .single-post .et_pb_post_content table:not(.has-fixed-layout),
    .single-post .et_pb_text_inner table:not(.has-fixed-layout) {
        font-size: 13px;
    }

    .single-post .entry-content > table,
    .single-post .et_pb_post_content > table,
    .single-post .et_pb_text_inner > table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .single-post .entry-content table th,
    .single-post .entry-content table td,
    .single-post .et_pb_post_content table th,
    .single-post .et_pb_post_content table td,
    .single-post .et_pb_text_inner table th,
    .single-post .et_pb_text_inner table td {
        min-width: 105px;
        padding: 10px 11px;
        white-space: normal;
    }

    .single-post .entry-content .wp-block-table table th:first-child,
    .single-post .entry-content .wp-block-table table td:first-child,
    .single-post .et_pb_post_content .wp-block-table table th:first-child,
    .single-post .et_pb_post_content .wp-block-table table td:first-child,
    .single-post .et_pb_text_inner .wp-block-table table th:first-child,
    .single-post .et_pb_text_inner .wp-block-table table td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        min-width: 130px;
        background: #fff;
        box-shadow: 2px 0 0 #e6e8eb;
    }

    .single-post .entry-content .wp-block-table table thead th:first-child,
    .single-post .et_pb_post_content .wp-block-table table thead th:first-child,
    .single-post .et_pb_text_inner .wp-block-table table thead th:first-child {
        z-index: 3;
        background: #202124;
        color: #fff;
    }

    .single-post .entry-content .wp-block-table table tbody tr:nth-child(even) > *:first-child,
    .single-post .et_pb_post_content .wp-block-table table tbody tr:nth-child(even) > *:first-child,
    .single-post .et_pb_text_inner .wp-block-table table tbody tr:nth-child(even) > *:first-child {
        background: #f8f9fa;
    }
}

@media (max-width: 420px) {
    .single-post .entry-content table th,
    .single-post .entry-content table td,
    .single-post .et_pb_post_content table th,
    .single-post .et_pb_post_content table td,
    .single-post .et_pb_text_inner table th,
    .single-post .et_pb_text_inner table td {
        padding: 9px 10px;
        font-size: 12px;
    }
}
