/* s1ber rich text editor + extended markdown output (forum posts, announcements, previews). */

/* ---------- rendered content (forum + preview) ---------- */
.md h2, .md .md-h:is(h2) { margin: 18px 0 10px; font-size: 21px; line-height: 1.25; letter-spacing: -.01em; }
.md h3 { font-size: 17px; }
.md s { opacity: .75; }
.md u { text-underline-offset: 3px; }
.md .md-mark, .md-mark { background: rgb(250 204 21 / .28); color: inherit; border-radius: 3px; padding: 0 .18em; box-shadow: inset 0 -2px 0 rgb(250 204 21 / .5); }
.md-c-red { color: #f2667a } .md-c-orange { color: #fb923c } .md-c-yellow { color: #facc15 } .md-c-green { color: #34d399 } .md-c-cyan { color: #22d3ee }
.md-c-blue { color: #60a5fa } .md-c-purple { color: #a78bfa } .md-c-pink { color: #f472b6 } .md-c-gray { color: #94a3b8 }
.md-sz-lg { font-size: 1.28em; line-height: 1.3; } .md-sz-sm { font-size: .84em; }
.md-al-left { text-align: left } .md-al-center { text-align: center } .md-al-right { text-align: right } .md-al-justify { text-align: justify; hyphens: auto; }
.md-al-center .md-img, .md-al-right .md-img { display: inline-block; }
.md .md-tasks { list-style: none; padding-left: 4px; margin: 0 0 10px; }
.md .md-tasks li { display: flex; gap: 8px; align-items: flex-start; margin: 3px 0; }
.md .md-tasks li.done { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.md-check { flex: none; width: 16px; height: 16px; margin-top: 3px; border: 1.5px solid var(--line-2); border-radius: 4px; display: inline-grid; place-items: center; }
.md-check.on { background: var(--ok); border-color: var(--ok); }
.md-check.on::after { content: ""; width: 8px; height: 4px; border: solid #062018; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.md-box { --bx: var(--info); border: 1px solid color-mix(in srgb, var(--bx) 45%, transparent); background: color-mix(in srgb, var(--bx) 9%, transparent); border-left: 4px solid var(--bx); border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; }
.md-box-h { font-weight: 700; color: var(--bx); margin-bottom: 4px; }
.md-box-b > :last-child { margin-bottom: 0; }
.md-box-tip { --bx: var(--warn) } .md-box-warn { --bx: #fb923c } .md-box-danger { --bx: var(--bad) } .md-box-success { --bx: var(--ok) }
.md-table-wrap { overflow-x: auto; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 8px; }
.md-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.md-table th, .md-table td { padding: 7px 11px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; }
.md-table th:last-child, .md-table td:last-child { border-right: 0; }
.md-table tbody tr:last-child td { border-bottom: 0; }
.md-table th { background: var(--panel-2); text-align: left; font-weight: 700; white-space: nowrap; }
.md-table tbody tr:nth-child(even) td { background: #ffffff04; }
.md-pre { background: #060a10; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow: auto; max-height: 420px; font: 13px/1.5 var(--mono); margin: 0 0 10px; position: relative; }
.md-pre[data-lang]::before { content: attr(data-lang); position: absolute; top: 4px; right: 8px; font-size: 11px; color: var(--faint); }

/* ---------- editor ---------- */
.s1e-composer > .fm-toolbar { display: none !important; }
.s1e-host { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-2); overflow: visible; }
.s1e-host:focus-within { border-color: rgb(var(--accent-rgb) / .6); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .12); }
.s1e-bar { grid-column: 1 / -1; position: sticky; top: 0; z-index: 5; grid-row: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; background: linear-gradient(var(--panel-2), var(--panel)); border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; }
.s1e-g { display: flex; align-items: center; gap: 2px; }
.s1e-right { margin-left: auto; }
.s1e-sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 4px; }
.s1e-b { all: unset; box-sizing: border-box; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 3px; color: var(--muted); cursor: pointer; font: 600 14px/1 var(--sans); transition: background .12s, color .12s, transform .08s; }
.s1e-b:hover { background: rgb(var(--accent-rgb) / .1); color: var(--text); }
.s1e-b:active { transform: translateY(1px); }
.s1e-b:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.s1e-b[aria-pressed="true"] { background: rgb(var(--accent-rgb) / .16); color: var(--accent); }
.s1e-i { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.s1e-t { font-size: 14px; } .s1e-wide { min-width: 62px; text-align: left; font-weight: 600; }
.s1e-caret { font-size: 9px; opacity: .6; }
.s1e-acol { border-bottom: 3px solid; border-image: linear-gradient(90deg, #f2667a, #facc15, #34d399, #60a5fa, #a78bfa) 1; padding: 0 2px; }
.s1e-ta.s1e-ta { grid-column: 1; grid-row: 2; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent !important; min-height: 220px; resize: vertical; padding: 12px 14px; font: 15px/1.65 var(--sans); tab-size: 4; }
.s1e-prev { display: none; padding: 12px 16px; min-height: 220px; max-height: 70vh; overflow: auto; border-left: 1px solid var(--line); background: rgb(0 0 0 / .14); }
.s1e-host[data-view="split"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.s1e-host[data-view="split"] .s1e-prev { display: block; grid-column: 2; grid-row: 2; }
.s1e-host[data-view="split"] .s1e-ta { max-height: 70vh; }
.s1e-host[data-view="preview"] .s1e-ta { position: absolute; opacity: 0; pointer-events: none; height: 0 !important; min-height: 0; }
.s1e-host[data-view="preview"] .s1e-prev { display: block; border-left: 0; grid-column: 1 / -1; grid-row: 2; }
.s1e-stat { grid-column: 1 / -1; grid-row: 3; font: 12px var(--sans); color: var(--faint); padding: 5px 12px; border-top: 1px solid var(--line); text-align: right; }
.s1e-stat.warn { color: var(--warn); }
.s1e-host.s1e-full { position: fixed; inset: 12px; z-index: 1000; grid-template-rows: auto 1fr auto; box-shadow: 0 30px 80px rgb(0 0 0 / .6); background: var(--bg); }
.s1e-host.s1e-full .s1e-bar { top: 0; }
.s1e-host.s1e-full .s1e-ta, .s1e-host.s1e-full .s1e-prev { max-height: none; height: auto !important; min-height: 0; resize: none; }
.s1e-host.s1e-full[data-view="split"] .s1e-prev { grid-row: 2; }
html.s1e-noscroll { overflow: hidden; }
.s1e-pop { position: absolute; z-index: 30; min-width: 200px; max-width: min(320px, 92vw); padding: 8px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 16px 40px rgb(0 0 0 / .5); animation: s1e-in .12s ease-out; }
@keyframes s1e-in { from { opacity: 0; transform: translateY(-4px); } }
.s1e-pop-t { font: 700 11px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 4px 4px 6px; }
.s1e-menu { display: flex; flex-direction: column; }
.s1e-menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.s1e-mi { all: unset; cursor: pointer; padding: 7px 10px; border-radius: 6px; color: var(--text); font: 14px var(--sans); }
.s1e-mi:hover, .s1e-mi:focus-visible { background: rgb(var(--accent-rgb) / .12); }
.s1e-h1 { font-size: 20px; font-weight: 700; } .s1e-h2 { font-size: 17px; font-weight: 700; } .s1e-h3 { font-size: 15px; font-weight: 700; }
.s1e-swatches { display: grid; grid-template-columns: repeat(9, 24px); gap: 5px; padding: 0 4px 8px; }
.s1e-sw { all: unset; width: 24px; height: 24px; border-radius: 6px; cursor: pointer; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .15); transition: transform .1s; }
.s1e-sw:hover { transform: scale(1.15); }
.s1e-sw-red { background: #f2667a } .s1e-sw-orange { background: #fb923c } .s1e-sw-yellow { background: #facc15 } .s1e-sw-green { background: #34d399 } .s1e-sw-cyan { background: #22d3ee }
.s1e-sw-blue { background: #60a5fa } .s1e-sw-purple { background: #a78bfa } .s1e-sw-pink { background: #f472b6 } .s1e-sw-gray { background: #94a3b8 }
.s1e-grid { display: grid; gap: 3px; padding: 0 4px 6px; }
.s1e-cell { all: unset; width: 18px; height: 18px; border: 1px solid var(--line-2); border-radius: 3px; cursor: pointer; }
.s1e-cell.on { background: rgb(var(--accent-rgb) / .35); border-color: var(--accent); }
.s1e-emoji { display: grid; grid-template-columns: repeat(10, 28px); gap: 2px; }
.s1e-em { all: unset; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; cursor: pointer; font-size: 18px; }
.s1e-em:hover { background: rgb(var(--accent-rgb) / .12); }
.s1e-link { display: flex; flex-direction: column; gap: 6px; width: 260px; }
.s1e-in.bad { border-color: var(--bad); }
.s1e-help table { width: 100%; font-size: 13px; border-collapse: collapse; }
.s1e-help td { padding: 3px 4px; } .s1e-help kbd { font: 11px var(--mono); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.s1e-toast { position: absolute; right: 12px; bottom: 34px; z-index: 31; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); font: 13px var(--sans); padding: 7px 12px; border-radius: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / .4); animation: s1e-in .15s ease-out; }
@media (max-width: 980px) { .s1e-hide-sm { display: none; } .s1e-host[data-view="split"] { grid-template-columns: minmax(0, 1fr); } .s1e-host[data-view="split"] .s1e-prev { display: none; } }
@media (max-width: 600px) { .s1e-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; } .s1e-right { margin-left: 0; } .s1e-wide { min-width: 0; } }
@media (prefers-reduced-motion: reduce) { .s1e-pop, .s1e-toast { animation: none; } .s1e-b, .s1e-sw { transition: none; } }
/* image upload is disabled: never show the forum's own image controls */
.fm-toolbar input[type=file], .fm-toolbar [title*="Görsel"], .fm-toolbar [aria-label*="Görsel"] { display: none !important; }
/* admin edit (s1-forum-admin.v1.js) */
.s1fa-btn { margin-left: auto; }
.s1fa-ov { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; background: rgb(2 5 10 / .72); backdrop-filter: blur(6px); }
.s1fa-box { width: min(980px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.s1fa-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
/* new topic / reply: use the full page width and a tall editor so the live preview is easy to read */
.card:has(> .s1e-composer) { max-width: none !important; }
.s1e-composer .s1e-ta, .s1e-composer .s1e-prev { min-height: max(320px, 58vh); }
.s1e-composer .s1e-host[data-view="split"] .s1e-ta, .s1e-composer .s1e-host[data-view="split"] .s1e-prev { max-height: 78vh; }
/* image drop target + upload in progress */
.s1e-host.s1e-drop { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .25); }
.s1e-host.s1e-drop .s1e-ta { background: rgb(var(--accent-rgb) / .06) !important; }
.s1e-host.s1e-busy .s1e-stat::before { content: "⏳ görsel yükleniyor · "; color: var(--accent); }
.md .md-img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.s1fa-toast { position: fixed; right: 16px; bottom: 16px; z-index: 2100; max-width: min(420px, calc(100vw - 32px)); padding: 12px 14px; font-size: 14px; border-color: var(--warn); }
/* forum staff tools (s1-forum-staff.v1.js) */
.s1fs-btn { margin-left: auto; }
.s1fs-menu { position: absolute; z-index: 2050; width: 220px; padding: 6px; display: grid; gap: 2px; box-shadow: 0 14px 36px rgb(0 0 0 / .45); }
.s1fs-mi { text-align: left; background: none; border: 0; color: inherit; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 14px; }
.s1fs-mi:hover, .s1fs-mi:focus-visible { background: var(--panel-2, #131d2c); outline: none; }
.s1fs-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 12px; padding: 8px 10px; border: 1px dashed var(--line-2, #2a3a52); border-radius: 10px; }
.s1fs-field { display: grid; gap: 4px; }
.s1fs-pendbtn { position: fixed; left: 16px; bottom: 16px; z-index: 1500; box-shadow: 0 8px 24px rgb(0 0 0 / .35); }
.s1fs-pend { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line, #1e2a3c); }
.s1fs-pend-body { white-space: pre-wrap; max-height: 160px; overflow: auto; color: var(--muted, #8193a9); }
.s1fa-toast.s1fs-bad { border-color: var(--bad, #ef4444); }
