/* spudo/weekly-menu modal — opened by JS when a mealbox card's
   "Se ugens retter" button is clicked. Zero coupling to the outer
   theme; every rule is scoped under .spudo-weekly-menu-modal so
   compat sites can't leak styles in either direction. */

body.spudo-weekly-menu-modal-open {
  overflow: hidden;
}

.spudo-weekly-menu-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.spudo-weekly-menu-modal[hidden] {
  display: none !important;
}

.spudo-weekly-menu-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 26, 30, 0.72);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.spudo-weekly-menu-modal__panel {
  position: relative;
  background: #ffffff;
  color: #0a2a2f;
  width: min(1200px, calc(100vw - 32px));
  /* Fill 90% of the viewport height so a 44-dish menu doesn't
     feel cramped — the internal .spudo-weekly-menu-modal__body
     scrolls vertically when the grid overflows. */
  height: min(900px, calc(100vh - 48px));
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.spudo-weekly-menu-modal__head {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(10, 42, 47, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.spudo-weekly-menu-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}

.spudo-weekly-menu-modal__close {
  border: 0;
  background: rgba(10, 42, 47, 0.06);
  color: #0a2a2f;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}
.spudo-weekly-menu-modal__close:hover {
  background: rgba(10, 42, 47, 0.12);
}

.spudo-weekly-menu-modal__body {
  padding: 18px 22px;
  overflow-y: auto;
  /* Fill the flex space between head + foot so the scroll bar
     lands inside the panel rather than shifting the whole page. */
  flex: 1 1 auto;
  min-height: 0;
  /* Thin, subtle scrollbar so the panel edge stays clean. */
  scrollbar-width: thin;
  scrollbar-color: rgba(10, 42, 47, 0.25) transparent;
}
.spudo-weekly-menu-modal__body::-webkit-scrollbar {
  width: 8px;
}
.spudo-weekly-menu-modal__body::-webkit-scrollbar-thumb {
  background: rgba(10, 42, 47, 0.25);
  border-radius: 4px;
}

/* Box tabs — wrap onto multiple lines on desktop (plenty of width
   to breathe), switch to a horizontally-scrollable strip on mobile
   (≤768px) where wrapping blows up a Skagenfood popup to 4+ lines
   of chips. Giorgos 2026-10-01. */
.spudo-weekly-menu-modal__boxtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
@media (max-width: 768px) {
  .spudo-weekly-menu-modal__boxtabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 8px;
    /* Fade the right edge so the overflow is discoverable. */
    mask-image: linear-gradient(to right, black 94%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 94%, transparent 100%);
  }
  .spudo-weekly-menu-modal__boxtabs::-webkit-scrollbar { display: none; }
}
.spudo-weekly-menu-modal__boxtab {
  border: 1px solid rgba(10, 42, 47, 0.15);
  background: #ffffff;
  color: rgba(10, 42, 47, 0.75);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  flex: 0 0 auto;         /* never shrink in the horizontal strip */
  white-space: nowrap;    /* long box names stay single-line */
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
/* "Alle" chip stands out as the aggregate view */
.spudo-weekly-menu-modal__boxtab--all {
  border-style: dashed;
}
.spudo-weekly-menu-modal__boxtab:hover {
  border-color: #00a76f;
  color: #0a2a2f;
}
.spudo-weekly-menu-modal__boxtab.is-on {
  background: #00a76f;
  color: #ffffff;
  border-color: #00a76f;
}
.spudo-weekly-menu-modal__boxtabcount {
  opacity: 0.7;
  font-weight: 400;
  margin-left: 4px;
  font-size: 13px;
}

.spudo-weekly-menu-modal__weekchips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.spudo-weekly-menu-modal__weekchip {
  border: 1px solid rgba(10, 42, 47, 0.12);
  background: transparent;
  color: rgba(10, 42, 47, 0.65);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.spudo-weekly-menu-modal__weekchip:hover {
  background: rgba(0, 167, 111, 0.06);
}
.spudo-weekly-menu-modal__weekchip.is-on {
  background: rgba(0, 167, 111, 0.12);
  color: #007a51;
  border-color: #00a76f;
}
.spudo-weekly-menu-modal__weekchipcnt {
  font-size: 12px;
  opacity: 0.7;
}

/* Category filter chips — operators like RetNemt tag each dish with
   overlapping categories (Uden laktose, Børnevenlig, Fjerkræ, …).
   Chip row sits between the week chips and the dish grid; single-
   select; "Alle" clears the filter. Rendered only when the current
   pool contains any tagged dishes.
   Mobile (≤640px): switch to a horizontal scroll strip instead of
   wrapping onto 4+ lines (Rene 2026-10-01 — the wrapping chip row
   was pushing the dish grid 60% off-screen on phones). Hides the
   scrollbar visually; swipe gesture carries the discovery. */
.spudo-weekly-menu-modal__catchips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(10, 42, 47, 0.08);
}
@media (max-width: 768px) {
  .spudo-weekly-menu-modal__catchips {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 8px;
    /* Fade on the right edge hints "there's more" */
    mask-image: linear-gradient(to right, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 92%, transparent 100%);
  }
  .spudo-weekly-menu-modal__catchips::-webkit-scrollbar { display: none; }
  .spudo-weekly-menu-modal__catchip {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}
.spudo-weekly-menu-modal__catchip {
  border: 1px solid rgba(10, 42, 47, 0.12);
  background: transparent;
  color: rgba(10, 42, 47, 0.7);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  /* v0.66.0 — operator feeds send category slugs lowercase (e.g.
   * "double-protein"). CSS `capitalize` lifts just the first letter per
   * whitespace-separated word, which is the only transform we want —
   * hyphenated slugs stay as "Double-protein" (hyphens aren't word
   * separators to the browser). Already-cased labels like "Uden laktose"
   * become "Uden Laktose" — minor cosmetic drift, acceptable. */
  text-transform: capitalize;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.spudo-weekly-menu-modal__catchip:hover {
  background: rgba(0, 167, 111, 0.06);
  color: #0a2a2f;
}
.spudo-weekly-menu-modal__catchip.is-on {
  background: #00a76f;
  color: #ffffff;
  border-color: #00a76f;
}
.spudo-weekly-menu-modal__catchip--alle {
  font-weight: 600;
}
.spudo-weekly-menu-modal__catchipcnt {
  font-size: 12px;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}
.spudo-weekly-menu-modal__catchip.is-on .spudo-weekly-menu-modal__catchipcnt {
  opacity: 0.9;
}

.spudo-weekly-menu-modal__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.spudo-weekly-menu-modal__card {
  border-radius: 12px;
  border: 1px solid rgba(10, 42, 47, 0.08);
  overflow: hidden;
  background: #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  /* Flex-column so each card is a vertical stack; combined with
     stretched grid rows, dish names of different lengths no longer
     push the "Se deklaration" + CTA pills to uneven heights across
     the row (Giorgos 2026-10-01). */
  display: flex;
  flex-direction: column;
}
.spudo-weekly-menu-modal__card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(10, 42, 47, 0.08);
}

.spudo-weekly-menu-modal__photo {
  position: relative;
  aspect-ratio: 3 / 2;
  background: #e9ecef;
  overflow: hidden;
  margin: 0;
}
.spudo-weekly-menu-modal__photo meta,
.spudo-weekly-menu-dekl__photo meta {
  display: none;
}
.spudo-weekly-menu-modal__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.spudo-weekly-menu-modal__new {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #00a76f;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
}

.spudo-weekly-menu-modal__rec {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ffd666;
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 4px 8px;
  border-radius: 999px;
}

.spudo-weekly-menu-modal__slot {
  font-size: 12px;
  font-weight: 700;
  color: #00a76f;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.spudo-weekly-menu-modal__cardbody {
  padding: 12px 14px 14px;
  /* Fill remaining vertical space inside the card so .pills can
     anchor to the bottom with margin-top:auto below. */
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.spudo-weekly-menu-modal__name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: #0a2a2f;
}
.spudo-weekly-menu-modal__name a {
  color: inherit;
  text-decoration: none;
}
.spudo-weekly-menu-modal__name a:hover {
  color: #00a76f;
  text-decoration: underline;
}

.spudo-weekly-menu-modal__desc {
  margin-top: 4px;
  font-size: 13px;
  color: rgba(10, 42, 47, 0.65);
  line-height: 1.35;
}

.spudo-weekly-menu-modal__empty {
  padding: 20px;
  color: rgba(10, 42, 47, 0.6);
  text-align: center;
}

/* Action pill row under each dish — Se deklaration + CTA. Buttons
   share the same green outline pill styling. The CTA pill links to
   the operator affiliate URL (Rene 2026-10-01 #5).
   margin-top:auto pushes the row to the bottom of the card body
   so dishes with longer / shorter names still align their pills
   across the row (Giorgos 2026-10-01 polish). */
.spudo-weekly-menu-modal__pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 10px;
}
.spudo-weekly-menu-modal__deklbtn,
.spudo-weekly-menu-modal__ctabtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(0, 167, 111, 0.35);
  background: rgba(0, 167, 111, 0.06);
  color: #007a51;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.spudo-weekly-menu-modal__deklbtn::before,
.spudo-weekly-menu-modal__ctabtn::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00a76f;
}
.spudo-weekly-menu-modal__deklbtn:hover,
.spudo-weekly-menu-modal__ctabtn:hover {
  background: #00a76f;
  color: #ffffff;
  border-color: #00a76f;
  text-decoration: none;
}
.spudo-weekly-menu-modal__deklbtn:hover::before,
.spudo-weekly-menu-modal__ctabtn:hover::before {
  background: #ffffff;
}

.spudo-weekly-menu-dekl {
  position: fixed;
  inset: 0;
  z-index: 100010;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.spudo-weekly-menu-dekl[hidden] {
  display: none !important;
}
.spudo-weekly-menu-dekl__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 26, 30, 0.55);
  backdrop-filter: blur(2px);
  cursor: pointer;
}
.spudo-weekly-menu-dekl__panel {
  position: relative;
  background: #ffffff;
  color: #0a2a2f;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.spudo-weekly-menu-dekl__head {
  padding: 16px 20px;
  background: linear-gradient(135deg, #0a2a2f 0%, #144b52 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 12px;
}
.spudo-weekly-menu-dekl__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}
.spudo-weekly-menu-dekl__close {
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}
.spudo-weekly-menu-dekl__close:hover {
  background: rgba(255, 255, 255, 0.28);
}
.spudo-weekly-menu-dekl__body {
  padding: 18px 22px 22px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(10, 42, 47, 0.25) transparent;
}
.spudo-weekly-menu-dekl__body::-webkit-scrollbar {
  width: 8px;
}
.spudo-weekly-menu-dekl__body::-webkit-scrollbar-thumb {
  background: rgba(10, 42, 47, 0.25);
  border-radius: 4px;
}
.spudo-weekly-menu-dekl__photo {
  margin: -18px -22px 14px;
  aspect-ratio: 16 / 9;
  background: #e9ecef;
  overflow: hidden;
  position: relative;
}
.spudo-weekly-menu-dekl__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.spudo-weekly-menu-dekl__meta {
  margin-bottom: 14px;
}
.spudo-weekly-menu-dekl__slot {
  font-size: 12px;
  font-weight: 700;
  color: #00a76f;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.spudo-weekly-menu-dekl__desc {
  font-size: 14px;
  color: rgba(10, 42, 47, 0.75);
  line-height: 1.45;
}
.spudo-weekly-menu-dekl__section {
  margin-top: 16px;
}
.spudo-weekly-menu-dekl__section:first-of-type {
  margin-top: 0;
}
.spudo-weekly-menu-dekl__label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: rgba(10, 42, 47, 0.55);
}
.spudo-weekly-menu-dekl__nutritable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.spudo-weekly-menu-dekl__nutritable td {
  padding: 6px 0;
  border-bottom: 1px solid rgba(10, 42, 47, 0.08);
  vertical-align: top;
}
.spudo-weekly-menu-dekl__nutritable td:nth-child(2) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 600;
  color: #0a2a2f;
}
.spudo-weekly-menu-modal__nutrisub td:first-child {
  padding-left: 16px;
  color: rgba(10, 42, 47, 0.6);
  font-style: italic;
}
.spudo-weekly-menu-modal__nutrisub td:nth-child(2) {
  font-weight: 500;
  color: rgba(10, 42, 47, 0.7);
}
.spudo-weekly-menu-dekl__text {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(10, 42, 47, 0.85);
  white-space: pre-wrap;
}

.spudo-weekly-menu-modal__foot {
  padding: 12px 22px;
  border-top: 1px solid rgba(10, 42, 47, 0.08);
  background: rgba(10, 42, 47, 0.02);
  display: flex;
  align-items: center;
}

.spudo-weekly-menu-modal__note {
  font-size: 12px;
  color: rgba(10, 42, 47, 0.55);
}

/* Enabled-state tweak on the button itself — restore normal cursor
   and full opacity, remove the "coming soon" gray. Base pill styling
   comes from feed.css. */
.spudo-mealbox .spudo-mealbox-weekly-menu.spudo-mealbox-weekly-menu--enabled {
  cursor: pointer;
  opacity: 1;
  color: var(--spudo-green, #00a76f);
  border-color: var(--spudo-green, #00a76f);
}
.spudo-mealbox .spudo-mealbox-weekly-menu.spudo-mealbox-weekly-menu--enabled:hover {
  background: rgba(0, 167, 111, 0.08);
  color: var(--spudo-text, #0a2a2f);
}
