/* Контент из CKEditor 5 (кастомные страницы). Перекрывает reset из main.css. */
.ck-content {
  color: var(--muted);
  font-weight: 500;
  font-size: 1rem;
  line-height: 150%;
  overflow-wrap: anywhere;
}
.ck-content > :first-child { margin-top: 0; }

.ck-content p { margin: 0 0 16px; color: inherit; }
.ck-content h1, .ck-content h2, .ck-content h3, .ck-content h4 {
  color: var(--text);
  line-height: 150%;
  margin: 32px 0 16px;
}
.ck-content h1 { font-size: 2.5rem; font-weight: 600; }
.ck-content h2 { font-size: 2rem; font-weight: 600; }
.ck-content h3 { font-size: 1.5rem; font-weight: 700; }
.ck-content h4 { font-size: 1.125rem; font-weight: 600; }

.ck-content strong, .ck-content b { font-weight: 700; color: var(--text); }
.ck-content em, .ck-content i { font-style: italic; }
.ck-content u { text-decoration: underline; }
.ck-content s, .ck-content strike, .ck-content del { text-decoration: line-through; }
.ck-content sub { vertical-align: sub; font-size: .75em; }
.ck-content sup { vertical-align: super; font-size: .75em; }
.ck-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.ck-content mark { padding: 0 2px; border-radius: 3px; }

.ck-content ul, .ck-content ol { margin: 0 0 16px; padding-left: 1.5em; }
.ck-content ul { list-style: disc; }
.ck-content ol { list-style: decimal; }
.ck-content ul ul { list-style: circle; }
.ck-content li { margin-bottom: 6px; }
.ck-content li::marker { color: var(--accent); }
.ck-content ul.todo-list { list-style: none; padding-left: 0; }
.ck-content .todo-list li label { display: inline-flex; gap: 8px; align-items: baseline; }

.ck-content blockquote {
  margin: 24px 0;
  padding: 8px 0 8px 20px;
  border-left: 3px solid var(--accent);
  color: var(--text);
  font-style: italic;
}

.ck-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9em;
  background: var(--bg_light);
  padding: 2px 6px;
  border-radius: 6px;
}
.ck-content pre {
  margin: 0 0 16px;
  padding: 16px;
  background: var(--bg_light);
  border-radius: 12px;
  overflow-x: auto;
}
.ck-content pre code { background: none; padding: 0; }

.ck-content hr { border: 0; height: 1px; background: var(--bg_light); margin: 32px 0; }

.ck-content figure { margin: 24px 0; }
.ck-content img { max-width: 100%; height: auto; border-radius: 12px; }
.ck-content figure.image { display: table; clear: both; margin: 24px auto; text-align: center; }
.ck-content figure.image img { display: block; margin: 0 auto; }
.ck-content figure.image_resized { max-width: 100%; display: block; }
.ck-content figure.image_resized img { width: 100%; }
.ck-content figcaption { margin-top: 8px; font-size: .875rem; color: var(--muted_alt); }
.ck-content .image-style-side,
.ck-content .image-style-align-right { float: right; margin: 0 0 16px 24px; max-width: 50%; }
.ck-content .image-style-align-left { float: left; margin: 0 24px 16px 0; max-width: 50%; }
.ck-content .image-style-align-center { margin-left: auto; margin-right: auto; }
.ck-content::after { content: ""; display: table; clear: both; }

.ck-content figure.table { display: block; overflow-x: auto; margin: 24px 0; }
.ck-content table { width: 100%; border-collapse: collapse; }
.ck-content th, .ck-content td {
  border: 1px solid var(--muted_alt);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.ck-content th { color: var(--text); font-weight: 600; background: var(--bg_light); }

.ck-content figure.media { display: block; }
.ck-content .media iframe, .ck-content oembed { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; }

.ck-content .text-tiny { font-size: .7em; }
.ck-content .text-small { font-size: .85em; }
.ck-content .text-big { font-size: 1.4em; }
.ck-content .text-huge { font-size: 1.8em; }
.ck-content .marker-yellow { background: #fdfd77; color: #1b1a1a; }
.ck-content .marker-green { background: #62f962; color: #1b1a1a; }
.ck-content .marker-pink { background: #fc7899; color: #1b1a1a; }
.ck-content .marker-blue { background: #72ccfd; color: #1b1a1a; }
.ck-content .pen-red { color: #e71313; background: transparent; }
.ck-content .pen-green { color: #128a00; background: transparent; }

@media (max-width: 768px) {
  .ck-content h1 { font-size: 2rem; }
  .ck-content h2 { font-size: 1.5rem; }
  .ck-content .image-style-side,
  .ck-content .image-style-align-left,
  .ck-content .image-style-align-right { float: none; max-width: 100%; margin: 16px 0; }
}
