/* ==================================================================
   rich-text.css : the extras the PROMO and MOMENTS editors add, and how they show on the pages.
   Ported from SHOWTIME! (showtime.css). Loaded by includes/header.php (so every page shows fonts, sizes and tight lines),
   by quill_paste_script() (so the editor's own buttons and panels are styled) and by the two preview pages.
   Fonts: assets/js/quill-format.js. Their Google Fonts address is rich_fonts_url() in includes/functions.php.
   ================================================================== */

/* Alignment: Quill writes classes (ql-align-*). style.css already has these; repeated so a page that does not load it still shows them. */
.ql-align-center  { text-align: center; }
.ql-align-right   { text-align: right; }
.ql-align-justify { text-align: justify; }


/* ---- Enter once = a new line, Enter twice = a new paragraph (assets/js/quill-enter.js) ----
   A line typed with a single Enter carries the class ql-tight-1: it sits directly under the line above, with
   no gap. A paragraph without it (everything written before this, and anything after a second Enter) is spaced
   exactly as it always was. */
p.ql-tight-1 { margin-top: 0 !important; }
p:has(+ p.ql-tight-1) { margin-bottom: 0 !important; }
/* In the editor itself paragraphs are flush, so a real paragraph break after a run of tight lines shows a gap. */
.ql-editor p.ql-tight-1 + p:not(.ql-tight-1) { margin-top: 0.9em; }

/* ---------- Fonts, exact sizes, indent and sub/superscript from the editors ----------
   Fonts are classes (ql-font-NAME), exact sizes are inline style font-size: Npx (kept by sanitize_rich_text),
   indent is ql-indent-N, sub/superscript are <sub>/<sup>. Here, outside the editor's stylesheet, so they show on every page.
   The Google fonts are loaded by includes/header.php. Keep this list in step with assets/js/quill-format.js. */
.ql-font-georgia { font-family: Georgia, 'Times New Roman', serif; }
.ql-font-times { font-family: 'Times New Roman', Times, serif; }
.ql-font-courier { font-family: 'Courier New', Courier, monospace; }
.ql-font-anton { font-family: 'Anton', Impact, sans-serif; }
.ql-font-bebas { font-family: 'Bebas Neue', Impact, sans-serif; }
.ql-font-oswald { font-family: 'Oswald', sans-serif; }
.ql-font-playfair { font-family: 'Playfair Display', Georgia, serif; }
.ql-font-cinzel { font-family: 'Cinzel', Georgia, serif; }
.ql-font-abril { font-family: 'Abril Fatface', Georgia, serif; }
.ql-font-merriweather { font-family: 'Merriweather', Georgia, serif; }
.ql-font-slab { font-family: 'Roboto Slab', Georgia, serif; }
.ql-font-lobster { font-family: 'Lobster', cursive; }
.ql-font-pacifico { font-family: 'Pacifico', cursive; }
.ql-font-caveat { font-family: 'Caveat', cursive; }
.ql-font-marker { font-family: 'Permanent Marker', cursive; }
.ql-font-special { font-family: 'Special Elite', 'Courier New', monospace; }
.ql-font-bangers { font-family: 'Bangers', Impact, sans-serif; }
.ql-font-orbitron { font-family: 'Orbitron', sans-serif; }
.ql-font-creepster { font-family: 'Creepster', cursive; }

/* Names in the editor's Font menu, each shown in its own font. */
.ql-snow .ql-picker.ql-font { width: 118px; }
.ql-snow .ql-picker.ql-font .ql-picker-label:not([data-value])::before, .ql-snow .ql-picker.ql-font .ql-picker-item:not([data-value])::before { content: 'Default font'; font-family: inherit; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="georgia"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="georgia"]::before { content: 'Georgia'; font-family: Georgia, 'Times New Roman', serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="times"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="times"]::before { content: 'Times'; font-family: 'Times New Roman', Times, serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="courier"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="courier"]::before { content: 'Typewriter'; font-family: 'Courier New', Courier, monospace; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="anton"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="anton"]::before { content: 'Anton'; font-family: 'Anton', Impact, sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="bebas"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="bebas"]::before { content: 'Bebas Neue'; font-family: 'Bebas Neue', Impact, sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="oswald"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="oswald"]::before { content: 'Oswald'; font-family: 'Oswald', sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="playfair"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="playfair"]::before { content: 'Playfair Display'; font-family: 'Playfair Display', Georgia, serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="cinzel"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="cinzel"]::before { content: 'Cinzel'; font-family: 'Cinzel', Georgia, serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="abril"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="abril"]::before { content: 'Abril Fatface'; font-family: 'Abril Fatface', Georgia, serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="merriweather"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="merriweather"]::before { content: 'Merriweather'; font-family: 'Merriweather', Georgia, serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="slab"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="slab"]::before { content: 'Roboto Slab'; font-family: 'Roboto Slab', Georgia, serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="lobster"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="lobster"]::before { content: 'Lobster'; font-family: 'Lobster', cursive; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="pacifico"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="pacifico"]::before { content: 'Pacifico'; font-family: 'Pacifico', cursive; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="caveat"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="caveat"]::before { content: 'Caveat'; font-family: 'Caveat', cursive; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="marker"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="marker"]::before { content: 'Permanent Marker'; font-family: 'Permanent Marker', cursive; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="special"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="special"]::before { content: 'Special Elite'; font-family: 'Special Elite', 'Courier New', monospace; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="bangers"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="bangers"]::before { content: 'Bangers'; font-family: 'Bangers', Impact, sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="orbitron"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="orbitron"]::before { content: 'Orbitron'; font-family: 'Orbitron', sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="creepster"]::before, .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="creepster"]::before { content: 'Creepster'; font-family: 'Creepster', cursive; }

/* Exact sizes: the menu shows the number. */
.ql-snow .ql-picker.ql-fsize { width: 74px; }
.ql-snow .ql-picker.ql-fsize .ql-picker-label::before, .ql-snow .ql-picker.ql-fsize .ql-picker-item::before { content: 'Size'; }
.ql-snow .ql-picker.ql-fsize .ql-picker-label[data-value]::before, .ql-snow .ql-picker.ql-fsize .ql-picker-item[data-value]::before { content: attr(data-value); }
.ql-snow .ql-picker.ql-fsize .ql-picker-options { max-height: 260px; overflow-y: auto; }

/* Indent: Quill adds ql-indent-1 ... ql-indent-8. */
.ql-indent-1 { padding-left: 3em; } .ql-indent-2 { padding-left: 6em; } .ql-indent-3 { padding-left: 9em; } .ql-indent-4 { padding-left: 12em; }
.ql-indent-5 { padding-left: 15em; } .ql-indent-6 { padding-left: 18em; } .ql-indent-7 { padding-left: 21em; } .ql-indent-8 { padding-left: 24em; }
li.ql-indent-1, li.ql-indent-2, li.ql-indent-3, li.ql-indent-4, li.ql-indent-5, li.ql-indent-6, li.ql-indent-7, li.ql-indent-8 { padding-left: 0; }
li.ql-indent-1 { margin-left: 1.5em; } li.ql-indent-2 { margin-left: 3em; } li.ql-indent-3 { margin-left: 4.5em; } li.ql-indent-4 { margin-left: 6em; }
li.ql-indent-5 { margin-left: 7.5em; } li.ql-indent-6 { margin-left: 9em; } li.ql-indent-7 { margin-left: 10.5em; } li.ql-indent-8 { margin-left: 12em; }
@media (max-width: 600px) { .ql-indent-3, .ql-indent-4, .ql-indent-5, .ql-indent-6, .ql-indent-7, .ql-indent-8 { padding-left: 4em; } }

/* The custom hex colour button and its small panel. */
.ql-snow .ql-toolbar button.ql-stwhex, .ql-toolbar.ql-snow button.ql-stwhex { width: auto; padding: 3px 7px; font: 700 12px/1 sans-serif; }
.ql-toolbar.ql-snow button.ql-stwhex::before { content: '#Hex'; }
.stw-hexpop { position: absolute; z-index: 100000; background: #17171a; color: #f3e9ee; border: 1px solid var(--accent, #e11d2e); border-radius: 8px; padding: 12px; width: 232px; box-shadow: 0 10px 30px rgba(0,0,0,.6); font: 13px/1.3 system-ui, sans-serif; }
.stw-hexpop label { display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 13px; }
.stw-hexpop .row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.stw-hexpop input[type=color] { width: 44px; height: 34px; padding: 0; border: 1px solid #555; background: none; cursor: pointer; }
.stw-hexpop input[type=text] { flex: 1; min-width: 0; padding: 7px 8px; background: #0c0c0e; color: #fff; border: 1px solid #555; border-radius: 4px; font: 14px monospace; text-transform: lowercase; }
.stw-hexpop button { padding: 7px 12px; border: 0; border-radius: 4px; background: var(--accent, #e11d2e); color: #09090b; font: 700 12px sans-serif; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.stw-hexpop button.ghost { background: transparent; color: #f3e9ee; border: 1px solid #666; }
.stw-hexpop .msg { margin-top: 8px; color: #ff8c8c; min-height: 1em; font-size: 12px; }

/* ---------- Live preview panel under an editor (assets/js/live-preview.js) ---------- */
.stw-live { margin: 10px 0 14px; border: 1px solid color-mix(in srgb, var(--accent, #e11d2e) 40%, transparent); border-radius: 8px; overflow: hidden; background: #0c0c0e; }
.stw-live-bar { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; font: 600 12px/1.2 system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: #f0a0a8; margin: 0; }
.stw-live-bar input { width: auto; margin: 0; }
.stw-live-bar small { font-weight: 400; letter-spacing: 0; text-transform: none; color: #999; margin-left: 4px; }
.stw-live-box { border-top: 1px solid color-mix(in srgb, var(--accent, #e11d2e) 30%, transparent); }
.stw-live-box[hidden] { display: none; }
.stw-live-frame { display: block; width: 100%; border: 0; min-height: 140px; background: #09090b; }

/* Dialogue and Description buttons (assets/js/quill-format.js). */
.ql-toolbar.ql-snow button.ql-stwcont, .ql-toolbar.ql-snow button.ql-stwdlg, .ql-toolbar.ql-snow button.ql-stwdlgx, .ql-toolbar.ql-snow button.ql-stwdesc, .ql-toolbar.ql-snow button.ql-stwcom, .ql-toolbar.ql-snow button.ql-stwsfx, .ql-toolbar.ql-snow button.ql-stwmedia { width: auto; padding: 3px 8px; font: 700 12px/1 sans-serif; border: 1px solid color-mix(in srgb, var(--accent, #e11d2e) 55%, transparent); border-radius: 4px; margin-right: 4px; }
.ql-toolbar.ql-snow button.ql-stwdlg::before { content: 'Dialogue'; }
.ql-toolbar.ql-snow button.ql-stwdesc::before { content: 'Description'; }
.ql-toolbar.ql-snow button.ql-stwcont::before { content: 'Continue'; }
.ql-toolbar.ql-snow button.ql-stwdlgx::before { content: 'Other Dialogue'; }
.ql-toolbar.ql-snow button.ql-stwcom::before { content: 'Commentary'; }
.ql-toolbar.ql-snow button.ql-stwsfx::before { content: 'SFX'; }
.ql-toolbar.ql-snow button.ql-stwmedia::before { content: 'Image / Video'; }
.ql-toolbar.ql-snow button.ql-stwcont:hover, .ql-toolbar.ql-snow button.ql-stwdlg:hover, .ql-toolbar.ql-snow button.ql-stwdlgx:hover, .ql-toolbar.ql-snow button.ql-stwdesc:hover, .ql-toolbar.ql-snow button.ql-stwcom:hover, .ql-toolbar.ql-snow button.ql-stwsfx:hover, .ql-toolbar.ql-snow button.ql-stwmedia:hover { color: var(--accent, #e11d2e); }

/* Name suggestions under the Other Dialogue box. */
.stw-sugg { margin-top: 6px; display: flex; flex-direction: column; border: 1px solid #34343a; border-radius: 4px; overflow: hidden; }
.stw-sugg:empty { display: none; }
.stw-sugg .sg { display: flex; align-items: center; gap: 8px; text-align: left; width: 100%; padding: 7px 9px; background: #0c0c0e; color: #f3e9ee; border: 0; border-bottom: 1px solid #26262b; border-radius: 0; font: 13px system-ui, sans-serif; letter-spacing: 0; text-transform: none; }
.stw-sugg .sg:last-child { border-bottom: 0; }
.stw-sugg .sg.on, .stw-sugg .sg:hover { background: #2a1d20; }
.stw-sugg .sg i { width: 12px; height: 12px; border-radius: 50%; flex: none; }

/* Subscript and superscript (the toolbar writes <sub> and <sup>). */
.rich-body sub, .ql-editor sub { font-size: 0.75em; vertical-align: sub; line-height: 0; }
.rich-body sup, .ql-editor sup { font-size: 0.75em; vertical-align: super; line-height: 0; }

/* the Image / Video picker (Moments editor) */
.stw-hexpop.stw-mediapop { width: 328px; }
.stw-mediapop .stw-medialist { margin-top: 8px; max-height: 280px; overflow-y: auto; border: 1px solid #34343a; border-radius: 4px; }
.stw-mediapop .stw-medialist:empty { display: none; }
.stw-mediapop .mi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; background: #0c0c0e; color: #f3e9ee; border: 0; border-bottom: 1px solid #26262b; border-radius: 0; font: 13px system-ui, sans-serif; letter-spacing: 0; text-transform: none; text-align: left; }
.stw-mediapop .mi:last-child { border-bottom: 0; }
.stw-mediapop .mi:hover { background: #2a1d20; }
.stw-mediapop .mi img, .stw-mediapop .mi .vid { width: 44px; height: 32px; flex: none; object-fit: cover; border-radius: 3px; background: #26262b; display: grid; place-items: center; color: #f3e9ee; font-size: 14px; }
.stw-mediapop .mi .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stw-mediapop .mi .kd { font: 700 10px sans-serif; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
