/* Vertical 注音 for js/utils/zhuyin.js.
   All sizes are in em of the character size, so set font-size on the container only.
   Font: Noto Sans TC Bold, 注音 symbols + ˊˇˋ˙ only (4 KB, SIL OFL 1.1, see fonts/OFL-NotoSansTC.txt).
   unicode-range keeps it away from every other character. */
@font-face {
    font-family: "BpmfNotoBold";
    src: url("../fonts/bpmf-noto-sans-tc-bold.woff2") format("woff2");
    font-weight: 400 900;
    font-display: block;
    unicode-range: U+3105-3129, U+02C7, U+02CA, U+02CB, U+02D9;
}

:root {
    --zy-size: .5;    /* 注音 size as a part of the character size */
}

/* Characters regular, 注音 bold (the column sets its own weight) */
.zy-text { line-height: 1; font-weight: 400; }

/* One character + its column. A line may break between cells, never inside one. */
.zy-cell {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    white-space: nowrap;
    margin-right: .04em;
}
.zy-ch { display: inline-block; line-height: 1; }
/* Punctuation: no column, keep it on the base line of the cells */
.zy-p { display: inline-block; vertical-align: middle; line-height: 1; }

/* The column. 1em inside it = one 注音 symbol. */
.zy-col {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: "BpmfNotoBold", "PingFang TC", "Noto Sans TC", sans-serif;
    font-size: calc(var(--zy-size) * 1em);
    font-weight: 700;
    line-height: 1;
    width: 1em;
    margin: 0 .5em 0 .1em;   /* right: room for the tone mark */
}
.zy-s {
    position: relative;
    display: block;
    width: 1em;
    height: 1.08em;
    line-height: 1.08em;
    text-align: center;
}
/* ˙ on top, in a short slot */
.zy-light { height: .55em; line-height: .55em; }
/* ˊˇˋ at the right of the last symbol, near its top (textbook position) */
.zy-tone {
    position: absolute;
    left: 92%;
    top: -.2em;
    width: .6em;
    text-align: left;
}

/* 注音 alone in a box the size of a character (看注音寫國字) */
.zy-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    min-width: 1.2em;
    min-height: 1.5em;
    padding: .06em .02em;
    border: .06em solid currentColor;
    border-radius: .12em;
}
.zy-box .zy-col { font-size: calc(var(--zy-size) * 1.15em); margin: 0 .5em 0 .1em; }

/* 注音 columns with no characters (聽寫 keys) */
.zy-only {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    vertical-align: middle;
    line-height: 1;
    /* font-size of this box = the character size; columns are a bit larger, as in the box */
}
.zy-only .zy-col { font-size: calc(var(--zy-size) * 1.15em); margin: 0 .45em 0 .1em; }

/* A column placed by a template next to its own character element */
.zy-colwrap { display: contents; }

/* Fallback when text and 注音 do not pair up: the 注音 in one small line */
.zy-flat {
    margin-left: .3em;
    font-family: "BpmfNotoBold", "PingFang TC", sans-serif;
    font-size: .6em;
    font-weight: 700;
    letter-spacing: .05em;
}
