/* ===================================================================
   Graphic icons (scripts/icons.js): flags, logos, glyphs. Size: --si-size (18px by default).
   =================================================================== */

.si {
    --si-size: 18px;
    display: inline-block;
    flex: none;
    width: var(--si-size);
    height: var(--si-size);
    object-fit: contain;
    vertical-align: middle;
}

/* a flag: a small rounded rectangle with a hairline */
.si-flag {
    width: calc(var(--si-size) * 1.34);
    height: var(--si-size);
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-text) 14%, transparent);
}

/* a logo drawn with currentColor: painted through a mask, so it follows the theme */
.si-mono {
    background-color: var(--si-color, var(--color-text-soft));
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.si-glyph,
.si-fav {
    display: inline-grid;
    place-items: center;
    color: var(--si-color, var(--color-text-soft));
}

.si-glyph .material-symbols-outlined,
.si-fav .material-symbols-outlined {
    font-size: calc(var(--si-size) * 1.12);
}

/* a domain's favicon over its glyph: the glyph shows only when the picture is not there (none is known, or it did not load and
   scripts/icons.js took it away) */
.si-fav {
    position: relative;
}

.si-fav img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 3px;
}

.si-fav img + .material-symbols-outlined {
    visibility: hidden;
}

/* Material Symbols Outlined (loaded by the page): the glyphs stay invisible until the font is there, so a name is never shown as text */
.material-symbols-outlined {
    font-family: "Material Symbols Outlined";
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    flex: none;
    width: 1em;
    overflow: hidden;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    font-feature-settings: "liga";
    -webkit-font-feature-settings: "liga";
    -webkit-font-smoothing: antialiased;
    user-select: none;
}

html:not([data-ms="ready"]) .material-symbols-outlined {
    visibility: hidden;
}

[dir="rtl"] .si-flip {
    transform: scaleX(-1);
}
