/* A network's own fonts, the "Czcionki" tab of the "Cenówki" page (Shared/NetworkFonts/). Global, not
   .razor.css: a new component's scoped styles do not apply under hot reload. Laid out as mockup 014
   (option A), in the panel's colours; the fonts themselves are tiles as the template gallery's. */

.network-fonts {
    container-type: inline-size;
}

/* The network on the left, the explanation under it. */
.network-fonts-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.network-fonts-hint {
    font-size: 12.5px;
    line-height: 1.5;
    color: #6c757d;
    max-width: 720px;
}

.network-fonts-network {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}

.network-fonts-network-label {
    font-size: 12px;
    font-weight: 700;
    color: #6c757d;
}

.network-fonts-network-select {
    min-width: 220px;
    font-size: 13px;
}

.network-fonts-empty,
.network-fonts-loading {
    font-size: 13px;
    color: #6c757d;
    padding: 18px 0;
    margin: 0;
}

/* The fonts as tiles, on the template gallery's grid, tile, thumbnail and badge (template-gallery.css,
   under .aw-page). Narrower columns than the gallery's 270 px, so that two tiles fit side by side at an
   800 px window beside the side menu; wider ones once the tab has room. */
.aw-page .aw-gallery-grid.network-fonts-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
}

@container (min-width: 760px) {
    .aw-page .aw-gallery-grid.network-fonts-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* A tile is not a button: nothing happens on a click outside its bin. */
.aw-page .aw-tile.network-fonts-tile {
    cursor: default;
}

/* The specimen, in the font itself (the fallback until the browser has registered it): a large "Aa" and
   the sample line, centred on the dotted ground above the format badge, which keeps the panel's font.
   Sized to the thumbnail's width. */
.aw-page .aw-thumb.network-fonts-thumb {
    container-type: inline-size;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 14px 28px;
    color: var(--vn-text);
}

.network-fonts-sample {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    min-width: 0;
}

.network-fonts-glyphs {
    font-size: clamp(30px, 22cqw, 72px);
    line-height: 1;
    white-space: nowrap;
}

.network-fonts-specimen {
    max-width: 100%;
    font-size: clamp(12px, 7cqw, 18px);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Where the font is used: the whole sentence, on two lines when the tile is narrow. */
.aw-page .aw-tile-details.network-fonts-usage {
    white-space: normal;
    color: var(--vn-head);
}

.aw-page .aw-tile-details.network-fonts-usage.is-free {
    color: var(--vn-label);
}

/* The bin, in the thumbnail's top-right corner where the gallery puts its tick. */
.network-fonts-trash {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #ffffff;
    color: var(--vn-bad);
    box-shadow: 0 1px 4px rgba(33, 28, 51, .22);
    cursor: pointer;
}

.network-fonts-trash:hover {
    background: var(--vn-bad-soft);
}

.network-fonts-trash:focus-visible {
    outline: 2px solid #334194;
    outline-offset: 2px;
}

/* The upload window. */
.network-font-upload-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #6c757d;
    margin-bottom: 4px;
}

/* theme.css sizes every field 42 px with 14 px text but leaves file inputs out, so this one would keep
   Bootstrap's 38 px, site.css's 12 px text (set !important on every input) and a 30 px grey button.
   Here it matches the name field below it: the same height, text and radius, and the button fills the
   field's left end. */
main .network-font-upload .network-font-upload-file {
    height: 42px;
    padding: 0 12px 0 0;
    font-size: 14px !important;
    line-height: 42px;
    overflow: hidden;
}

main .network-font-upload .network-font-upload-file::file-selector-button {
    height: 100%;
    margin: 0 12px 0 0;
    padding: 0 16px;
    border: 0;
    border-right: 1px solid rgba(33, 28, 51, .12);
    border-radius: 12px 0 0 12px;
    background-color: #e7e3f1;
    color: var(--vn-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

/* Bootstrap draws a select's text at 16 px; the window's other fields have 14. */
main .network-font-upload .network-font-upload-network {
    font-size: 14px;
}

main .network-font-upload .network-font-upload-file:hover::file-selector-button {
    background-color: #ddd7ec;
}

.network-font-upload-hint {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

.network-font-upload-error {
    margin-top: 12px;
    font-size: 13px;
    color: #b3124b;
}
