/* ══════════════════════════════════════════════════════════════════════════════
   PPEA — Edition Annotations Stylesheet
   ══════════════════════════════════════════════════════════════════════════════
   TEI element visual rendering: inline text appearance per view mode.
   Loaded on text and intro pages (via html_head_text.html).

   Covers: foreign-language phrases, TEI elements (app, del, add, corr, reg,
   sic, orig, damage, gap, expan, seg, supplied), highlights (hi), and view-mode
   overrides (all-view, diplomatic-view, scribal-view, critical-view).

   Depends on edition-specific tokens declared in edition_passage.css (§1).
   ══════════════════════════════════════════════════════════════════════════════ */



/* ══════════════════════════════════════════════════════════════════════════════
   PART D — TEI ANNOTATION STYLING
   ══════════════════════════════════════════════════════════════════════════════
   Coloring, pointer behavior, and display per view mode.  Default styling
   is for All Views; each annotation block adjusts for other views. */

/* ── §31  <title> ─────────────────────────────────────────────────────────── */
.title { font-style: italic; }

/* ── §32  <app> ───────────────────────────────────────────────────────────── */
.app {
    background-color: var(--color-tei-app-bg);
    cursor: pointer;
}

.diplomatic-view .app {
    background-color: transparent;
    cursor: auto;
}

.app > .ed-mark { color: var(--color-tei-seg); }

/* ── §33  <del> ───────────────────────────────────────────────────────────── */
.del {
    cursor: pointer;
    text-decoration: line-through;
}

/* { } emitted as <span class="ed-mark"> in XSLT */

.scribal-view .del,
.critical-view .del { display: none; }

/* ── §34  <add> ───────────────────────────────────────────────────────────── */
.add {
    color: var(--color-tei-add);
    cursor: pointer;
}

.critical-view .add,
.diplomatic-view .add {
    color: inherit;
    cursor: auto;
}

.scribal-view .supplied,
.diplomatic-view .supplied { display: none; }

/* ── §35  <supplied> ──────────────────────────────────────────────────────── */
/* [ ] emitted as <span class="ed-mark"> in XSLT */

/* ── §36  <sic> ───────────────────────────────────────────────────────────── */
.sic { color: var(--color-tei-sic); }

.diplomatic-view .sic { color: inherit; }
.critical-view .sic   { display: none; }

/* ── §37  <corr> ──────────────────────────────────────────────────────────── */
/* " / " emitted as <span class="ed-mark"> in XSLT, gated on preceding <sic>. */
.corr > .ed-mark { color: var(--color-tei-sic); }

/* corr is display:none in scribal/diplomatic, so their ed-mark is hidden too.
   In critical view corr is visible but the slash should be suppressed. */
.critical-view .corr .ed-mark { display: none; }

.corr { color: var(--color-tei-corr); }

.critical-view .corr { color: inherit; }

.diplomatic-view .corr,
.scribal-view .corr { display: none; }

/* ── §38  <orig> ──────────────────────────────────────────────────────────── */
.orig { color: var(--color-tei-orig); }

.diplomatic-view .orig { color: inherit; }
.critical-view .orig   { display: none; }

/* ── §39  <reg> ───────────────────────────────────────────────────────────── */
/* " / " emitted as <span class="ed-mark"> in XSLT, gated on preceding <orig>. */
.reg > .ed-mark { color: var(--color-tei-reg-sep); }

/* reg is display:none in diplomatic/scribal, so their ed-mark is hidden too.
   In critical view reg is visible but the slash should be suppressed. */
.critical-view .reg .ed-mark { display: none; }

.reg { color: var(--color-tei-reg); }

.critical-view .reg { color: inherit; }

.diplomatic-view .reg,
.scribal-view .reg { display: none; }

/* ── §40  <damage> / <unclear> ────────────────────────────────────────────── */
.damage, .unclear { color: var(--color-tei-damage); }

.diplomatic-view .damage, .critical-view .damage, .scribal-view .damage,
.diplomatic-view .unclear, .critical-view .unclear, .scribal-view .unclear {
    color: inherit;
}

/* ── §40b  <gap> / <space> ───────────────────────────────────────────────── */
/* gap: colour matches damage/unclear family; ░ characters or […] from XSLT. */
.gap { color: var(--color-tei-damage); }

.diplomatic-view .gap, .critical-view .gap, .scribal-view .gap { color: inherit; }

/* space: white-space: pre prevents the browser from collapsing the literal
   space characters emitted by the XSLT (one per unit of @extent). */
.space { white-space: pre; }

/* ── §41  <expan> ─────────────────────────────────────────────────────────── */
.expan { font-style: oblique; }

.critical-view .expan { font-style: inherit; }

/* ── §42  <seg> (includes shadow hyphens) ─────────────────────────────────── */
.seg { color: var(--color-tei-seg); }

.diplomatic-view .seg { visibility: hidden; }
.critical-view .seg   { display: none; }

.seg.shadowHyphen { color: var(--color-tei-seg); }

.diplomatic-view .seg.shadowHyphen { visibility: hidden; }
.critical-view .seg.shadowHyphen   { display: none; }


/* ══════════════════════════════════════════════════════════════════════════════
   PART E — HIGHLIGHTS
   ══════════════════════════════════════════════════════════════════════════════
   Rendering of <hi> tags.  Expected format: .hi + a second class specifying
   the appropriate PPEA vocabulary style. */

/* ── §43  Color highlights ────────────────────────────────────────────────── */
.hi.bl { color: var(--color-hi-blue); }

.hi.rb { color: var(--color-hi-red); }

.hi.gr { color: var(--color-hi-green); }

/* Text-shadow highlights */
.hi.tr { text-shadow: .3px .3px var(--color-hi-red); }
.hi.tg { text-shadow: .3px .3px var(--color-hi-green); }
.hi.tb { text-shadow: .3px .3px var(--color-hi-blue); }

/* ── §44  Typographic highlights ──────────────────────────────────────────── */
.hi.bold    { font-weight: bold; }
.hi.display { font-size: larger; }
.hi.it      { font-style: italic; }

.hi.sup {
    font-size: smaller;
    vertical-align: top;
}

.hi.sub {
    font-size: smaller;
    vertical-align: bottom;
}

.hi.ul { text-decoration: underline; }

/* ── §44b  Script and size highlights (placeholders) ──────────────────────── */
/* These @rend values are used in the corpus but have no final styling.
   Placeholders apply a visible interim style so the feature is not invisible.
   See docs/tei-css-reference.md for design notes and font candidates.

   tx (textura) — text written in textura script; ~1,897 occurrences in
   P, F, S manuscripts.  Ideal rendering is a textura webfont (see notes in
   tei-css-reference.md); bold is the agreed interim.  In critical view all
   script distinctions are suppressed by §46's broad .hi override.
   TODO: replace with font-family once a suitably licensed textura font with
   medieval character support (þ ð ȝ) is identified. */
.hi.tx { font-weight: bold; }

/* bastardAnglicana — text in bastard anglicana script; ~713 occurrences.
   MA Bastard Anglicana DB font exists but licensing is unresolved; bold
   interim.
   TODO: replace with font-family once licensing is confirmed. */
.hi.bastardAnglicana { font-weight: bold; }

/* displayScript — display/formal script; ~156 occurrences, Southworth (S) only.
   Marks words written in a distinct display hand at line openings and headings. */
.hi.displayScript { font-weight: bold; }

/* smallFont — text written in a physically smaller script; ~558 occurrences,
   Crowley print (Cr1) only.  Used for Latin quotations and running heads
   written in a smaller hand than the main text. */
.hi.smallFont { font-size: 0.85em; }

/* lc (Lombard Cap) — a Lombardic decorated capital letter; ~115 occurrences.
   These initials are already styled by their co-occurring color tags (bl, rb,
   etc.) and sized by the enclosing dropcap zone (hi rend="o\d+").  No
   additional CSS rule is needed; lc is documented here for completeness. */
/* .hi.lc — no rule needed; styling from co-occurring tags */

/* ── §45  Border highlights ───────────────────────────────────────────────── */
.hi.ur, .hi.ulr { border-bottom: solid 1px var(--color-hi-border-red); }

.hi.ulANDol {
    border-bottom: solid 1px var(--color-hi-border);
    border-top: solid 1px var(--color-hi-border);
}

.hi.ulrANDolr {
    border-bottom: solid 1px var(--color-hi-border-red);
    border-top: solid 1px var(--color-hi-border-red);
}

.hi.boxed {
    margin: 2px 4px;
    padding: 1px 2px;
    border: 2px solid var(--color-hi-border);
    position: relative;
}

.hi.BinR { border: 1px solid var(--color-hi-border-red); }

/* ── §46  Critical-view highlight overrides ───────────────────────────────── */
.critical-view .hi:not(.initialLetter) {
    color: inherit;
    text-shadow: inherit;
    font-size: inherit;
}

.critical-view .hi.initialLetter {
    color: inherit;
    text-shadow: inherit;
    /* font-size NOT reset: .initial-letter-cell .initialLetter uses calc(). */
}

.critical-view .hi.ur,
.critical-view .hi.ulr { border-bottom: solid 1px var(--color-hi-border); }

.critical-view .hi.ulrANDolr { border-bottom: solid 1px var(--color-hi-border); border-top: solid 1px var(--color-hi-border); }

.critical-view .hi.BinR { border: none; }


