/* /security/ — the public security area (list and detail page).
   Page-only sheet, loaded via extra_head of advisories/vulnerability_list.html and
   advisories/vulnerability_detail.html. Tokens only. The severity badge (.app-sev)
   and the reason chips (.app-sec-reason) live in components.css, shared with the
   /sudo/ security tab. */

/* ---- Rules line and search ---- */
.app-sec-rules {
    margin: -0.5rem 0 1.25rem;
    color: var(--app-muted);
}

.app-sec-rules__asof {
    display: block;
    margin-top: 0.25rem;
    font-family: var(--app-font-mono);
    color: var(--app-faint);
}

.app-sec-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 1rem;
}

.app-sec-search__cmd {
    font-family: var(--app-font-mono);
    font-size: 0.85rem;
    color: var(--app-faint);
}

.app-sec-search__input {
    flex: 1 1 14rem;
    min-width: 0;
}

/* The filter rows reuse .app-list-filter (blog.css); stacked, they need less space between. */
.app-list-filter + .app-list-filter {
    margin-top: -1.1rem;
}

.app-sec-count {
    margin: 0 0 0.75rem;
    font-family: var(--app-font-mono);
    font-size: 0.85rem;
    color: var(--app-faint);
}

/* ---- List: one log entry per vulnerability ---- */
.app-sec-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--app-border);
}

.app-sec-entry {
    padding: 1rem 0 1rem 0.85rem;
    border-bottom: 1px solid var(--app-border);
    border-left: 2px solid transparent;
}

/* Exploited in the wild: a red margin mark, like a flagged log line (the KEV badge says it in words). */
.app-sec-entry--kev {
    border-left-color: var(--app-danger);
}

.app-sec-entry__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    margin: 0 0 0.35rem;
    font-family: var(--app-font-mono);
    font-size: 0.8rem;
    color: var(--app-faint);
}

.app-sec-entry__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
}

.app-sec-entry__title a {
    color: var(--app-text-strong);
    text-decoration: none;
}

.app-sec-entry__title a:hover,
.app-sec-entry__title a:focus-visible {
    color: var(--app-link-hover);
}

.app-sec-entry__id {
    margin-right: 0.5rem;
    font-family: var(--app-font-mono);
    color: var(--app-green);
    white-space: nowrap;
}

.app-sec-entry__product {
    margin: 0.15rem 0 0;
    font-family: var(--app-font-mono);
    font-size: 0.8rem;
    color: var(--app-muted);
}

.app-sec-entry__summary {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: var(--app-muted);
    overflow-wrap: anywhere;
}

.app-sec-entry__summary::before {
    margin-right: 0.4rem;
    color: var(--app-green);
    content: ">";
}

/* ---- Badges ---- */
.app-sec-badges {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.app-sec-badge {
    display: inline-block;
    padding: 0 0.4em;
    border: 1px solid var(--app-border-strong);
    border-radius: var(--app-radius-sm);
    font-family: var(--app-font-mono);
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--app-muted);
    white-space: nowrap;
}

.app-sec-badge--kev {
    border-color: var(--app-danger);
    color: var(--app-danger);
    background: var(--app-danger-bg);
}

.app-sec-badge--ransomware {
    border-color: var(--app-danger);
    color: var(--app-text-strong);
    background: var(--app-danger-bg);
}

.app-sec-badge--due {
    border-color: var(--app-warning);
    color: var(--app-warning);
}

/* ---- Why it is listed ---- */
.app-sec-why {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.4rem;
    margin: 0.5rem 0 0;
    font-family: var(--app-font-mono);
    font-size: 0.75rem;
}

.app-sec-why__label {
    color: var(--app-faint);
}

/* ---- Detail page ---- */
.app-sec-detail__id {
    font-family: var(--app-font-mono);
    overflow-wrap: anywhere;
}

.app-sec-detail__badges {
    margin: 0.75rem 0 0;
}

.app-sec-block {
    margin-top: 2rem;
}

.app-sec-block__title {
    margin: 0 0 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--app-border);
    font-family: var(--app-font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--app-text-strong);
}

.app-sec-block__title::before {
    color: var(--app-green);
    content: "## ";
}

.app-sec-block__subtitle {
    margin: 1.25rem 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--app-text);
}

.app-sec-block--kev .app-sec-block__title::before {
    color: var(--app-danger);
}

.app-sec-description {
    max-width: var(--app-prose-width);
    margin: 0 0 1rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.app-sec-facts {
    display: grid;
    gap: 0.45rem;
    margin: 0;
}

.app-sec-facts > div {
    display: grid;
    grid-template-columns: minmax(9rem, 14rem) 1fr;
    gap: 0.75rem;
}

.app-sec-facts dt {
    font-size: 0.85rem;
    color: var(--app-faint);
}

.app-sec-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.app-sec-vector {
    font-size: 0.85rem;
}

.app-sec-alert {
    color: var(--app-danger);
}

.app-sec-products,
.app-sec-links,
.app-sec-refs,
.app-sec-cpes ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-sec-products li,
.app-sec-refs li {
    padding: 0.2rem 0;
    overflow-wrap: anywhere;
}

.app-sec-products__purl {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    color: var(--app-muted);
}

.app-sec-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
    font-family: var(--app-font-mono);
    font-size: 0.85rem;
}

.app-sec-refs {
    font-size: 0.85rem;
}

.app-sec-refs__tags {
    font-family: var(--app-font-mono);
    font-size: 0.75rem;
    color: var(--app-faint);
}

.app-sec-cpes {
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.app-sec-cpes summary {
    cursor: pointer;
    font-family: var(--app-font-mono);
    color: var(--app-muted);
}

.app-sec-cpes li {
    overflow-wrap: anywhere;
}

/* ---- Sources (the area's footer) ---- */
.app-sec-sources {
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--app-border-strong);
    font-size: 0.8rem;
    color: var(--app-muted);
}

.app-sec-sources__title {
    margin: 0 0 0.5rem;
    font-family: var(--app-font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--app-faint);
}

.app-sec-sources__list {
    display: grid;
    gap: 0.3rem;
    margin: 0 0 0.5rem;
    padding-left: 1.1rem;
}

.app-sec-sources__note {
    margin: 0;
    color: var(--app-faint);
}

@media (max-width: 640px) {
    .app-sec-entry {
        padding-left: 0.6rem;
    }

    .app-sec-facts > div {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }

    .app-sec-reason {
        white-space: normal;
    }
}
