/* Styling der öffentlichen Rezeptseiten (/community/:slug).
 *
 * Die Seite soll aussehen wie die Rezeptseite in der App
 * (src/app/features/rezepte/rezept-detail-page.ts) — die Angular-Komponente
 * selbst ist hier nicht verwendbar (sie hängt an Auth, Stores und sieben
 * Modals), also spiegelt diese Datei deren Markup-Klassen.
 *
 * Der :root-Block ist eine wörtliche Kopie von src/styles/tokens.scss.
 * TestCommunityCSSTokensInSync vergleicht beide bei jedem Testlauf und wird
 * bei Drift rot — sonst driftet die öffentliche Seite lautlos von der App weg,
 * sobald dort eine Farbe geändert wird.
 *
 * Wird per go:embed ins Binary gelegt und unter /community/style.css
 * ausgeliefert, damit lokal (ohne Firebase Hosting davor) dasselbe ankommt
 * wie in PROD.
 */

/* --- tokens.scss (Kopie, s.o.) ------------------------------------------ */
:root {
  --bottom-nav-h: 64px;
  --green-100: #e8f3e9;
  --green-150: #dcecdd;
  --green-500: #3fae5a;
  --green-600: #379a50;
  --green-650: #2a7f41;
  --green-700: #2f6b3d;
  --green-800: #4a6b45;
  --green-50: #f2f7ee;
  --ink-900: #22301f;
  --ink-600: #495745;
  --ink-500: #4c5a47;
  --ink-400: #8a967f;
  --ink-200: #c9c4b6;
  --paper-page: #f1efe9;
  --paper-app: #fbfaf7;
  --paper-card: #ffffff;
  --paper-chip: #eef0ea;
  --paper-chip-hover: #e2e5dc;
  --paper-hover: #f2f5ee;
  --paper-sand: #f7f5ef;
  --line-default: #e6e3da;
  --line-input: #e0ddd2;
  --line-divider: #f0ede4;
  --line-check: #cfd8c8;
  --red-50: #fbe9ec;
  --red-500: #d94861;
  --rust-50: #faf1ee;
  --rust-150: #e6d5cf;
  --rust-500: #a8553a;
  --accent: var(--green-500);
  --accent-hover: var(--green-600);
  --accent-soft: var(--green-100);
  --accent-deep: var(--green-700);
  --accent-strong: var(--green-650);
  --surface-page: var(--paper-page);
  --surface-app: var(--paper-app);
  --surface-card: var(--paper-card);
  --surface-chip: var(--paper-chip);
  --surface-chip-hover: var(--paper-chip-hover);
  --surface-row-hover: var(--paper-hover);
  --surface-sand: var(--paper-sand);
  --surface-danger: var(--rust-50);
  --surface-fav: var(--red-50);
  --border-default: var(--line-default);
  --border-input: var(--line-input);
  --border-divider: var(--line-divider);
  --border-check: var(--line-check);
  --border-danger: var(--rust-150);
  --text-primary: var(--ink-900);
  --text-sage: var(--ink-600);
  --text-muted: var(--ink-500);
  --text-faint: var(--ink-200);
  --fav: var(--red-500);
  --danger: var(--rust-500);
  --scrim: rgba(34, 48, 31, 0.4);
  --radius-pill: 999px;
  --radius-sm: 11px;
  --radius-md: 14px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --shadow-row: 0 1px 2px rgba(34, 48, 31, 0.06);
  --shadow-card: 0 2px 8px rgba(34, 48, 31, 0.08);
  --shadow-card-hover: 0 6px 18px rgba(34, 48, 31, 0.14);
  --shadow-dropdown: 0 10px 30px rgba(34, 48, 31, 0.14);
  --shadow-modal: 0 16px 50px rgba(0, 0, 0, 0.25);
  --content-max: 1000px;
  --font-sans: 'Outfit', 'Outfit Fallback', sans-serif;
}

/* Dieselbe Schrift wie App und Landing. Die Datei liegt bei diesem Service
   (services/api/fonts) und wird von ihm selbst unter /community/font.woff2
   ausgeliefert — nicht unter /fonts/**, denn das bedient nur Firebase Hosting
   aus den Angular-Builds und existiert lokal nicht. Der metrisch angepasste
   Arial-Fallback bleibt für den Ladezeitraum. */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/community/font.woff2') format('woff2');
}
@font-face {
  font-family: 'Outfit Fallback';
  src: local('Arial');
  size-adjust: 99.1474%;
  ascent-override: 100.8599%;
  descent-override: 26.2236%;
  line-gap-override: 0%;
}

/* --- Seitenrahmen ------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--surface-page);
  color-scheme: light;
  scrollbar-color: var(--ink-200) transparent;
}
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-primary);
  font: 500 16px/1.4 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 16px 48px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
/* Wortmarke wie in der Topbar der App (ui/app-shell/app-shell.ts): 24px/800,
   engeres Tracking, Punkt in --accent-strong. Kein Icon — die App führt dort
   auch keins. */
.brand {
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  text-decoration: none;
}
.brand-dot {
  color: var(--accent-strong);
}
.topbar-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}
.topbar-link:hover {
  color: var(--accent);
}

/* --- Karte (rezept-detail-page.ts) -------------------------------------- */
.card {
  background: var(--surface-card);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.card-image-wrap {
  position: relative;
}
.card-image-wrap img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
}
.body {
  padding: 20px 22px 24px;
}
.badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.tag-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
}
.zeit-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sage);
  background: var(--surface-chip);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
}
.name {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.15;
  margin: 0;
}

/* --- Zutaten ------------------------------------------------------------ */
.zutaten-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 10px;
}
.section-title {
  font-size: 15px;
  font-weight: 700;
}
.stepper {
  display: inline-flex;
  align-items: center;
  background: var(--surface-chip);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.stepper button {
  border: none;
  background: none;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-sage);
  padding: 5px 13px;
  cursor: pointer;
  font-family: var(--font-sans);
}
.stepper button:hover {
  background: var(--surface-chip-hover);
}
.stepper span {
  font-size: 14px;
  font-weight: 600;
  min-width: 86px;
  text-align: center;
}
.ingredients {
  display: flex;
  flex-direction: column;
}
.ing-group {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 14px 0 2px;
}
.ing-group:first-child {
  margin-top: 0;
}
.ingredient-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-divider);
}
.check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-strong);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.qty {
  width: 76px;
  font-weight: 600;
  font-size: 15px;
  color: var(--accent);
  flex: none;
}
.ing-name {
  font-size: 15.5px;
}

/* --- Nährwerte ---------------------------------------------------------- */
.nutri-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface-sand);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-top: 12px;
}
.nutri-head {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
}
.nutri-label {
  font-size: 13px;
  font-weight: 700;
}
.nutri-values {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
}
@media (min-width: 480px) {
  .nutri-values {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 640px) {
  .nutri-bar {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
  }
  .nutri-head {
    display: contents;
  }
  .nutri-label {
    order: 1;
  }
  .nutri-values {
    order: 3;
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
  }
  .nutri-seg {
    order: 4;
  }
}
.nutri-item {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.nutri-item .val {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}
.nutri-item .lbl {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}
.nutri-seg {
  display: flex;
  margin-left: auto;
  background: var(--surface-chip);
  border-radius: var(--radius-pill);
  padding: 3px;
}
.nutri-seg button {
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--text-muted);
  transition:
    background 0.15s,
    color 0.15s;
}
.nutri-seg button.active {
  background: var(--surface-card);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(34, 48, 31, 0.14);
}
.nutri-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

/* --- Handlungsknopf ----------------------------------------------------- */
/* An der Stelle, an der die App „Alle Zutaten auf die Einkaufsliste" und
   „Kochen" zeigt — beides braucht ein Konto. */
.actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.cta {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-strong);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 15.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.cta:hover {
  background: var(--accent-deep);
}
.cta-hint {
  margin: 8px 2px 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* --- Zubereitung -------------------------------------------------------- */
.steps-title {
  margin: 24px 0 10px;
}
.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.step-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.step-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.step-text {
  font-size: 15.5px;
  line-height: 1.55;
  padding-top: 2px;
}
.step-detail {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* --- Fuß der Karte ------------------------------------------------------ */
.prep-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--green-50);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-top: 24px;
  font-size: 13.5px;
  color: var(--green-800);
  font-weight: 500;
}
.meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border-divider);
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-muted);
  min-width: 0;
}
.meta-icon {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--text-faint);
}
.meta-item a,
.meta-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meta-item a {
  color: var(--text-muted);
}
.fork-origin {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* --- Fehlerseite -------------------------------------------------------- */
.notice {
  background: var(--surface-card);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
  padding: 28px 24px;
  text-align: center;
}
.notice h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 0 0 8px;
}
.notice p {
  margin: 0 0 18px;
  font-size: 14.5px;
  color: var(--text-muted);
}
