/* WriteUpCafe — writeup content blocks (editor v2, 2026-11-16).
   Shared by the post page (.wp-body), the draft preview (.post-body) and the editor (.ck-content) so a writeup looks
   the same while writing and when published. Only blocks the v2 editor can create; base typography stays in
   writeup-v2.css. Colours follow wuc-tokens (parchment). */

:is(.wp-body, .post-body, .ck-content) mark,
:is(.wp-body, .post-body, .ck-content) mark.marker-yellow {
  background: #f9e3a8; color: inherit; padding: 0 2px; border-radius: 2px;
}

/* Callout boxes: <p class="wuc-callout wuc-callout--tip|note|warn"> */
:is(.wp-body, .post-body, .ck-content) p.wuc-callout {
  position: relative; margin: 24px 0; padding: 16px 18px 16px 50px; border-radius: 12px;
  font-size: 16px; line-height: 1.6;
  background: rgba(232, 122, 53, .08); border: 1px solid rgba(232, 122, 53, .3);
}
:is(.wp-body, .post-body, .ck-content) p.wuc-callout::after {
  content: ""; position: absolute; left: 18px; top: 18px; width: 20px; height: 20px;
  background-color: #a0622d;
  -webkit-mask: var(--wuc-callout-icon) center / contain no-repeat; mask: var(--wuc-callout-icon) center / contain no-repeat;
}
:is(.wp-body, .post-body, .ck-content) p.wuc-callout--tip {
  --wuc-callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 22h4M12 2a7 7 0 0 0-4 12.7V17h8v-2.3A7 7 0 0 0 12 2z'/%3E%3C/svg%3E");
}
:is(.wp-body, .post-body, .ck-content) p.wuc-callout--note {
  background: rgba(47, 93, 140, .07); border-color: rgba(47, 93, 140, .28);
  --wuc-callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E");
}
:is(.wp-body, .post-body, .ck-content) p.wuc-callout--note::after { background-color: #2f5d8c; }
:is(.wp-body, .post-body, .ck-content) p.wuc-callout--warn {
  background: rgba(154, 91, 0, .08); border-color: rgba(154, 91, 0, .3);
  --wuc-callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0zM12 9v4M12 17h.01'/%3E%3C/svg%3E");
}
:is(.wp-body, .post-body, .ck-content) p.wuc-callout--warn::after { background-color: #8a5200; }

/* Checklists (CKEditor todo list) */
:is(.wp-body, .post-body, .ck-content) ul.todo-list { list-style: none; padding-left: 0; margin: 20px 0; }
:is(.wp-body, .post-body, .ck-content) ul.todo-list li { margin: 8px 0; padding-left: 0; }
:is(.wp-body, .post-body, .ck-content) ul.todo-list li::before { content: none; display: none; }
:is(.wp-body, .post-body) ul.todo-list label { display: inline-flex; gap: 10px; align-items: baseline; }
:is(.wp-body, .post-body) ul.todo-list input[type="checkbox"] {
  width: 18px; height: 18px; margin: 0; accent-color: #e87a35; transform: translateY(3px); flex: 0 0 18px;
}

/* Code */
:is(.wp-body, .post-body, .ck-content) pre {
  margin: 24px 0; padding: 16px 18px; border-radius: 12px; background: #1a0f06; color: #f0e6d8;
  font: 14px/1.65 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; white-space: pre;
  border: 0; tab-size: 4;
}
:is(.wp-body, .post-body, .ck-content) pre code { background: none; color: inherit; padding: 0; font: inherit; }
:is(.wp-body, .post-body, .ck-content) :not(pre) > code {
  background: rgba(139, 69, 19, .08); color: #8b4513; padding: 1px 6px; border-radius: 6px;
  font: .88em 'JetBrains Mono', ui-monospace, monospace;
}

/* Images: normal (default), side, full width; captions */
:is(.wp-body, .post-body) figure.image { margin: 28px 0; }
:is(.wp-body, .post-body) figure.image img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 12px; }
:is(.wp-body, .post-body, .ck-content) figure.image figcaption,
:is(.wp-body, .post-body, .ck-content) figure.table figcaption {
  margin-top: 10px; font-size: 14px; line-height: 1.5; color: #6b5a4c; text-align: center; background: none; caption-side: bottom;
}
:is(.wp-body, .post-body, .ck-content) figure.image.image-style-side {
  float: right; width: 42%; max-width: 360px; margin: 6px 0 16px 24px;
}
:is(.wp-body, .post-body, .ck-content) figure.image.image-style-full { width: 100%; max-width: none; }
:is(.wp-body, .post-body) figure.image.image-style-full img { width: 100%; }
:is(.wp-body, .post-body) h2, :is(.wp-body, .post-body) h3, :is(.wp-body, .post-body) hr,
:is(.wp-body, .post-body) figure.media, :is(.wp-body, .post-body) pre, :is(.wp-body, .post-body) table { clear: both; }
@media (max-width: 640px) {
  :is(.wp-body, .post-body, .ck-content) figure.image.image-style-side { float: none; width: 100%; max-width: none; margin: 24px 0; }
}

/* Video embeds (rendered from <oembed> by HtmlSanitizer::renderEmbeds) */
:is(.wp-body, .post-body) figure.media { margin: 28px 0; }
.wuc-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #1a0f06; }
.wuc-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Divider */
:is(.wp-body, .post-body, .ck-content) hr {
  border: 0; height: 1px; background: rgba(139, 69, 19, .25); margin: 36px auto; width: 40%;
}
