/* =========================================================================
   Rezepti – Design-Tokens (Richtung A · Emaille)
   Gepflegt von Chat #1 Design. Andere Module verwenden NUR diese Variablen.
   Hell- und Dunkelmodus folgen der System-Einstellung.
   ========================================================================= */

/* Schriften – selbst gehostet (kein Google-Server, DSGVO-freundlich). Lizenz: SIL OFL 1.1 */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/fraunces-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  color-scheme: light dark;

  /* --- Farben: Hell ---------------------------------------------------- */
  --c-bg:         #F7F2E8;   /* Seitengrund (Creme) */
  --c-surface:    #FFFDF8;   /* Karten, Leisten */
  --c-surface-2:  #EDE5D6;   /* Segment-Hintergrund, Foto-Platzhalter */
  --c-ink:        #2A2420;   /* Haupttext */
  --c-muted:      #6B6158;   /* Nebentext (≥ 4,5:1 auf bg) */
  --c-line:       #E2D8C6;   /* Trennlinien, Rahmen */
  --c-accent:     #1F4E79;   /* Emaille-Blau: Hauptaktion, Links, Mengen */
  --c-accent-ink: #FFFFFF;   /* Text auf Akzent */
  --c-accent-hover: #173B5C;
  --c-soft:       #E2EAF3;   /* zarte Akzentfläche */
  --c-soft-ink:   #1F4E79;
  --c-danger:     #A23B2E;   /* nur für Löschen / Fehler – NICHT für Bewertungen */
  --c-danger-soft:#F6E1DC;
  --c-success:    #2F6B3A;
  --c-focus:      #1F4E79;
  --c-overlay:    rgba(42, 36, 32, 0.45);

  /* --- Bewertungsskala 1–10 (verbindlich, siehe PROJEKT.md §7) ---------- */
  --rate-1:  #E06A5E;  --rate-1-ink:  #1A1A1A;
  --rate-2:  #E87B4C;  --rate-2-ink:  #1A1A1A;
  --rate-3:  #EF8B37;  --rate-3-ink:  #1A1A1A;
  --rate-4:  #F59A1B;  --rate-4-ink:  #1A1A1A;
  --rate-5:  #B5C335;  --rate-5-ink:  #1A1A1A;
  --rate-6:  #8DBF3B;  --rate-6-ink:  #1A1A1A;
  --rate-7:  #62B044;  --rate-7-ink:  #1A1A1A;
  --rate-8:  #3E9C48;  --rate-8-ink:  #1A1A1A;
  --rate-9:  #2A7F3C;  --rate-9-ink:  #FFFFFF;
  --rate-10: #1B6530;  --rate-10-ink: #FFFFFF;

  /* --- Schrift --------------------------------------------------------- */
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 0.75rem;    /* 12 */
  --fs-sm: 0.8125rem;  /* 13 */
  --fs-md: 0.9375rem;  /* 15 – Grundgröße */
  --fs-lg: 1.0625rem;  /* 17 */
  --fs-xl: 1.375rem;   /* 22 */
  --fs-2xl: 1.875rem;  /* 30 – Rezepttitel */
  --lh-tight: 1.15;
  --lh-text: 1.5;
  --fw-regular: 400; --fw-medium: 500; --fw-semi: 600; --fw-bold: 700; --fw-black: 800;

  /* --- Abstände (4-px-Raster) ----------------------------------------- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* --- Formen ---------------------------------------------------------- */
  --r-sm: 8px;    /* Eingabefelder, kleine Flächen */
  --r-md: 10px;   /* Segment-Knöpfe */
  --r-lg: 14px;   /* Karten, Knöpfe */
  --r-pill: 999px;
  --tap: 44px;    /* Mindest-Tippfläche */
  --shadow-1: 0 1px 2px rgba(42,36,32,0.06), 0 1px 1px rgba(42,36,32,0.04);
  --shadow-2: 0 6px 24px rgba(42,36,32,0.14);

  /* --- Layout ---------------------------------------------------------- */
  --topbar-h: 56px;
  --nav-h: 64px;
  --content-max: 720px;      /* Tablet: Inhalt bleibt lesbar */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  --ease: cubic-bezier(.2,.7,.2,1);
  --dur: 160ms;
}

/* --- Farben: Dunkel ----------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --c-bg:         #1A1714;
    --c-surface:    #24201C;
    --c-surface-2:  #302A24;
    --c-ink:        #F3EDE3;
    --c-muted:      #B5AA9C;
    --c-line:       #3A332C;
    --c-accent:     #8DB4DD;
    --c-accent-ink: #10202F;
    --c-accent-hover: #A9C7E7;
    --c-soft:       #1F2D3B;
    --c-soft-ink:   #C2D7ED;
    --c-danger:     #F0948A;
    --c-danger-soft:#3A221F;
    --c-success:    #8FCB98;
    --c-focus:      #8DB4DD;
    --c-overlay:    rgba(0, 0, 0, 0.6);
    --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-2: 0 8px 28px rgba(0,0,0,0.5);
  }
}

/* Manuelle Umschaltung (z. B. im Profil): <html data-theme="light|dark"> */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --c-bg: #1A1714; --c-surface: #24201C; --c-surface-2: #302A24; --c-ink: #F3EDE3; --c-muted: #B5AA9C;
  --c-line: #3A332C; --c-accent: #8DB4DD; --c-accent-ink: #10202F; --c-accent-hover: #A9C7E7;
  --c-soft: #1F2D3B; --c-soft-ink: #C2D7ED; --c-danger: #F0948A; --c-danger-soft: #3A221F;
  --c-success: #8FCB98; --c-focus: #8DB4DD; --c-overlay: rgba(0,0,0,0.6);
  --shadow-1: 0 1px 2px rgba(0,0,0,0.4); --shadow-2: 0 8px 28px rgba(0,0,0,0.5);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="light"] {
    --c-bg: #F7F2E8; --c-surface: #FFFDF8; --c-surface-2: #EDE5D6; --c-ink: #2A2420; --c-muted: #6B6158;
    --c-line: #E2D8C6; --c-accent: #1F4E79; --c-accent-ink: #FFFFFF; --c-accent-hover: #173B5C;
    --c-soft: #E2EAF3; --c-soft-ink: #1F4E79; --c-danger: #A23B2E; --c-danger-soft: #F6E1DC;
    --c-success: #2F6B3A; --c-focus: #1F4E79; --c-overlay: rgba(42,36,32,0.45);
    --shadow-1: 0 1px 2px rgba(42,36,32,0.06), 0 1px 1px rgba(42,36,32,0.04);
    --shadow-2: 0 6px 24px rgba(42,36,32,0.14);
  }
}
