/*
 * mentaxonomy Molecular
 * Analysis results.
 *
 * Loaded after molecular.css and advanced-options.css.
 */


/* Result container
-------------------------------------------------- */

.analysis-result {
    max-width: 1160px;
    margin-top: 48px;
    padding-top: 34px;

    border-top: 1px solid #e1e8e3;
}


/* Result heading
-------------------------------------------------- */

.analysis-result > h2 {
    margin: 0 0 22px;

    color: #202722;

    font-size: clamp(
        1.65rem,
        2.6vw,
        2.15rem
    );
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
}


/* Analysis metadata
-------------------------------------------------- */

.analysis-time {
    margin: 0 0 8px;

    color: #718078;

    font-size: 0.78rem;
    line-height: 1.5;
}


/* Analysis summary
-------------------------------------------------- */

.analysis-summary {
    display: grid;
    grid-template-columns:
        minmax(180px, 1fr)
        minmax(300px, 2fr)
        minmax(100px, 0.55fr);

    margin-bottom: 14px;

    overflow: hidden;

    background: #f7f8f6;

    border: 1px solid #dbe4de;
    border-radius: 7px;
}

.analysis-summary > div {
    min-width: 0;
    padding: 18px 20px;

    color: #435149;

    font-size: 0.9rem;
    line-height: 1.55;
}

.analysis-summary > div:not(:last-child) {
    border-right: 1px solid #dfe6e1;
}

.analysis-summary strong {
    display: inline-block;

    margin-bottom: 4px;

    color: #397c55;

    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.analysis-summary > div:last-child {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.analysis-summary > div:last-child br {
    display: none;
}

.analysis-summary > div:last-child {
    color: #202722;

    font-size: 1.35rem;
    font-weight: 700;
}


/* Results table
-------------------------------------------------- */

.results-table-wrapper {
    width: 100%;
    margin-top: 28px;

    overflow-x: auto;

    background: #ffffff;

    border: 1px solid #dbe4de;
    border-radius: 7px;

    box-shadow:
        0 1px 2px rgba(22, 52, 35, 0.02);
}

.results-table {
    width: 100%;

    border-collapse: collapse;

    color: #303d35;

    font-size: 0.86rem;
}

.results-table th {
    padding: 12px 14px;

    color: #526158;
    background: #f5f8f6;

    border-bottom: 1px solid #dbe4de;

    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-align: left;
    text-transform: uppercase;

    white-space: nowrap;
}

.results-table td {
    padding: 14px;

    vertical-align: middle;

    border-bottom: 1px solid #e5ebe7;
}

.results-table tbody > tr:not(.result-detail-row) {
    transition: background-color 100ms ease;
}

.results-table tbody > tr:not(.result-detail-row):hover {
    background: #f8faf9;
}

.results-table tbody > tr:last-of-type td {
    border-bottom: 0;
}

.results-table td:first-child,
.results-table th:first-child {
    width: 42px;

    color: #7a8880;

    text-align: center;
}

.results-table td:nth-child(2) {
    color: #26342c;

    font-weight: 600;
}

.results-table td:nth-child(3) {
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    font-size: 0.8rem;
}

.results-table td:nth-child(5),
.results-table td:nth-child(6) {
    white-space: nowrap;
}

.results-table td:nth-child(5) strong {
    color: #286844;
}

.results-table td:last-child,
.results-table th:last-child {
    width: 78px;

    text-align: right;
}

.results-table td:last-child a {
    color: #397c55;

    font-size: 0.8rem;
    font-weight: 700;

    text-decoration: none;
}

.results-table td:last-child a:hover {
    color: #285f3e;

    text-decoration: underline;
    text-underline-offset: 0.18em;
}


.results-table th.sortable {
    cursor: pointer;

    user-select: none;
}

.results-table th.sortable::after {
    content: '↕';

    display: inline-block;

    margin-left: 6px;

    color: #9aa69f;

    font-size: 0.75em;
    font-weight: 600;

    vertical-align: 0.08em;
}

.results-table th.sortable:hover {
    color: #397c55;
}

.results-table th.sortable:hover::after {
    color: #718078;
}

.results-table th.sortable[aria-sort="ascending"]::after {
    content: '↑';

    color: #397c55;
}

.results-table th.sortable[aria-sort="descending"]::after {
    content: '↓';

    color: #397c55;
}


/* Detail rows
-------------------------------------------------- */

.result-detail-row > td {
    padding: 0 !important;

    background: #ffffff;

    border-bottom: 0;
}

.result-detail {
    border-bottom: 1px solid #e5ebe7;
}

.result-detail > summary {
    display: none;
}


/*
 * The "Details" link targets the <details> element.
 * Open the corresponding panel when it is the URL target.
 */


.result-detail[open] > summary {
    display: block;

    padding: 12px 18px;

    color: #365d47;
    background: #f3f7f4;

    border-top: 1px solid #dfe7e1;
    border-bottom: 1px solid #dfe7e1;

    cursor: pointer;

    font-size: 0.82rem;
    font-weight: 650;
}


/* Detail content
-------------------------------------------------- */

.result-detail-content {
    padding: 24px 22px 28px;

    background: #fbfcfb;
}

.result-detail-content > p:first-child {
    max-width: 900px;
    margin: 0 0 22px;

    color: #59675f;

    font-size: 0.84rem;
    line-height: 1.55;
}

.result-detail-content h3 {
    margin: 28px 0 12px;

    color: #244d38;

    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.result-detail-content h3:first-child {
    margin-top: 0;
}


/* Hit metrics
-------------------------------------------------- */

.hit-metrics {
    display: grid;
    grid-template-columns:
        repeat(
            3,
            minmax(140px, 1fr)
        );

    margin: 0;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid #dfe7e1;
    border-radius: 6px;
}

.hit-metrics > div {
    min-width: 0;
    padding: 13px 15px;

    border-right: 1px solid #e5ebe7;
    border-bottom: 1px solid #e5ebe7;
}

.hit-metrics > div:nth-child(3n) {
    border-right: 0;
}

.hit-metrics > div:nth-last-child(-n + 3) {
    border-bottom: 0;
}

.hit-metrics dt {
    margin: 0 0 4px;

    color: #77847c;

    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.hit-metrics dd {
    margin: 0;

    color: #26342c;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    font-size: 0.82rem;
    font-weight: 600;
}


/* Alignment
-------------------------------------------------- */

.alignment {
    max-width: 100%;
    margin: 0;
    padding: 18px 20px;

    overflow-x: auto;

    color: #26342c;
    background: #f4f7f5;

    border: 1px solid #dbe4de;
    border-radius: 6px;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        monospace;

    font-size: 0.78rem;
    line-height: 1.55;

    tab-size: 4;
}


/* Taxonomy
-------------------------------------------------- */

.taxonomy {
    display: grid;
    grid-template-columns:
        repeat(
            3,
            minmax(140px, 1fr)
        );

    margin: 0;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid #dfe7e1;
    border-radius: 6px;
}

.taxonomy > div {
    min-width: 0;
    padding: 12px 15px;

    border-right: 1px solid #e5ebe7;
    border-bottom: 1px solid #e5ebe7;
}

.taxonomy > div:nth-child(3n) {
    border-right: 0;
}

.taxonomy dt {
    margin: 0 0 4px;

    color: #77847c;

    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.taxonomy dd {
    margin: 0;

    color: #26342c;

    font-size: 0.84rem;
    line-height: 1.4;

    overflow-wrap: anywhere;
}


/* SILVA taxonomy path
-------------------------------------------------- */

.taxonomy--silva {
    grid-template-columns: 1fr;
}

.taxonomy--silva > div {
    border-right: 0;
}

.taxonomy--silva > div:last-child {
    border-bottom: 0;
}


/* Raw JSON
-------------------------------------------------- */

.raw-json {
    margin-top: 30px;

    border-top: 1px solid #e1e8e3;
}

.raw-json > summary {
    width: fit-content;

    padding: 14px 0;

    color: #718078;

    cursor: pointer;

    font-size: 0.78rem;
    font-weight: 600;

    user-select: none;
}

.raw-json > summary:hover {
    color: #397c55;
}

.raw-json > pre {
    max-height: 520px;
    margin: 0;
    padding: 18px 20px;

    overflow: auto;

    color: #344139;
    background: #f5f7f5;

    border: 1px solid #dfe6e1;
    border-radius: 6px;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    font-size: 0.76rem;
    line-height: 1.5;

    white-space: pre;
}


/* Empty result
-------------------------------------------------- */

.analysis-result > p:not(.analysis-time) {
    padding: 18px 20px;

    color: #59675f;
    background: #f7faf8;

    border: 1px solid #dfe7e1;
    border-radius: 6px;
}


/* Responsive
-------------------------------------------------- */

@media (max-width: 800px) {

    .analysis-result {
        margin-top: 38px;
        padding-top: 28px;
    }

    .analysis-summary {
        grid-template-columns: 1fr;
    }

    .analysis-summary > div:not(:last-child) {
        border-right: 0;
        border-bottom: 1px solid #dfe6e1;
    }

    .analysis-summary > div:last-child {
        display: block;

        font-size: 0.9rem;
        font-weight: 400;
    }

    .analysis-summary > div:last-child br {
        display: initial;
    }

    .hit-metrics,
    .taxonomy {
        grid-template-columns:
            repeat(
                2,
                minmax(120px, 1fr)
            );
    }

    .hit-metrics > div,
    .taxonomy > div {
        border-right: 1px solid #e5ebe7;
        border-bottom: 1px solid #e5ebe7;
    }

    .hit-metrics > div:nth-child(3n),
    .taxonomy > div:nth-child(3n) {
        border-right: 1px solid #e5ebe7;
    }

    .hit-metrics > div:nth-child(2n),
    .taxonomy > div:nth-child(2n) {
        border-right: 0;
    }

    .result-detail-content {
        padding: 20px 16px 24px;
    }
}


@media (max-width: 520px) {

    .hit-metrics,
    .taxonomy {
        grid-template-columns: 1fr;
    }

    .hit-metrics > div,
    .taxonomy > div,
    .hit-metrics > div:nth-child(2n),
    .taxonomy > div:nth-child(2n),
    .hit-metrics > div:nth-child(3n),
    .taxonomy > div:nth-child(3n) {
        border-right: 0;
        border-bottom: 1px solid #e5ebe7;
    }

    .hit-metrics > div:last-child,
    .taxonomy > div:last-child {
        border-bottom: 0;
    }

    .alignment {
        padding: 14px;

        font-size: 0.72rem;
    }
}