// Document
//
// A linguistics article, book chapter, abstract, book, etc. Most of the styles in this file handle counters for examples, figures, etc. The sectioning hierarchy is: ling-document > section > subsection > subsubsection > paragraph > subparagraph. Note that the `.paragraph` class is different than the `.p` class. `.paragraph` is for sectioning, while `.p` is specifically for styling `<p>` elements within a ling-document.
//
// Markup: document.html
//
// Styleguide components.document
.ling-document {

  counter-reset: examples figures sections tables;
  font-family:   var(--font-unicode-serif);

  caption::before {
    content          : 'Table ' counter(tables) ':';
    font-weight      : bold;
    margin-inline-end: var(--counter-margin);
  }

  figcaption::before {
    content          : 'Figure ' counter(figures) ':';
    font-weight      : bold;
    margin-inline-end: var(--counter-margin);
  }

  .figure {
    counter-increment: figures;
  }

  h2 {

    counter-increment: sections;

    &::before {
      content          : counter(sections) '.';
      margin-inline-end: var(--counter-margin);
    }

  }

  h3 {

    counter-increment: subsections;

    &::before {
      content          : counter(sections) '.' counter(subsections) '.';
      margin-inline-end: var(--counter-margin);
    }

  }

  h4 {

    counter-increment: subsubsections;

    &::before {
      content          : counter(sections) '.' counter(subsections) '.' counter(subsubsections) '.';
      margin-inline-end: var(--counter-margin);
    }

  }

  h5 {

    counter-increment: paragraphs;

    &::before {
      content          : counter(sections) '.' counter(subsections) '.' counter(subsubsections) '.' counter(paragraphs) '.';
      margin-inline-end: var(--counter-margin);
    }

  }

  h6 {

    counter-increment: subparagraphs;

    &::before {
      content          : counter(sections) '.' counter(subsections) '.' counter(subsubsections) '.' counter(paragraphs) '.' counter(subparagraphs) '.';
      margin-inline-end: var(--counter-margin);
    }

  }

  p {
    margin: 0.5em 0em;
  }

  .paragraph {
    counter-reset: subparagraphs;
  }

  .section {
    counter-reset: subsections;
  }

  .subsection {
    counter-reset: subsubsections;
  }

  .subsubsection {
    counter-reset: paragraphs;
  }

  .table {
    counter-increment: tables;
  }

}

