﻿/* =========================================
   CKEditor base fixes for print / PDF
   ========================================= */

body.ck-content {
    margin: 0;
    padding: 0;
}

.ck-content > :first-child {
    margin-top: 0 !important;
}

.ck-content > :last-child {
    margin-bottom: 0 !important;
}


/* =========================================
   CKEditor tables - custom compact/fixed layout
   ========================================= */

.ck-content .table table {
    table-layout: fixed;
    width: 100%;
}

/* Uniform columns and compact cells */
.ck-content .table table th,
.ck-content .table table td {
    padding: 0.15em 0.35em;
    vertical-align: middle;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* No paragraph margins inside table cells */
.ck-content .table table td p,
.ck-content .table table th p {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* If CKEditor uses accessory empty elements and internal paragraphs */
.ck-content .table table td > *:first-child,
.ck-content .table table th > *:first-child {
    margin-top: 0 !important;
}

.ck-content .table table td > *:last-child,
.ck-content .table table th > *:last-child {
    margin-bottom: 0 !important;
}

/* No table columns width update with long texts */
.ck-content .table table td,
.ck-content .table table th {
    white-space: normal;
}

/* Font Size override */
.ck-content .text-tiny {
    font-size: 0.60em;
}

.ck-content .text-small {
    font-size: 0.8em;
}

.ck-content .text-big {
    font-size: 1.2em;
}

.ck-content .text-huge {
    font-size: 1.4em;
}

/* =========================================
   Disable CKEditor support classes for print-content
   ========================================= */

/* =========================================
   CKEditor print: hide default borders only
   when no explicit border is defined
   ========================================= */

/* Remove editor helper visuals */
.ck-content.print-content figure.table,
.ck-content.print-content table,
.ck-content.print-content tbody,
.ck-content.print-content tr,
.ck-content.print-content th,
.ck-content.print-content td {
    outline: none !important;
    box-shadow: none !important;
    background-image: none !important;
}

/* Wrapper cleanup */
.ck-content.print-content figure.table {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Tables that have NO explicit inline border = treat as border none */
.ck-content.print-content figure.table > table:not([style*="border"]) {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
}

/* Remove borders from inner structure too */
.ck-content.print-content figure.table > table:not([style*="border"]) > tbody,
.ck-content.print-content figure.table > table:not([style*="border"]) > tbody > tr,
.ck-content.print-content figure.table > table:not([style*="border"]) > tbody > tr > th,
.ck-content.print-content figure.table > table:not([style*="border"]) > tbody > tr > td {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
}