html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    background: initial;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
    display: block;
}
style, script {
    display: none !important;
}

body {
    line-height: 1;
}

ol, ul, menu, nav {
    list-style: none;
}

blockquote, q {
    quotes: none;
}

    blockquote:before, blockquote:after,
    q:before, q:after {
        content: '';
        content: none;
    }

table {
    border-collapse: collapse;
    border-spacing: 0;
}

button {
    all: unset;
    outline: revert;
    box-sizing: border-box;
    cursor: pointer;
}

* {
    box-sizing: border-box;
    scroll-margin-top: calc(var(--header-height) + 2rem);
}

:target {
    animation: highlight 1s 1 ease-out;
}

@keyframes highlight {
    0% { background: var(--color-warning); }
    100% { background: inherit; }
}


:root {
    --color-primary: #3F2C42;
    --color-shadows: #8F777025;
    --color-secondary: #ba6383;
    --color-secondary-25: color-mix(in srgb, var(--color-secondary) 25%, var(--color-bg));
    --color-secondary-50: color-mix(in srgb, var(--color-secondary) 50%, var(--color-bg));
    --color-secondary-75: color-mix(in srgb, var(--color-secondary) 75%, var(--color-bg));

    --color-bg: #F5F0EA;
    --color-bg-text: #ffffff;
    --color-bg-quote: #f0f0f0;
    --color-warning: #FFD75E;
    --color-error: #FF6B47;

    --color-header-text: var(--color-bg-text);
    --color-button-text: var(--color-bg-text);
    --color-button-text-hover: var(--color-bg-text);

    --color-text-primary: #222222;
    --color-text-secondary: #666666;

    --header-height: 3rem;

    --main-font-family: 'Segoe UI', Calibri, Helvetica, sans-serif;
    --line-height-main: 1.5;
    --line-height-tight: 1.2;
    --main-font-size: 18px;
    --mid-font-size: 16px;
    --smol-font-size: 14px;

    --page-pad: var(--gutter);
    --gaps: 2rem;
    --gutter: 1rem;
    --smol-gutter: .666rem;

    --border-radius: .333rem;
}




body {
    display: grid;
    width: 100%;
    min-height: 100vh;
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    accent-color: var(--color-secondary);
    overflow-x: hidden;
}

    body > header {
        background: var(--color-primary);
        color: var(--color-header-text);
        box-shadow: 0 0px 5px var(--color-shadows);
        display: flex;
        flex-direction: row;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: var(--header-height);
        justify-content: end;
        gap: var(--gaps);
        padding: 0 calc(var(--page-pad) + var(--gutter));
        align-items: center;
        z-index: 100;
    }
        body > header > #logo {
            margin-inline-end: auto;
        }
        body > header > #logo .ph {
            font-size: 1.8rem;
        }

    body > footer {
        width: 100%;
        height: var(--header-height);
        display: flex;
        flex-direction: row;
        justify-content: end;
        gap: var(--gaps);
        padding: 0 var(--gaps);
        align-items: center;
    }
        body > footer > :last-child {
            /*flex-grow: 1;*/
            text-align: right;
        }

main {
    width: 100%;
    min-height: calc(100vh - var(--header-height)*2);
    margin-top: var(--header-height);
    padding: 0 0 var(--gaps);
    display: grid;
    grid-template-columns: [fullwidth-start]
                           minmax(var(--gutter), auto)
                           [breakout-start]
                           minmax(auto, 20rem)
                           [main-start]
                           min(35rem, 100% - var(--page-pad) * 2)
                           [main-end]
                           minmax(auto, 20rem)
                           [breakout-end]
                           minmax(var(--gutter), auto)
                           [fullwidth-end];
    grid-auto-rows: max-content;
    overflow-x: hidden;
}

main > *:first-child {
    margin-top: var(--gaps);
}
main > * {
    grid-column: main;
}
main > section > *:first-child {
    margin-top: 0;
}

main > * + * {
    margin-top: var(--gaps);
}

main #breadcrumbs {
    font-size: var(--smol-font-size);
    grid-column: breakout;
    color: var(--color-text-secondary);

}
main #breadcrumbs .ph-caret-right {
    font-size: .8em;
    vertical-align: 0;
}

body > footer {
    background: var(--color-primary);
    color: var(--color-button-text);
}




/*************************  Grundlegende Typografie  *************************/
html, body,
input, textarea, select,
optgroup, option {
    font-size: var(--main-font-size);
    line-height: var(--line-height-main);
    font-family: var(--main-font-family);
    font-style: normal;
}

input, textarea, select {
    padding-inline: var(--smol-gutter);
    padding-block: calc(var(--smol-gutter) * .666);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-text-primary);
    max-width: 100%;
}

label {
    font-size: var(--smol-font-size);
    break-inside: avoid;
}

textarea {
    resize: vertical;
    min-height: 2lh;
    max-height: 66.666vh;
    max-height: 66.666svh;
}

h1 {
    font-size: 3rem;
    line-height: var(--line-height-tight);
    font-weight: normal;
    text-align: center;
    text-wrap: balance;
    grid-column: breakout;
}

    h1 > small {
        font-size: var(--main-font-size);
        line-height: var(--line-height-tight);
        font-weight: initial;
        display: block;
    }
    h1 + * {
        margin-top: 1rem;
    }

h2 {
    font-size: 1.666rem;
    line-height: var(--line-height-tight);
    font-weight: 350;
    margin-top: 3.333rem;
}
    h2:first-child {
        margin-top: 0;
    }
    h2 + * {
        margin-top: .7rem;
    }

p + p,
p + ul,
ul + p,
p + ol,
ol + p,
blockquote + p {
    margin-block-start: .666em;
    margin-top: .666em;
}
p + blockquote {
    margin-block-start: 1.666em !important;
    margin-top: 1.666em !important;
}

.mid {
    font-size: var(--mid-font-size);
}
small, .small {
    font-size: var(--smol-font-size);
}


strong, b, h3 {
    font-weight: 600;
}

em, i {
    font-style: italic;
}

img {
    border-radius: calc(var(--border-radius) * .666);
}
main img {
    margin-block: var(--smol-gutter);
}

img.inline {
    display: inline-block;
    height: .89lh;
    margin: 0;
    vertical-align: text-bottom;
    margin: 0;
}

blockquote {
    background: var(--color-bg-quote);
    padding: 1em 1.333em;
    border-left: .5em solid var(--color-secondary-25);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 3px var(--color-shadows);
}
    blockquote > ol,
    blockquote > ul {
        padding-left: 1em !important;
    }

pre {
    font-family: Consolas, 'Courier New', monospace;
    font-size: var(--smol-font-size);
    margin-block: var(--smol-gutter);
    background: var(--color-bg-quote);
    padding-inline: var(--smol-gutter);
    padding-block: calc(var(--smol-gutter) * .666);
    border-radius: calc(var(--border-radius) * .666);
    max-height: 60vh;
    max-height: 60svh;
    overflow: scroll;
}
code {
    font-family: Consolas, 'Courier New', monospace;
    border-radius: calc(var(--border-radius) * .666);
    background: var(--color-bg-quote);
    padding: .2em .333em;
}

a {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

main a {
    color: var(--color-secondary);
}
    main a:hover {
        color: var(--color-secondary-50);
    }



main table
{
    border-radius: var(--border-radius);
    overflow: clip;
    box-shadow: 0 2px 3px var(--color-shadows);

    thead {
        background: var(--color-bg-text);
        font-weight: 600;
        text-align: left;
    }

    tbody tr:nth-child(even) {
        background: var(--color-bg-text);
    }
    tbody tr:nth-child(2n+1) {
        background: var(--color-bg-quote);
    }

    td, th {
        vertical-align: middle;
        padding: .333rem .666rem;
    }
    td:first-child, th:first-child {
        padding-inline-start: var(--gutter);
    }
    td:last-child, th:last-child {
        padding-inline-end: var(--gutter);
    }
    img {
        margin: 0;
        display: block;
    }
}




.error,
#error {
    color: var(--color-error);
    display: initial;
}
.error:empty,
#error:empty {
    display: none;
}
.error:not(.htmx-settling),
#error:not(.htmx-settling) {
	animation: shake .666s 1 ease-out;
}

@keyframes shake {
    0% { transform: translateX(0); }
   10% { transform: translateX(0.5em); }
   20% { transform: translateX(-.5em); }
   30% { transform: translateX(0.4em); }
   40% { transform: translateX(-.4em); }
   50% { transform: translateX(0.2em); }
   60% { transform: translateX(-.2em); }
   70% { transform: translateX(0.1em); }
   80% { transform: translateX(-.1em); }
   90% { transform: translateX(.03em); }
}

/***********************  10-Spalten-Grid (für Forms)  ***********************/
.grid10 {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    align-items: end;
    gap: var(--gutter);
}
    .grid10 > * {
        grid-column: 1 / span 10;
    }
        .grid10 > * > * {
            width: 100%;
        }

/**************************** Flex in einer Zeile ****************************/
.flexstretch {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: stretch;
    gap: var(--gutter);
}

    .flexstretch > * {
        width: auto;
    }

    .flexstretch > .half {
        flex-grow: 5;
        width: 0;
    }

    .flexstretch > .third {
        flex-grow: 3.33333;
        width: 0;
    }

    .flexstretch > .two-thirds {
        flex-grow: 6.66666;
        width: 0;
    }

/****************************** Flex-Shorthands ******************************/
.flex-column {
    display: flex !important;
    flex-direction: column;
    gap: var(--gutter);
}
.flex-center {
    display: flex !important;
    gap: var(--gutter);
    justify-content: center !important;
}
.flex-between {
    display: flex !important;
    gap: var(--gutter);
    justify-content: space-between !important;
}
.flex-around {
    display: flex !important;
    gap: var(--gutter);
    justify-content: space-around !important;
}
.flex-evenly {
    display: flex !important;
    gap: var(--gutter);
    justify-content: space-evenly !important;
}
.flex-end {
    display: flex !important;
    gap: var(--gutter);
    justify-content: end !important;
}
.flex-align-start {
    display: flex !important;
    align-items: start !important;
}
.flex-align-baseline {
    display: flex !important;
    align-items: baseline !important;
}
.flex-align-center {
    display: flex !important;
    align-items: center !important;
}


/******************************** Misc. Fixes ********************************/
.htmx-request {
    pointer-events: none; /*verhindert doppeltes abschicken*/
}




.mobileonly {
    display: none !important;
}


@media (prefers-color-scheme: dark)
{
    :root {
        --color-primary: #14160c;
        --color-shadows: #161711;
        --color-secondary: #ff6188;
        --color-bg: #1d1e18;
        --color-bg-text: #272822;
        --color-bg-quote: #232321;
        --color-warning: #FFD75E;
        --color-error: #FF6B47;

        --color-text-primary: #efefef;
        --color-text-secondary: #bbbbbb; /*#e3d97a;*/

        --color-header-text: #ffffff;
        --color-button-text: #ffffff;
        --color-button-text-hover: #ffffff;
    }
}


@media only screen and (max-width: 800px)
{
    :root {
        --main-font-size: 16px;
        --mid-font-size: 14px;
        --smol-font-size: 12px;

        --page-pad: .666rem;
    }

    h1 {
        font-size: 2rem;
    }

    main {
        grid-template-columns: [fullwidth-start]
                               var(--page-pad)
                               [breakout-start]
                               1rem
                               [main-start]
                               min(80rem, 100% - var(--page-pad) * 2 - 2rem)
                               [main-end]
                               1rem
                               [breakout-end]
                               var(--page-pad)
                               [fullwidth-end];
    }

    body > header {
        gap: .666rem;
        padding: 0 var(--page-pad);
    }

    .nomobile {
        display: none !important;
    }

    .mobileonly {
        display: initial !important;
    }

    .flex-mobile-column {
        flex-direction: column;
    }
}