/**
 * Rich-text content (CKEditor output) on public pages and in the admin editor.
 * The public theme resets all ul/ol markers and uses a custom counter on every ol;
 * CKEditor tables also need explicit borders to be visible.
 */

/* Shared: editor canvas + published legal pages */
.ck-content ul,
.ck-content ol,
.ft-legal-content ul,
.ft-legal-content ol {
  display: block !important;
  width: auto !important;
  flex: none !important;
  flex-flow: unset !important;
  row-gap: normal !important;
  margin: 0 0 1rem !important;
  padding-left: 2rem !important;
  list-style-position: outside !important;
  counter-reset: none !important;
}

.ck-content ul,
.ft-legal-content ul {
  list-style-type: disc !important;
}

.ck-content ol,
.ft-legal-content ol {
  list-style-type: decimal !important;
}

.ck-content ul ul,
.ft-legal-content ul ul {
  list-style-type: circle !important;
  margin-bottom: 0 !important;
}

.ck-content ol ol,
.ft-legal-content ol ol {
  list-style-type: lower-alpha !important;
  margin-bottom: 0 !important;
}

.ck-content li,
.ft-legal-content li {
  display: list-item !important;
  width: auto !important;
  position: static !important;
  padding: 0.15rem 0 !important;
  margin: 0 !important;
  list-style: inherit !important;
  counter-increment: none !important;
}

.ck-content li::before,
.ft-legal-content li::before {
  content: none !important;
  display: none !important;
}

.ck-content p,
.ft-legal-content p {
  margin: 0 0 0.75rem;
}

.ck-content h1,
.ck-content h2,
.ck-content h3,
.ck-content h4,
.ck-content h5,
.ck-content h6,
.ft-legal-content h1,
.ft-legal-content h2,
.ft-legal-content h3,
.ft-legal-content h4,
.ft-legal-content h5,
.ft-legal-content h6 {
  margin: 1rem 0 0.5rem;
}

.ck-content figure.table,
.ft-legal-content figure.table {
  display: block;
  margin: 1rem 0;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.ck-content table,
.ft-legal-content table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  border: 1px solid #bfbfbf;
  background: #fff;
}

.ck-content table td,
.ck-content table th,
.ft-legal-content table td,
.ft-legal-content table th {
  min-width: 2em;
  padding: 0.5rem 0.75rem;
  border: 1px solid #bfbfbf;
  vertical-align: top;
  word-break: break-word;
}

.ck-content table th,
.ft-legal-content table th {
  font-weight: 600;
  background: #f8f9fa;
}

.ck-content li > br:first-child,
.ft-legal-content li > br:first-child,
.ck-content li > br:last-child,
.ft-legal-content li > br:last-child {
  display: none;
}
