/*
 * Shared presentation for tables authored by TinyMCE.
 * Loaded both inside the editor iframe and by the public/admin layouts.
 */
.tiny-editor-table {
    width: 100%;
    margin: 1.25rem 0;
    border: 1px solid #d7dde5;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    background: #fff;
    color: #273142;
    font-size: .95rem;
    line-height: 1.65;
    text-align: start;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .06);
}

.tiny-editor-table caption {
    padding: .7rem 1rem;
    color: #526071;
    font-size: .875rem;
    font-weight: 600;
    text-align: start;
    caption-side: top;
}

.tiny-editor-table th,
.tiny-editor-table td {
    min-width: 7rem;
    padding: .8rem 1rem;
    border: 0;
    border-inline-end: 1px solid #e5e9ef;
    border-bottom: 1px solid #e5e9ef;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.tiny-editor-table th {
    background: #f1f5f9;
    color: #172033;
    font-weight: 700;
}

.tiny-editor-table thead th {
    background: #e9eff7;
}

.tiny-editor-table tr > :last-child {
    border-inline-end: 0;
}

.tiny-editor-table tbody tr:last-child > *,
.tiny-editor-table tfoot tr:last-child > * {
    border-bottom: 0;
}

.tiny-editor-table tbody tr {
    transition: background-color .15s ease;
}

.tiny-editor-table tbody tr:hover {
    background: #f8fafc;
}

.tiny-editor-table--striped tbody tr:nth-child(even) {
    background: #f7f9fc;
}

.tiny-editor-table--compact th,
.tiny-editor-table--compact td {
    padding: .45rem .65rem;
    font-size: .875rem;
}

.tiny-editor-table a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tiny-editor-table img {
    max-width: 100%;
    height: auto;
}

[data-bs-theme="dark"] .tiny-editor-table {
    border-color: #475569;
    background: #1e293b;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .tiny-editor-table th,
[data-bs-theme="dark"] .tiny-editor-table td {
    border-color: #475569;
}

[data-bs-theme="dark"] .tiny-editor-table th,
[data-bs-theme="dark"] .tiny-editor-table thead th {
    background: #334155;
    color: #f8fafc;
}

[data-bs-theme="dark"] .tiny-editor-table tbody tr:hover,
[data-bs-theme="dark"] .tiny-editor-table--striped tbody tr:nth-child(even) {
    background: #273449;
}

@media (max-width: 767.98px) {
    .tiny-editor-table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        border-radius: 8px;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .tiny-editor-table th,
    .tiny-editor-table td {
        padding: .65rem .75rem;
        white-space: normal;
    }
}

@media print {
    .tiny-editor-table {
        break-inside: avoid;
        box-shadow: none;
    }
}

@media (prefers-color-scheme: dark) {
    .mce-content-body .tiny-editor-table {
        border-color: #475569;
        background: #1e293b;
        color: #e2e8f0;
    }

    .mce-content-body .tiny-editor-table th,
    .mce-content-body .tiny-editor-table td {
        border-color: #475569;
    }

    .mce-content-body .tiny-editor-table th,
    .mce-content-body .tiny-editor-table thead th {
        background: #334155;
        color: #f8fafc;
    }

    .mce-content-body .tiny-editor-table tbody tr:hover,
    .mce-content-body .tiny-editor-table--striped tbody tr:nth-child(even) {
        background: #273449;
    }
}
