/*
 * ###
 * ###
 * ###    ######    ##   ##    ##### ####     ######     ####  ###   ##
 * ###  ###    ###  ##   ##   ##  ###  ###  ###    ##   ###    ###  ###
 * ###  ###    ###  ###  ###  ##   ##   ##  ###   ####  ###    #######
 * ###    ######     #### #####    ##   ##   ###### ##  ###    ###   ##
 *
 * 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: #2e7d32;
    --secondary: #00838f;
    --highlight: #ffca28;

    /* Logo colors (inline SVG in header) */
    --logo-shape: var(--neutral-900);
    --logo-inverse: var(--neutral-100);

    /* 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: #81c784;
        --secondary: #4dd0e1;
        --highlight: #ffd54f;
    }

    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%232e7d32%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%232e7d32%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;
}

/* Partnerlogo-Links ohne Extern-Link-Pfeil */
main a.partner-logo-link {
    padding-right: 0;
    background: none;
}

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

.lowmark-mail {
    overflow-wrap: anywhere;
    word-break: normal;
    display: inline-block;
    max-width: 100%;
}

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

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

/* Seitenkopf mit Titel + Veranstaltungskopf (Frontmatter start/location) */
.page-header h1 {
    margin-bottom: 0.25em;
}

header {
    padding: 1em 0;
}

/* 3. Header/footer layout and navigation */
header .container {
    display: flex;
    flex-direction: column; /* Logo, Site-Name und Menü zentriert untereinander */
    align-items: center;
    gap: 0.75rem;
    max-width: 1072px;
    margin: 0 auto;
    padding: 1.5em 1em 1em;
}

header .logo {
    text-decoration: none;
}

header .logo svg {
    display: block;
    width: 240px;
    height: auto;
    max-width: 100%;
}

.site-name {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-align: center;
}

header nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem 1.5rem;
    flex-wrap: wrap;
}

header nav a,
header nav a:visited {
    color: var(--text);
    text-decoration: none;
    font-size: 1.05rem;
    padding: 0.2rem 0;
    border-bottom: 2px solid transparent;
}

header nav a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary); /* gleiche Linie wie .current (deckungsgleich) */
    text-decoration: none; /* globale a:hover-Unterstreicherung unterdrücken */
    cursor: pointer;
}

header nav a.current {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

header nav a.current:hover {
    border-bottom-color: transparent; /* „negativ": aktiver Punkt zeigt bei Hover keine Linie */
}

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

/* Partnerlogos (via ::: logo – 1:1, ohne Skalierung, nebeneinander) */
.partner-logo-item {
    display: inline-block;
    vertical-align: top;
    text-align: center;
    margin: 0.5rem 1rem 0.5rem 0;
}

.partner-logo {
    display: inline-block;
    max-width: 240px;
    height: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 0.5rem;
}

.partner-logo-caption {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.25rem;
}


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

/* Veranstaltungs-Teaser (timeline, ohne Card-Design) */

.event-list {
    margin-top: 1.5rem;
}

.event {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem 1.5rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border-light);
}

.event:first-of-type {
    border-top: none;
    padding-top: 0.25rem;
}

.event-media {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--border-radius);
    background: var(--surface-muted);
}

.event-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Platzhalter: Logo schwach kontrastig, zentriert (Darkmode via invert) */
.event-media img.event-placeholder {
    width: 72%;
    height: auto;
    object-fit: contain;
    opacity: 0.18;
}

@media (prefers-color-scheme: dark) {
    .event-media img.event-placeholder {
        filter: invert(1);
        opacity: 0.22;
    }
}

.event-date {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
}

.event-date a {
    color: var(--primary);
    text-decoration: none;
}

.event-date a:hover {
    text-decoration: underline;
}

.event-title {
    margin: 0.25rem 0 0;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.35;
}

.event-title a {
    color: var(--text);
    text-decoration: none;
}

.event-title a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.event-location {
    margin: 0.35rem 0 0;
    color: var(--muted);
}

.event-teaser {
    margin: 0.5rem 0 0;
}

@media (min-width: 720px) {
    .event {
        grid-template-columns: 1fr 2fr;
    }
}

/* Veranstaltungskopf in der Detailansicht (Frontmatter start/location) – Labels fett, Werte normal */
.event-meta {
    margin: 0 0 1em;
}


/* 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: 600px) {
    /* Responsive global font adjustments */
    body {
        font-size: 1.15rem;
    }

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

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

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

    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%2381c784%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%2381c784%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;
    }
}
