/*
  BianCuisine website – recipe pages (/rezepte/, /en/recipes/ …), rendered by the Pages Function
  in website-functions/functions/_shared/recipes.ts. Uses the tokens of styles.css; no JavaScript.
*/

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.recipe-nav {
  display: flex;
  gap: 18px;
}

.recipe-nav a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.recipe-nav a:hover {
  color: var(--accent);
}

.crumbs {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.crumbs a {
  color: var(--muted);
}

/* List */

.recipes-title {
  margin: 12px 0 10px;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
}

.recipes-lead {
  max-width: 44rem;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.55;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recipe-card a {
  display: grid;
  gap: 6px;
  height: 100%;
  padding-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.recipe-card a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.recipe-card img,
.recipe-card-empty {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--sand);
}

.recipe-card-title {
  padding: 8px 16px 0;
  font-family: var(--display);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.25;
}

.recipe-card-facts {
  padding: 0 16px;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* List header: title, search bar and filters, centred */

.recipes-hero {
  display: grid;
  justify-items: center;
  margin: 8px 0 30px;
  text-align: center;
}

.recipes-hero .recipes-lead {
  margin: 0 auto 26px;
}

.recipe-finder {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: 100%;
  max-width: 660px;
}

.recipe-search {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease;
}

.recipe-search:focus-within {
  border-color: var(--accent);
}

.recipe-search-icon {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0 4px 0 12px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
}

.recipe-search input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.recipe-search input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.recipe-search button {
  flex: none;
  height: 46px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.recipe-search button:hover {
  opacity: 0.9;
}

.recipe-search button:focus-visible,
.filter summary:focus-visible,
.filter-menu a:focus-visible,
.recipe-tags a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Filters: a drop-down per filter (<details>, one open at a time), options are links. */
.recipe-filters {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.filter {
  position: relative;
}

.filter summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  list-style: none;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: border-color 0.15s ease;
}

.filter summary::-webkit-details-marker {
  display: none;
}

.filter summary:hover,
.filter[open] summary {
  border-color: var(--accent);
}

.filter.is-active summary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.filter-chevron {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s ease;
}

.filter[open] .filter-chevron {
  transform: rotate(180deg);
}

.filter-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 50%;
  min-width: 240px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: left;
  transform: translateX(-50%);
}

.filter-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 44px;
  padding: 0 12px 0 14px;
  border-radius: 12px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.filter-menu a:hover {
  background: var(--bg);
}

.filter-menu a[aria-current] {
  color: var(--accent);
}

.filter-count {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
}

.filter-check {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.filter-clear {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.filter-clear a {
  color: var(--muted);
  font-weight: 400;
}

/* Phones: the open menu spans the width of the filter row. */
@media (max-width: 639px) {
  .filter {
    position: static;
  }

  .filter-menu {
    right: 0;
    left: 0;
    min-width: 0;
    transform: none;
  }
}

/* Results: count, reset link and cards, centred under the search */
.recipe-results {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 6px 16px;
  margin: 0 0 18px;
  color: var(--muted);
}

.recipe-results b {
  color: var(--ink);
  font-weight: 600;
}

.recipe-results a {
  color: var(--accent);
  font-weight: 600;
}

.recipe-results-area .recipe-more h2 {
  text-align: center;
}

@media (min-width: 640px) {
  .recipe-results-area .recipe-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 280px));
    justify-content: center;
  }

  .recipe-results-area .recipe-pager {
    justify-content: center;
    gap: 12px 40px;
  }
}

/* Topic pages with enough recipes, linked below the list */
.recipe-topics {
  margin: 44px 0 0;
  text-align: center;
}

.recipe-topics h2 {
  margin: 0 0 14px;
  font-size: 1.5rem;
}

.recipe-topics ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recipe-topics a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.recipe-topics a:hover {
  border-color: var(--accent);
}

.topic-count {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 400;
}

.recipe-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 0;
}

.recipes-empty {
  color: var(--muted);
}

/* Recipe */

.recipe h1 {
  margin: 20px 0 10px;
  font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem);
}

.recipe-hero {
  margin: 0 calc(-1 * var(--gutter));
}

.recipe-hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--sand);
}

.recipe-hero figcaption {
  padding: 6px var(--gutter) 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

@media (min-width: 640px) {
  .recipe-hero {
    margin: 0;
  }

  .recipe-hero img {
    border-radius: var(--radius);
  }

  .recipe-hero figcaption {
    padding-inline: 4px;
  }
}

.recipe-lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.55;
}

.recipe-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.recipe-facts li {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.recipe-facts span {
  color: var(--muted);
  font-size: 0.8125rem;
}

.recipe-facts b {
  font-family: var(--display);
  font-size: 1.1875rem;
}

.recipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.recipe-tags li {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.875rem;
}

.recipe-tags a,
.recipe-tags span {
  display: block;
  padding: 5px 12px;
  border-radius: inherit;
  color: var(--ink);
  text-decoration: none;
}

.recipe-tags a:hover {
  color: var(--accent);
}

.recipe-tags li:has(a:hover) {
  border-color: var(--accent);
}

.recipe-columns {
  display: grid;
  gap: 8px 40px;
}

@media (min-width: 900px) {
  /* Header and content of a recipe page share the wider measure. */
  .recipe-shell {
    max-width: calc(1080px + 2 * var(--gutter));
  }

  /* Photo beside the title, facts and tags. */
  .recipe-top.has-photo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    grid-template-areas: "intro hero";
    gap: 0 44px;
    align-items: center;
    margin-top: 8px;
  }

  .recipe-top.has-photo .recipe-hero {
    grid-area: hero;
  }

  .recipe-top.has-photo .recipe-intro {
    grid-area: intro;
  }

  .recipe-top.has-photo h1 {
    margin-top: 0;
  }

  .recipe-top.has-photo .recipe-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recipe-columns {
    grid-template-columns: minmax(260px, 2fr) 3fr;
    align-items: start;
  }

  .recipe-ingredients {
    position: sticky;
    top: 16px;
  }
}

.recipe-ingredients,
.recipe-steps,
.recipe-nutrition {
  margin-top: 26px;
}

.recipe h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
}

.recipe h3 {
  margin: 18px 0 6px;
  font-size: 1.125rem;
}

.recipe-servings {
  margin: -6px 0 10px;
  color: var(--muted);
}

.ingredients {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ingredients li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.4;
}

.ingredients .amount {
  font-weight: 600;
}

.ingredients .note,
.ingredients .optional {
  color: var(--muted);
}

.recipe-steps ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.recipe-steps li {
  position: relative;
  padding: 0 0 18px 48px;
  counter-increment: step;
}

.recipe-steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 0.9375rem;
}

.recipe-steps p {
  margin: 4px 0 6px;
  line-height: 1.6;
}

.step-time,
.step-tip {
  color: var(--muted);
  font-size: 0.9375rem;
}

.recipe-nutrition table {
  width: 100%;
  max-width: 28rem;
  border-collapse: collapse;
}

.recipe-nutrition th,
.recipe-nutrition td {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 400;
}

.recipe-nutrition td {
  text-align: right;
  font-weight: 600;
}

.recipe-source,
.recipe-allergens {
  max-width: 40rem;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.recipe-cta {
  margin: 36px 0 0;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
}

.recipe-cta h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.recipe-cta p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.55;
}

.recipe-more {
  margin-top: 44px;
}

.recipe-more h2 {
  margin: 0 0 16px;
}

/* Store buttons, as on the landing page. */
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.store {
  display: grid;
  min-width: 170px;
  padding: 10px 22px 12px 18px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--bg);
  line-height: 1.2;
}

a.store {
  text-decoration: none;
  transition: opacity 0.15s ease;
}

a.store:hover {
  opacity: 0.88;
}

.store small {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
}

.store b {
  font-family: var(--display);
  font-size: 1.375rem;
  letter-spacing: -0.01em;
}

/* Header: the nutrition link from 480px on (phones keep "Recipes" next to the language menu). */
@media (max-width: 479px) {
  .recipe-nav .nav-nutrition {
    display: none;
  }
}

/* Nutrition pages (/naehrwerte/, /en/nutrition-facts/ …) */

.food-header {
  margin: 0 0 22px;
}

.food-header .recipes-lead {
  margin: 0;
}

.food h1 {
  margin: 12px 0 4px;
  font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem);
}

.food-lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 1.125rem;
}

.food-split {
  max-width: 34rem;
  margin: 24px 0 0;
}

.food-split h2,
.food-similar h2,
.food-groups-section h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
}

.food-split svg {
  display: block;
  width: 100%;
  height: 14px;
  border-radius: 999px;
}

.split-protein {
  fill: var(--mark);
}

.split-carbs {
  fill: var(--accent-soft);
}

.split-fat {
  fill: var(--accent);
}

.food-split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.9375rem;
}

.food-split-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border-radius: 50%;
}

.food-split-legend .split-protein {
  background: var(--mark);
}

.food-split-legend .split-carbs {
  background: var(--accent-soft);
}

.food-split-legend .split-fat {
  background: var(--accent);
}

.food-nutrition table {
  max-width: 34rem;
}

.food-nutrition thead th {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.food-nutrition thead th + th {
  text-align: right;
}

.food-nutrition td + td {
  width: 5.5rem;
  color: var(--muted);
  font-weight: 400;
}

.food-nutrition .sub th {
  padding-left: 16px;
  color: var(--muted);
}

.food-similar {
  margin-top: 36px;
}

.food-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.food-groups a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.food-groups a:hover {
  border-color: var(--accent);
}

.food-groups span,
.food-list span {
  flex: none;
  color: var(--muted);
  font-weight: 400;
}

.food-list {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2 300px;
  column-gap: 36px;
}

.food-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  break-inside: avoid;
}

.food-list a {
  color: var(--ink);
  text-decoration: none;
}

.food-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.food-source {
  max-width: 46rem;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.food-source a {
  color: var(--muted);
}

.food-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 600px) {
  .food-facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
