@-webkit-keyframes rotating
{
    from 
    {
        -webkit-transform: rotate(0deg);
        -o-transform: rotate(0deg);
        transform: rotate(0deg);
    }

    to 
    {
        -webkit-transform: rotate(360deg);
        -o-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

@keyframes rotating 
{
    from 
    {
        -ms-transform: rotate(0deg);
        -moz-transform: rotate(0deg);
        -webkit-transform: rotate(0deg);
        -o-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    
    to 
    {
        -ms-transform: rotate(360deg);
        -moz-transform: rotate(360deg);
        -webkit-transform: rotate(360deg);
        -o-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

.animation-rotation 
{
    -webkit-animation: rotating 2s linear infinite;
    -moz-animation: rotating 2s linear infinite;
    -ms-animation: rotating 2s linear infinite;
    -o-animation: rotating 2s linear infinite;
    animation: rotating 2s linear infinite;
}

@keyframes anim-slide-from-right 
{
    0% 
    {
        transform: translateX(250%);
    }
    
    100%
    {
        transform: translateX(0);
    }
}:root 
{
    --square-size: 15px;
    --square-gap: 5px;
    --week-width: calc(var(--square-size) + var(--square-gap));
}

.contrib-months 
{ 
    grid-area: months; 
}

.contrib-days 
{ 
    grid-area: days; 
}

.contrib-squares 
{ 
    grid-area: squares; 
}

.contrib-grid 
{
    display: inline-grid;
    grid-template-areas: "empty months"
                        "days squares";
    grid-template-columns: auto 1fr;
    grid-gap: 10px;
}

.contrib-months 
{
    display: grid;
    grid-template-columns: calc(var(--week-width) * 4) /* Jan */
                            calc(var(--week-width) * 4) /* Feb */
                            calc(var(--week-width) * 4) /* Mar */
                            calc(var(--week-width) * 5) /* Apr */
                            calc(var(--week-width) * 4) /* May */
                            calc(var(--week-width) * 4) /* Jun */
                            calc(var(--week-width) * 5) /* Jul */
                            calc(var(--week-width) * 4) /* Aug */
                            calc(var(--week-width) * 4) /* Sep */
                            calc(var(--week-width) * 5) /* Oct */
                            calc(var(--week-width) * 4) /* Nov */
                            calc(var(--week-width) * 5) /* Dec */;
}

.contrib-days,
.contrib-squares 
{
    display: grid;
    grid-gap: var(--square-gap);
    grid-template-rows: repeat(7, var(--square-size));
}

.contrib-squares 
{
    grid-auto-flow: column;
    grid-auto-columns: var(--square-size);
}
  
.contrib-squares li 
{
    background-color: var(--heat-empty);
}
  
.contrib-squares li[data-level="1"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 25%, var(--heat-low));
}

.contrib-squares li[data-level="2"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 40%, var(--heat-low));
}

.contrib-squares li[data-level="3"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 55%, var(--heat-low));
}

.contrib-squares li[data-level="4"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 70%, var(--heat-low));
}

.contrib-squares li[data-level="5"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 80%, var(--heat-low));
}

.contrib-squares li[data-level="6"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 90%, var(--heat-low));
}

.contrib-squares li[data-level="7"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="8"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="9"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="10"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="11"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="12"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="13"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="14"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="15"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="16"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="17"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="18"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="19"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="20"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="21"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="22"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="23"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="24"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="25"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="26"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="27"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="28"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="29"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}

.contrib-squares li[data-level="30"] 
{
    background-color: color-mix(in srgb, var(--heat-high) 100%, var(--heat-low));
}.landing-hero
{
    text-align: center;
    padding: 4.5rem 1.5rem 4rem 1.5rem;
    margin: 1.5rem 0 0 0;
    border-radius: calc(var(--radius) * 1.5);
    border: 1px solid var(--border);
    background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-mid) 55%, var(--hero-to) 100%);
}

.landing-hero h1
{
    margin: 0 0 0.75rem 0;
    font-size: 3.2rem;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.landing-hero p
{
    margin: 0 auto;
    max-width: 38rem;
    font-size: 1.25rem;
    color: var(--muted);
}

.landing-hero p.smaller-text
{
    margin-top: 0.5rem;
    font-size: 1.05rem;
}

.landing-actions
{
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.landing-actions .btn
{
    height: 2.75rem;
    line-height: 2.75rem;
    padding: 0 1.5rem;
}


.landing-actions .btn
{
    background: var(--accent);
    color: var(--accent-contrast);
}

.landing-actions .btn-outline,
.not-found .btn-outline
{
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.landing-row
{
    margin-top: 2.5rem;
}

.landing-title
{
    margin: 0 0 1rem 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.landing-featured
{
    display: block;
    position: relative;
    margin: 0 0 1rem 0;
    padding: 1.75rem;
    color: inherit;
}

.landing-featured:hover
{
    text-decoration: none;
    border-color: var(--accent);
}

.landing-featured h3
{
    margin: 0 0 0.25rem 0;
    font-size: 1.7rem;
    color: var(--text);
}

.landing-featured p
{
    margin: 0.75rem 0 0 0;
    color: var(--text);
}

.landing-badge
{
    display: inline-block;
    margin-bottom: 0.5rem;
    padding: 0 0.7rem;
    border-radius: 1rem;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 0.75rem;
    font-weight: 650;
    line-height: 1.5rem;
}

.landing-list .collection-item
{
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.landing-date
{
    white-space: nowrap;
}

.landing-article
{
    display: block;
    overflow: hidden;
    margin: 0 0 1rem 0;
    color: inherit;
}

.landing-article:hover
{
    text-decoration: none;
    border-color: var(--accent);
}

.landing-article-image
{
    aspect-ratio: 16 / 9;
    background: var(--thumb-bg);
    overflow: hidden;
}

.landing-article-image img,
.landing-article-image picture
{
    display: block;
    width: 100%;
    height: 100%;
    /* Whole image, never cropped: article images range from screenshots to wide logos */
    object-fit: contain;
}

.landing-article .card-content
{
    padding: 1rem 1.25rem 1.25rem 1.25rem;
}

.landing-more
{
    display: inline-block;
    margin: 0.5rem 0 1.5rem 0;
    font-weight: 600;
}

@media screen and (max-width: 600px)
{
    .landing-hero
    {
        padding: 3rem 1rem 2.5rem 1rem;
    }

    .landing-hero h1
    {
        font-size: 2.4rem;
    }

    .landing-hero p
    {
        font-size: 1.1rem;
    }

    .landing-featured
    {
        padding: 1.25rem;
    }

    .landing-featured h3
    {
        font-size: 1.4rem;
    }
}
#users-container
{
    display: none;
    height: 40%;
    position: fixed;
    right: 2rem;
    bottom: 0%;
    /*background-color: white;
    border-left: 1px solid black;*/
    z-index: 2;
    min-width: 300px;
}

.users-header
{
    position: absolute;
    width: 100%;
    height: 4rem;
    margin-bottom: 0px;
    border-radius: 5px 5px 0px 0px;
}

.users-body
{
    height: 100%;
    padding-bottom: 5rem;
    margin-top: 4rem;
}

.users-conversation
{
    display: flex !important;
    flex-direction: row !important; 
    justify-content: flex-start !important; 
    align-items: center !important;
}

.users-data
{
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: flex-start; 
    margin-left: 1rem;
}

.users-footer
{
    position: absolute;
    width: 100%;
    height: 5rem;
    margin-bottom: 0px;
    bottom: 0px;
}

#users-container-close
{
    vertical-align: middle;
    position: absolute;
    cursor: pointer;
    top: 16px;
    right: 16px;
}

#users-search
{
    border-bottom: none !important;
}

@media screen and (max-width: 600px)
{
    #users-container
    {
        width: 100%;
        height: 100%;
        right: 0rem;
    }
}

@media screen and (min-width: 601px)
{
    #users-container
    {
        width: 100%;
        height: 100%;
        right: 0rem;
    }
}

@media screen and (min-width: 993px)
{
    #users-container
    {
        width: 30%;
        height: 40%;
        right: 2rem;
    }
}

@media screen and (min-width: 1201px)
{
    #users-container
    {
        width: 20%;
        height: 40%;
        right: 2rem;
    }
}

#conversation-container
{
    display: none;
    width: 20%;
    height: 40%;
    position: fixed;
    right: 2rem;
    bottom: 0px;
    /*background-color: white;
    border: 1px solid black;*/
    z-index: 3;
    min-width: 300px;
}

#conversation-container-close
{
    vertical-align: middle;
    position: absolute;
    cursor: pointer;
    top: 16px;
    right: 16px;
}

@media screen and (max-width: 600px)
{
    #conversation-container
    {
        width: 100%;
        height: 100%;
        right: 0rem;
    }
}

@media screen and (min-width: 601px)
{
    #conversation-container
    {
        width: 100%;
        height: 100%;
        right: 0rem;
    }
}

@media screen and (min-width: 993px)
{
    #conversation-container
    {
        width: 30%;
        height: 40%;
        right: 2rem;
    }
}

@media screen and (min-width: 1201px)
{
    #conversation-container
    {
        width: 20%;
        height: 40%;
        right: 2rem;
    }
}

/* Chat bubbles - colours come from the theme (see theme.css) */
.chat-bubble
{
    color: var(--text);
}

.chat-bubble-mine
{
    margin-left: 1rem;
    padding-right: 1rem;
    border-radius: 0px 16px 16px 0px;
    background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--bubble) 50%, transparent) 15%, var(--bubble) 100%);
}

.chat-bubble-theirs
{
    margin-right: 1rem;
    padding-left: 1rem;
    border-radius: 16px 0px 0px 16px;
    background: linear-gradient(90deg, var(--bubble) 0%, color-mix(in srgb, var(--bubble) 50%, transparent) 85%, transparent 100%);
}
html 
{
    max-width: 100%;
    overflow-x: hidden;
}

body
{
    max-width: 100%;
    /* clip, not hidden: hidden would turn body into a scroll container and break sticky elements */
    overflow-x: clip;
}

h1
{
    font-size: 2.2rem;
}

h2
{
    font-size: 2.0rem;
}

h3
{
    font-size: 1.8rem;
}

h4
{
    font-size: 1.6rem;
}

h5
{
    font-size: 1.4rem;
}

h6
{
    font-size: 1.2rem;
}


/* Material Icons, served from this site (the path is relative to the style sheet) */
@font-face
{
    font-family: 'Material Icons';
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url('data/resources/font/materialize-icons.woff2') format('woff2');
}

.material-icons
{
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

.modal_color_item
{
    border: none;
}

.modal_color_item.active
{
    border: 1px solid black;
}

.materialboxed
{
    margin-left: auto;
    margin-right: auto;
}/*

Site theme - design tokens, typography, layout, navigation, cards, posts, dark mode.

Everything visual hangs on the custom properties below, so colours, type and spacing are changed in one place.
This file is concatenated last (src/*.css), so it deliberately overrides Materialize defaults.

*/

:root
{
    color-scheme: light dark;

    /* Colour (light) */
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f4f6f8;
    --text: #1f2933;
    --muted: #5f6c7b;
    --border: #e1e5ea;
    --accent: #0b5cad;
    --accent-contrast: #ffffff;
    --accent-soft: #e6f0fa;
    /* Backing of images: keeps images with transparency (logos, diagrams) readable in both themes */
    --thumb-bg: #f4f6f8;
    --code-bg: #0f172a;
    --code-text: #e2e8f0;
    --hero-from: #e3f2fd;
    --hero-mid: #f6f8fa;
    --hero-to: #ede7f6;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 6px 16px rgba(16, 24, 40, 0.06);

    /* Shape and size */
    --radius: 12px;
    --wrap: 72rem;
    --measure: 52rem;
    --nav-height: 3.5rem;

    /* Type - system fonts only, nothing to download */
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* Dark theme: follows the system setting unless the visitor chose a mode with the switch in the menu */
@media (prefers-color-scheme: dark)
{
    :root:not([data-theme="light"])
    {
        --bg: #0e141b;
        --surface: #151d27;
        --surface-2: #1b2633;
        --text: #e6edf3;
        --muted: #9aa7b4;
        --border: #263241;
        --accent: #6cb2ff;
        --accent-contrast: #0e141b;
        --accent-soft: #16283b;
        --thumb-bg: #e3e8ee;
        --code-bg: #0a0f16;
        --code-text: #dbe4ee;
        --hero-from: #14263a;
        --hero-mid: #131c26;
        --hero-to: #20203a;
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.35);
    }
}

:root[data-theme="dark"]
{
    --bg: #0e141b;
    --surface: #151d27;
    --surface-2: #1b2633;
    --text: #e6edf3;
    --muted: #9aa7b4;
    --border: #263241;
    --accent: #6cb2ff;
    --accent-contrast: #0e141b;
    --accent-soft: #16283b;
    --thumb-bg: #e3e8ee;
    --code-bg: #0a0f16;
    --code-text: #dbe4ee;
    --hero-from: #14263a;
    --hero-mid: #131c26;
    --hero-to: #20203a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"]
{
    color-scheme: light;
}

:root[data-theme="dark"]
{
    color-scheme: dark;
}

/* ---------- Base ---------- */

html
{
    font-family: var(--font);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

/* Large displays: the layout is rem based, so a larger root size scales all of it proportionally */
@media screen and (min-width: 1800px)
{
    html { font-size: 18px; }
}

@media screen and (min-width: 2400px)
{
    html { font-size: 21px; }
}

@media screen and (min-width: 3200px)
{
    html { font-size: 26px; }
}

body
{
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
}

a
{
    color: var(--accent);
}

/* Wide code must scroll inside its own box, never widen the page */
pre
{
    max-width: 100%;
    overflow-x: auto;
}

a:hover
{
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6
{
    font-family: var(--font);
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--text);
}

h1 { font-size: 2.4rem; margin: 1.25rem 0 0.75rem; }
h2 { font-size: 1.7rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.35rem; margin: 1.5rem 0 0.5rem; }
h4 { font-size: 1.15rem; margin: 1.25rem 0 0.5rem; }
h5 { font-size: 1.05rem; margin: 1rem 0 0.5rem; }

@media screen and (max-width: 600px)
{
    h1 { font-size: 1.9rem; }
    h2 { font-size: 1.45rem; }
}

/* Materialize utility colours used all over the views - make them follow the theme */
.black-text, .black-text.text-darken-1, .black-text.text-darken-2 { color: var(--text) !important; }
.grey-text, .grey-text.text-darken-1, .grey-text.text-darken-2, .grey-text.text-darken-3 { color: var(--muted) !important; }
.white { background-color: var(--surface) !important; }
.blue-grey.lighten-5, .grey.lighten-3, .grey.lighten-4, .grey.lighten-5 { background-color: var(--surface-2) !important; }
.blue-text, .blue-text.text-darken-4 { color: var(--accent) !important; }

/* ---------- Layout ---------- */

#page
{
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 1rem 2rem 1rem;
}

/* Footer always at the bottom of the window, also on short pages: menu, page, footer and version form one column */
body
{
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

#main
{
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

#page
{
    flex: 1 0 auto;
    width: 100%;
}

/* The version continues the footer instead of forming a stripe of its own */
#version
{
    padding: 0 1rem 0.2rem 1rem;
    background: var(--surface-2);
    color: var(--muted);
    text-align: right;
    font-size: 0.65rem;
    line-height: 1;
}

/* ---------- Navigation ---------- */

/* The wrapper must not form a box of its own, otherwise the sticky bar could not stick */
#menu
{
    display: contents;
}

/* Materialize makes menu entries and icons 64px tall - taller than the bar, so the floated lists stuck
   out below it and pushed page content (i.e. the login card) sideways */
#menu nav ul li,
#menu nav ul a,
#menu nav i.material-icons,
#menu nav .sidenav-trigger,
#menu nav .sidenav-trigger i
{
    height: var(--nav-height);
    line-height: var(--nav-height);
}

#page
{
    clear: both;
}

#menu nav
{
    position: sticky;
    top: 0;
    z-index: 10;
    height: var(--nav-height);
    line-height: var(--nav-height);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
}

@supports (backdrop-filter: blur(8px))
{
    #menu nav
    {
        background: color-mix(in srgb, var(--bg) 85%, transparent);
        backdrop-filter: blur(8px);
    }
}

#menu nav .nav-wrapper
{
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 1rem;
}

#menu nav ul
{
    margin-left: 0 !important;
}

#menu nav ul a
{
    color: var(--text);
    font-size: 1rem;
    padding: 0 0.9rem;
    transition: background-color 0.15s;
}

#menu nav ul.right
{
    margin-right: -0.5rem !important;
}

#menu nav ul a:hover
{
    background: var(--surface-2);
    text-decoration: none;
}

#menu nav ul li > a span
{
    color: var(--text) !important;
    font-weight: 500;
}

/* Brand: first entry */
#menu nav ul li:first-child > a span
{
    color: var(--accent) !important;
    font-weight: 750;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

/* Current section (set by System.MarkActiveMenu) */
#menu nav ul li > a.active
{
    box-shadow: inset 0 -3px 0 var(--accent);
}

#menu nav ul li > a.active span
{
    color: var(--accent) !important;
}

#menu .sidenav-trigger i
{
    color: var(--text) !important;
}

.sidenav
{
    background: var(--surface);
}

.sidenav li > a
{
    color: var(--text);
}

.sidenav li > a > i.material-icons
{
    color: var(--text);
}

/* ---------- Cards, lists, chips, buttons ---------- */

.card, .card-panel
{
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.collection
{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: none;
}

.collection .collection-item
{
    background: transparent;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.collection .collection-item:last-child
{
    border-bottom: none;
}

.collection a.collection-item:not(.active):hover
{
    background: var(--surface-2);
    text-decoration: none;
}

.chip
{
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    height: 1.7rem;
    line-height: 1.6rem;
}

.btn, .btn-large, .btn-small
{
    border-radius: 8px;
    box-shadow: none;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
}

/* Form fields */
input:not([type]), input[type="text"]:not(.browser-default), input[type="password"]:not(.browser-default),
input[type="email"]:not(.browser-default), textarea.materialize-textarea
{
    color: var(--text);
}

.input-field label
{
    color: var(--muted);
}

/* Dialogs */
.modal
{
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius);
}

.modal .modal-footer
{
    background: var(--surface);
}

.modal .modal-footer .btn-flat
{
    color: var(--accent);
}

/* ---------- Posts (blog, articles, projects) ---------- */

.post
{
    max-width: var(--measure);
    margin-left: auto !important;
    margin-right: auto !important;
}

.post h1
{
    font-size: 2.5rem;
    margin-top: 1.5rem;
}

.post .post-meta
{
    color: var(--muted);
    font-size: 0.95rem;
}

.post-body
{
    font-size: 1.0625rem;
    line-height: 1.75;
}

.post-body p
{
    margin: 0 0 1.15em 0;
}

.post-body a
{
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-body ul, .post-body ol
{
    padding-left: 1.5rem;
    margin: 0 0 1.15em 0;
}

.post-body ul li
{
    list-style-type: disc;
}

.post-body blockquote
{
    margin: 1.25em 0;
    padding: 0.25rem 1.1rem;
    border-left: 4px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 8px 8px 0;
    color: var(--text);
}

.post-body pre
{
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1rem 1.15rem;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 1.25em 0;
    border: 1px solid var(--border);
}

.post-body code
{
    font-family: var(--mono);
    font-size: 0.9em;
}

.post-body :not(pre) > code
{
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 0.1em 0.35em;
}

.post-body table
{
    display: block;
    overflow-x: auto;
    margin: 1.25em 0;
    border-collapse: collapse;
}

.post-body th, .post-body td
{
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.post-body th
{
    background: var(--surface-2);
}

/* Images in posts (see GetMarked in app.ts) */
.post-figure
{
    display: block;
    margin: 1.5em 0;
    text-align: center;
}

.post-figure img
{
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    background: var(--thumb-bg);
}

.post-caption
{
    display: block;
    margin-top: 0.5rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* ---------- Footer ---------- */

.site-footer
{
    margin-top: 0;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--muted);
}

.site-footer .footer-inner
{
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0.45rem 1rem 0.15rem 1rem;
    font-size: 0.85rem;
    line-height: 1.3;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    justify-content: center;
}

.site-footer a
{
    color: var(--muted);
    cursor: pointer;
}

.site-footer a:hover
{
    color: var(--accent);
}

/* ---------- Widgets that must follow the theme ---------- */

:root
{
    --bubble: #f1f3f5;
    --heat-empty: #eef1f4;
    --heat-low: #e1f5fe;
    --heat-high: #0277bd;
}

@media (prefers-color-scheme: dark)
{
    :root:not([data-theme="light"])
    {
        --bubble: #243246;
        --heat-empty: #1b2633;
        --heat-low: #16324a;
        --heat-high: #6cc8ff;
    }
}

:root[data-theme="dark"]
{
    --bubble: #243246;
    --heat-empty: #1b2633;
    --heat-low: #16324a;
    --heat-high: #6cc8ff;
}

/* Editor tabs (Edit / Preview) */
.tabs
{
    background: var(--surface-2);
    border-radius: 8px 8px 0 0;
}

.tabs .tab a, .tabs .tab a:hover
{
    color: var(--muted);
    text-transform: none;
    font-weight: 600;
}

.tabs .tab a.active, .tabs .tab a:hover
{
    color: var(--accent);
}

.tabs .tab a:focus, .tabs .tab a:focus.active
{
    background: var(--accent-soft);
}

.tabs .indicator
{
    background: var(--accent);
}

/* Dropdowns, selects and date / time pickers used by the editor */
.dropdown-content
{
    background: var(--surface);
}

.dropdown-content li > a, .dropdown-content li > span
{
    color: var(--text);
}

.dropdown-content li:hover, .dropdown-content li.active, .dropdown-content li.selected
{
    background: var(--surface-2);
}

.select-wrapper input.select-dropdown
{
    color: var(--text);
}

.select-wrapper .caret
{
    fill: var(--muted);
}

.datepicker-modal, .datepicker-container, .datepicker-calendar-container, .datepicker-footer,
.timepicker-modal, .timepicker-container, .timepicker-analog-display, .timepicker-footer
{
    background: var(--surface);
    color: var(--text);
}

.timepicker-plate
{
    background: var(--surface-2);
}

.timepicker-tick, .datepicker-day-button, .datepicker-table th
{
    color: var(--text);
}

.btn-flat
{
    color: var(--text);
}

/* TODO items: the colour picked for the item (--item-color) */
.collection .collection-item.todo-item
{
    background-color: var(--item-color, var(--surface));
}

/* Dark variant of whatever colour was picked: same hue, calm and dark */
@media (prefers-color-scheme: dark)
{
    :root:not([data-theme="light"]) .collection .collection-item.todo-item
    {
        background-color: color-mix(in srgb, var(--item-color, var(--surface)) 18%, var(--surface));
        background-color: hsl(from var(--item-color, #808080) h calc(s * 0.45) 19%);
    }
}

:root[data-theme="dark"] .collection .collection-item.todo-item
{
    background-color: color-mix(in srgb, var(--item-color, var(--surface)) 18%, var(--surface));
    background-color: hsl(from var(--item-color, #808080) h calc(s * 0.45) 19%);
}

/* ---------- Account forms: profile, password recovery ---------- */

.account-form
{
    float: none !important;
    display: block;
    max-width: 44rem;
    margin: 1.5rem auto !important;
}

.account-form .row > .col
{
    width: 100% !important;
    margin-left: 0 !important;
}

/* The empty spacer columns of the old layout */
.account-form .row > .col:empty
{
    display: none;
}

.account-form .input-field, .auth-card .input-field
{
    margin-top: 1.4rem;
}

.account-form input:not([type="file"]), .auth-card input
{
    font-size: 1.1rem !important;
    height: 3.4rem !important;
}

.account-form textarea.materialize-textarea
{
    font-size: 1.05rem;
    line-height: 1.6;
    min-height: 12rem;
}

/* ---------- Login / sign up ---------- */

.auth-wrap
{
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 0;
}

.auth-card
{
    width: 100%;
    max-width: 30rem;
    padding: 1.5rem 1rem;
}

.auth-card h1
{
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    text-align: center;
}

.auth-card .btn.col, .auth-card .btn-flat.col
{
    height: 3rem;
    line-height: 3rem;
}

/* ---------- Video player (see util/video.ts) ---------- */

.video-player
{
    display: block;
    margin: 1.5em 0;
    text-align: center;
    color: var(--muted);
}

.video-player video
{
    display: block;
    width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    background: #000;
}

.video-player progress
{
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    accent-color: var(--accent);
}

.video-toolbar
{
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.video-toolbar select.browser-default
{
    width: auto;
    height: 2.25rem;
    padding: 0 0.8rem;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

/* ---------- Media library (data/view/media.html) ---------- */

.media-drop
{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    cursor: pointer;
}

.media-drop input[type="file"]
{
    display: none;
}

.media-filters
{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.media-filters select.browser-default
{
    width: auto;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.media-grid
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.media-card
{
    margin: 0;
    overflow: hidden;
}

.media-card.expanded
{
    grid-column: 1 / -1;
}

.media-card .video-player
{
    margin: 0.5rem;
}

.media-thumb
{
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    background: var(--thumb-bg);
    color: #5f6c7b;
}

.media-thumb img
{
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.media-thumb.clickable
{
    cursor: pointer;
}

.media-info
{
    padding: 0.5rem 0.75rem 0.75rem;
}

.media-copy
{
    padding: 0;
    color: var(--accent);
}

.media-delete
{
    padding: 0 0 0 1rem;
    color: #d9534f;
}

/* ---------- Project cards (games, software) ---------- */

.project-grid
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.project-card
{
    display: flex;
    flex-direction: column;
    margin: 0;
    overflow: hidden;
    color: inherit;
}

.project-card:hover
{
    text-decoration: none;
    border-color: var(--accent);
}

.project-image
{
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    background: var(--thumb-bg);
    color: #5f6c7b;
}

.project-image img
{
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-info
{
    padding: 0.9rem 1.1rem 1.1rem 1.1rem;
}

.project-info h2
{
    margin: 0 0 0.25rem 0;
    font-size: 1.2rem;
}

.project-info p
{
    margin: 0.5rem 0 0 0;
}

/* Unpublished records (see DraftBadge in app.ts) */
.draft-badge
{
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.5rem;
    border: 1px solid #d9822b;
    border-radius: 1rem;
    color: #d9822b;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4rem;
    letter-spacing: 0;
    vertical-align: middle;
    white-space: nowrap;
}

.draft-badge i.material-icons
{
    font-size: 1rem;
    line-height: 1.4rem;
}

/* ---------- Post header line ---------- */

.post .post-meta
{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 0.6rem;
    margin-bottom: 0.75rem;
}

/* ---------- Code blocks (see util/code.ts) - dark in both themes ---------- */

.code-block
{
    position: relative;
    margin: 1.25em 0;
}

.code-block pre, .post-body .code-block pre
{
    margin: 0;
    padding: 1rem 1.15rem;
    background: var(--code-bg);
    color: var(--code-text);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.55;
}

.code-block code
{
    font-family: var(--mono);
}

.code-copy
{
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    color: #cbd5e1;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}

.code-block:hover .code-copy, .code-copy:focus
{
    opacity: 1;
    background: #1e293b;
}

/* Touch screens have no hover */
@media (hover: none)
{
    .code-copy
    {
        opacity: 0.85;
    }
}

.tok-comment { color: #7f9a77; font-style: italic; }
.tok-string { color: #e9a97b; }
.tok-number { color: #b5cea8; }
.tok-keyword { color: #7cb7ff; }
.tok-directive { color: #c792ea; }
.tok-function { color: #e6d58a; }

/* ---------- Site mark ---------- */

.brand-mark
{
    vertical-align: middle;
}

#menu nav ul li:first-child > a span .brand-mark
{
    margin: -3px 0.5rem 0 0;
}

/* Small screens: centred in the bar */
#menu nav .brand-mobile
{
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    padding: 0;
}

@media screen and (min-width: 993px)
{
    #menu nav .brand-mobile
    {
        display: none;
    }
}

/* ---------- Table of contents (see util/contents.ts) ---------- */

.post-body h2, .post-body h3
{
    /* Jumping to a section must not hide its heading below the sticky menu */
    scroll-margin-top: calc(var(--nav-height) + 1rem);
}

/* Narrow screens: a box above the text, closed until asked for */
.toc
{
    margin: 0.75rem 0.75rem 1rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    font-size: 0.9rem;
}

.toc summary
{
    cursor: pointer;
    font-weight: 650;
}

.toc ul
{
    margin: 0.5rem 0 0.25rem;
}

.toc a
{
    display: block;
    padding: 0.2rem 0 0.2rem 0.75rem;
    border-left: 2px solid var(--border);
    color: var(--muted);
    line-height: 1.35;
}

.toc li.toc-sub a
{
    padding-left: 1.6rem;
}

.toc a.active
{
    color: var(--accent);
    border-left-color: var(--accent);
}

/* Wide screens: sidebar right of the reading column, following the reader */
@media screen and (min-width: 1400px)
{
    .post
    {
        position: relative;
    }

    .toc-side
    {
        position: absolute;
        top: 0;
        bottom: 0;
        left: calc(100% + 1.5rem);
        width: 15rem;
    }

    .toc-side .toc
    {
        position: sticky;
        top: calc(var(--nav-height) + 1rem);
        max-height: calc(100vh - var(--nav-height) - 2rem);
        overflow-y: auto;
        margin: 1.5rem 0 0;
        padding: 0;
        border: none;
        background: transparent;
    }

    .toc-side .toc summary
    {
        cursor: default;
        list-style: none;
    }

    .toc-side .toc summary::-webkit-details-marker
    {
        display: none;
    }
}

/* ---------- Search (menu box, search page, keyword chips) ---------- */

input.search-field:not(.browser-default)
{
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 0 0.8rem;
    height: 2.75rem;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

input.search-field:not(.browser-default):focus
{
    border-color: var(--accent);
    box-shadow: none;
}

#menu nav .menu-search-box
{
    display: none;
    padding: 0 0.5rem;
}

#menu nav .menu-search-box input.search-field:not(.browser-default)
{
    width: 11rem;
    height: 2.2rem;
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Room for a box only on wide screens, an icon otherwise */
@media screen and (min-width: 1400px)
{
    #menu nav .menu-search-box
    {
        display: block;
    }

    #menu nav .menu-search-icon
    {
        display: none;
    }
}

.post a.chip:hover
{
    color: var(--accent);
    border-color: var(--accent);
    text-decoration: none;
}

/* ---------- Account dropdown ---------- */

#menu nav #menu-account
{
    position: relative;
}

#menu nav .account-menu
{
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 12rem;
    padding: 0.35rem 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

#menu nav #menu-account.open .account-menu
{
    display: block;
}

#menu nav ul .account-menu a
{
    display: block;
    height: 2.6rem;
    line-height: 2.6rem;
    white-space: nowrap;
}

#menu nav ul .account-menu a i.material-icons
{
    float: left;
    height: 2.6rem;
    line-height: 2.6rem;
    margin-right: 0.75rem;
    font-size: 1.3rem;
}

#menu nav ul .account-menu a.active
{
    box-shadow: inset 3px 0 0 var(--accent);
    color: var(--accent);
}

/* Signed in with every section visible, the row is nearly full - keep it on one line */
#menu nav .menu-search-box input.search-field:not(.browser-default)
{
    width: 9rem;
}

@media screen and (min-width: 993px) and (max-width: 1100px)
{
    #menu nav ul a
    {
        padding: 0 0.6rem;
    }

    #menu nav ul .account-menu a
    {
        padding: 0 0.9rem;
    }
}

/* ---------- Text written by users (see util/safe.ts) ---------- */

.user-content ul
{
    padding-left: 1.5rem;
}

.user-content ul li
{
    list-style-type: disc;
}

.user-content img
{
    max-width: 100%;
    height: auto;
}

/* Confirmation dialog (util/dialog.ts) */
dialog.confirm
{
    width: min(28rem, calc(100vw - 2rem));
    padding: 1.5rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

dialog.confirm::backdrop
{
    background: rgba(0, 0, 0, 0.55);
}

dialog.confirm p
{
    margin: 0 0 1.5rem;
    white-space: pre-line;
    overflow-wrap: anywhere;
    max-height: 50vh;
    overflow-y: auto;
}

dialog.confirm .confirm-buttons
{
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

dialog.confirm .btn-flat
{
    color: var(--text);
}

dialog.confirm button:focus-visible
{
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Page not found and empty lists */
.not-found
{
    text-align: center;
    padding: 3rem 1rem;
}

.not-found .btn
{
    margin: 0.25rem;
}

.empty-state
{
    color: var(--muted);
    text-align: center;
    padding: 1.5rem 1rem;
    margin: 0;
}

/* Loading placeholders (util/loading.ts): a title and lines of text, drawn only while the container is empty */
.loading:empty::before
{
    content: "";
    display: block;
    height: 11rem;
    margin: 1rem 0;
    background-repeat: no-repeat;
    background-image:
        linear-gradient(var(--surface-2), var(--surface-2)),
        linear-gradient(var(--surface-2), var(--surface-2)),
        linear-gradient(var(--surface-2), var(--surface-2)),
        linear-gradient(var(--surface-2), var(--surface-2)),
        linear-gradient(var(--surface-2), var(--surface-2));
    background-size: 45% 2rem, 100% 1rem, 92% 1rem, 97% 1rem, 60% 1rem;
    background-position: 0 0, 0 3.5rem, 0 5.5rem, 0 7.5rem, 0 9.5rem;
    animation: loading-pulse 1.4s ease-in-out infinite;
}

@keyframes loading-pulse
{
    50% { opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce)
{
    .loading:empty::before
    {
        animation: none;
    }
}

/* Keyboard focus: one outline everywhere. !important because the framework removes outlines in many places */
a:focus-visible,
button:focus-visible,
select:focus-visible,
summary:focus-visible,
video:focus-visible,
[tabindex]:focus-visible,
[type="checkbox"]:focus-visible + span:not(.lever),
[type="radio"]:focus-visible + span,
[type="checkbox"]:focus-visible + .lever,
.file-field:focus-within .btn
{
    outline: 2px solid var(--accent) !important;
    outline-offset: 2px;
}

/* Inside the top bar and lists an outer outline would be cut off */
nav a:focus-visible,
.collection a:focus-visible,
.sidenav a:focus-visible
{
    outline-offset: -3px;
}

/* Contrast: the framework's green and grey are too light for text (4.5:1 is needed) */
.btn.green,
.btn-large.green,
.btn-small.green
{
    background-color: #2e7d32 !important;
}

[type="checkbox"] + span:not(.lever),
[type="radio"] + span
{
    color: var(--muted);
}

/* Skip link: out of sight until the keyboard reaches it */
.skip-link
{
    position: absolute;
    left: 0.5rem;
    top: -4rem;
    z-index: 1100;
    padding: 0.5rem 1rem;
    background: var(--surface);
    color: var(--accent);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.skip-link:focus
{
    top: 0.5rem;
}

.visually-hidden
{
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* The page itself takes focus after navigation, an outline around everything would only distract */
#page[tabindex]:focus,
#page[tabindex]:focus-visible
{
    outline: none !important;
}

#forum-title:empty
{
    display: none;
}

/* Opened project: summary box and gallery */
.project-summary
{
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2.5rem;
    margin: 0.5rem 0 1.5rem 0;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(128, 128, 128, 0.35);
    border-radius: 6px;
}

.project-summary dt
{
    font-size: 0.8rem;
    opacity: 0.75;
}

.project-summary dd
{
    margin: 0;
    font-weight: 600;
}

.project-gallery
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}

.project-gallery img
{
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 4px;
}

/* The zoomed picture is shown whole */
.project-gallery img.active
{
    object-fit: contain;
}
