/* Summernote ↔ Bootstrap 5.2.3 bridge
   - cílem je, aby obsah v .note-editable vypadal jako "čistý Bootstrap"
   - a aby <table> v editoru vypadala jako .table
*/

/* 1) Základ typografie (Bootstrap body) */
.note-editor .note-editable {
    font-family: var(--bs-body-font-family, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
    font-size: var(--bs-body-font-size, 1rem);
    font-weight: var(--bs-body-font-weight, 400);
    line-height: var(--bs-body-line-height, 1.5);
    color: var(--bs-body-color, #212529);
    background-color: var(--bs-body-bg, #fff);
}

/* 2) Headings – hodnoty dle Bootstrap 5.2.3 */
.note-editor .note-editable h1,
.note-editor .note-editable h2,
.note-editor .note-editable h3,
.note-editor .note-editable h4,
.note-editor .note-editable h5,
.note-editor .note-editable h6 {
    margin-top: 0;
    margin-bottom: .5rem;
    font-weight: 500;
    line-height: 1.2;
}

.note-editor .note-editable h1 { font-size: calc(1.3125rem + .75vw); }
.note-editor .note-editable h2 { font-size: calc(1.2875rem + .45vw); }
.note-editor .note-editable h3 { font-size: calc(1.2625rem + .15vw); }
.note-editor .note-editable h4 { font-size: 1.25rem; }
.note-editor .note-editable h5 { font-size: 1.125rem; }
.note-editor .note-editable h6 { font-size: 1rem; }

@media (min-width: 1200px) {
    .note-editor .note-editable h1 { font-size: 1.875rem; }
    .note-editor .note-editable h2 { font-size: 1.625rem; }
    .note-editor .note-editable h3 { font-size: 1.375rem; }
}

/* 3) Odstavce */
.note-editor .note-editable p {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* 4) Odkazy – jen běžné odkazy, ne tlačítka */
.note-editor .note-editing-area .note-editable a:not(.btn) {
    color: var(--bs-link-color, #0d6efd);
    text-decoration: underline;
}
.note-editor .note-editing-area .note-editable a:not(.btn):hover {
    color: var(--bs-link-hover-color, #0a58ca);
}

/* A tagy, které jsou tlačítka – vrať Bootstrap chování (bg/hover) */
.note-editor .note-editing-area .note-editable a.btn {
    text-decoration: none;
    color: var(--bs-btn-color, inherit);
    background-color: var(--bs-btn-bg);
    border-color: var(--bs-btn-border-color);
}

.note-editor .note-editing-area .note-editable a.btn:hover {
    color: var(--bs-btn-hover-color, var(--bs-btn-color, inherit));
    background-color: var(--bs-btn-hover-bg);
    border-color: var(--bs-btn-hover-border-color);
}

.note-editor .note-editing-area .note-editable a.btn:active {
    color: var(--bs-btn-active-color, var(--bs-btn-color, inherit));
    background-color: var(--bs-btn-active-bg);
    border-color: var(--bs-btn-active-border-color);
}

/* 5) Seznamy */
.note-editor .note-editable ol,
.note-editor .note-editable ul,
.note-editor .note-editable dl {
    margin-top: 0;
    margin-bottom: 1rem;
}

.note-editor .note-editable ol,
.note-editor .note-editable ul {
    padding-left: 2rem;
}

/* v Bootstrapu je pro nested listy margin-bottom: 0 */
.note-editor .note-editable ul ul,
.note-editor .note-editable ol ul,
.note-editor .note-editable ul ol,
.note-editor .note-editable ol ol {
    margin-bottom: 0;
}

/* 6) Strong/B */
.note-editor .note-editable b,
.note-editor .note-editable strong {
    font-weight: bolder;
}

/* 7) Tabulky – mapování <table> => Bootstrap .table */
.note-editor .note-editable table {
    /* zkopírované “.table{...}” principy z BS 5.2.3 */
    --bs-table-color: var(--bs-body-color);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--bs-border-color);
    --bs-table-accent-bg: transparent;
    --bs-table-striped-color: var(--bs-body-color);
    --bs-table-striped-bg: rgba(0, 0, 0, .05);
    --bs-table-active-color: var(--bs-body-color);
    --bs-table-active-bg: rgba(0, 0, 0, .1);
    --bs-table-hover-color: var(--bs-body-color);
    --bs-table-hover-bg: rgba(0, 0, 0, .075);

    width: 100%;
    margin-bottom: 1rem;
    color: var(--bs-table-color);
    vertical-align: top;
    border-color: var(--bs-table-border-color);

    caption-side: bottom;
    border-collapse: collapse;
}

.note-editor .note-editable table > :not(caption) > * > * {
    padding: 0.5rem 0.5rem;
    background-color: var(--bs-table-bg);
    border-bottom-width: 1px;
    box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg);
}

.note-editor .note-editable table > thead {
    vertical-align: bottom;
}

.note-editor .note-editable table > tbody {
    vertical-align: inherit;
}

/* Bootstrap reset pro elementy tabulky */
.note-editor .note-editable table thead,
.note-editor .note-editable table tbody,
.note-editor .note-editable table tfoot,
.note-editor .note-editable table tr,
.note-editor .note-editable table td,
.note-editor .note-editable table th {
    border-color: inherit;
    border-style: solid;
    border-width: 0;
}

.note-editor .note-editable table th {
    text-align: inherit;
    text-align: -webkit-match-parent;
}
