/* WünschDirWas – Gestaltung
   Idee: Hinter der Haustür (Klingelschild auf ho-mann.de) hängen die Wünsche als Geschenkanhänger.
   Kopfzeile = Hauswand der Startseite, Wünsche = Anhänger mit Loch und Faden, Status = Stempel.
   Keine externen Schriften: Schildschrift (Bahnschrift/DIN) für Überschriften, Systemschrift für Text. */
:root {
    --wall: #3d4a4c;
    --wall-deep: #2c3638;
    --fog: #e7ecec;          /* Hintergrund: kühles, helles Grau */
    --paper: #ffffff;
    --ink: #20272a;
    --muted: #5f6a6e;
    --line: #cfd7d8;
    --bell: #f0b13c;         /* Hauptaktion, wie der beleuchtete Klingelknopf */
    --bell-deep: #d99a22;
    --gift: #c23b2a;         /* Schleife: "Wünsche ich mir sehr" */
    --link: #2f6c71;
    --taken: #a85a12;
    --group: #2d5a8a;
    --idea: #6b3f8a;
    --ok: #2e6b35;
    --plate-font: "Bahnschrift", "DIN Alternate", "DIN Next", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
    --text-font: system-ui, -apple-system, "Segoe UI", sans-serif;
    --notch: 0.9rem;         /* Anhänger: links angeschrägte Ecken */
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--fog);
    color: var(--ink);
    font: 400 1rem/1.55 var(--text-font);
}

h1, h2, h3, legend, .brand, button, a.button {
    font-family: var(--plate-font);
}
h1 { font-size: 1.9rem; line-height: 1.15; margin: 1.2rem 0 0.6rem; letter-spacing: 0.01em; }
h2 { font-size: 1.3rem; line-height: 1.2; margin: 1.8rem 0 0.5rem; }
section > h2:first-child { margin-top: 2rem; }

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--bell); outline-offset: 2px; }

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

/* ---------- Kopfzeile: die Hauswand ---------- */
.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem 1rem;
    padding: 0.8rem max(1rem, calc((100% - 44rem) / 2));
    background:
        radial-gradient(ellipse at 30% 0, #4a5859 0, transparent 70%),
        linear-gradient(var(--wall), var(--wall-deep));
    color: #e8ecec;
}
.brand {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #f4f6f6;
    text-decoration: none;
    text-shadow: 0 1px 0 rgba(0,0,0,.35);
}
.brand::before {         /* kleiner Leuchtknopf vor dem Namen */
    content: "";
    display: inline-block;
    width: 0.6em; height: 0.6em;
    margin-right: 0.45em;
    border-radius: 50%;
    background: var(--bell);
    box-shadow: 0 0 8px 1px rgba(240,177,60,.7);
    vertical-align: 0.05em;
}
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 1rem; font-size: 0.95rem; }
.site-nav a, .site-nav .link { color: #dfe5e5; text-decoration: none; }
.site-nav a:hover, .site-nav .link:hover { color: #fff; text-decoration: underline; }
.site-nav .muted { color: #a9b5b6; }

.container {
    max-width: 44rem;
    margin: 0 auto;
    padding: 0.5rem 1rem 3rem;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem 1rem;
}
.page-head h1 { margin-bottom: 0.4rem; }

/* ---------- Formulare ---------- */
form.inline { display: inline; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 0.45rem; margin: 1rem 0; }
.stack label { font-weight: 600; margin-top: 0.4rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 1rem 0; }

input[type="text"], input[type="email"], input[type="number"], input[type="url"], input[type="date"],
textarea, select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    font: inherit;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid #b9c3c5;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.06);
}
input:focus, textarea:focus, select:focus { border-color: var(--wall); outline: 2px solid var(--bell); outline-offset: 0; }
input.narrow { width: 5rem; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--wall); width: 1.1rem; height: 1.1rem; }
.check { display: flex; align-items: center; gap: 0.55rem; font-weight: 400 !important; margin-top: 0 !important; }

fieldset {
    margin: 0.4rem 0 0;
    padding: 0.6rem 0.9rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: rgba(255,255,255,.55);
}
legend { padding: 0 0.3rem; font-weight: 700; }
.field-error { margin: 0; color: #a3271a; font-size: 0.9rem; font-weight: 600; }

/* ---------- Knöpfe ---------- */
button, a.button {
    display: inline-block;
    padding: 0.62rem 1.1rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ink);
    background: linear-gradient(#f6c25a, var(--bell));
    border: 1px solid var(--bell-deep);
    border-radius: 5px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 2px 0 var(--bell-deep);
    text-decoration: none;
    cursor: pointer;
}
button:hover, a.button:hover { background: var(--bell); color: var(--ink); }
button:active, a.button:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 0 0 var(--bell-deep); }

button.secondary, a.button.secondary {
    padding: 0.45rem 0.85rem;
    font-weight: 600;
    color: var(--wall);
    background: var(--paper);
    border: 1px solid #9aa6a8;
    box-shadow: 0 1px 0 #9aa6a8;
}
button.secondary:hover, a.button.secondary:hover { background: #f2f5f5; border-color: var(--wall); }

button.link {
    padding: 0;
    font: inherit;
    font-weight: 400;
    color: var(--link);
    background: none;
    border: 0;
    box-shadow: none;
    text-decoration: underline;
}

/* ---------- Meldungen ---------- */
.flash {
    padding: 0.7rem 0.9rem;
    margin: 1rem 0;
    background: var(--paper);
    border-left: 5px solid var(--link);
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.flash p { margin: 0 0 0.5rem; }
.flash-error { border-left-color: #b4321f; background: #fdf2f0; }
.flash-success { border-left-color: var(--ok); background: #f1f8f1; }

/* ---------- Listen (Verwaltung, Familie) ---------- */
.list { list-style: none; padding: 0; margin: 1rem 0; background: var(--paper); border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e6ebeb;
}
.list li:last-child { border-bottom: 0; }
.list li > a { font-family: var(--plate-font); font-size: 1.15rem; text-decoration: none; color: var(--ink); }
.list li > a:hover { color: var(--link); }
/* Ganze Zeile klickbar: Die Klickfläche des Links wird über die Zeile gezogen. */
.list-clickable { overflow: hidden; }
.list-clickable li { position: relative; cursor: pointer; }
.list-clickable li > a::after { content: ""; position: absolute; inset: 0; }
.list-clickable li:hover { background: #f3f6f6; }
.list-clickable li:hover > a { color: var(--link); }
.list-clickable li > a:focus-visible { outline: none; }
.list-clickable li:focus-within { outline: 2px solid var(--link); outline-offset: -2px; }

details { margin: 1rem 0; }
summary { cursor: pointer; font-weight: 700; color: var(--link); }

/* ---------- Stempel / Etiketten ---------- */
.badge {
    display: inline-block;
    padding: 0.05rem 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    border: 1.5px solid currentColor;
    border-radius: 3px;
    line-height: 1.5;
}
.badge-ok { color: var(--ok); }
.badge-taken { color: var(--taken); transform: rotate(-2.5deg); background: #fff7ec; }
.badge-group { color: var(--group); transform: rotate(-2.5deg); background: #f0f5fb; }
.badge-idea { color: var(--idea); border-style: dashed; }
.badge-elsewhere { color: var(--muted); border-style: dotted; background: #f4f5f5; }
.prio-1 { color: var(--gift); }
.prio-1::before { content: "♥ "; }

/* ---------- Wünsche als Geschenkanhänger ---------- */
.wishes { list-style: none; padding: 0; margin: 1.2rem 0; display: grid; gap: 1.1rem; }

.wish {
    position: relative;
    display: flex;
    flex-direction: column;
    --tag-bg: var(--paper);
    background:
        linear-gradient(135deg, transparent var(--notch), var(--tag-bg) 0) top left / 2.2rem 51% no-repeat,
        linear-gradient(45deg, transparent var(--notch), var(--tag-bg) 0) bottom left / 2.2rem 51% no-repeat,
        linear-gradient(var(--tag-bg), var(--tag-bg)) top right / calc(100% - 2rem) 100% no-repeat;
    filter: drop-shadow(0 1px 0 #c2cbcc) drop-shadow(0 6px 10px rgba(44,54,56,.12));
    padding-left: 2.1rem;    /* Platz für das Loch */
}
/* Ösen-Loch mit Faden */
.wish::before {
    content: "";
    position: absolute;
    left: 0.75rem;
    top: 50%;
    width: 0.8rem; height: 0.8rem;
    margin-top: -0.4rem;
    border-radius: 50%;
    background: var(--fog);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.25), 0 0 0 3px #f1e2b8;
}
.wish::after {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 1.15rem;
    border-top: 2px solid var(--gift);
    transform: rotate(-12deg);
    transform-origin: right center;
}
.wish-idea { --tag-bg: #fbf8fd; }
.wish-idea::before { box-shadow: inset 0 1px 2px rgba(0,0,0,.25), 0 0 0 3px #e3d4ee; }
.wish-idea::after { border-top-color: var(--idea); }
.wish-elsewhere { --tag-bg: #f6f7f7; }
.wish-elsewhere .wish-image { opacity: .6; }

.wish-image {
    display: block;
    width: 100%;
    max-height: 15rem;
    object-fit: contain;
    background: #f3f5f5;
    margin-top: 0.9rem;
    border-radius: 3px;
}
.wish > .wish-image { width: calc(100% - 1rem); }
.wish-image.preview { max-width: 12rem; max-height: 12rem; margin-top: 0; }

.wish-body { padding: 0.9rem 1rem 1rem 0.2rem; min-width: 0; }
.wish-body h1 { margin: 0 0 0.35rem; font-size: 1.6rem; }
.wish-body h2 { margin: 0 0 0.35rem; font-size: 1.25rem; }
.wish-body h2 a { color: inherit; text-decoration: none; }
.wish-body h2 a:hover { color: var(--link); text-decoration: underline; }
.wish-body p { margin: 0.4rem 0; }
.wish-text { overflow-wrap: anywhere; }
.wish-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }

article.wish { margin: 1rem 0 0.5rem; }

@media (min-width: 36rem) {
    .wish { flex-direction: row; align-items: stretch; }
    .wish > .wish-image { width: 10rem; max-height: none; margin: 0.9rem 0.9rem 0.9rem 0; flex-shrink: 0; }
    .wish-body { flex: 1; }
}

/* ---------- Absprache ---------- */
.comments { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.6rem; }
.comments li {
    padding: 0.6rem 0.85rem;
    background: var(--paper);
    border-radius: 3px 10px 10px 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.comments p { margin: 0.15rem 0; }
.comments li.comment-system { background: #fff6e0; border: 1px solid #efd9a3; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
    button:active, a.button:active { transform: none; }
}

/* ---------- Event-Icons ---------- */
.event-icon { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.event-icon-xmas { color: #2e6b35; }
.event-icon-birthday { color: var(--gift); }
.event-icon-easter { color: var(--bell-deep); }
.event-icon-gift { color: var(--wall); }
.event-ref { white-space: nowrap; }
.event-strip { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin: 0.3rem 0 0.8rem; font-weight: 600; }
.event-choice .event-icon { width: 1.35em; height: 1.35em; }
.comment-delete { margin: 0.2rem 0 0; text-align: right; font-size: 0.85rem; }
.comment-delete .link { color: var(--muted); }
.row-actions { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.badge-withdrawn { color: #a3271a; transform: rotate(-2.5deg); background: #fdf0ee; }
.wish-withdrawn { --tag-bg: #fdf6f4; }
.wish-withdrawn h2 { text-decoration: line-through; text-decoration-color: rgba(163,39,26,.5); }
section > h2 .event-icon { width: 1.1em; height: 1.1em; }
.comment-forward { margin-top: 0.3rem; font-size: 0.9rem; }
.comment-forward summary { font-weight: 600; color: var(--muted); }
.comment-forward form { margin: 0.5rem 0 0.2rem; }
.notify-people { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin-bottom: 0.5rem; }

/* ---------- Statistik ---------- */
.admin-links { margin: 1rem 0 0; }
.stat-totals { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }
.stat-totals div { flex: 1 1 6.5rem; padding: 0.6rem 0.8rem; background: var(--paper); border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat-totals dt { font-size: 0.85rem; color: var(--muted); }
.stat-totals dd { margin: 0; font-family: var(--plate-font); font-size: 1.6rem; font-weight: 700; }
.table-scroll { overflow-x: auto; background: var(--paper); border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
table.stats { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.stats th, table.stats td { padding: 0.5rem 0.6rem; text-align: right; border-bottom: 1px solid #e6ebeb; white-space: nowrap; }
table.stats th:first-child { text-align: left; }
table.stats thead th { font-family: var(--plate-font); font-size: 0.85rem; color: var(--muted); vertical-align: bottom; white-space: normal; }
table.stats tbody th { font-weight: 600; }
table.stats tr.inactive { color: var(--muted); }

/* ---------- Fußzeile mit Zitat ---------- */
.site-footer {
    max-width: 40rem;
    margin: 2.5rem auto 2rem;
    padding: 1.25rem 1rem 0;
    border-top: 1px solid var(--line);
    text-align: center;
}
.site-quote { margin: 0; color: var(--muted); }
.site-quote p { margin: 0; font-style: italic; }
.site-quote cite { display: block; margin-top: 0.35rem; font-style: normal; font-size: 0.9rem; }
.site-quote cite::before { content: "– "; }
