/*
    2020-02-11 EM editing gap CSS
   2021-08-24 EM building Mat Med CSS on top of Epidoc class
  */



tei-div{
  display: block;
}

/* Hide the whole header. */
tei-TEIHeader {
  display: none;
}

tei-text {
  font-family: "Garamond", serif;
}

tei-div[type="plant"] {
  font-size: .8em;
}

/* Styles the plant name, main header. */
tei-div[type="plant"] > tei-head {
  display: none;
  /* display: block;
  font-weight: bold;
  font-size: 1.5em;
  margin-left: -3%;
  margin-top: 2%; */
}


/* All other head elements */
 tei-body > tei-head {
    display: block;
    font-weight: bold;
    font-size: 1.2em;
    margin-left: -3%;
    margin-top: 2%;
  }

tei-div[type="editorial-D"], tei-div[type="editorial-M"], tei-div[type="notes"],
tei-div[type="bibl"] {
  font-family: "Trebuchet", sans-serif;
  font-size: .875em!important;
}

tei-p {
  display: block;
}

tei-ab {
  display: none;
}

tei-foreign, tei-hi {
  font-style: italic;
}

tei-p tei-persname {
  color: #873e23;
}

tei-p tei-placename {
  color: #D9714A;
}

tei-div[type="editorial-D"]::before {
  border-top: solid grey;
  border-top-width: thin;
  line-height: 250%;
  content: "Critical Analysis by E. De Toni";
  display: block;
  font-weight: bold;
  font-size: 1em;
  margin-left: -3%;
  margin-top: 5%;
}

tei-div[type="notes"]::before {
  line-height: 250%;
  content: "Notes";
  display: block;
  font-weight: bold;
  font-size: 1em;
  margin-left: -3%;
  margin-top: 2%;
  counter-reset: note;
}

tei-div[type="notes"] tei-note {
  display: block;
  font-size: .875em!important;
}


tei-note::before {
  counter-increment: note;                   /* Increment the value of note counter by 1 */
  content:  counter(note) ". ";    /* Display the value of counter, and a period before the  content of each note */
}


tei-div[type="bibl"]::before {
  content: "Bibliography";
  display: block;
  font-weight: bold;
  font-size: 1em;
  margin-left: -3%;
  margin-top: 2%;

}

tei-div[type="bibl"] tei-bibl {
  display: list-item;
}

tei-pb {
  color: grey;
  font-style: italic;
}

tei-fw {
  display: none;
}

tei-ptr > a {
  vertical-align: super;
  font-size: small;
}

/* --------------- Epidoc styles below ------------- */


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-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;
}
