@-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: #f5f5f5;
}
  
.contrib-squares li[data-level="1"] 
{
    background-color: #b3e5fc;
}

.contrib-squares li[data-level="2"] 
{
    background-color: #81d4fa;
}

.contrib-squares li[data-level="3"] 
{
    background-color: #4fc3f7;
}

.contrib-squares li[data-level="4"] 
{
    background-color: #29b6f6;
}

.contrib-squares li[data-level="5"] 
{
    background-color: #4fc3f7;
}

.contrib-squares li[data-level="6"] 
{
    background-color: #03a9f4;
}

.contrib-squares li[data-level="7"] 
{
    background-color: #039be5;
}

.contrib-squares li[data-level="8"] 
{
    background-color: #0288d1;
}

.contrib-squares li[data-level="9"] 
{
    background-color: #0277bd;
}

.contrib-squares li[data-level="10"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="11"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="12"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="13"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="14"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="15"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="16"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="17"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="18"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="19"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="20"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="21"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="22"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="23"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="24"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="25"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="26"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="27"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="28"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="29"] 
{
    background-color: #01579b;
}

.contrib-squares li[data-level="30"] 
{
    background-color: #01579b;
}.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
{
    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 h4
{
    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 h4
    {
        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;
    }
}html 
{
    max-width: 100%;
    overflow-x: hidden;
}

body
{
    max-width: 100%;
    overflow-x: hidden;
}

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;
}


/* Materialize icons */
/*@font-face 
{
    font-family: 'Material Icons';
    font-style: normal;
    font-weight: 400;
    src: url({BASE_URL}/data/resources/font/materielize-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;
    min-height: 60vh;
}

#version
{
    color: var(--muted);
}

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

#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: 2rem;
    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: 1.5rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: center;
}

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

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