/* Text view, after the V3 Tabula variant: a ruled genealogical table, one row per person. */
.tv-page { --ink2: var(--muted); --ink3: color-mix(in srgb, var(--ink) 40%, var(--paper)); --hw: 1px;
  max-width: 62rem; margin-top: .75rem; font-variant-numeric: oldstyle-nums proportional-nums; }
.tv-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* running head and folio */
.tv-run { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 4px; border-bottom: 3px double var(--ink); }
.tv-sc { font-variant-caps: all-small-caps; letter-spacing: .06em; font-weight: 600; font-size: 1.05rem; }
:lang(zh-Hans) .tv-sc, .tv-sc:lang(zh-Hans) { font-variant-caps: normal; letter-spacing: .1em; font-size: .9rem; }
.tv-run-r { font-variant-numeric: lining-nums; text-align: right; }
.tv-folio { display: flex; justify-content: space-between; gap: 12px; margin: 1.5rem 0 0; padding-top: .4rem; border-top: 1px solid var(--rule); font-size: .8rem; color: var(--muted); font-variant-numeric: lining-nums; }

/* the table */
.tv { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: .95rem; line-height: 1.3; }
.tv caption { caption-side: top; text-align: left; font-style: italic; color: var(--muted); font-size: .85rem; padding: .35rem 0; }
:lang(zh-Hans) .tv caption { font-style: normal; }
.tv thead th { text-align: left; font-weight: 400; font-size: .8rem; color: var(--muted); padding: 3px 4px 3px 0; border-top: 1.6px solid var(--ink); border-bottom: 1px solid var(--ink); }
.tv tbody th, .tv tbody td { text-align: left; vertical-align: top; padding: .5rem 6px .45rem 0; border-bottom: 1px solid var(--rule); font-weight: 400; }
.tv th.tv-gen, .tv td.tv-gen { width: 2.4rem; padding-right: 4px; }
.tv thead th:nth-child(2) { width: 46%; }
.tv td.tv-gen { position: relative; color: var(--muted); font-size: .85rem; font-variant-numeric: lining-nums; padding-top: .62rem; }
.tv tr.tv-on td.tv-gen, .tv tr.tv-head td.tv-gen { color: var(--hi); }

/* names */
:where(.tv-page) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: left; }
.tv-name { font-size: 1.05rem; line-height: 1.2; min-height: 24px; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--ink3); text-underline-offset: 3px; overflow-wrap: anywhere; }
.tv-name:hover, .tv-edge:hover { text-decoration-color: var(--ink); }
.tv-famous .tv-name { font-size: 1.15rem; }
.tv-head .tv-name { color: var(--hi); }
.tv-head .tv-name { font-size: 1.2rem; }
.tv-latin, .tv-yrs, .tv-field { display: block; color: var(--muted); font-size: .82rem; line-height: 1.3; }
.tv-latin { font-style: italic; }
.tv-yrs { white-space: nowrap; font-variant-numeric: lining-nums; }
.tv-field { font-style: italic; margin-top: 1px; color: var(--ink); }
.tv-field::before { content: "- "; color: var(--ink3); }
:lang(zh-Hans) .tv-field, :lang(zh-Hans) .tv-latin { font-style: normal; }

/* advisors */
.tv-advs { list-style: none; margin: 0; padding: 0; }
.tv-a { margin: 0 0 .3rem; }
.tv-a:last-child { margin-bottom: 0; }
.tv-an { display: block; overflow-wrap: anywhere; }
.tv-edge { font-size: .85rem; color: var(--ink); min-height: 24px; padding: 2px 0; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--ink3); text-underline-offset: 3px; font-variant-numeric: lining-nums; }
.tv-teacher, .tv-teacher + .tv-mk { color: var(--muted); }
.tv-typed { color: var(--hi); border: 1px dashed var(--hi); padding: 0 5px; text-decoration: none; font-style: italic; }
:lang(zh-Hans) .tv-typed { font-style: normal; }
.tv-mk { font-size: .75rem; line-height: 0; margin-left: 1px; font-variant-numeric: lining-nums; }
.tv-end { display: block; font-style: italic; color: var(--muted); font-size: .85rem; }
:lang(zh-Hans) .tv-end { font-style: normal; }
.tv-advs + .tv-end { margin-top: .3rem; }
.tv button.tv-act { display: inline-block; margin: .3rem 12px 0 0; padding: 4px 0; min-height: 28px; color: var(--hi); font-size: .85rem; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tv tr:last-child th, .tv tr:last-child td { border-bottom: 1.6px solid var(--ink); }

/* notes: the apparatus under the table */
.tv-notes { margin-top: 1.25rem; font-size: .85rem; line-height: 1.45; }
.tv-h { font-variant-caps: all-small-caps; letter-spacing: .06em; font-weight: 600; font-size: 1.05rem; margin: 0 0 .4rem; padding-top: .35rem; border-top: 1.6px solid var(--ink); }
:lang(zh-Hans) .tv-h { font-variant-caps: normal; letter-spacing: .08em; font-size: .95rem; }
.tv-sub { font-weight: 400; font-style: italic; color: var(--muted); margin: .75rem 0 .25rem; font-size: .85rem; }
:lang(zh-Hans) .tv-sub { font-style: normal; }
.tv-siglum { margin: 0 0 .5rem; }
.tv-fn { list-style: none; margin: 0 0 .75rem; padding: 0; border-top: 1px solid var(--rule); }
.tv-fn li { padding: 2px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 2.8em 1fr; column-gap: 4px; align-items: baseline; }
.tv-fn-n { color: var(--muted); font-variant-numeric: lining-nums; }
.tv-fn li > button, .tv-fn-src { grid-column: 2; justify-self: start; }
.tv-fn-src { color: var(--muted); }
.tv-fn-src a { display: inline-block; min-height: 24px; padding: 2px 0; }
.tv-noref { font-style: italic; }
:lang(zh-Hans) .tv-noref { font-style: normal; }

@media (min-width: 700px) {
  .tv-page { margin-top: 1rem; }
  .tv th.tv-gen, .tv td.tv-gen { width: 3.2rem; }
  .tv thead th:nth-child(2) { width: 42%; }
  .tv-who .tv-latin, .tv-who .tv-yrs { display: inline; }
  .tv-who .tv-latin::after { content: " \00b7  "; }
  .tv-who .tv-field { display: block; }
  .tv-an { display: inline; margin-right: .6rem; }
  .tv-a { display: flex; flex-wrap: wrap; align-items: baseline; }
  .tv-fn li { grid-template-columns: 3em minmax(0, 14em) 1fr; }
  .tv-fn li > button { grid-column: 2; }
  .tv-fn-src { grid-column: 3; }
}
@media print { .tv-page { max-width: none; } .tv-page button { text-decoration: none; } }
