/* ------------------------------------------------------------------
   Familienrezepte – Stylesheet
   Farben als Variablen, damit sie leicht anpassbar sind.
   ------------------------------------------------------------------ */
:root {
  /* Beere & Hopfen */
  --hintergrund: #f7f7f2;     /* Holunderblüte */
  --flaeche: #ffffff;
  --text: #2a1c2c;            /* Brombeerschwarz */
  --leise: #6e6273;
  --linie: #e9e3ea;
  --akzent: #b0255f;          /* Himbeere */
  --akzent-dunkel: #861a49;
  --akzent-zart: #fbe6f0;
  --gruen: #4f7d16;           /* Hopfen */
  --gruen-hell: #8cc63f;
  --gruen-zart: #edf5dd;
  --blau: #3b5fa8;            /* Heidelbeere */
  --blau-zart: #e3e9f7;
  --sonne: #f4b63f;
  --rot: #b3263a;
  --auf-akzent: #ffffff;
  --schatten: 0 1px 2px rgb(60 20 50 / .05), 0 6px 18px rgb(90 30 70 / .07);
  --radius: 16px;
  --serif: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Arial Rounded MT Bold", system-ui, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --hintergrund: #18131b;
    --flaeche: #231c27;
    --text: #f3ecf4;
    --leise: #ad9fb2;
    --linie: #372d3c;
    --akzent: #ec6a9f;
    --akzent-dunkel: #f58db8;
    --akzent-zart: #3d1f2f;
    --gruen: #a6d861;
    --gruen-hell: #a6d861;
    --gruen-zart: #26331a;
    --blau: #93acec;
    --blau-zart: #222b42;
    --sonne: #f4b63f;
    --rot: #f0889a;
    --auf-akzent: #2a0f1d;
    --schatten: 0 1px 2px rgb(0 0 0 / .35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(60rem 30rem at 100% -10%, color-mix(in srgb, var(--akzent) 9%, transparent), transparent 70%),
    radial-gradient(50rem 28rem at -10% 0%, color-mix(in srgb, var(--gruen-hell) 12%, transparent), transparent 70%),
    var(--hintergrund);
  background-attachment: fixed;
  color: var(--text);
  font: 17px/1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--akzent); }
h1, h2 { font-family: var(--serif); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); margin: .2em 0 .3em; }
h2 { font-size: 1.3rem; margin: 0 0 .6em; }

.leise { color: var(--leise); }
.klein { font-size: .85rem; }

/* Kopfzeile ---------------------------------------------------------- */
.kopf {
  background: color-mix(in srgb, var(--flaeche) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 10;
}
/* Sommerstreifen: Himbeere → Sonne → Hopfen */
.kopf::after {
  content: ""; display: block; height: 3px;
  background: linear-gradient(90deg, var(--akzent), var(--sonne) 50%, var(--gruen-hell));
}
.kopf-innen {
  max-width: 1080px; margin: 0 auto; padding: .7rem 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.logo { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; color: var(--akzent-dunkel); text-decoration: none; white-space: nowrap; }
.kopf nav { display: flex; align-items: center; gap: 1rem; }
.abmelden { color: var(--leise); font-size: .9rem; text-decoration: none; }

.inhalt { max-width: 1080px; margin: 0 auto; padding: 1.2rem 16px 4rem; }

/* Knöpfe ------------------------------------------------------------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: .5rem 1.1rem;
  background: var(--akzent); color: var(--auf-akzent); border: 1px solid transparent; border-radius: 999px; gap: .25em;
  font: 600 .95rem var(--sans); text-decoration: none; cursor: pointer;
}
.knopf:hover { background: var(--akzent-dunkel); }
.knopf-klein { min-height: 36px; padding: .3rem .9rem; font-size: .9rem; white-space: nowrap; }
@media (max-width: 420px) { .logo { font-size: 1.05rem; } .kopf nav { gap: .6rem; } .nur-breit { display: none; } }
.knopf-hell { background: var(--flaeche); color: var(--text); border-color: var(--linie); }
.knopf-hell:hover { background: var(--akzent-zart); }
.knopf-hell.aktiv { background: var(--gruen-zart); border-color: var(--gruen); color: var(--gruen); }
.knopf-gefahr { background: transparent; color: var(--rot); border-color: var(--linie); }
.knopf-gefahr:hover { background: var(--rot); color: #fff; }

/* Formularelemente --------------------------------------------------- */
input, select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px;
  padding: .6rem .8rem; min-height: 44px;
}
textarea { line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent); outline-offset: 1px; border-color: transparent; }
label { display: block; font-weight: 600; margin: 1.1rem 0 .35rem; }

.hinweis { padding: .8rem 1rem; border-radius: 10px; margin: 1rem 0; }
.fehler { background: #f8e1e1; color: #7a2626; }
@media (prefers-color-scheme: dark) { .fehler { background: #3d2222; color: #f0b4b4; } }

/* Login -------------------------------------------------------------- */
.login {
  max-width: 400px; margin: 10vh auto 0;
  background: linear-gradient(90deg, var(--akzent), var(--sonne), var(--gruen-hell)) top / 100% 5px no-repeat, var(--flaeche);
  padding: 2rem 1.5rem; border-radius: var(--radius); box-shadow: var(--schatten);
}
.login h1 { font-size: 1.6rem; }
.login .knopf { width: 100%; margin-top: 1.2rem; }

/* Filter ------------------------------------------------------------- */
.filter { display: grid; gap: .7rem; margin-bottom: 1rem; }
.suche { display: flex; gap: .5rem; }
.suche input { flex: 1; border-radius: 999px; padding-left: 1.1rem; }
.filter-reihe { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
@media (min-width: 760px) { .filter-reihe { grid-template-columns: repeat(4, 1fr); } }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
  font-size: .85rem; padding: .25rem .7rem; border-radius: 999px; text-decoration: none;
  background: var(--flaeche); border: 1px solid var(--linie); color: var(--leise);
}
.tag:hover { border-color: var(--akzent); color: var(--akzent); }
.tag.aktiv { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); }

.ergebnis-kopf { display: flex; justify-content: space-between; align-items: baseline; margin: .5rem 0; font-size: .9rem; }
.ergebnis-kopf p { margin: 0; }

/* Rezeptkarten ------------------------------------------------------- */
.karten { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.karte a {
  display: flex; flex-direction: column; height: 100%;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; color: inherit; text-decoration: none; box-shadow: var(--schatten);
  transition: transform .15s ease, border-color .15s ease;
}
.karte a:hover { transform: translateY(-2px); border-color: var(--akzent); }
.karte h2 { margin: .5rem 0 .3rem; font-size: 1.25rem; }
.karte .beschreibung { color: var(--leise); font-size: .93rem; margin: 0 0 .8rem; flex: 1; }
.karte-oben { display: flex; gap: .4rem; flex-wrap: wrap; }
.karte-meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--leise); }
.karte-tags { display: flex; gap: .6rem; flex-wrap: wrap; font-size: .8rem; color: var(--akzent); margin-top: .5rem; }

.badge {
  display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .02em;
  padding: .15rem .6rem; border-radius: 999px; background: var(--akzent-zart); color: var(--akzent-dunkel); text-decoration: none;
}
.badge-vegan, .badge-vegetarisch { background: var(--gruen-zart); color: var(--gruen); }
.badge-fisch { background: var(--blau-zart); color: var(--blau); }
.badge-fleisch { background: color-mix(in srgb, var(--sonne) 22%, var(--flaeche)); color: color-mix(in srgb, var(--sonne) 45%, var(--text)); }

.leer { text-align: center; padding: 3rem 1rem; color: var(--leise); }

/* Rezeptansicht ------------------------------------------------------ */
.zurueck { display: inline-block; color: var(--leise); text-decoration: none; font-size: .9rem; margin-bottom: .5rem; }
.rezept-kopf { margin-bottom: 1.5rem; }
.rezept-kopf .beschreibung { font-size: 1.05rem; color: var(--leise); max-width: 60ch; margin: 0 0 1rem; }

.eckdaten { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 1rem; }
.eckdaten div { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: .4rem .9rem; }
.eckdaten dt { font-size: .75rem; color: var(--leise); }
.eckdaten dd { margin: 0; font-weight: 600; }

.rezept-raster { display: grid; gap: 1.5rem; }
@media (min-width: 860px) {
  .rezept-raster { grid-template-columns: minmax(300px, 380px) 1fr; align-items: start; }
  .zutaten-box { position: sticky; top: 80px; }
}

.zutaten-box, .schritte section {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 1.2rem; box-shadow: var(--schatten);
}
.schritte { display: grid; gap: 1.2rem; }
.schritte .text p { margin: 0 0 .9em; }
.schritte .text ul { margin: 0 0 .9em; padding-left: 1.2em; }
.schritte .text li { margin-bottom: .25em; }
.notiz { background: var(--gruen-zart) !important; border-color: transparent !important; border-left: 4px solid var(--gruen-hell) !important; }
.notiz h2 { color: var(--gruen); }

.portionen { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; margin-bottom: .8rem; font-size: .95rem; }
.portionen button {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--linie);
  background: var(--hintergrund); color: var(--text); font: 600 1rem var(--sans); cursor: pointer;
}
.portionen button.aktiv { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); }
.skalier-hinweis { margin: -.3rem 0 .6rem; }

.zutaten { list-style: none; padding: 0; margin: 0; }
.zutaten li { border-top: 1px solid var(--linie); }
.zutaten li:first-child { border-top: 0; }
.zutaten li.gruppe { font-family: var(--serif); font-weight: 600; padding: .9rem 0 .3rem; border-top: 0; color: var(--gruen); }
.zutaten label { display: grid; grid-template-columns: auto 7.2em 1fr; gap: .6rem; align-items: baseline; padding: .5rem 0; margin: 0; font-weight: 400; cursor: pointer; }
.zutaten input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--akzent); transform: translateY(3px); }
.zutaten .menge { font-weight: 600; text-align: right; white-space: normal; }
.zutaten input:checked ~ span { text-decoration: line-through; color: var(--leise); }

.rezept-aktionen { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--linie); }
.rezept-aktionen form { margin: 0 0 0 auto; }

/* Formular ----------------------------------------------------------- */
.formular { max-width: 760px; }
.feld-raster { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 .8rem; }
@media (min-width: 700px) { .feld-raster { grid-template-columns: repeat(3, 1fr); } }
.formular .klein { margin: .35rem 0 0; }
.formular-aktionen { display: flex; gap: .6rem; margin-top: 1.8rem; }

/* Druck -------------------------------------------------------------- */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .kopf, .zurueck, .rezept-aktionen, .portionen, .skalier-hinweis, .zutaten input, .tags { display: none !important; }
  .zutaten-box, .schritte section { box-shadow: none; border: 0; padding: 0; position: static; }
  .rezept-raster { grid-template-columns: 1fr 2fr; }
  .inhalt { padding: 0; }
}

/* Fotos -------------------------------------------------------------- */
.karte a { overflow: hidden; }
.karte-bild {
  display: block; width: calc(100% + 2.4rem); max-width: none; margin: -1.1rem -1.2rem 1rem;
  aspect-ratio: 4 / 3; object-fit: cover; background: var(--linie);
}
.rezept-bild {
  display: block; width: 100%; max-height: 460px; object-fit: cover;
  border-radius: var(--radius); margin: .3rem 0 1.2rem; box-shadow: var(--schatten); background: var(--linie);
}
@media (max-width: 600px) {
  .rezept-bild { width: calc(100% + 32px); max-width: none; margin-left: -16px; border-radius: 0; max-height: 340px; }
}

.foto-feld { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.foto-feld > div { flex: 1; min-width: 220px; }
.foto-vorschau { width: 140px; height: 105px; object-fit: cover; border-radius: 10px; border: 1px solid var(--linie); }
.foto-feld input[type=file] { padding: .45rem; }
label.checkbox { display: flex; align-items: center; gap: .5rem; font-weight: 400; margin: .5rem 0 0; }
label.checkbox input { width: 18px; height: 18px; min-height: 0; accent-color: var(--akzent); }
@media print { .rezept-bild { max-height: 200px; width: auto; margin: 0 0 1rem; box-shadow: none; } }

/* Kochlöffel-Gimmick ------------------------------------------------- */
.kochloeffel {
  position: fixed; left: 0; top: 0; z-index: 9999;
  pointer-events: none; transform-origin: 0 0; will-change: transform;
  opacity: 0; transition: opacity .25s ease;
  filter: drop-shadow(0 3px 3px rgb(60 20 40 / .25));
}
.kochloeffel.sichtbar { opacity: 1; }
.kochloeffel svg { display: block; transform-origin: 8px 8px; transition: transform .15s ease; }
.kochloeffel.ruehren svg { transform: rotate(-22deg) scale(.9); }
@media print { .kochloeffel { display: none; } }
