/*
 * Corporate design tables (output of the Quill "cd-table" embed) - ADMIN PREVIEW.
 * Load in the Pimcore admin (addEditmodeCSSFiles / addCSSFiles).
 * The live site uses the SCSS in wysiwyg-table.scss instead.
 *
 * Colours = the site's Tailwind colours:
 *   primary #005ca5, green #0e623e, greenLight #e6efeb,
 *   secondary #d2ddea, dark #575756, light #f9f9f9
 *
 * Scheme selectors use .cd-table.cd-table--x on purpose (higher specificity than
 * generic table rules). .cd-table--westerham = old name of the primary scheme.
 */

.cd-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5rem 0;
}

.cd-table {
    /* primary (default) */
    --cd-head-bg: #005ca5;
    --cd-head-fg: #ffffff;
    --cd-rowhead-fg: #005ca5;
    --cd-stripe-bg: #e5eff6;
    --cd-border: #d2ddea;

    border-collapse: collapse;
    table-layout: auto;
    border: 1px solid var(--cd-border);
}

/* Width follows the content; also beats w-full on tables saved with the old scheme. */
.cd-table-wrap .cd-table:not(.cd-table--full) {
    width: auto;
}

.cd-table-wrap .cd-table.cd-table--full {
    width: 100%;
}

.cd-table.cd-table--secondary {
    --cd-head-bg: #d2ddea;
    --cd-head-fg: #005ca5;
    --cd-rowhead-fg: #005ca5;
    --cd-stripe-bg: #f9f9f9;
}

.cd-table.cd-table--neutral {
    --cd-head-bg: #575756;
    --cd-head-fg: #ffffff;
    --cd-rowhead-fg: #575756;
    --cd-stripe-bg: #f9f9f9;
}

.westerham .cd-table.cd-table--primary,
.westerham .cd-table.cd-table--westerham {
    --cd-head-bg: #0e623e;
    --cd-rowhead-fg: #0e623e;
    --cd-stripe-bg: #e6efeb;
}

.westerham .cd-table.cd-table--secondary {
    --cd-head-bg: #e6efeb;
    --cd-head-fg: #0e623e;
    --cd-rowhead-fg: #0e623e;
}

.cd-table th,
.cd-table td {
    width: auto;
    min-width: 6rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--cd-border);
    text-align: left;
    vertical-align: top;
    color: #575756;
}

.cd-table thead th {
    background-color: var(--cd-head-bg) !important;
    color: var(--cd-head-fg) !important;
    font-weight: 600;
}

.cd-table tbody th[scope="row"] {
    font-weight: 600;
    color: var(--cd-rowhead-fg);
}

.cd-table tbody tr {
    background-color: #ffffff !important;
}

.cd-table.cd-table--striped tbody tr:nth-child(even) {
    background-color: var(--cd-stripe-bg) !important;
}

/* Formatting inside cells (bold, italic, underline, lists) */
.cd-table strong {
    font-weight: 700;
}

.cd-table em {
    font-style: italic;
}

.cd-table u {
    text-decoration: underline;
}

.cd-table ul,
.cd-table ol {
    margin: 0.25rem 0;
    padding-left: 1.25rem;
    list-style-position: outside;
}

.cd-table ul {
    list-style-type: disc;
}

.cd-table ol {
    list-style-type: decimal;
}

.cd-table li {
    display: list-item;
}
