/*
 * ###
 * ###
 * ###    ######    ##   ##    ##### ####     ######     ####  ###   ##
 * ###  ###    ###  ##   ##   ##  ###  ###  ###    ##   ###    ###  ###
 * ###  ###    ###  ###  ###  ##   ##   ##  ###   ####  ###    #######
 * ###    ######     #### #####    ##   ##   ###### ##  ###    ###   ##
 *
 * LOWMARK - A Low-tech Markdown Website Generator
 *
 * File:         lowmark_project.css
 * Version:      0.2
 * Last updated: 2025-05-19
 * Homepage:     https://lowmark.de
 * Repository:   https://github.com/weitblick/lowmark
 *
 * Description:  CSS of lowmark theme *project*
 *
 * Copyright (c) 2025 Erhard Maria Klein, lowmark.de
 * Licensed under the GNU General Public License v3.0 or later
 * See https://www.gnu.org/licenses/gpl-3.0.html
 */

:root,
::-webkit-backdrop {
    /* Neutral colors */
    --neutral-100: #ffffff;
    --neutral-900: #222222;

    /* Grayscale */
    --gray-100: #f9f9f9;
    --gray-200: #f3f3f3;
    --gray-300: #dddddd;
    --gray-500: #999999;
    --gray-700: #666666;

    /* Brand and accent colors */
    --primary: #0d47a1;
    --secondary: #0d47a1;
    --highlight: #ffdd33;

    /* Fonts und layout settings */
    --font-base: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --font-mono: Consolas, Menlo, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
    --border-radius: 5px;

    /* Usage */
    --text: var(--neutral-900);
    --background: var(--neutral-100);
    --muted: var(--gray-700);
    --link: var(--primary);
    --quote: var(--gray-700);
    --border: var(--gray-500);
    --border-light: var(--gray-300);
    --surface-muted: var(--gray-200);
    --surface-light: var(--gray-100);
    --table-header: var(--gray-200);
    --accent: var(--primary);
    --marked: var(--highlight);
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
    :root,
    ::-webkit-backdrop {
        color-scheme: dark;
        --neutral-100: #212121;
        --neutral-900: #dddddd;

        --gray-100: #2b2b2b;
        --gray-200: #383838;
        --gray-300: #444444;
        --gray-500: #888888;
        --gray-700: #999999;

        --primary: #ffb300;
        --secondary: #b78000;
        --highlight: #514400;
    }

    img,
    video {
        opacity: 0.8;
    }
}


/* 1. Global settings */
html {
    font-size: 16px; /* 1rem = 16px */
    scroll-behavior: smooth;
}

.visually-hidden {
    position: absolute !important;
    height: 1px; width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-base);
    font-weight: normal;
    line-height: 1.6;
    color: var(--text);
    background: var(--background);
    font-size: 1.15rem;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    margin: 1.5em 0 0.5em;
    overflow-wrap: break-word;
    hyphens: auto;
}

main h1:first-of-type {
    margin-top: 0;
}

p {
    margin: 1em 0;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

main a[href^="http://"],
main a[href^="https://"] {
    padding-right: 1em;
    background: url("data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2012%2012%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpolygon%20fill%3D%22%230d47a1%22%20points%3D%222%2C2%205%2C2%205%2C3%203%2C3%203%2C9%209%2C9%209%2C7%2010%2C7%2010%2C10%202%2C10%22/%3E%3Cpolygon%20fill%3D%22%230d47a1%22%20points%3D%226.2%2C2%2010%2C2%2010%2C5.8%208.6%2C4.4%206.5%2C6.5%205.5%2C5.5%207.6%2C3.4%22/%3E%3C/svg%3E") no-repeat right center;
    background-size: 1em;
}

/*
main a[href^="http://"]::after,
main a[href^="https://"]::after {
    content: "⤴";
    color: var(--muted);
    font-size: 1rem;
    position: relative;
    top: -0.3rem;
}
*/

/* 2. Layout containers */
.container {
    max-width: 750px;
    margin: 0 auto;
}

main {
    max-width: 750px;
    margin: 2em auto;
    padding: 0 1em;
}

header {
    padding: 1em 0;
}

/* 3. Header/footer layout and navigation */
header .container {
    display: flex;
    align-items: center; /* vertikal zentrieren */
    justify-content: space-between;
    flex-wrap: wrap;
    max-width: 1072px;
    margin: 0 auto;
    padding: 0 1em;
}

header .container > a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

header .container svg {
    display: block;
    height: 2.5rem;
    width: auto;
    max-width: 100%;
}

header nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

header nav a,
header nav a:visited {
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    color: var(--text);
    display: inline-block;
    padding: 0.4rem 1rem;
    margin: 0 0.1rem;
    text-decoration: none;
    font-size: 1rem;
}

header nav a:hover {
    border-color: var(--accent);
    color: var(--accent);
    cursor: pointer;
}

footer .container {
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted);
    padding: 0 1.2em;
    margin: 6em auto 1em auto;
}

main footer {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5em;
}

/* 4. Typografie & content styling */
ul, ol {
    margin: 0 0 0 1.5em;
    padding: 0;
}

ul:not(ul ul), ol:not(ol ol) {
    margin-top: 1em;
    margin-bottom: 1em;
}

dt {
    font-weight: bold;
    margin-top: 0.5em;
}

li {
    margin: 0.25em 0;
}

blockquote {
    border-left: 3px solid var(--border);
    margin: 1em 0;
    padding-left: 1em;
    color: var(--text);
    font-style: italic;
}

code {
    background: var(--surface-muted);
    border-radius: var(--border-radius);
    font-family: var(--font-mono);
    font-size: 1rem;
}

:not(pre) > code {
    padding: 0.2em 0.4em;
}

details {
    background: var(--surface-muted);
    padding: 0.7rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    margin-bottom: 1em;
}

pre {
    background: var(--surface-light);
    padding: 1em;
    overflow-x: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
}

pre code {
    background: var(--surface-light);
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2em 0;
    height: 0;
}

/* 5. Special components */
.logo {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary);
    margin: 0;
}

.footnotes, cite {
    font-size: 0.9rem;
    color: var(--muted);
}

.footnote-ref {
    font-size: 0.9rem;
}

kbd {
    display: inline-block;
    padding: 0.2em 0.4em;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    color: var(--text);
    background-color: var(--surface-muted);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    box-shadow: inset 0 -1px 0px var(--border);
}

mark {
    padding: 2px 5px;
    border-radius: var(--border-radius);
    background-color: var(--marked);
    color: var(--text);
}

mark a {
    color: var(--text);
}

/* 6. Images */
img,
video {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

figure {
    margin: 0;
    display: block;
    overflow-x: auto;
}

figure > img,
figure > picture > img {
    display: block;
    margin-inline: auto;
}

figcaption {
    text-align: center;
    font-size: 1rem;
    color: var(--muted);
    margin-block: 0.5rem;
}

.lowmark-left {
    float: left;
    margin-right: 20px;
    max-width: 40%;
}

.lowmark-right {
    float: right;
    margin-left: 20px;
    max-width: 40%;
}

.lowmark-center {
    margin-left: auto;
    margin-right: auto;
    display: block;
    max-width: 40%;
}


/* 7. Tables */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

th, td {
    border: 1px solid var(--border);
    padding: 0.5em;
    text-align: left;
}

th {
    background: var(--table-header);
}

/* 4. Breadcrumbs */

.breadcrumbs {
    font-size: 0.875rem;
    margin: 0.5rem 0;
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
    content: "›";
    margin-left: 0.5rem;
    color: var(--muted);
}

.breadcrumbs .current {
    color: var(--muted);
}

/* Teaser & timeline */


.teaser header {
    padding: 0.5rem 0;
    margin: 0;
    align-items: baseline;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.teaser article {
    padding: 1.5rem;
}

.teaser h2 {
    margin: 0 0 0.25rem;
}

.teaser p {
    margin: 0 0 0.5rem;
    color: var(--text);
}

.teaser a {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);

}

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

.teaser a:hover h2 {
    text-decoration: underline;
}


.teaser * {
    text-decoration: none;
}

.timeline a {
    margin-bottom: 1em;
}

.timeline time {
    font-size: 0.9rem;
    color: var(--muted);
    display: block;
}


/* Grid Container */
.grid-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
    min-height: 10rem;
    align-items: stretch;
}

.grid-container > a {
    display: block;
    min-height: 10rem;
}

@media (min-width: 600px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1072px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Paginator */

.paginator {
    text-align: center;
    margin: 2em 0;
}

.paginator ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4em;
    padding: 0;
    list-style: none;
    margin: 0;
}

.paginator li a,
.paginator li form {
    display: inline-block;
    padding: 0.3em 0.8em 0.5em 0.8em;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 1em;
}

.paginator li span {
    color: var(--muted);
}

.paginator li a:hover,
.paginator li a:focus,
.paginator li form:hover,
.paginator li form:focus {
    border-color: var(--accent);
    color: var(--accent);
    outline: none;
}

.paginator li form {
    color: var(--muted);
}

.paginator input {
    appearance: textfield;
    -moz-appearance: textfield;
    -webkit-appearance: none;
    border: 1px solid var(--background);
    background: transparent;
    color: inherit;
    font: inherit;
    width: 0.8em;
    height: 0.8em;
    text-align: center;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.paginator input:hover {
    border: 1px solid var(--border);
}

/* 9. Media Queries */
@media (max-width: 720px) {
    /* Responsive header adjustments */
    header nav a,
    header nav a:visited {
        all: unset;
        color: var(--text);
        text-decoration: underline;
        font-size: 1rem;
        cursor: pointer;
        margin: 0 0.5rem;
    }

    header nav a:hover {
        text-decoration: none;
    }
}

@media (max-width: 600px) {
    /* Responsive global font adjustments */
    body {
        font-size: 1.15rem;
    }

    /* Responsive header adjustments */
    header .container {
        flex-direction: column;
        align-items: center;
    }

    main footer {
        flex-direction: column;
        gap: 0.2em;
    }

    header nav {
        margin-top: 1em;
        text-align: center;
    }

    .teaser header {
        flex-direction: column; /* Standard: untereinander */
        gap: 0.2em;
    }
}

/* 10. Print styles */
@media print {
    header, footer, nav {
        display: none;
    }

    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    main {
        margin: 0;
        padding: 0;
        max-width: 100%;
    }

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

    a::after {
        content: " (" attr(href) ")";
        font-size: 0.9em;
    }

    img {
        max-width: 100%;
        height: auto;
        page-break-inside: avoid;
    }

    table {
        page-break-inside: avoid;
    }
}

/* 11. Additional */

@media (prefers-color-scheme: dark) {
    main a[href^="http://"],
    main a[href^="https://"] {
        padding-right: 1.1em;
        background: url("data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2012%2012%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpolygon%20fill%3D%22%23ffb300%22%20points%3D%222%2C2%205%2C2%205%2C3%203%2C3%203%2C9%209%2C9%209%2C7%2010%2C7%2010%2C10%202%2C10%22/%3E%3Cpolygon%20fill%3D%22%23ffb300%22%20points%3D%226.2%2C2%2010%2C2%2010%2C5.8%208.6%2C4.4%206.5%2C6.5%205.5%2C5.5%207.6%2C3.4%22/%3E%3C/svg%3E") no-repeat right center;
        background-size: 1em;
    }
}
