/* Article body styles. Shared by the site (.prose) and the editor iframe (.mce-content-body). */

.prose, .mce-content-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  overflow-wrap: anywhere;
}
.prose > :first-child, .mce-content-body > :first-child { margin-top: 0; }

.prose h2, .mce-content-body h2 {
  font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em;
  margin: 2.2rem 0 .8rem; padding-top: 1.2rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: 5rem;
}
.prose h3, .mce-content-body h3 { font-size: 1.1rem; font-weight: 650; margin: 1.6rem 0 .5rem; scroll-margin-top: 5rem; }
.prose h4, .mce-content-body h4 { font-size: .95rem; font-weight: 650; margin: 1.2rem 0 .4rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.prose p, .mce-content-body p { margin: 0 0 1rem; }
.prose a, .mce-content-body a { color: var(--link); text-underline-offset: 3px; }
.prose ul, .prose ol, .mce-content-body ul, .mce-content-body ol { margin: 0 0 1rem; padding-left: 1.5rem; }
.prose li, .mce-content-body li { margin: .25rem 0; }
.prose li::marker, .mce-content-body li::marker { color: var(--muted); }
.prose hr, .mce-content-body hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose img, .mce-content-body img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); }
.prose blockquote, .mce-content-body blockquote {
  margin: 0 0 1rem; padding: .6rem 1rem;
  border-left: 3px solid var(--border-strong); color: var(--muted);
}

/* Commands */
.prose code, .mce-content-body code {
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: .88em;
  padding: .12em .42em;
  border-radius: 5px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  color: var(--code-text);
  white-space: nowrap;
}
.prose code:not(pre code) { cursor: copy; }
.prose code:not(pre code):hover { border-color: var(--accent); }
.prose pre, .mce-content-body pre {
  position: relative;
  margin: 0 0 1rem; padding: 1rem 1.1rem;
  background: var(--code-block-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: .88rem; line-height: 1.55;
}
.prose pre code, .mce-content-body pre code { background: none; border: 0; padding: 0; white-space: pre; color: inherit; }

/* Tables */
.prose .table-wrap { overflow-x: auto; margin: 0 0 1.2rem; border: 1px solid var(--border); border-radius: 10px; }
.prose table, .mce-content-body table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.mce-content-body table { margin-bottom: 1rem; }
.prose th, .prose td, .mce-content-body th, .mce-content-body td {
  padding: .55rem .75rem; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.mce-content-body th, .mce-content-body td { border: 1px dashed var(--border-strong); }
.prose th, .mce-content-body th { background: var(--surface-2); font-weight: 650; font-size: .85rem; }
/* Table cells wrap between words only (the page-level 'anywhere' wrapping split short headers like MINOR). */
.prose th, .prose td { overflow-wrap: normal; word-break: normal; }
@media (max-width: 720px) {
  /* On phones, size tables to their content (each column up to ~18rem) and let them scroll sideways. */
  .prose .table-wrap table { width: max-content; min-width: 100%; }
  .prose .table-wrap td, .prose .table-wrap th { max-width: 18rem; }
}
.prose th { white-space: nowrap; }
.prose td small { white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose td + td, .prose th + th { border-left: 1px solid var(--border); }

/* Copyable player response */
.prose .kb-response, .mce-content-body .kb-response {
  position: relative;
  margin: 0 0 1.2rem;
  padding: 2.9rem 1.1rem .9rem;
  border-radius: 10px;
  background: var(--response-bg);
  border: 1px solid var(--response-border);
}
.prose .kb-response::before, .mce-content-body .kb-response::before {
  content: "Suggested player response";
  position: absolute; top: .7rem; left: 1.1rem;
  font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-text);
}
.prose .kb-response > :last-child, .mce-content-body .kb-response > :last-child { margin-bottom: 0; }

/* Callouts */
.prose .kb-callout, .mce-content-body .kb-callout {
  position: relative;
  margin: 0 0 1.2rem; padding: .8rem 1rem .8rem 2.8rem;
  border-radius: 10px; border: 1px solid; font-size: .96rem;
}
.prose .kb-callout > :last-child, .mce-content-body .kb-callout > :last-child { margin-bottom: 0; }
.prose .kb-callout::before, .mce-content-body .kb-callout::before {
  position: absolute; left: 1rem; top: .8rem; font-weight: 800;
}
.kb-info    { background: rgba(59,130,246,.10); border-color: rgba(59,130,246,.35) !important; }
.kb-info::before    { content: "i"; color: #60a5fa; font-family: Georgia, serif; font-style: italic; }
.kb-success { background: rgba(34,197,94,.09); border-color: rgba(34,197,94,.35) !important; }
.kb-success::before { content: "✓"; color: #4ade80; }
.kb-warning { background: rgba(245,158,11,.10); border-color: rgba(245,158,11,.4) !important; }
.kb-warning::before { content: "!"; color: #fbbf24; }
.kb-danger  { background: rgba(225,29,72,.10); border-color: rgba(225,29,72,.45) !important; }
.kb-danger::before  { content: "✕"; color: #fb7185; }

/* Numbered procedure */
.prose ol.kb-steps, .mce-content-body ol.kb-steps { list-style: none; padding-left: 0; counter-reset: step; }
.prose ol.kb-steps > li, .mce-content-body ol.kb-steps > li {
  counter-increment: step; position: relative;
  padding: .15rem 0 .5rem 2.6rem; margin: 0;
}
.prose ol.kb-steps > li::before, .mce-content-body ol.kb-steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: .1rem;
  width: 1.8rem; height: 1.8rem; border-radius: 50%;
  display: grid; place-items: center;
  font-size: .85rem; font-weight: 700;
  background: var(--accent); color: var(--on-accent);
}

/* Alignment classes (editor uses classes instead of inline styles) */
.align-left { text-align: left; }
.align-center { text-align: center; }
.align-right { text-align: right; }
.align-justify { text-align: justify; }
img.align-left { float: left; margin: 0 1rem .5rem 0; }
img.align-right { float: right; margin: 0 0 .5rem 1rem; }
img.align-center { display: block; margin-left: auto; margin-right: auto; }
.prose::after { content: ""; display: table; clear: both; }

/* Server-specific blocks inside a shared page: "Hollow only" / "AceRust only" */
.prose .kb-hollow, .prose .kb-acerust, .mce-content-body .kb-hollow, .mce-content-body .kb-acerust {
  position: relative;
  margin: 0 0 1.2rem;
  padding: 2.2rem 1.1rem .9rem;
  border-radius: 10px;
  border: 1px solid;
  border-left-width: 4px;
}
.prose .kb-hollow, .mce-content-body .kb-hollow { border-color: rgba(59,130,246,.45); background: rgba(37,99,235,.08); }
.prose .kb-acerust, .mce-content-body .kb-acerust { border-color: rgba(225,29,72,.45); background: rgba(225,29,72,.08); }
.prose .kb-hollow::before, .prose .kb-acerust::before, .mce-content-body .kb-hollow::before, .mce-content-body .kb-acerust::before {
  position: absolute; top: .7rem; left: 1.1rem;
  padding-left: 1.3rem;
  font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  background-repeat: no-repeat; background-size: auto 15px; background-position: left center;
  line-height: 15px;
}
.prose .kb-hollow::before, .mce-content-body .kb-hollow::before { content: "Hollow only"; color: #93c5fd; background-image: url("brand/hollow-icon.png"); }
.prose .kb-acerust::before, .mce-content-body .kb-acerust::before { content: "AceRust only"; color: #fda4af; background-image: url("brand/acerust-icon.png"); }
.prose .kb-hollow > :last-child, .prose .kb-acerust > :last-child, .mce-content-body .kb-hollow > :last-child, .mce-content-body .kb-acerust > :last-child { margin-bottom: 0; }
/* A reply box inside a server block keeps its own label */
.prose .kb-hollow .kb-response, .prose .kb-acerust .kb-response { margin-top: .4rem; }

/* Status badges at the top of a page: where the information comes from */
.prose p.kb-status, .mce-content-body p.kb-status { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.1rem; }
.prose .kb-badge, .mce-content-body .kb-badge {
  display: inline-block; padding: .15rem .6rem; border-radius: 999px; border: 1px solid;
  font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; line-height: 1.5;
}
.kb-badge.kb-official { color: #86efac; border-color: rgba(34,197,94,.45); background: rgba(34,197,94,.1); }
.kb-badge.kb-trainer  { color: #93c5fd; border-color: rgba(59,130,246,.45); background: rgba(59,130,246,.1); }
.kb-badge.kb-live     { color: #67e8f9; border-color: rgba(6,182,212,.45); background: rgba(6,182,212,.1); }
.kb-badge.kb-practice { color: #d4d4d8; border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.05); }
.kb-badge.kb-review   { color: #fcd34d; border-color: rgba(245,158,11,.45); background: rgba(245,158,11,.1); }
.kb-badge.kb-gap      { color: #fda4af; border-color: rgba(225,29,72,.45); background: rgba(225,29,72,.1); }
.kb-badge.kb-proposed { color: #d8b4fe; border-color: rgba(168,85,247,.55); background: rgba(168,85,247,.1); border-style: dashed; }

/* Long lines in templates wrap instead of running off the edge (copying still keeps the original lines) */
.prose pre, .prose pre code { white-space: pre-wrap; overflow-wrap: anywhere; }

/* "Image needed" placeholder: a spot where a screenshot would help. Replace the box with the image. */
.prose .kb-image-needed, .mce-content-body .kb-image-needed {
  position: relative; margin: 0 0 1.2rem; padding: .9rem 1rem .9rem 3rem;
  border: 2px dashed rgba(148,163,184,.45); border-radius: 10px; background: rgba(148,163,184,.06); color: var(--muted);
}
.prose .kb-image-needed::before, .mce-content-body .kb-image-needed::before {
  content: "📷"; position: absolute; left: 1rem; top: .85rem; font-size: 1.1rem; line-height: 1.4;
}
.prose .kb-image-needed::after, .mce-content-body .kb-image-needed::after {
  content: "Blur staff and player names, profile pictures and IDs before adding a screenshot.";
  display: block; margin-top: .35rem; font-size: .78rem; opacity: .8;
}
.prose .kb-image-needed > p, .mce-content-body .kb-image-needed > p { margin: 0; }
.prose .kb-image-needed strong { color: var(--text); }
