/*
 * Zentrale Oberflächenkonfiguration für den offenen Brief.
 * Farben, Inhaltsbreite und Schriften können hier angepasst werden.
 */

:root {
    --page-background: #abe3a2;
    --content-background: #ffffdf;
    --content-width: 800px;

    --text-color: #202820;
    --muted-text-color: #435243;
    --link-color: #245f2c;
    --focus-color: #163f1d;
    --border-color: #687568;

    --text-font: Georgia, "Times New Roman", Times, serif;
    --ui-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
    background: var(--page-background);
}

body {
    min-width: 0;
    min-height: 100vh;
    margin: 0;
    background: var(--page-background);
    color: var(--text-color);
    font-family: var(--text-font);
    font-size: 1.05rem;
    line-height: 1.65;
}

main {
    width: 100%;
    max-width: var(--content-width);
    min-height: 100vh;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 5rem;
    overflow-wrap: anywhere;
    background: var(--content-background);
}

h1,
h2,
h3,
h4,
h5,
h6,
nav,
form,
button,
.signature-summary {
    font-family: var(--ui-font);
}

h1,
h2,
h3 {
    line-height: 1.25;
    text-wrap: balance;
}

h1 {
    margin-top: 0;
    font-size: clamp(2rem, 6vw, 2.8rem);
}

h2 {
    font-size: clamp(1.45rem, 4.5vw, 1.9rem);
}

p,
li {
    max-width: 72ch;
}

a {
    color: var(--link-color);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
}

a:hover {
    text-decoration-thickness: 0.14em;
}

:focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.65rem 0.9rem;
    transform: translateY(-180%);
    background: var(--content-background);
    color: var(--text-color);
    font-family: var(--ui-font);
    font-weight: 700;
    border: 2px solid var(--focus-color);
}

.skip-link:focus {
    transform: translateY(0);
}

.top-nav {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 1rem;
    font-size: 0.9rem;
}

.top-nav a {
    display: inline-block;
    padding: 0.35rem 0.45rem;
}

.signature-summary {
    margin: 2.5rem 0 1.5rem;
}

.signature-count {
    margin: 0 0 0.45rem;
    font-size: clamp(2.7rem, 12vw, 4.5rem);
    font-weight: 750;
    line-height: 1;
}

.signature-count-label {
    margin: 0;
}

form {
    display: grid;
    width: 100%;
    max-width: 620px;
    gap: 1rem;
    margin: 1.5rem 0 2rem;
}

form > label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
}

input[type="text"],
input[type="email"] {
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    background: #ffffff;
    color: #111111;
    font: inherit;
    font-size: 1rem;
}

fieldset {
    min-width: 0;
    margin: 0;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-color);
}

legend {
    padding: 0 0.35rem;
    font-weight: 700;
}

fieldset label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0.55rem 0;
    font-weight: 400;
}

input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.15rem;
    flex: 0 0 auto;
}

button {
    min-height: 44px;
    width: fit-content;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.form-help,
small {
    color: var(--muted-text-color);
    font-family: var(--ui-font);
}

.form-help {
    max-width: 620px;
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.hp {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.notice,
.error {
    margin: 1.5rem 0;
    padding: 1rem;
    border: 2px solid currentColor;
    font-family: var(--ui-font);
}

.error {
    font-weight: 650;
}

.signers {
    padding: 0;
    list-style: none;
}

.signers li {
    padding: 0.4rem 0;
}

.signers li:target {
    font-weight: 750;
    outline: 3px solid var(--focus-color);
    outline-offset: 4px;
}

@media (max-width: 800px) {
    body {
        font-size: 1rem;
    }

    main {
        padding: 1rem 1rem 3.5rem;
    }

    .top-nav {
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 520px) {
    main {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    fieldset {
        padding: 0.75rem;
    }

    button {
        width: 100%;
    }

    .signature-count {
        font-size: clamp(2.6rem, 18vw, 4rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Obere Seitennavigation innerhalb der zentrierten Inhaltsspalte */
.top-nav {
    width: 100%;
    box-sizing: border-box;
    text-align: right;
    margin: 0 0 1rem 0;
}

/* Mobile Navigation */
.mobile-menu,
.mobile-imprint-link {
    display: none;
}

@media (max-width: 800px) {
    .desktop-nav {
        display: none;
    }

    .mobile-menu {
        display: block;
        position: relative;
        margin: 0 0 1rem auto;
        width: fit-content;
        max-width: 100%;
        font-family: var(--ui-font);
    }

    .mobile-menu summary {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        min-height: 44px;
        padding: 0.55rem 0.8rem;
        border: 1px solid var(--border-color);
        border-radius: 0.3rem;
        background: var(--content-background);
        color: var(--text-color);
        font-weight: 700;
        cursor: pointer;
        list-style: none;
    }

    .mobile-menu summary::-webkit-details-marker {
        display: none;
    }

    .mobile-menu summary::marker {
        content: "";
    }

    .hamburger-icon {
        font-size: 1.35rem;
        line-height: 1;
    }

    .mobile-menu[open] summary {
        margin-bottom: 0.35rem;
    }

    .mobile-menu nav {
        display: grid;
        min-width: min(16rem, calc(100vw - 2rem));
        padding: 0.35rem;
        border: 1px solid var(--border-color);
        border-radius: 0.3rem;
        background: var(--content-background);
        box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.12);
    }

    .mobile-menu nav a {
        display: block;
        min-height: 44px;
        padding: 0.7rem 0.8rem;
        box-sizing: border-box;
        text-align: left;
    }

    .mobile-imprint-link {
        display: block;
        position: fixed;
        z-index: 900;
        left: 50%;
        bottom: max(0.55rem, env(safe-area-inset-bottom));
        transform: translateX(-50%);
        padding: 0.45rem 0.75rem;
        border: 1px solid var(--border-color);
        border-radius: 999px;
        background: var(--content-background);
        color: var(--text-color);
        font-family: var(--ui-font);
        font-size: 0.9rem;
        line-height: 1.2;
        box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.14);
    }

    main {
        padding-bottom: calc(5rem + env(safe-area-inset-bottom));
    }
}

