/*

    WebKitGTK
    ====================

    Shamelessly stolen CSS from systemd
    https://github.com/systemd/systemd/tree/main/docs

*/

/* Fonts */

@font-face {
    font-family: InterVariable;
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/InterVariable.ttf") format("truetype");
}

@font-face {
    font-family: InterVariable;
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/InterVariable-Italic.ttf") format("truetype");
}

@supports (font-variation-settings: normal) {
    :root {
        font-family: "InterVariable", sans-serif;
        font-optical-sizing: auto;
    }
}

/* Colors */

:root {
    --primary-color: #0461be;
    --rounded-corner: 9px;
    --fg-color: rgb(0 0 6 / 80%);
    --bg-color: #f5f5f6;
    --term-bg: #ffffff;
    --term-br: 9px;
    --borders: #deddda;
}

/* General */

* {
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-size: 16px;
    font-family: "InterVariable", sans-serif;
    font-weight: 400;
    line-height: 1.6;
    scroll-behavior: smooth;
}

body {
    color: var(--fg-color);
    background-color: var(--bg-color);
    display: grid;
    min-height: 100vh;
    grid-template-rows: auto minmax(auto, 1fr) auto; /* header, stuff, footer */
}

/* Tables */

table {
  width: 100%;
  font-size: 90%;
  box-shadow: none;
  border-collapse: collapse;
  border-spacing: 0;
  border-radius: 0;
  text-align: left;
  border-width: 0;
  box-sizing: border-box;
}

table th, table tr, table td {
  background-color: transparent;
  text-align: left;
}

table td, table th {
  border-width: 0;
  padding: .25rem;
}

table tr {
  border-width: 0;
  border-bottom: 1px solid var(--borders);
}

table thead tr {
  font-weight: 800;
  border-width: 0;
  box-sizing: inherit;
  border-bottom: 2px solid var(--borders);
}

/* Make tables vertically aligned to the top */
tbody td {
    vertical-align: top;
}

b {
    font-weight: 600;
}

hr {
    margin: 3rem auto 4rem;
    width: 40%;
    opacity: 40%;
}

/* Footer */

footer {
    background-color: #1e1e22;
    margin-top: 6rem;
    padding: 2em 0 4em;
    color: white;
}

footer p {
    font-size: 80%;
    max-width: 720px;
    padding: 0 10%;
    margin: auto;
    text-align: center;
}

footer a {
    text-decoration: none;
    color: white;
}

footer a[href^="http"]:after {
    content: none;
}

ul.bottomlinks {
    column-width: 12rem;
    column-gap: 24px;
    max-width: 60rem;
    margin: 2rem auto;
    padding: 0 2rem;
    line-height: 2.5rem;
}

ul.bottomlinks li {
    display: block;
    list-style: none;
    padding: 0;
    margin: 0;
}

ul.bottomlinks li:first-child a {
    font-weight: 900;
    font-variation-settings: "wght" 900;
}

ul.bottomlinks li a {
    font-weight: 400;
    font-variation-settings: "wght" 600;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: rgba(255,255,255,0);
    transition: all 200ms ease-out;
}

ul.bottomlinks li a:hover {
    text-decoration-color: rgba(255,255,255,1);
}

a.social {
    width: 32px;
    height: 32px;
    margin: 0;
}

.socials {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: baseline;
    margin: 24px 6px 0 0;
    gap: 6px;
}

.social {
    fill: rgba(255,255,255,0.6);
    transition: all 200ms ease-out;
}

.social:hover {
    fill: rgba(255,255,255,1);
}

.extlink>svg {
    width: 12px;
    height: 12px;
    display: inline-block;
    fill: rgba(255,255,255,0.6);
    transition: all 200ms ease-out;
}

.extlink:hover>svg {
    fill: rgba(255,255,255,1);
}

/* Titles */

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 3rem 0 1rem;
    font-weight: 600;
    line-height: 1.25;
    font-variation-settings: "wght" 600; /* needed for webkit */
}

h1 {
    font-size: 1.5rem;
    font-weight: 100;
}

h2 {
    font-size: 1.2rem;
}

/* Links */

a {
    font-weight: 600;
    text-decoration: none;
    color: var(--primary-color);
    cursor: pointer;
    font-variation-settings: "wght" 600; /* needed for webkit */
}

a:hover {
    text-decoration: underline;
}

a[href^="http"]:after {
    display: inline-block;
    margin-left: 3px;
    content: url("assets/extlink-l.svg");
}

a[href^="http"]:has(img, svg):after {
    content: none;
}

/* Images */

img {
    display: block;
    margin: 2rem auto;
    max-width: 100%;
}

img.full,
picture.full img {
    width: 100%;
}

/* Code */

pre {
    font-size: 80%;
    line-height: normal;
    padding: 1rem;
    border-radius: var(--term-br);
    background-color: var(--term-bg);
    max-width: 100vw;
    overflow-x: auto;
    margin: 1rem 0;
}

code {
    padding: 2px 6px;
    background-color: var(--term-bg);
}

pre code {
    padding: 0;
    background-color: transparent;
}

/* Singletons */

.container {
    width: 100%;
    max-width: 60rem;
    margin: 0 auto;
    padding: 0 2rem;
}

#logo {
    display: block;
    width: 251px;
    height: 26px;
    background: url("assets/page-logo.svg") no-repeat center;
    padding: 5rem 0 3rem;
    margin: 0 auto;
    position: relative;
}

#logo a {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    color: rgb(0 0 0 / 0%); /* make text transparent */
    cursor: pointer;
}

#logo a:after {
    content: none;
}

/* Buttons */

.dialog-buttons {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 6rem;
}

.inline-button {
    display: inline-block;
    font-weight: 900;
    font-size: 90%;
    padding: 0.4rem 1rem;
    border-radius: var(--rounded-corner);
    background-color: var(--term-bg);
    color: var(--fg-color);
}

/* News */

ul.news {
    display: block;
    width: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
}

ul.news li {
    padding: 0 0 1rem 0;
    text-align: center;
}

ul.news li > a {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 1rem;
    border-radius: var(--rounded-corner);
    transition: all 0.35s cubic-bezier(0.17, 0.89, 0.32, 1.28);
}

ul.news li > a:hover {
    background-color: var(--term-bg);
    box-shadow: 0 0 0 8px var(--term-bg);
}

ul.news .date {
    opacity: 0.4;
    font-feature-settings: "tnum";
    -webkit-font-feature-settings: "tnum";
    font-size: 80%;
    letter-spacing: 0.1rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

ul.news .title {
    text-transform: capitalize;
    flex-grow: 1;
}

/* Media Queries */

@media only screen and (max-width: 650px) {
    ul.bottomlinks {
        column-count: 1;
    }
    .socials {
        justify-content: center;
        margin-top: 16px;
    }

    pre {
        max-width: 80vw;
    }
}

@media screen and (min-width: 650px) {
    h1 {
        font-size: 1.6rem;
    }

    ul.news li {
        padding: 0;
        text-align: left;
    }

    ul.news li > a {
        flex-direction: row;
        padding: 1rem 3rem;
        gap: 1rem;
        row-gap: 1rem;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --primary-color: #81d0ff;
        --fg-color: #ffffff;
        --bg-color: #222226;
        --term-bg: #343437;
    }

    #logo {
        background-image: url("assets/page-logo-i.svg");
    }

    img.filterimg {
        filter: invert() hue-rotate(180deg) opacity(50%);
    }

    a[href^="http"]:after {
        display: inline-block;
        margin-left: 3px;
        content: url("assets/extlink-d.svg");
    }
}
