/**
 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
 */
:root, :host {
  --ck-content-footnotes-list-background-color: none;
  --ck-content-footnotes-list-separator-color: #000;
  --ck-content-footnote-font-size: var(--ck-content-font-size-small);
}

.ck-content {
  & .footnote {
    margin-inline-end: .2em;
  }

  & .footnotes {
    font-size: var(--ck-content-footnote-font-size);
    background-color: var(--ck-content-footnotes-list-background-color);
    margin: .9em 0 1.5em;
    position: relative;
  }

  & .footnotes-divider {
    border: none;
    border-top: 1px solid var(--ck-content-footnotes-list-separator-color);
    background: none;
    width: min(30%, 350px);
    height: 1px;
    margin: 0 0 1em;
    display: block;

    [dir="rtl"] & {
      margin-left: auto;
      margin-right: 0;
    }
  }

  & .footnotes-list {
    margin: 0;
    padding-inline-start: 3em;
  }

  & .footnote-backlink {
    -webkit-user-select: none;
    user-select: none;
    vertical-align: top;
    width: auto;
    margin-inline-end: 1ch;
    display: inline-block;
  }

  & .footnote-content {
    vertical-align: top;
    width: calc(100% - 2em);
    padding: 0 4px;
    display: inline-block;

    & > p:first-of-type {
      margin-top: 0;
    }

    & > p:last-of-type {
      margin-bottom: 0;
    }

    & ol {
      list-style-type: decimal;
    }

    & ol ol {
      list-style-type: lower-latin;
    }

    & ol ol ol {
      list-style-type: lower-roman;
    }

    & ol ol ol ol {
      list-style-type: upper-latin;
    }

    & ol ol ol ol ol {
      list-style-type: upper-roman;
    }
  }
}
