/* byteworkz/doc.css — byteDoc rich-text editor styles. */

.doc-shell {
    display: flex; flex-direction: column;
    height: 100%; overflow: hidden;
}

.doc-toolbar {
    /* uses .toolbar from styles.css for base look */
}
.doc-toolbar select.heading-pick { width: 96px; }

.doc-tabs { /* uses .tabs-bar */ }

.doc-editor-wrap {
    flex: 1; min-height: 0;
    overflow: auto;
    background: var(--bg-2);
    padding: 24px 0;
}
.doc-editor {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    min-height: calc(100% - 0px);
    max-width: 820px;
    margin: 0 auto;
    padding: 56px 72px 96px;
    color: var(--fg);
    font-size: 15px;
    line-height: 1.65;
    box-shadow: 0 1px 0 rgba(0,0,0,0.3), 0 8px 32px rgba(0,0,0,0.35);
    outline: none;
    border-radius: 2px;
    caret-color: var(--accent);
}
.doc-editor:focus { border-color: var(--border); }

.doc-editor h1 { font-size: 28px; margin: .8em 0 .4em; font-weight: 700; }
.doc-editor h2 { font-size: 22px; margin: .8em 0 .4em; font-weight: 600; }
.doc-editor h3 { font-size: 18px; margin: .8em 0 .4em; font-weight: 600; }
.doc-editor p  { margin: .5em 0; }
.doc-editor a  { color: var(--accent); text-decoration: underline; }
.doc-editor ul, .doc-editor ol { padding-left: 1.6em; margin: .5em 0; }
.doc-editor li { margin: .15em 0; }
.doc-editor blockquote {
    border-left: 3px solid var(--accent);
    padding: 4px 14px;
    color: var(--fg-muted);
    margin: .8em 0;
}
.doc-editor img {
    max-width: 100%;
    display: inline-block;
    border-radius: 2px;
    cursor: pointer;
}
.doc-editor img.selected { outline: 2px solid var(--accent); }

.doc-editor table {
    border-collapse: collapse;
    margin: .8em 0;
    table-layout: fixed;
    width: auto;
}
.doc-editor table td, .doc-editor table th {
    border: 1px solid var(--border);
    padding: 6px 10px;
    min-width: 48px;
    vertical-align: top;
}
.doc-editor table th {
    background: var(--surface-2);
    font-weight: 600;
}

/* Find/replace highlight */
.doc-editor mark.find-hit {
    background: rgba(253,125,0,0.35);
    color: var(--fg);
    border-radius: 2px;
    padding: 0 1px;
}
.doc-editor mark.find-hit.active {
    background: var(--accent);
    color: var(--accent-fg);
}

/* Find/Replace bar */
.doc-find-bar {
    display: flex; gap: 6px; align-items: center;
    padding: 6px 10px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.doc-find-bar input[type="text"] {
    height: 26px; padding: 0 8px;
    background: var(--bg); color: var(--fg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit; font-size: 12px;
    min-width: 0;
}
.doc-find-bar .find-count {
    font-family: var(--mono);
    color: var(--fg-muted); font-size: 11px;
    min-width: 60px; text-align: center;
}
.doc-find-bar .spacer { flex: 1; }

/* Image resize handle */
.img-resize-overlay {
    position: absolute;
    pointer-events: none;
    border: 1.5px solid var(--accent);
    box-sizing: border-box;
}
.img-resize-overlay::after {
    content: "";
    position: absolute;
    right: -5px; bottom: -5px;
    width: 10px; height: 10px;
    background: var(--accent);
    pointer-events: auto;
    cursor: nwse-resize;
}

/* Print */
@media print {
    .topbar, .doc-toolbar, .tabs-bar, .doc-find-bar, .status-bar { display: none !important; }
    .doc-editor-wrap { padding: 0; background: white; }
    .doc-editor {
        background: white; color: black;
        box-shadow: none; border: 0;
        max-width: none;
        padding: 0;
    }
    .doc-editor a { color: #0066cc; }
}
