/**
 * Meine Rezepte: Darstellung über Nicepage/Page-4 Klassen.
 * Diese Datei enthält nur kleine Fixes für dynamische Inhalte.
 */

/* Wrapper neutralisieren: Nicepage Section soll "frei" stehen */
body.home-landing-page .callout.page-leistungen {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

/* Rezeptübersicht: immer volle Breite (nicht auf .row/.u-sheet begrenzen) */
.row:has(#site-content-column .mm-meine-rezepte) {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

#site-content-column:has(.mm-meine-rezepte) {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.mm-meine-rezepte.u-section-4 {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.mm-meine-rezepte .u-sheet.u-sheet-1 {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
}

/* Kompakterer Abstand nach oben, weniger Mindesthöhe als Page-4 „Breads“ */
.mm-meine-rezepte .u-sheet-1 {
  min-height: 0 !important;
}

/* Nicepage hat für die Grid-Repeater in Page-4 fixe min-heights (z. B. 915px).
   Bei wenigen Rezepten wird sonst die Kartenhöhe unnötig gestreckt. */
.mm-meine-rezepte .u-repeater-1 {
  min-height: 0 !important;
  height: auto !important;
  align-content: start;
  /* Karten sollen nicht breit gezogen werden: fixe Kartenbreite, dafür mehr Spalten auf großen Screens */
  grid-template-columns: repeat(auto-fit, minmax(210px, 240px)) !important;
  justify-content: center;
}

.mm-meine-rezepte .u-text-1.mm-meine-rezepte__title {
  margin-top: 0 !important;
  margin-bottom: 1.25rem;
}

.mm-u-cardlink {
  display: block;
}

/* Klickfläche: Bild + Überschrift */
.mm-u-cardlink--with-title {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-decoration: none;
  color: inherit;
  position: relative;
}

/* Privat-Badge oben links im Bild (halbe Größe ggü. Einzelrezept) */
.mm-recipe-private-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  width: 25px;
  height: 25px;
  pointer-events: none;
}

.mm-recipe-private-badge__img {
  width: 100%;
  height: 100%;
  display: block;
}

.mm-recipe-favorite-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 3;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.mm-recipe-favorite-badge__img {
  width: 100%;
  height: 100%;
  display: block;
}

/* Kein Hover-/Klick-Stil auf der Karte (Überschrift bleibt unverändert; globales a:hover neutralisieren) */
.mm-recipe-card .mm-u-cardlink--with-title:hover,
.mm-recipe-card .mm-u-cardlink--with-title:focus,
.mm-recipe-card .mm-u-cardlink--with-title:focus-visible,
.mm-recipe-card .mm-u-cardlink--with-title:active {
  text-decoration: none !important;
  color: var(--color-text) !important;
}

.mm-u-cardlink--with-title .mm-u-cardtitle {
  margin: 20px auto 0;
  text-decoration: none !important;
}

/* Nicepage setzt bei u-text-* teils letter-spacing: 2px; das wollen wir für Rezepttitel nicht */
.mm-recipe-card .mm-u-cardtitle {
  letter-spacing: 1px !important;
  font-weight: 250 !important;
  font-size: 1.05rem !important;
  line-height: 1.2;
  /* Lange Einzelwörter sollen nicht aus der Box laufen */
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

/* Unter dem Titel: Zeit + kcal (pro Portion) */
.mm-recipe-card__meta-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 1.35rem;
  margin-top: 10px;
  margin-bottom: 2px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.2;
}

/* Karte als Spalte: „zuletzt gekocht“ + Zeit/kcal als gemeinsamer Block unten */
.mm-recipe-card__layout {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mm-recipe-card__layout .mm-recipe-card__footer {
  margin-top: auto;
  padding-top: 10px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.mm-recipe-card__layout .mm-recipe-card__footer .mm-recipe-card__meta-row {
  margin-top: 0;
  padding-top: 0;
  margin-bottom: 0;
}

.mm-recipe-card__stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mm-recipe-card__icon {
  flex-shrink: 0;
  color: rgba(26, 26, 26, 0.7);
}

.mm-recipe-card__stat-txt {
  white-space: nowrap;
}

/* Für echte <img> sicherstellen, dass es wie Nicepage "cover" wirkt */
img.mm-u-cardimg {
  object-fit: cover;
}

/* Placeholder-DIV optisch wie Bildfläche */
.mm-u-cardimg--placeholder {
  background-image:
    radial-gradient(circle at 20% 20%, rgba(238, 177, 109, 0.55), transparent 60%),
    radial-gradient(circle at 75% 35%, rgba(0, 0, 0, 0.07), transparent 55%),
    linear-gradient(135deg, rgba(242, 242, 242, 1), rgba(255, 255, 255, 1));
}

/* Facetten-Filter über der Rezeptliste */
.mm-recipe-filters {
  width: 100%;
  max-width: 100%;
  padding: 1rem 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.92);
  box-sizing: border-box;
  /* Filter mittig, nicht full-bleed */
  margin-left: auto;
  margin-right: auto;
  max-width: 1100px;
}

.mm-recipe-filters__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 12px 20px;
}

.mm-recipe-filters__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 0 0 auto;
}

.mm-recipe-filters__label {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(26, 26, 26, 0.72);
}

.mm-recipe-filters__field select.mm-recipe-filter-select {
  margin: 0;
  min-width: 0;
  width: auto;
  max-width: 100%;
  max-width: 100%;
  padding: 8px 32px 8px 10px;
  font-size: 1rem;
  line-height: 1.35;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background-color: #fff;
  color: #1a1a1a;
  cursor: pointer;
}

.mm-recipe-filter-empty[hidden] {
  display: none !important;
}

.mm-recipe-filter-empty:not([hidden]) {
  margin: 0 0 1rem;
}

.mm-recipe-pagination {
  margin: 22px auto 8px;
  padding: 12px 14px;
  max-width: 760px;
  border-top: 1px dashed rgba(74, 78, 84, 0.28);
  border-bottom: 1px dashed rgba(74, 78, 84, 0.28);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.mm-recipe-pagination[hidden] {
  display: none !important;
}

.mm-recipe-pagination__nav,
.mm-recipe-pagination__page {
  border: 0;
  background: transparent;
  color: #7a818a;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.mm-recipe-pagination__page {
  min-width: 22px;
  height: 22px;
  padding: 0 2px;
}

.mm-recipe-pagination__page.is-active {
  color: #2f343b;
  font-weight: 800;
}

.mm-recipe-pagination__nav {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 2px solid rgba(107, 111, 118, 0.5);
  color: #4a4e54;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.9);
}

.mm-recipe-pagination__nav:hover,
.mm-recipe-pagination__page:hover {
  color: #2f343b;
}

.mm-recipe-pagination__nav:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Darkmode: Filter-Box wie Seitenfläche; Selects wie Sortierung (rezept-ansehen .mm-cook-ing-sort__select) */
body.mm-theme-dark .mm-recipe-filters {
  background: #1b2029 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

body.mm-theme-dark .mm-recipe-filters__label {
  color: rgba(231, 236, 246, 0.78) !important;
}

body.mm-theme-dark .mm-recipe-filters__field select.mm-recipe-filter-select {
  background: #11151c !important;
  color: #e7ecf6 !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 10px;
}

body.mm-theme-dark .mm-recipe-filters__field select.mm-recipe-filter-select:hover {
  border-color: rgba(255, 255, 255, 0.32) !important;
}

body.mm-theme-dark .mm-recipe-filters__field select.mm-recipe-filter-select:focus {
  outline: 2px solid rgba(224, 96, 112, 0.45);
  outline-offset: 2px;
}

body.mm-theme-dark .mm-recipe-pagination {
  border-top-color: rgba(231,236,246,0.22);
  border-bottom-color: rgba(231,236,246,0.22);
}

body.mm-theme-dark .mm-recipe-pagination__nav,
body.mm-theme-dark .mm-recipe-pagination__page {
  color: rgba(231,236,246,0.72);
}

body.mm-theme-dark .mm-recipe-pagination__page.is-active {
  color: #f4f4f5;
}

body.mm-theme-dark .mm-recipe-pagination__nav {
  border-color: rgba(125, 130, 139, 0.72);
  color: #e7ecf6;
  background: rgba(27, 32, 41, 0.9);
}

body.mm-theme-dark .mm-recipe-card__stat {
  background: #1b2029;
  color: #e7ecf6;
  border: 0;
  box-shadow: none;
  border-radius: 999px;
  padding: 3px 8px;
}

body.mm-theme-dark .mm-recipe-card__meta-row {
  flex-wrap: nowrap;
}

body.mm-theme-dark .mm-recipe-card__icon {
  color: rgba(231, 236, 246, 0.82);
}

body.mm-theme-dark .mm-recipe-card__stat-txt {
  color: #e7ecf6;
}

.mm-recipe-card__gekocht {
  margin: 0 8px 0;
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(26, 26, 26, 0.68);
  line-height: 1.35;
}

.mm-recipe-card__layout .mm-recipe-card__footer .mm-recipe-card__gekocht {
  margin-top: 0;
}

body.mm-theme-dark .mm-recipe-card__gekocht {
  color: rgba(231, 236, 246, 0.62);
}


