/*
 * HTML EDITOR - TinyMCE v inline režime (js/html-editor.js, Vojto 5. 10. 2026)
 * =============================================================================
 *   .html-editor          rámik (Backend: 1 px, zaoblenie poľa; Frontend
 *                         popup: čierny, 10 px - css/upravy-frontendu.css)
 *   .html-editor-lista    lišta nástrojov TinyMCE, stále viditeľná
 *   .html-editor-obsah    text - priamo v stránke, nie v rámci <iframe>
 */
.html-editor {
    position: relative;
    border: 1px solid #CCCCCC;
    border-radius: 10px;
    background: #FFFFFF;
}

.html-editor-lista {
    position: relative;
    z-index: 2;
    padding-top: 6px;
    border-bottom: 1px solid #EEEEEE;
    border-radius: 10px 10px 0 0;
}

/* Lišta TinyMCE bez vlastného rámu a tieňa - rám má obal. */
.html-editor-lista .tox.tox-tinymce-inline,
.html-editor-lista .tox.tox-tinymce-inline .tox-editor-container,
.html-editor-lista .tox.tox-tinymce-inline .tox-editor-header {
    position: static !important;
    width: auto !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Užšie skupiny tlačidiel - lišta sa zmestí aj do stĺpca vizuálneho editora. */
.html-editor-lista .tox .tox-toolbar__group {
    padding: 0 2px 0 6px !important;
}

.html-editor-lista .tox .tox-toolbar,
.html-editor-lista .tox .tox-toolbar__primary,
.html-editor-lista .tox .tox-toolbar-overlord {
    background: transparent !important;
}

.html-editor-obsah {
    box-sizing: border-box;
    padding: 12px 15px;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.5;
    color: #000000;
    overflow-wrap: anywhere;
    outline: none;
    cursor: text;
}

.html-editor-obsah > :first-child { margin-top: 0; }
.html-editor-obsah > :last-child { margin-bottom: 0; }

.html-editor-obsah p { margin: 0 0 10px; }
.html-editor-obsah strong,
.html-editor-obsah b { font-weight: 700; }

.html-editor-obsah h1,
.html-editor-obsah h2,
.html-editor-obsah h3,
.html-editor-obsah h4,
.html-editor-obsah h5,
.html-editor-obsah h6 {
    margin: 15px 0 10px;
    font-weight: 700;
    line-height: 1.3;
}

.html-editor-obsah h1 { font-size: 28px; }
.html-editor-obsah h2 { font-size: 24px; }
.html-editor-obsah h3 { font-size: 20px; }
.html-editor-obsah h4 { font-size: 18px; }

.html-editor-obsah ul,
.html-editor-obsah ol {
    margin: 0 0 10px;
    padding-left: 25px;
}

.html-editor-obsah ul { list-style: disc; }
.html-editor-obsah ol { list-style: decimal; }

.html-editor-obsah blockquote {
    margin: 0 0 10px;
    padding-left: 15px;
    border-left: 3px solid #CCCCCC;
}

.html-editor-obsah a {
    color: inherit;
    text-decoration: underline;
}

/* Prvky z ďalších tlačidiel lišty (Vojto 5. 10. 2026). */
.html-editor-obsah img,
.html-editor-obsah video,
.html-editor-obsah iframe {
    max-width: 100%;
    height: auto;
}

.html-editor-obsah table {
    width: 100%;
    margin: 0 0 10px;
    border-collapse: collapse;
}

.html-editor-obsah td,
.html-editor-obsah th {
    padding: 5px 8px;
    border: 1px solid #CCCCCC;
}

.html-editor-obsah hr {
    margin: 15px 0;
    border: 0;
    border-top: 1px solid #CCCCCC;
}

.html-editor-obsah pre {
    margin: 0 0 10px;
    padding: 10px;
    background: #F5F5F5;
    border-radius: 5px;
    overflow-x: auto;
}

.html-editor-obsah details {
    margin: 0 0 10px;
}

.html-editor-obsah u { text-decoration: underline; }
.html-editor-obsah s { text-decoration: line-through; }

/* Odsek v bunke tabuľky bez spodného okraja - rovnako ako na webe (stranka.css). */
.html-editor-obsah td > :last-child,
.html-editor-obsah th > :last-child {
    margin-bottom: 0;
}

.html-editor-obsah td,
.html-editor-obsah th {
    vertical-align: top;
}

/* Lišta nástrojov sa pri posúvaní dlhého textu drží hore v okne, kým je
   editor viditeľný (Vojto 5. 10. 2026). */
.html-editor-lista {
    position: sticky;
    top: var(--html-editor-lista-hore, 0px);
    background: #FFFFFF;
}
