/* 2020-02-11 EM editing gap CSS */

tei-expan > tei-ex::before {
    content: "(";
}
tei-expan > tei-ex::after {
    content: ")";
}

tei-expan > tei-ex[cert='low']::after {
    content: "?)";
}

.transcription  tei-am {
    display:  none;
}

tei-add::before {
    content: "<";
}
tei-add::after {
    content: ">";
}

tei-add[place='above']::before {
    content: "\\";
}
tei-add[place='above']::after {
    content: "/";
}

tei-add[place='below']::before {
    content: "//";
}
tei-add[place='below']::after {
    content: "\\\\";
}

/* these selectors work because the divs are being rewritten in Django
so as to be contained in p elements with class attributes "transcription", etc */
.diplomatic tei-choice > tei-corr {
    display: none;
}

.diplomatic tei-choice > tei-reg {
    display: none;
}

.transcription tei-choice > tei-orig {
    display: none;
}

.transcription tei-choice > tei-sic {
    display: none;
}

.transcription tei-choice > tei-reg::before {
  content: "("
}

.transcription tei-choice > tei-reg::after {
  content: ")"
}

 :not(tei-choice) > tei-orig {
    text-transform: uppercase;
}

tei-choice > tei-unclear:first-child::after {
 content: "/";
}

/* easier to do this as a special case in Hebrew, as the XML element that is
2nd Hebrew word counts as the first element. */
[lang="heb"] > tei-choice > tei-unclear:first-child::before {
 content: "/";
}

tei-damage {

}
/*〚
LEFT WHITE SQUARE BRACKET
Unicode: U+301A, UTF-8: E3 80 9A*/
tei-del[rend='erasure']::before {
    content: "\301a";
}
/*〛
RIGHT WHITE SQUARE BRACKET
Unicode: U+301B, UTF-8: E3 80 9B*/
tei-del[rend='erasure']::after {
    content: "\301b";
}

tei-del[rend='corrected'] {
    text-decoration: line-through;
}

/* This is for del with no attributes. although this should probably not
occur */
tei-del::before {
    content: "\301a";
}

tei-del::after {
    content: "\301b";
}

tei-g::before {
  content: "((";
  unicode-bidi: bidi-override;
  direction: ltr;
}

tei-g::after {
  content: "))";
  unicode-bidi: bidi-override;
  direction: ltr;
}

tei-g:empty::before {
  content: "((" attr(ref);
  unicode-bidi: bidi-override;
  direction: ltr;
}

tei-gap[reason="illegible"][unit="character"][extent="unknown"]::before {
  content: "[...]";
  unicode-bidi: bidi-override;
  direction: ltr;
}

tei-gap[reason="lost"][unit="character"][extent="unknown"]::before {
  content: "[---]";
  unicode-bidi: bidi-override;
  direction: ltr;
}

/*  doesn't appear in IIP at this point. Doesn't make sense, really
tei-gap[reason="illegible"][unit="line"][extent="unknown"]::before {
  content: "-----";
} */

tei-gap[reason="lost"][unit="line"][extent="unknown"]::before {
  content: "-----";
  unicode-bidi: bidi-override;
  direction: ltr;
}
/*  one two (or three) ill. characters, use one two (or three) dots
otherwise parenthsis with number. Note that CSS rule for quantities unspecified
has to be before the rules with specified @units. Otherwise it is the rule
that selects. */

tei-gap[reason="illegible"][unit="character"][quantity]::before {
    content: "[. " attr(quantity) " char. .]";
    unicode-bidi: bidi-override;
    direction: ltr;
}

tei-gap[reason="illegible"][unit="character"][quantity="1"]::before {
  content: ".";
}

tei-gap[reason="illegible"][unit="character"][quantity="2"]::before {
  content: "..";
}

tei-gap[reason="lost"][unit="character"][quantity]::before {
    content: "[- " attr(quantity) " char. -]";
    unicode-bidi: bidi-override;
    direction: ltr;
  }

  tei-gap[reason="lost"][unit="character"][quantity="1"]::before {
    content: "[-]";
  }

  tei-gap[reason="lost"][unit="character"][quantity="2"]::before {
    content: "[--]";
  }


tei-gap[reason="lost"][unit="character"][quantity][precision="low"]::before {
        content: "[?- ca. " attr(quantity) " char. -]";
        unicode-bidi: bidi-override;
        direction: ltr;
      }

      tei-gap[reason="lost"][unit="line"][quantity]::before {
        content: "[- " attr(quantity) " lin. -]";
        unicode-bidi: bidi-override;
        direction: ltr;
      }

tei-gap[reason="lost"][unit="line"][quantity="1"]::before {
        content: "[-]";
      }

tei-gap[reason="lost"][unit="line"][quantity="2"]::before {
        content: "[--]";
      }


tei-gap[reason="illegible"][unit="character"][atLeast]::before {
  content: "[. " attr(atLeast) "-" attr(atMost) " chars. .]";
  unicode-bidi: bidi-override;
  direction: ltr;
}

tei-gap[reason="lost"][unit="character"][atLeast]::before {
  content: "[- " attr(atLeast) "-" attr(atMost) " chars. -]";
  unicode-bidi: bidi-override;
  direction: ltr;
}

tei-gap[reason="lost"][unit="line"][atLeast]::before {
  content: "[- " attr(atLeast) "-" attr(atMost) " lin. -]";
  unicode-bidi: bidi-override;
  direction: ltr;
}

/* need to add @cert rules for gap */

tei-lb::before {
    content: "\a";
    white-space: pre;
}
tei-lb[break='no']::before {
    content: "-\a";
    white-space: pre;
}

tei-unclear {
    text-decoration: underline;
    /*text-decoration-style: dotted;*/
    /* text-emphasis-style: dot;
    text-emphasis-position: under; */
}

tei-unclear[cert='low']::after {
    content" "(?)";
    unicode-bidi: bidi-override;
    direction: ltr;
}

/* see tei-choice for tei-unclear inside tei-choice */

tei-hi[rend='superscript'] {
    vertical-align: super;
    font-size: smaller;
}
/*¯
MACRON
Unicode: U+00AF, UTF-8: C2 AF
*/
tei-hi[rend='supraline']::before, tei-hi[rend='supraline']::after {
    content: "\00AF";
}

tei-hi[rend='subscript'] {
    vertical-align: sub;
    font-size: smaller;
}

tei-hi[rend='ligature'] {
    /*TODO*/
}

tei-space[quantity][unit='character']::before {
    content: " (vac. " attr(quantity) ") ";
    unicode-bidi: bidi-override;
    direction: ltr;
}

tei-space[extent='unknown']::before {
    content: " (vac. ?) ";
    unicode-bidi: bidi-override;
    direction: ltr;
}

tei-space[dim='horizontal']::before {
  content: " (vac.) ";
  unicode-bidi: bidi-override;
  direction: ltr;
}

tei-note::before {
    content: "/*";
}

tei-note::after {
    content: "*/";
}

tei-supplied[reason="lost"]::before {
    content: "[";
}

tei-supplied[reason="lost"]::after {
    content: "]";
}

tei-supplied[reason="lost"][cert='low']::after {
    content: "?]";
}

tei-supplied[reason="omitted"]::before {
    content: "<";
}

tei-supplied[reason="omitted"]::after {
    content: ">";
}

tei-supplied[reason="omitted"][cert='low']::after {
    content: "?>";
}
tei-supplied[reason="subaudible"]::before {
    content: "\(";
}

tei-supplied[reason="subaudible"]::after {
    content: "\)";
}

tei-surplus::before {
    content: "{";
}

tei-surplus::after {
    content: "}";
}

.transcription tei-app > tei-lem {
    display: none;
}

.diplomatic tei-app > tei-rdg {
    display: none;
}

tei-gap[reason='ellipsis'] {
    /*?*/
}

/* Hebrew */
[lang='heb'] {
    unicode-bidi: bidi-override;
    direction: rtl;
    text-align: right;
}

/* Aramaic */
[lang='arc'] {
    unicode-bidi: bidi-override;
    direction: rtl;
    text-align: right;
}

/* Latin */
[lang='lat'] {
    unicode-bidi: bidi-override;
    direction: ltr;
    text-align: left;
}

/* Greek */
[lang='grc'] {
    unicode-bidi: bidi-override;
    direction: ltr;
    text-align: left;
}

tei-num {
  unicode-bidi: bidi-override;
  direction: ltr;
  text-align: left;
}
