/*
 * Copyright © Michal Čihař <michal@weblate.org>
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

.tos {
  counter-reset: tos_chapter;
}

.tos h2::before {
  counter-increment: tos_chapter;
  content: counter(tos_chapter) ". ";
}

.tos h2 {
  counter-reset: tos_item;
}

.tos p.item,
.tos p.subitem,
.tos p.subsubitem {
  position: relative;
}
.tos p,
.tos dl {
  padding: 0 3.5em;
}
.tos p.item {
  counter-reset: tos_subitem;
}
.tos p.subitem {
  counter-reset: tos_subsubitem;
}
.tos p.subsubitem {
  padding: 0 4.2em;
}

.tos p.item::before {
  counter-increment: tos_item;
  content: counter(tos_chapter) "." counter(tos_item) ". ";
  position: absolute;
  inset-inline-start: 0;
}

.tos p.subitem::before {
  counter-increment: tos_subitem;
  content: counter(tos_chapter) "." counter(tos_item) "." counter(tos_subitem)
    ". ";
  position: absolute;
  inset-inline-start: 0;
}

.tos p.subsubitem::before {
  counter-increment: tos_subsubitem;
  content: counter(tos_chapter) "." counter(tos_item) "." counter(tos_subitem)
    "." counter(tos_subsubitem) ". ";
  position: absolute;
  inset-inline-start: 0;
}

.tos ol {
  counter-reset: tos_list;
  padding: 0 5em;
}
.tos ol > li {
  list-style: none;
  position: relative;
}
.tos ol > li:before {
  counter-increment: tos_list;
  content: counter(tos_list, lower-alpha) ") ";
  position: absolute;
  inset-inline-start: -1.4em;
}
@counter-style lower-belorussian {
  system: alphabetic;
  symbols: "а" "б" "в" "г" "д" "е" "ё" "ж" "з" "і" "й" "к" "л" "м" "н" "о" "п"
    "р" "с" "т" "у" "ў" "ф" "х" "ц" "ч" "ш" "ы" "ь" "э" "ю" "я";
}
@counter-style lower-bulgarian {
  system: alphabetic;
  symbols: "а" "б" "в" "г" "д" "е" "ж" "з" "и" "й" "к" "л" "м" "н" "о" "п" "р"
    "с" "т" "у" "ф" "х" "ц" "ч" "ш" "щ" "ъ" "ь" "ю" "я";
}
@counter-style lower-macedonian {
  system: alphabetic;
  symbols: "а" "б" "в" "г" "д" "ѓ" "е" "ж" "з" "ѕ" "и" "ј" "к" "л" "љ" "м" "н"
    "њ" "о" "п" "р" "с" "т" "ќ" "у" "ф" "х" "ц" "ч" "џ" "ш";
}
@counter-style lower-russian {
  system: alphabetic;
  symbols: "а" "б" "в" "г" "д" "е" "ж" "з" "и" "к" "л" "м" "н" "о" "п" "р" "с"
    "т" "у" "ф" "х" "ц" "ч" "ш" "щ" "э" "ю" "я";
}
@counter-style lower-ukrainian {
  system: alphabetic;
  symbols: "а" "б" "в" "г" "д" "е" "є" "ж" "з" "и" "і" "к" "л" "м" "н" "о" "п"
    "р" "с" "т" "у" "ф" "х" "ц" "ч" "ш" "ю" "я";
}
[lang="be"] .tos ol > li:before {
  content: counter(tos_list, lower-belorussian) ") ";
}
[lang="bg"] .tos ol > li:before {
  content: counter(tos_list, lower-bulgarian) ") ";
}
[lang="mk"] .tos ol > li:before {
  content: counter(tos_list, lower-macedonian) ") ";
}
[lang="ru"] .tos ol > li:before {
  content: counter(tos_list, lower-russian) ") ";
}
[lang="uk"] .tos ol > li:before {
  content: counter(tos_list, lower-ukrainian) ") ";
}
