/*
 * Wunschliste – Stylesheet
 *
 * Schlicht, modern und warm. Eine Schrift (Bricolage Grotesque), warme Pastelltöne
 * für Flächen, eine kräftige Beere für Aktionen. Das Auffällige sind die Personen:
 * jede hat ihre eigene Pastellfarbe (oder ihr Foto) und einen grossen Namen.
 */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  /* Farben */
  --canvas: #fbf5f2;        /* Seitenhintergrund, warmes Rosé-Weiss */
  --paper: #ffffff;         /* Flächen */
  --ink: #2b2024;           /* Text, warmes Dunkelbraun (14.6:1) */
  --muted: #76626a;         /* Nebentext (5.2:1) */
  --line: #f0e2de;          /* Linien */
  --accent: #9c3d5e;        /* Beere: Knöpfe & Links (6.5:1 mit Weiss) */
  --accent-strong: #7e2f4b;
  --accent-soft: #fbe1e8;   /* Rosé-Pastell */
  --taken: #5f4954;         /* "Reserviert"-Schild, warmes Mauve (8.2:1) */
  --danger: #a3271f;
  --danger-soft: #fbe6e3;
  --ok: #2f5a33;
  --ok-soft: #dcefdc;       /* Salbei-Pastell */
  --warn: #6b4e00;
  --warn-soft: #fcefc4;     /* Butter-Pastell */

  /* Personenfarben (Pastell), Text darauf in --ink (>11:1) */
  --p0: #f8d3c3;  /* Pfirsich */
  --p1: #f6d0dd;  /* Rosé */
  --p2: #e2d8f3;  /* Flieder */
  --p3: #d5ebd9;  /* Salbei */
  --p4: #fbe5b0;  /* Butter */
  --p5: #d3e6f2;  /* Himmel */

  /* Typo */
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.75rem;
  --step-3: 2.5rem;

  /* Form */
  --radius-panel: 14px;
  --radius-control: 10px;
  --gap: 1rem;
  --measure: 78rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.5;
  font-variation-settings: "wdth" 100;
}

h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: var(--step-3); font-weight: 750; }
h2 { font-size: var(--step-2); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 650; }
p { margin: 0 0 .75rem; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Grundgerüst ---------- */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: .9rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.5rem;
}
.brand {
  font-size: var(--step-1);
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.site-nav { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; font-size: var(--step--1); }
.site-nav a { color: var(--muted); text-decoration: none; padding: .25rem 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}
main.narrow { max-width: 32rem; }
.narrow h1 { font-size: var(--step-2); margin-bottom: 1rem; }

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem 1rem;
  margin-bottom: 1.75rem;
}
.page-head > div { flex: 1 1 18rem; }
.page-head p { color: var(--muted); margin: .35rem 0 0; }

.back { display: inline-block; font-size: var(--step--1); color: var(--muted); margin-bottom: 1rem; text-decoration: none; }
.back:hover { color: var(--ink); }

/* ---------- Meldungen ---------- */

.flash {
  border-radius: var(--radius-control);
  padding: .75rem 1rem;
  margin-bottom: 1.25rem;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.flash--success { background: var(--ok-soft); color: var(--ok); }
.flash--error { background: var(--danger-soft); color: var(--danger); }
.flash--warning { background: var(--warn-soft); color: var(--warn); }

.note { color: var(--muted); font-size: var(--step--1); }

/* ---------- Knöpfe ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 2.5rem;
  padding: .45rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.button:hover { background: var(--accent-strong); color: #fff; }
/* Knöpfe ohne Klasse (allauth-Standardseiten) sehen aus wie .button */
main button:not([class]) {
  min-height: 2.5rem; padding: .45rem 1rem; margin: 0;
  border: 0; border-radius: var(--radius-control);
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
main button:not([class]):hover { background: var(--accent-strong); }
.button--quiet { background: var(--paper); color: var(--ink); border-color: var(--line); }
.button--quiet:hover { background: var(--canvas); color: var(--ink); }
.button--danger { background: var(--danger); }
.button--danger:hover { background: #7f1d17; }
.button--small { min-height: 2.1rem; padding: .3rem .8rem; font-size: var(--step--1); }

/* Textknopf: für leise Aktionen wie "Doch nicht" */
.link-button {
  background: none;
  border: 0;
  padding: .25rem 0;
  font: inherit;
  font-size: var(--step--1);
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-button:hover { color: var(--ink); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }

/* ---------- Status ---------- */

.chip {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 600;
  white-space: nowrap;
}
.chip--taken { background: var(--taken); color: #fff; }
.chip--mine { background: var(--accent-soft); color: var(--accent-strong); }
.chip--free { background: var(--paper); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.chip--bought { background: var(--ok-soft); color: var(--ok); }
.chip--open { background: var(--warn-soft); color: var(--warn); }

/* ---------- Personen ---------- */

.person { margin-bottom: 2.5rem; scroll-margin-top: 1rem; }
.person__head {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-bottom: .9rem;
}
.person__name { font-size: var(--step-2); font-weight: 750; }
.person__name a { color: inherit; text-decoration: none; }
.person__name a:hover { text-decoration: underline; }
.person__meta { color: var(--muted); font-size: var(--step--1); margin: .1rem 0 0; }
.person__add { margin-left: auto; }

.monogram {
  flex: none;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--p0);
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.monogram--large { width: 5rem; height: 5rem; font-size: 1.6rem; }
.monogram img { width: 100%; height: 100%; object-fit: cover; }
.monogram--c1 { background: var(--p1); }
.monogram--c2 { background: var(--p2); }
.monogram--c3 { background: var(--p3); }
.monogram--c4 { background: var(--p4); }
.monogram--c5 { background: var(--p5); }

/* Breite Bildschirme: Personen nebeneinander statt endlos lange Zeilen */
.person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 0 2.5rem;
  align-items: start;
}
.person-grid .person__head { flex-wrap: wrap; }

/* Eine Person = eine Karte mit feinem Rahmen; der Kopf trägt einen Hauch ihrer Pastellfarbe */
.person--card {
  --tint: var(--p0);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  overflow: hidden;
}
.person--card.person--c1 { --tint: var(--p1); }
.person--card.person--c2 { --tint: var(--p2); }
.person--card.person--c3 { --tint: var(--p3); }
.person--card.person--c4 { --tint: var(--p4); }
.person--card.person--c5 { --tint: var(--p5); }
.person--card .person__head {
  margin: 0;
  padding: 1rem 1.25rem;
  background: color-mix(in srgb, var(--tint) 35%, var(--paper));
  border-bottom: 1px solid var(--line);
}
.person--card .person__name { font-size: var(--step-1); }
.person--card .wishes__add a { border-radius: 0; }
.person-grid { gap: 1.5rem; }
.person-grid > .person { margin-bottom: 0; }
.content-medium { max-width: 52rem; }

/* ---------- Wunschliste ---------- */

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}
.panel--padded { padding: 1.5rem; }

.wishes { list-style: none; margin: 0; padding: 0; }
.wishes > li + li { border-top: 1px solid var(--line); }
.wishes__empty { padding: 1.1rem 1.25rem; color: var(--muted); }
.wishes__empty a { font-weight: 600; }
.wishes__add a {
  display: block;
  padding: .75rem 1.25rem;
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius-panel) var(--radius-panel);
}
.wishes__add:first-child a { border-radius: var(--radius-panel); }
.wishes__add a:hover { background: var(--accent-soft); color: var(--accent-strong); }

.wish {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .9rem;
  padding: .9rem 1.25rem;
}
.wish__thumb { width: 3.5rem; height: 3.5rem; border-radius: 8px; object-fit: cover; background: var(--canvas); }
.wish--no-image { grid-template-columns: 1fr auto; } /* kein Bild = kein Platzhalter */
.wish__title { font-weight: 650; color: var(--ink); text-decoration: none; }
.wish__title:hover { text-decoration: underline; }
.wish__desc { color: var(--muted); font-size: var(--step--1); margin: .1rem 0 0; }
.wish__link { display: table; font-size: var(--step--1); margin-top: .1rem; }
.wish__action { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; }
.wish__action form { margin: 0; }

/* Eigene Reservierung: Band am linken Rand – wie ein Geschenkband */
.wish--mine::before {
  content: "";
  position: absolute;
  left: 0; top: .6rem; bottom: .6rem;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}
/* Fremd reserviert: Inhalt tritt zurück, das Schild nicht */
.wish--taken .wish__thumb, .wish--taken .wish__body { opacity: .5; }

/* Gekauft (Einkaufsliste) */
.wish--bought .wish__title { text-decoration: line-through; color: var(--muted); }

@media (max-width: 34rem) {
  .wish { grid-template-columns: auto 1fr; padding: .85rem 1rem; }
  .wish__action { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; gap: .75rem; }
  .wish--no-image { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
}

/* Live-Aktualisierung (static/js/live.js) */
@keyframes live-flash { from { background-color: var(--warn-soft); } to { background-color: transparent; } }
.live-flash { animation: live-flash 2s ease-out; }

/* ---------- Wunsch-Detail ---------- */

.wish-detail { display: grid; gap: 1.5rem; }
.wish-detail__image { border-radius: var(--radius-panel); width: 100%; max-height: 26rem; object-fit: cover; background: var(--paper); }
.wish-detail__desc { white-space: pre-line; }
.wish-detail__status { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin: 1.25rem 0; }
@media (min-width: 44rem) {
  .wish-detail--with-image { grid-template-columns: 18rem 1fr; align-items: start; }
}

/* ---------- Formulare ---------- */

form p, .field { margin: 0 0 1.1rem; }
label, .label { display: block; font-weight: 600; margin-bottom: .35rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="number"], input[type="search"], input:not([type]), select, textarea {
  width: 100%;
  padding: .6rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="file"] { font: inherit; font-size: var(--step--1); color: var(--muted); }
input[type="file"]::file-selector-button {
  margin-right: .75rem; padding: .45rem .9rem;
  border: 1px solid var(--line); border-radius: var(--radius-control);
  background: var(--paper); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
}
input[type="checkbox"], input[type="radio"] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); vertical-align: -2px; margin: 0 .5rem 0 0; }

.help, .helptext, .form-help { display: block; color: var(--muted); font-size: var(--step--1); margin-top: .3rem; }
.help ul { margin: .25rem 0 0; padding-left: 1.1rem; }

/* Checkbox/Radio: Beschriftung daneben, normal gewichtet */
label.check, input[type="radio"] + label, input[type="checkbox"] + label { display: inline; font-weight: 400; }
label.check { display: inline-flex; align-items: center; gap: .1rem; cursor: pointer; }

/* Formularfehler, die nicht zu einem Feld gehören (z. B. falsches Passwort) */
.errorlist.nonfield {
  margin: 0 0 1.1rem;
  padding: .7rem .9rem;
  border-radius: var(--radius-control);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: var(--step-0);
}

.form-title { margin-bottom: 1.5rem; }

/* Mehrfachauswahl (z. B. weitere Eltern) als Liste von Checkboxen */
.field--choices > div > div + div { margin-top: .35rem; }
.field--choices > div label { display: inline-flex; align-items: center; font-weight: 400; margin: 0; cursor: pointer; }
.form-intro { margin: -1rem 0 1.5rem; }
.form-intro:empty { display: none; }

/* Konto */
.konto-section { margin-bottom: 1.75rem; }
.konto-section > h2 { font-size: var(--step-1); margin: 0 0 .6rem; }
.konto-list { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.konto-list .note { margin: 0; }
.konto-logout { margin-top: 2.5rem; }

.own-list-hint { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; }
.own-list-hint form { margin: 0; }
.own-list-unlink { margin: .5rem 0 0; }
.own-list-unlink .link-button { color: inherit; }

/* Bild-Upload mit Vorschau */
.image-input__current { display: flex; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.image-input__preview { width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: 12px; background: var(--canvas); }

/* allauth-Seiten (Passwort, E-Mail, …) */
.allauth-form, .allauth-panel { margin-bottom: 1.5rem; }
main.narrow h2 { font-size: var(--step-1); margin: 1.75rem 0 .75rem; }
.allauth-panel > h2 { margin-top: 0; }
.allauth-form p { margin-bottom: 1rem; }
.errorlist, .help.is-danger, .invalid-feedback { list-style: none; padding: 0; margin: .35rem 0 0; color: var(--danger); font-size: var(--step--1); }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 1.5rem; }

/* Einladung */
.invite__heading { font-size: var(--step-1); margin: 0 0 .75rem; }
.invite__title { font-size: var(--step-1); margin-bottom: .25rem; }
.invite--new { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.invite--new .copy-field { margin-top: .75rem; }
.invite__row-actions { flex-direction: row; align-items: center; flex-wrap: wrap; gap: .5rem .75rem; justify-content: flex-end; }
@media (max-width: 34rem) { .invite__row-actions { justify-content: flex-start; } }
.copy-field { display: flex; gap: .5rem; margin-bottom: 1rem; }
.copy-field input { flex: 1; }
