/* Demo VEditora: strona z edytorem osadzana w ramce na veditor.eu/demo. */

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #222222;
    background: #f5f7fa;
}

.demo-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 8px 16px;
    border-bottom: 1px solid #dce2ea;
    background: #ffffff;
    font-size: 14px;
    color: #566070;
}
.demo-bar p { margin: 0; }
.demo-reset { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid #8a94a3; border-radius: 8px; color: #222222; font-weight: 600; text-decoration: none; }
.demo-reset:hover { background: #eaeff5; }
.demo-reset:focus-visible, .demo-submit:focus-visible, .demo-picker button:focus-visible { outline: 3px solid #2a6fdb; outline-offset: 2px; }

.demo-main { padding: 16px; }
.demo-mode-inline .demo-main { max-width: 760px; margin: 0 auto; background: #ffffff; border-radius: 12px; margin-top: 16px; }
.demo-form { margin: 0; }
.demo-form p { margin: 12px 0 0; }
.demo-submit { min-height: 44px; padding: 0 18px; border: 0; border-radius: 8px; background: #2a6fdb; color: #ffffff; font: inherit; font-weight: 600; cursor: pointer; }
.demo-submit:hover { background: #1f5fc4; }

.demo-result { margin-top: 20px; }
.demo-result h2 { margin: 0 0 8px; font-size: 17px; }
.demo-status { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid; }
.demo-status-ok { border-color: #8fd1a8; background: #ecf8f0; color: #155c32; }
.demo-status-warn { border-color: #f0c27a; background: #fdf5e6; color: #6b4300; }
.demo-code { margin: 0 0 12px; padding: 12px; max-height: 260px; overflow: auto; border-radius: 8px; background: #101820; color: #e6edf6; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.demo-result summary { cursor: pointer; margin-bottom: 8px; }

/* Style z listy „Styl” (te same klasy dopuszcza sanitizer: demo_styles()). */
.veditor-content .lead { font-size: 1.15em; color: #3a4656; }
.veditor-content .note { padding: 10px 14px; border-left: 4px solid #2a6fdb; background: #eef4fd; border-radius: 4px; }
.veditor-content .marker { background: #fff1a8; padding: 0 2px; }
.veditor-content table.table-striped tbody tr:nth-child(odd) { background: #f3f6fa; }

/* Okno przykładowych obrazów (picker.php). */
.demo-picker { padding: 16px; background: #ffffff; }
.demo-picker p { margin: 0 0 12px; }
.demo-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.demo-picker button { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 6px; border: 1px solid #dce2ea; border-radius: 10px; background: #ffffff; font: inherit; text-align: left; cursor: pointer; }
.demo-picker button:hover { border-color: #2a6fdb; }
.demo-picker img { width: 100%; height: auto; border-radius: 6px; }

@media (prefers-color-scheme: dark) {
    body { background: #0f1620; color: #e6edf6; }
    .demo-bar, .demo-picker, .demo-mode-inline .demo-main { background: #16202c; border-color: #2a3646; color: #b8c4d4; }
    .demo-reset { color: #e6edf6; border-color: #5b6b80; }
    .demo-reset:hover { background: #1f2b3a; }
}

/* Okno VFileManagera (assets/vfm-picker.js): pasek z nazwą i zamknięciem, pod nim ramka z oknem. */
.vfm-dialog {
    width: min(1000px, calc(100vw - 32px));
    height: min(700px, calc(100vh - 32px));
    padding: 0;
    border: 1px solid #c9d1dc;
    border-radius: 8px;
    overflow: hidden;
}
.vfm-dialog[open] { display: flex; flex-direction: column; }
.vfm-dialog::backdrop { background: rgba(15, 23, 42, .55); }
.vfm-bar {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 4px 2px 12px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    font: 600 13px/1.4 system-ui, sans-serif;
    color: #334155;
}
.vfm-dialog iframe { display: block; flex: 1; width: 100%; min-height: 0; border: 0; }
.vfm-close {
    min-width: 32px;
    min-height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.vfm-close:hover { background: #e2e8f0; }
.vfm-close:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
