/* Fonts */
@font-face {
    font-family: 'Press Start 2P';
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url('/assets/fonts/press-start-2p.woff2') format('woff2');
}
@font-face {
    font-family: 'Red Hat Mono';
    font-style: normal;
    font-weight: 300 700;
    font-display: block;
    src: url('/assets/fonts/red-hat-mono.woff2') format('woff2');
}

/* Generic */
:root {
    --primary-color: #fcfcfc;
    --heading-color: #fff;
    --background-color: #222;
    --font-regular: "Red Hat Mono", monospace;
    --font-brand: "Press Start 2P", system-ui;
    --font-heading: "Red Hat Mono", monospace;
    --list-padding-left: 20px;
    --link-hover-background-color: #1abc9c;
    --link-hover-color: #c0392b;
    --code-background-color: #2e2e2e;
    --muted-color: #888;
    --link-color-weight: 600;
    --page-width: 550px;
}
body {
    max-width: var(--page-width);
    background-color: var(--background-color);
    margin: 15px;
}
body > * {
    padding-left: 5px;
    padding-right: 5px;
    font-size: 15px;
}
ul {
    padding-left: var(--list-padding-left);
}
ol {
    padding-left: var(--list-padding-left);
    margin-left: 15px;
}
.brand, a.brand {
    display: block;
    font-size: 16px;
    font-family: var(--font-brand);
    background-image: url('/assets/icon.svg');
    background-repeat: no-repeat;
    background-position: center left;
    padding: 5px 0 5px 25px;
    margin: 0.67em 0;
    line-height: 1.5;
    color: var(--link-hover-background-color);
    font-weight: 500;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: unset;
}
h1:not(.brand) {
    font-size: 1.4em;
    font-weight: 600;
}
h2 {
    font-size: 1em;
    font-weight: 600;
    font-family: var(--font-heading);
    margin-top: 30px;
    color: var(--heading-color);
}
body, a, :link, :visited {
    color: var(--primary-color);
    font-family: var(--font-regular);
    font-optical-sizing: auto;
    text-decoration: none;
}
a:link:not(.nostyle), a:visited:not(.nostyle) {
    color: var(--link-hover-background-color);
    font-weight: var(--link-color-weight);
}
a:not(.nostyle):hover {
    background: var(--link-hover-background-color);
    color: var(--link-hover-color);
}
li {
    padding-bottom: 5px;
}
footer {
    margin-top: 30px;
    color: var(--muted-color);
}

/* Homepage */
.recent-discoveries {
    padding: 0 5px;
    padding-left: var(--list-padding-left);
    margin-top: 5px;
    margin-bottom: 0;
}
.recent-discoveries a, .recent-discoveries-intro {
    display: flex;
}
.recent-discoveries a > *, .recent-discoveries-intro > * {
    flex: 0;
    white-space: nowrap;
}
.recent-discoveries-intro {
    font-weight: var(--link-color-weight);
    padding-left: var(--list-padding-left);
    margin-top: 15px;
}
.recent-discoveries a > :nth-child(1), .recent-discoveries-intro > :nth-child(1) {
    min-width: 170px;
}
.recent-discoveries a > :nth-child(2), .recent-discoveries-intro > :nth-child(2) {
    flex: 1;
}
.recent-discoveries a > :nth-child(3), .recent-discoveries-intro > :nth-child(3) {
    min-width: 155px;
}
.recent-discoveries a > :nth-child(4), .recent-discoveries-intro > :nth-child(4) {
    min-width: 90px;
    text-align: right;
}
.recent-discoveries a > :nth-child(1) {
    color: var(--link-hover-background-color);
    font-weight: var(--link-color-weight);
}
.recent-discoveries a:hover {
    background-color: var(--link-hover-background-color);
    color: var(--link-hover-color);
    font-weight: var(--link-color-weight);
}
.recent-discoveries a:hover > :nth-child(1) {
    color: var(--link-hover-color);
    font-weight: var(--link-color-weight);
}

/* Abbreviations */
abbr[data-tooltip] {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}
abbr[data-tooltip]::after {
    content: "i";
    font-size: 0.7em;
    padding: 0 4px;
    border-radius: 50%;
    background: var(--code-background-color);
}
abbr[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--code-background-color);
    color: var(--primary-color);
    padding: 4px 8px;
    font-size: 0.85em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}
abbr[data-tooltip]:hover::before {
    opacity: 1;
}
a:hover abbr[data-tooltip]::after {
    background: rgba(0, 0, 0, 0.15);
}

code {
    background-color: var(--code-background-color);
    padding: 1px 4px;
    color: var(--link-hover-background-color);
    overflow-wrap: break-word;
}
pre {
    background-color: var(--code-background-color);
    padding: 10px 15px;
    overflow-x: auto;
    scrollbar-color: var(--muted-color) var(--code-background-color);
    scrollbar-width: thin;
}
pre code {
    padding: 0;
}

/* Discoveries */
.meta {
    font-size: 0.8em;
}
.meta > div {
    display: flex;
    padding: 3px 0;
}
.meta > div > * {
    flex: 0;
    white-space: nowrap;
}
.meta > div > :nth-child(1) {
    min-width: 130px;
}
.meta > div > :nth-child(2) {
    flex: 1;
}
.meta small, .muted {
    color: var(--muted-color);
}
/* Viewport */
@media screen and (max-width: 768px) {
    :root {
        --page-width: 100vw;
    }
    .cvss-vector {
        margin-top: 5px;
        display: block;
    }
    .recent-discoveries a > :nth-child(1), .recent-discoveries-intro > :nth-child(1) {
        flex: 3;
        min-width: 140px;
    }
    .recent-discoveries a > :nth-child(2), .recent-discoveries-intro > :nth-child(2) {
        flex: 2;
        min-width: 0;
    }
    .recent-discoveries a > :nth-child(3), .recent-discoveries-intro > :nth-child(3) {
        flex: 3;
        min-width: 0;
    }
    .recent-discoveries a > :nth-child(4), .recent-discoveries-intro > :nth-child(4) {
        flex: 2;
        min-width: 0;
        text-align: right;
    }
    .meta > div > :nth-child(1) {
        min-width: 100px;
    }
}
@media screen and (max-width: 600px) {
    .recent-discoveries {
        font-size: 0.9rem;
    }
    .meta {
        overflow: hidden;
    }
    abbr[data-tooltip]::after {
        display: none;
    }
    abbr.nomobile {
        display: none;
    }
}
@media screen and (max-width: 430px) {
    body {
        margin: 8px;
    }
    body > * {
        padding-left: 2px;
        padding-right: 2px;
    }
    .recent-discoveries {
        padding-left: 10px;
    }
    .recent-discoveries-intro {
        padding-left: 10px;
    }
    .recent-discoveries a > :nth-child(1), .recent-discoveries-intro > :nth-child(1) {
        min-width: 120px;
    }
}
@media screen and (max-width: 500px) {
    .recent-discoveries {
        font-size: 0.78rem;
    }
    .recent-discoveries a {
        padding-top: 2px;
        padding-bottom: 2px;
    }
}

/* Syntax highlighting */
.token.comment,
.token.block-comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #606060;
}
.token.punctuation {
    color: #909090;
}
.token.keyword,
.token.builtin,
.token.important,
.token.atrule,
.token.selector {
    color: #c0c0c0;
    font-weight: 600;
}
.token.tag {
    color: #c0c0c0;
}
.token.string,
.token.char,
.token.attr-value,
.token.regex {
    color: var(--link-hover-background-color);
}
.token.function,
.token.function-name {
    color: #d0d0d0;
}
.token.number,
.token.boolean,
.token.constant,
.token.symbol {
    color: var(--link-hover-background-color);
}
.token.property,
.token.class-name,
.token.variable {
    color: #b0b0b0;
}
.token.attr-name,
.token.namespace {
    color: #909090;
}
.token.operator,
.token.entity,
.token.url {
    color: #909090;
}
.token.deleted {
    color: var(--link-hover-color);
}
.token.inserted {
    color: var(--link-hover-background-color);
}
