/* The third-party notices, in the help menu's dialog and on the /Licenses page behind it.
   One partial, two homes - so the padding is the page's, not the list's. Every colour comes
   from tokens.css, which is what makes the dialog follow the theme. */

.licenses {
    max-width: 68em;
}

.licenses-page {
    padding: 0 1.5em 3em;
}

/* modal-lg is 800px, too narrow for a name, a version, an SPDX expression and a delivery
   note on one line. Bootstrap 4.0 has no modal-xl, and no scrollable body either. */
.licenses-modal .modal-dialog {
    max-width: 76em;
    width: calc(100% - 3.5rem);
}

/* Rendered outside .main-right, so it inherits bootstrap's body colour. */
.licenses-modal .modal-content {
    color: var(--text);
}

.licenses-modal .modal-body {
    max-height: 74vh;
    overflow-y: auto;
}

.licenses-modal .licenses {
    max-width: none;
}

.licenses-intro,
.licenses-lede {
    color: var(--text-secondary);
    max-width: 62em;
}

.licenses-empty {
    color: var(--text-secondary);
    padding: 2em 0;
}

.licenses-figures {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5em;
    align-items: flex-end;
    padding: 1em 0 1.4em;
    border-bottom: 1px solid var(--border);
}

.figure-n {
    font-size: 2.2rem;
    line-height: 1;
    color: var(--accent-text);
}

.figure-l {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-meta);
    margin-top: .5em;
}

.figure-link {
    display: inline-block;
    color: var(--accent-text);
}

.licenses-filter {
    margin: 1.6em 0 .5em;
    max-width: 26em;
    background: var(--bg-input);
    border-color: var(--border);
    color: var(--text);
}

/* Bootstrap's classes for the look, but the partial's own script does the switching - it can
   render twice in one document, and nav-tabs targets a pane by element id. */
.licenses-tabs {
    margin-top: 1.4em;
    border-bottom-color: var(--border);
}

.licenses-tabs .nav-link {
    color: var(--text-secondary);
    border-color: transparent;
    cursor: pointer;
}

.licenses-tabs .nav-link:hover {
    border-color: transparent transparent var(--border);
}

.licenses-tabs .nav-link.active {
    color: var(--text);
    background: var(--bg-surface);
    border-color: var(--border) var(--border) var(--bg-surface);
}

/* A tab with no matches left after filtering, which is worth seeing before you click it. */
.licenses-tabs .nav-link.empty {
    opacity: .45;
}

.lic-count {
    font-size: .78rem;
    color: var(--text-meta);
    margin-left: .35em;
}

.licenses-pane[hidden] {
    display: none;
}

.licenses-source {
    color: var(--text-meta);
    font-size: .82rem;
    margin: .9em 0 0;
}

.licenses-h2 {
    font-size: 1.3rem;
    margin-top: 1.8em;
}

/* Only the hand-kept entries carry one: what the thing is for, and why it is in the product. */
.lic-note {
    color: var(--text-secondary);
    margin: 0 0 1em;
    max-width: 62em;
}

.license-list {
    border-top: 1px solid var(--border);
    margin-top: 1em;
}

.license {
    border-bottom: 1px solid var(--border);
}

.license > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5em 1em;
    padding: .55em .4em;
    cursor: pointer;
}

.license > summary:hover {
    background: var(--row-stripe);
}

.lic-name {
    font-weight: 600;
    /* The one column worth aligning: names run from 'lie' to '@cornerstonejs/dicom-image-loader'. */
    min-width: 22em;
}

.lic-version,
.lic-via {
    color: var(--text-meta);
    font-size: .85rem;
}

.lic-badge {
    font-size: .78rem;
    letter-spacing: .04em;
    padding: .15em .6em;
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    color: var(--text-secondary);
}

/* Copyleft with no permissive alternative, and a package that declares nothing at all:
   the two states that need someone to make a decision rather than just keep a notice. */
.lic-badge.copyleft {
    color: var(--danger);
    border-color: var(--danger);
}

.lic-badge.unstated {
    color: var(--accent-text);
    border-color: var(--accent-border);
}

.lic-body {
    padding: .3em 1em 1.4em;
}

.lic-facts {
    display: grid;
    grid-template-columns: 9em 1fr;
    gap: .1em 1em;
    margin: 0 0 1em;
    font-size: .9rem;
}

.lic-facts dt {
    color: var(--text-meta);
    font-weight: normal;
}

.lic-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.lic-text {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 1em 1.2em;
    margin: 0;
    max-height: 26em;
    overflow: auto;
    font-size: .82rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.lic-notext {
    color: var(--text-meta);
    margin: 0;
}

@media (max-width: 700px) {
    .lic-name {
        min-width: 0;
        flex-basis: 100%;
    }

    .lic-facts {
        grid-template-columns: 1fr;
    }
}
