/**
 * CKEditor / CMS HTML inside .cms-html
 * Load AFTER tailwind.build.css so these rules beat preflight (ul list-style:none, etc.)
 */

.cms-html {
  width: 100%;
  max-width: 100%;
  color: #000;
  overflow-wrap: break-word;
}

.cms-html img,
.cms-html video,
.cms-html iframe {
  max-width: 100%;
  height: auto;
}

/* Tables — alignment/width come from CMS inline styles only (e.g. margin auto on some tables, not others) */
.cms-html table {
  border-collapse: collapse;
  max-width: 100%;
}

.cms-html figure.table {
  max-width: 100%;
}

/* Cell borders only when CMS does not set its own border on td/th */
.cms-html table:not([border="0"]) td:not([style*="border"]),
.cms-html table:not([border="0"]) th:not([style*="border"]) {
  border: 1px solid #000;
  padding: 4px 8px;
  vertical-align: top;
}

/* Lists: beat Tailwind preflight (ol,ul,menu { list-style:none }) */
.cms-html ul,
.cms-html ol {
  list-style: revert !important;
  margin: revert;
  padding: revert;
}

.cms-html li {
  display: list-item !important;
  list-style-position: outside !important;
  /* CKEditor exports white-space:pre on <li>, which puts the marker on its own line */
  white-space: normal !important;
}

/* CKEditor wraps list item text in <p> — keep marker and text on one line */
.cms-html li > p {
  display: inline !important;
  margin: 0 !important;
}

.cms-html li > p:only-child {
  display: inline !important;
}

.cms-html li > p + p {
  display: block !important;
  margin-top: 0.75em !important;
}

.cms-html h1,
.cms-html h2,
.cms-html h3,
.cms-html h4,
.cms-html h5,
.cms-html h6 {
  font-weight: revert;
  color: revert;
}

.cms-html a {
  color: revert;
  text-decoration: revert;
}