@font-face {
    font-family: "Noto Serif";
    src: url("../fonts/noto-serif-latin-400-normal.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                   U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                   U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Title appearance. To change the font, add an @font-face rule above and
   put its font-family name first in --title-font-family. */
:root {
    --title-font-family: "Noto Serif", Georgia, "Times New Roman", serif;
    --title-font-size: 3em;
    /* Only the 400 weight is installed; a bolder value makes browsers fake bold. */
    --title-font-weight: 400;
    --title-logo-height: 2.5em;
    --subtitle-font-size: 1.5em;
}

/* page frame from layout.html. webTiberius sets this as a style attribute on
   the logo, which the CSP forbids here */
.logo img {
    max-height: 60px;
}

/* the content column. new2.css resets nearly every element (font: inherit,
   no list bullets) and gives p and li a fixed size, errors.css indents h1 and
   h2. These rules undo what learnMSA's pages rely on */
.column-2 h1,
.column-2 h2 {
    margin-left: 0;
    margin-right: 0;
}

.column-2 h2 {
    margin-top: 1em;
}

.column-2 h3 {
    margin-top: 0.8em;
}

.column-2 pre,
.column-2 code {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.9rem;
}

.column-2 pre {
    margin: 0.8em 0;
    background: #f4f6fa;
    border: 1px solid #e1e5ee;
    border-radius: 4px;
    padding: 0.8em;
    overflow-x: auto;
}

.column-2 textarea {
    width: 100%;
    box-sizing: border-box;
}

.title {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.3em;
    font-family: var(--title-font-family);
    font-size: var(--title-font-size);
    font-weight: var(--title-font-weight);
    /* new2.css colours every h1 blue */
    color: #000;
}

.title-logo {
    height: var(--title-logo-height);
    width: auto;
}

/* the tagline right below the title */
.subtitle {
    font-size: var(--subtitle-font-size);
    margin-top: -0.3em;
}

/* sections of the submission form: a rule, then a header like those of the
   info sections at the foot of the page */
.form-separator {
    /* new2.css draws every hr as a navy 1px background */
    background: #e5e5e5;
    height: 1px;
    border: 0;
    margin: 1.2em 0 0.8em;
}

.column-2 h2.form-section {
    margin: 0 0 0.6rem;
    text-align: left;
    font-family: var(--title-font-family);
    font-size: 1.15rem;
    font-weight: var(--title-font-weight);
    color: #000e6b;
}

/* the structure input and the count of the selection below it */
.structure-pickers {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.column-2 p.structure-summary {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}

.column-2 p.structure-summary:empty {
    display: none;
}

/* labels as wide as they need, the fields take the rest of the column. the
   minimum keeps the fields of the separate section grids in one column */
.form-grid {
    display: grid;
    grid-template-columns: minmax(10em, max-content) 1fr;
    gap: 15px;
    align-items: center;
    text-align: left;
}

.form-grid input[type="checkbox"] {
    justify-self: start;
}

/* phones: the title and logo would overflow the column, and two form
   columns leave too little room for the fields */
@media (max-width: 480px) {
    :root {
        --title-font-size: 2em;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    /* mobile.css sets input[type=submit] to width: auto */
    input.submit-btn {
        width: 100%;
    }
}

.advanced-toggle {
    display: block;
    margin: 20px 0 10px 0;
    color: #007bff;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9rem;
    text-align: left;
}

.advanced-options {
    display: none;
    margin-bottom: 15px;
    padding-top: 10px;
    border-top: 1px dashed #eee;
}

.submit-btn {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
}

.submit-btn:hover {
    background-color: #0056b3;
}
/* submission errors. the CSP forbids inline styles, so this cannot live in a
   style attribute on the element itself. Looks like new2.css's .errormessage,
   new2.css has a .form-error of its own that this replaces */
.form-error {
    background: #fff3f3 url(../images/skin/exclamation.png) 8px 50% no-repeat;
    border: 1px solid red;
    color: #cc0000;
    margin: 10px 0 5px 0;
    padding: 5px 5px 5px 30px;
}

/* note on the example's job page, looks like new2.css's .message */
.example-result-notice {
    background: #f3f8fc url(../images/skin/information.png) 8px 50% no-repeat;
    border: 1px solid #b2d1ff;
    color: #006dba;
    margin: 10px 0 5px 0;
    padding: 5px 5px 5px 30px;
}

/* standing note about the input requirements, shown above the form. same
   reason as .form-error: the CSP forbids a style attribute on the element */
.form-notice {
    color: #000e6b;
    background-color: #e3eafd;
    border-left: 4px solid #1250fb;
    padding: 0.6em 0.9em;
    margin: 0.5em 0 1em;
}

/* "?" markers next to the input fields. the tooltip is pure CSS because the
   CSP forbids inline scripts and styles, and the text comes from the
   data-tooltip attribute that build_input_help() fills in */
.help-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    border: 1px solid #007bff;
    border-radius: 50%;
    color: #007bff;
    font-size: 0.75rem;
    line-height: 1;
    cursor: help;
    user-select: none;
}

.help-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 0;
    width: 260px;
    padding: 8px;
    border-radius: 4px;
    background-color: #333;
    color: white;
    font-size: 0.8rem;
    line-height: 1.3;
    white-space: normal;
    text-align: left;
    z-index: 10;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
}

.help-icon:hover::after,
.help-icon:focus::after,
.help-icon:focus-visible::after {
    visibility: visible;
    opacity: 1;
}

/* the same tooltip as a red "!", for options we advise against */
.help-icon.warn-icon {
    border-color: #d32f2f;
    color: #d32f2f;
    font-weight: bold;
}

/* example data links above the input fields */
.example-notice {
    font-size: 0.9rem;
    text-align: left;
    margin: 0 0 0.8em;
}

/* link to the API docs and the template client, under the tagline of the
   submission form */
.api-notice {
    font-size: 0.95rem;
    margin: 0 0 0.8em;
}

.api-notice a {
    color: #1250fb;
    font-weight: 600;
}

.api-table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
}

.api-table th,
.api-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 6px 8px;
    vertical-align: top;
    text-align: left;
}

.download-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    text-decoration: none;
}

/* new2.css's a:hover would turn the text dark blue and underline it */
.download-btn:hover {
    background-color: #0056b3;
    color: white;
    text-decoration: none;
}

/* the "Try Again" button on server_busy.html */
.busy-actions {
    margin: 1.5em 0 1em;
}

/* info sections at the foot of the create page */
.info-sections {
    margin-top: 2rem;
    text-align: left;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
}

.info-section {
    padding: 1rem 0;
    border-top: 1px solid #e5e5e5;
}

.info-section h2 {
    margin: 0 0 0.5rem;
    font-family: var(--title-font-family);
    font-size: 1.15rem;
    font-weight: var(--title-font-weight);
    color: #000e6b;
}

/* new2.css gives p and li a fixed 17px */
.info-section p,
.info-section li {
    margin: 0.4rem 0;
    font-size: inherit;
}

.info-section a {
    color: #007bff;
}

.info-section code,
.a2m-example {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.info-section code {
    padding: 0 0.3em;
    border-radius: 3px;
    background-color: #e3eafd;
    color: #000e6b;
}

.a2m-legend {
    margin: 0.4rem 0;
    padding-left: 1.2rem;
}

.a2m-example {
    margin: 0.6rem 0 0;
    padding: 0.6em 0.9em;
    border-left: 4px solid #1250fb;
    background-color: #f5f7fd;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
}

.runtime-table {
    width: auto;
    margin: 0.6rem 0 0;
    border-collapse: collapse;
}

.runtime-table th,
.runtime-table td {
    padding: 4px 12px;
    border-bottom: 1px solid #e5e5e5;
    text-align: right;
    white-space: nowrap;
}

.runtime-table td {
    font-variant-numeric: tabular-nums;
}

.a2m-header {
    color: #888;
    letter-spacing: normal;
}

.citations {
    margin: 0.4rem 0;
    padding-left: 1.2rem;
}

.citations li + li {
    margin-top: 0.5rem;
}

/* plot of the profile HMM, alignment/hmm.html. set here, the CSP blocks inline styles.
   scaled to the available width, below min-width it scrolls instead of
   shrinking until it is unreadable */
.hmm-plot {
    width: 100%;
    min-width: 600px;
    height: auto;
    display: block;
}

/* the plot and the alignment viewer embedded in the job page. the plot only
   scrolls inside its box when the window is narrower than its min-width */
.hmm-embed {
    overflow-x: auto;
    border: 1px solid #ddd;
}

.msa-embed {
    display: block;
    width: 100%;
    height: 80vh;
    border: 1px solid #ddd;
    box-sizing: border-box;
}

.embed-links {
    margin: 0 0 0.5em;
    font-size: 0.9rem;
}

/* the help page, help.html */
.help-toc {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.help-toc a {
    color: #007bff;
}

/* state letters in the help text, in the colours of the viewer's state track
   (M, I) and of the plot (D, the special states) */
.state {
    display: inline-block;
    min-width: 1.4em;
    padding: 0 0.3em;
    border-radius: 3px;
    text-align: center;
    font-weight: bold;
    font-size: 0.85em;
    line-height: 1.5;
}

.state-m {
    background-color: #6b93ca;
    color: #ffffff;
}

.state-i {
    background-color: #f3cf6c;
    color: #1a1a1a;
}

.state-d {
    background-color: #cc4b37;
    color: #ffffff;
}

.state-x {
    background-color: #6e6e6e;
    color: #ffffff;
}
