/* Shared article stylesheet: public blog pages (news.html, news-detail.html) and the admin editor.
   Served from the site root (/blog.css) in dev and prod. */

/* ---------- article body ---------- */
.post-body, .ProseMirror { font-size: 1.0625rem; line-height: 1.75; word-wrap: break-word; }
.post-body > * + *, .ProseMirror > * + * { margin-top: 1.1em; }
.post-body h2, .ProseMirror h2 { font-size: 1.85rem; line-height: 1.15; font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em; margin-top: 2.2em; scroll-margin-top: 6rem; }
.post-body h3, .ProseMirror h3 { font-size: 1.35rem; line-height: 1.25; font-weight: 800; margin-top: 1.8em; scroll-margin-top: 6rem; }
.post-body h4, .ProseMirror h4 { font-size: 1.1rem; font-weight: 700; margin-top: 1.5em; text-transform: uppercase; letter-spacing: 0.04em; }
.post-body a, .ProseMirror a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.post-body a:hover { background: #FF9F1C; }
.post-body ul, .ProseMirror ul { list-style: square; padding-inline-start: 1.5em; }
.post-body ol, .ProseMirror ol { list-style: decimal; padding-inline-start: 1.5em; }
.post-body li + li, .ProseMirror li + li { margin-top: 0.35em; }
.post-body blockquote, .ProseMirror blockquote { border-inline-start: 6px solid #121212; padding: 0.5em 1.25em; background: rgba(255, 159, 28, 0.12); font-weight: 600; }
.post-body hr, .ProseMirror hr { border: 0; border-top: 4px solid #121212; margin: 2.5em 0; }
.post-body img, .ProseMirror img { max-width: 100%; height: auto; border: 4px solid #121212; box-shadow: 6px 6px 0 #121212; }
.post-body figure, .ProseMirror figure { margin: 2em auto; }
.post-body figure.image img, .ProseMirror figure.image img { width: 100%; }
.post-body figcaption, .ProseMirror figcaption { font-family: "JetBrains Mono", "IBM Plex Sans Arabic", monospace; font-size: 0.75rem; opacity: 0.7; margin-top: 0.5em; text-align: center; }
.post-body mark, .ProseMirror mark { background: #33FF57; padding: 0 0.15em; }
.post-body kbd, .ProseMirror kbd { font-family: "JetBrains Mono", monospace; font-size: 0.85em; border: 2px solid #121212; border-bottom-width: 4px; padding: 0 0.35em; }
.post-body code:not(pre code), .ProseMirror code:not(pre code) { font-family: "JetBrains Mono", monospace; font-size: 0.875em; background: rgba(18, 18, 18, 0.08); padding: 0.1em 0.35em; border: 1px solid rgba(18, 18, 18, 0.2); }
.post-body .lead { font-size: 1.2em; font-weight: 500; }

/* tables */
.post-body table, .ProseMirror table { width: 100%; border-collapse: collapse; font-size: 0.925em; border: 3px solid #121212; margin: 1.5em 0; overflow: hidden; }
.post-body th, .ProseMirror th { background: #121212; color: #FFFDF5; text-align: start; font-family: "JetBrains Mono", "IBM Plex Sans Arabic", monospace; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.post-body th, .post-body td, .ProseMirror th, .ProseMirror td { border: 2px solid #121212; padding: 0.55em 0.75em; vertical-align: top; }
.post-body tr:nth-child(even) td { background: rgba(18, 18, 18, 0.04); }
.table-wrap { overflow-x: auto; }

/* task lists */
.post-body ul[data-type="taskList"], .ProseMirror ul[data-type="taskList"] { list-style: none; padding-inline-start: 0; }
.post-body li[data-type="taskItem"], .ProseMirror li[data-type="taskItem"] { display: flex; gap: 0.6em; align-items: flex-start; }
.post-body li[data-type="taskItem"] > label, .ProseMirror li[data-type="taskItem"] > label { flex: 0 0 auto; margin-top: 0.25em; }
.post-body li[data-type="taskItem"] input[type="checkbox"] { width: 1em; height: 1em; accent-color: #121212; }

/* callouts */
.post-body aside[data-type="callout"], .ProseMirror aside[data-type="callout"] { border: 3px solid #121212; padding: 1em 1.25em; box-shadow: 5px 5px 0 #121212; background: #fff; }
.post-body aside[data-type="callout"]::before, .ProseMirror aside[data-type="callout"]::before { display: block; font-family: "JetBrains Mono", monospace; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5em; content: "// note"; }
.post-body aside[data-variant="warning"], .ProseMirror aside[data-variant="warning"] { background: #fff1f1; border-color: #FF2A2A; }
.post-body aside[data-variant="warning"]::before, .ProseMirror aside[data-variant="warning"]::before { content: "// warning"; color: #FF2A2A; }
.post-body aside[data-variant="tip"], .ProseMirror aside[data-variant="tip"] { background: #f0fff3; }
.post-body aside[data-variant="tip"]::before, .ProseMirror aside[data-variant="tip"]::before { content: "// tip"; }
.post-body aside[data-type="callout"] > :first-child { margin-top: 0; }

/* code blocks: neo-brutalist token theme */
.post-body pre, .ProseMirror pre { position: relative; background: #121212; color: #FFFDF5; border: 4px solid #121212; box-shadow: 6px 6px 0 #FF9F1C; padding: 1.25em 1.25em 1.25em; overflow-x: auto; font-family: "JetBrains Mono", monospace; font-size: 0.85rem; line-height: 1.6; direction: ltr; text-align: left; unicode-bidi: isolate; tab-size: 4; }
.post-body pre code, .ProseMirror pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.post-body pre[data-language]::before, .ProseMirror pre[data-language]::before { content: attr(data-language); position: absolute; top: 0; inset-inline-end: 0; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; padding: 0.2em 0.6em; background: #FF9F1C; color: #121212; font-weight: 700; }
.post-body pre .copy-code { position: absolute; bottom: 0.5em; inset-inline-end: 0.5em; font-family: "JetBrains Mono", monospace; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; background: #FFFDF5; color: #121212; border: 2px solid #121212; padding: 0.25em 0.6em; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.post-body pre:hover .copy-code, .post-body pre:focus-within .copy-code { opacity: 1; }
.post-body pre .copy-code:hover { background: #33FF57; }
.hljs-comment, .hljs-quote { color: #8a8a8a; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-section, .hljs-link, .hljs-meta { color: #FF70A6; }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-template-tag { color: #33FF57; }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-variable, .hljs-template-variable, .hljs-selector-attr, .hljs-selector-pseudo { color: #FF9F1C; }
.hljs-title, .hljs-name, .hljs-selector-id, .hljs-selector-class, .hljs-type, .hljs-class .hljs-title, .hljs-title.class_, .hljs-title.function_ { color: #3B82F6; }
.hljs-built_in, .hljs-builtin-name, .hljs-tag { color: #A855F7; }
.hljs-deletion { color: #FF2A2A; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* table of contents */
.post-toc { font-family: "JetBrains Mono", "IBM Plex Sans Arabic", monospace; font-size: 0.75rem; }
.post-toc a { display: block; padding: 0.25em 0; opacity: 0.7; text-decoration: none; border-inline-start: 3px solid transparent; padding-inline-start: 0.75em; }
.post-toc a[data-level="3"] { padding-inline-start: 1.75em; font-size: 0.7rem; }
.post-toc a:hover, .post-toc a.active { opacity: 1; border-color: #FF9F1C; font-weight: 700; }

/* ---------- RTL ---------- */
html[dir="rtl"] .post-body, html[dir="rtl"] .ProseMirror { font-family: "IBM Plex Sans Arabic", "Space Grotesk", sans-serif; }
html[dir="rtl"] .post-body h2, html[dir="rtl"] .post-body h3, html[dir="rtl"] .post-body h4,
html[dir="rtl"] .ProseMirror h2, html[dir="rtl"] .ProseMirror h3, html[dir="rtl"] .ProseMirror h4 { letter-spacing: 0; text-transform: none; }
html[dir="rtl"] .post-body table, html[dir="rtl"] .ProseMirror table { direction: ltr; }
html[dir="rtl"] .post-body th, html[dir="rtl"] .post-body td, html[dir="rtl"] .ProseMirror th, html[dir="rtl"] .ProseMirror td { unicode-bidi: plaintext; }
[dir="rtl"] .ProseMirror, .ProseMirror[dir="rtl"] { font-family: "IBM Plex Sans Arabic", "Space Grotesk", sans-serif; }
.ProseMirror [dir="rtl"] { text-align: right; }
.ProseMirror [dir="ltr"] { text-align: left; }

/* ---------- editor-only ---------- */
.ProseMirror { outline: none; min-height: 24rem; padding: 1.25rem; }
.ProseMirror p.is-editor-empty:first-child::before { content: attr(data-placeholder); float: inline-start; color: #8a8a8a; pointer-events: none; height: 0; }
.ProseMirror .ProseMirror-selectednode { outline: 3px solid #FF9F1C; }
.ProseMirror .search-match { background: rgba(255, 159, 28, 0.45); }
.ProseMirror .search-match-current { background: #FF9F1C; }
.ProseMirror .selectedCell::after { content: ""; position: absolute; inset: 0; background: rgba(59, 130, 246, 0.15); pointer-events: none; }
.ProseMirror td, .ProseMirror th { position: relative; min-width: 4em; }
.ProseMirror .column-resize-handle { position: absolute; inset-inline-end: -2px; top: 0; bottom: 0; width: 4px; background: #FF9F1C; pointer-events: none; }
.ProseMirror.resize-cursor { cursor: col-resize; }
