/* Gestaltung camerata27.de - ohne externe Schriften oder Bibliotheken */

:root {
    --background: #faf8f4;
    --surface: #ffffff;
    --text: #1f1c19;
    --text-muted: #6b645a;
    --text-faint: #a9a196;
    --line: #e3ddd3;
    --border: #cfc7bb;
    --accent: #7a1f2b;
    --accent-dark: #5e1620;
    --accent-light: #f5e9ea;
    --ok: #2c6a3a;
    --ok-background: #e7f2e9;
    --info: #2a5577;
    --info-background: #e6eef5;
    --warning: #7a5300;
    --warning-background: #fbf0d9;
    --error: #a3232d;
    --error-background: #fbe8e9;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--background);
    color: var(--text);
    font: 1rem/1.55 var(--font);
    -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
code { font-size: .9em; background: #f1ede6; padding: .05em .3em; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-heading); font-weight: 600; line-height: 1.2; margin: 1.6em 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-top: .3em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }

/* Kopf und Fuß */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header-inner, .site-footer-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: .9rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1.5rem;
}
.brand { display: flex; flex-direction: column; line-height: 1.15; text-decoration: none; color: var(--text); }
.brand-title { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 600; color: var(--accent); }
.brand-subtitle { font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.1rem; font-size: .95rem; }
.nav a { color: var(--text); text-decoration: none; padding: .15rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.nav form { display: inline; margin: 0; }
.current-user { color: var(--text-muted); font-size: .9rem; }

.content { flex: 1; width: 100%; max-width: 44rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.content.wide { max-width: 72rem; }

.site-footer { border-top: 1px solid var(--line); font-size: .9rem; }
.site-footer-inner { justify-content: center; gap: .4rem 1.4rem; }
.site-footer a { color: var(--text-muted); }

/* Text */
.lead { font-size: 1.07rem; color: var(--text-muted); }
.small, .help { font-size: .9rem; color: var(--text-muted); }
.help { margin: .35rem 0 0; }
.optional { font-weight: 400; color: var(--text-muted); font-size: .9rem; }
.back-link { margin: 0; font-size: .95rem; }
.spaced-top { margin-top: 1rem; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Meldungen */
.notice { margin: 1rem 0; padding: .8rem 1rem; border: 1px solid transparent; border-radius: var(--radius); }
.notice-ok { background: var(--ok-background); color: var(--ok); border-color: #c6e0cb; }
.notice-info { background: var(--info-background); color: var(--info); border-color: #c8d8e6; }
.notice-warning { background: var(--warning-background); color: var(--warning); border-color: #ecd9a8; }
.notice-error { background: var(--error-background); color: var(--error); border-color: #efc4c7; }
.notice a { color: inherit; font-weight: 600; }

.card, .form {
    margin: 1.25rem 0;
    padding: 1.15rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.card > h2:first-child { margin-top: 0; }
.form.narrow { max-width: 26rem; }
details.card summary { cursor: pointer; font-weight: 600; }
details.card[open] summary { margin-bottom: .9rem; }

/* Formulare */
.field { margin: 0 0 1.3rem; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend, .label { display: block; margin-bottom: .35rem; padding: 0; font-weight: 600; }
.label { margin-top: .75rem; }

input[type="text"], input[type="email"], input[type="password"], select, textarea {
    width: 100%;
    padding: .6rem .75rem;
    font: inherit;
    color: inherit;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
}
textarea { min-height: 5.5rem; resize: vertical; }
input[type="file"] { font: inherit; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(122, 31, 43, .25); outline-offset: 0; border-color: var(--accent); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(122, 31, 43, .35); outline-offset: 2px; }

.has-error input[type="text"], .has-error input[type="email"], .has-error input[type="password"],
.has-error select, .has-error textarea { border-color: var(--error); }
.field-error { margin: .35rem 0 0; font-size: .9rem; color: var(--error); }

.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.choice span {
    display: inline-block;
    padding: .5rem 1.1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: background-color .15s, border-color .15s, color .15s;
}
.choice:hover span { border-color: var(--accent); }
.choice input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.choice input:focus-visible + span { outline: 3px solid rgba(122, 31, 43, .35); outline-offset: 2px; }
.has-error .choice span { border-color: var(--error); }
/* Zusatzfragen: eingerückter Kasten. Die Legende fließt per float in den Kasten, sonst setzt der Browser sie auf die Kante. */
.follow-up { margin-top: -.5rem; padding: .75rem 1rem; background: var(--background); border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; }
.follow-up > legend { float: left; width: 100%; }
.follow-up > legend + * { clear: both; }
.follow-up-nested { margin-left: 1.5rem; }

.checkbox, .field > label.checkbox { display: flex; align-items: flex-start; gap: .65rem; margin: 0; font-weight: 400; cursor: pointer; }
.checkbox input { flex: none; width: 1.15rem; height: 1.15rem; margin: .2rem 0 0; accent-color: var(--accent); }

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

/* Knöpfe */
.button {
    display: inline-block;
    padding: .6rem 1.2rem;
    font: inherit;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
}
.button:hover { color: #fff; background: var(--accent-dark); border-color: var(--accent-dark); }
.button-secondary { color: var(--accent); background: #fff; }
.button-secondary:hover { color: var(--accent-dark); background: var(--accent-light); border-color: var(--accent); }
.button-danger { color: var(--error); background: #fff; border-color: var(--error); }
.button-danger:hover { color: var(--error); background: var(--error-background); border-color: var(--error); }
.button-small { padding: .3rem .75rem; font-size: .88rem; }
.button-link {
    padding: 0;
    font: inherit;
    color: var(--accent);
    background: none;
    border: 0;
    text-decoration: underline;
    cursor: pointer;
}
.button-link.danger { color: var(--error); }
.actions, .button-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.actions { margin-top: 1.5rem; }
.button-row form { margin: 0; }
.secondary-action { margin-top: .6rem; }
.inline { display: inline; margin: 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0 0; }
.inline-form input[type="text"] { width: auto; flex: 1 1 12rem; }

.title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.title-row h1, .title-row h2 { margin-bottom: .4em; }

.copy-row { display: flex; gap: .5rem; align-items: stretch; }
.copy-row input, .copy-row textarea { flex: 1; min-width: 0; font-size: .92rem; background: var(--background); }

/* Orga-Übersicht */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .75rem; margin: 1rem 0 1.5rem; }
.stat { padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat-value {
    display: block;
    font-family: var(--font-heading);
    font-size: 2rem;
    line-height: 1.1;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}
.stat-label { display: block; margin-top: .2rem; font-size: .9rem; color: var(--text-muted); }
.stat-note { display: block; margin-top: .15rem; font-size: .8rem; color: var(--warning); }
.stat-note-muted { display: block; margin-top: .15rem; font-size: .8rem; color: var(--text-muted); }

.lineup-wrap { max-width: 36rem; }
.table .number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lineup-table td, .lineup-table th { padding-top: .35rem; padding-bottom: .35rem; }
.lineup-table .group-row th { padding-top: .8rem; background: var(--surface); font-family: var(--font-heading); }
.lineup-table tr.empty td { color: var(--text-faint); }
.lineup-table tfoot th { border-top: 2px solid var(--line); }

.sort-links { margin: .25rem 0 .75rem; font-size: .92rem; color: var(--text-muted); }
.sort-links a { margin-left: .5rem; }
.sort-links a[aria-current] { font-weight: 600; color: var(--text); text-decoration: none; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th, .table td { padding: .55rem .75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table th { background: #f3efe8; font-weight: 600; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfaf6; }
.table .remarks { min-width: 14rem; max-width: 28rem; white-space: pre-line; }
.table .date { white-space: nowrap; color: var(--text-muted); }
.table .empty-row { color: var(--text-muted); text-align: center; padding: 1.5rem; }
.muted { color: var(--text-faint); }
.row-action { display: inline-block; margin-right: .75rem; }
.row-action summary { cursor: pointer; color: var(--accent); text-decoration: underline; font-size: .9rem; }

.two-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 0 1.5rem; }

.summary { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 1rem 0; }
.summary dt { font-weight: 600; }
.summary dd { margin: 0; }

/* Unterlagen */
.file-list { list-style: none; margin: 0 0 1rem; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.file-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .25rem 1rem;
    padding: .6rem .9rem;
    border-bottom: 1px solid var(--line);
}
.file-list li:last-child { border-bottom: 0; }
.file-list a { word-break: break-word; }
.file-list .meta { font-size: .88rem; color: var(--text-muted); white-space: nowrap; }
.file-list .meta form { margin-left: .75rem; }

/* Startseite */
.hero { padding: 2.5rem 0 .5rem; }
.hero-kicker { margin: 0; font-size: .82rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin: .3em 0 .4em; }
.hero-text { max-width: 36rem; font-size: 1.15rem; }
.key-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; margin-top: 2rem; }
.key-facts > div { padding: 1rem 1.1rem; background: var(--surface); border-top: 3px solid var(--accent); border-radius: 0 0 var(--radius) var(--radius); }
.key-facts h2 { margin: 0 0 .4rem; font-size: 1.1rem; }
.key-facts p { margin: 0; }

.text-page h2 { font-size: 1.2rem; }
.placeholder { background: #fff3b0; padding: 0 .2em; }

@media (max-width: 36rem) {
    .form, .card { padding: 1rem; }
    .copy-row { flex-direction: column; }
    .summary { grid-template-columns: 1fr; gap: .1rem; }
    .summary dd { margin-bottom: .5rem; }
}

@media print {
    .site-header, .site-footer, .button, .button-row, .sort-links, details, form { display: none !important; }
    body { background: #fff; }
    .content, .content.wide { max-width: none; padding: 0; }
    .table-wrap { overflow: visible; border: 0; }
}
