.recipe-hero {
  margin-bottom: 24px;
}

.recipe-detail__header {
  margin-bottom: 18px;
}

.scent-hero-decoration-recept-left {
  left: 0;
  background-position: bottom left;
  background-image: url("../resources/recepty/recept_left_bg.png");
  filter: blur(0.5px) saturate(0.75);
}

.scent-hero-decoration-recept-right {
  right: 0;
  background-position: bottom right;
  background-image: url("../resources/recepty/recept_right_bg.png");
  filter: blur(0.5px) saturate(0.75);
}

.recipe-detail__header-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 800px;
  min-width: 0;
  margin-inline: auto;
  text-align: center;
}

.recipe-detail__title {
  margin: 0;
  color: #102e24;
  font-family: 'Merienda', cursive;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  font-weight: 700;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.recipe-detail__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 20px;
  margin-top: 12px;
  color: #334238;
  font-size: 0.98rem;
}

.recipe-detail__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.recipe-detail__favorite {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  margin-left: 4px;
  padding: 0;
  border: 1px solid #decba9;
  border-radius: 50%;
  background: rgba(255, 250, 241, 0.8);
  font-size: 1.55rem;
}

.recipe-detail__favorite:focus-visible {
  outline: 3px solid #2360a5;
  outline-offset: 2px;
}

.recipe-detail {
  margin: 0 0 48px;
}

.recipe-detail__top {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 14px;
  align-items: stretch;
}

.recipe-detail__card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: clamp(18px, 2.2vw, 28px);
  border: 1px solid #decba9;
  border-radius: 12px;
  background: rgba(255, 250, 241, 0.88) url("../resources/bg-card.jpg") center / cover;
  box-shadow: 0 4px 14px rgba(80, 53, 23, 0.1);
}

.recipe-detail__gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}

.recipe-detail__main-image {
  display: block;
  width: 100%;
  height: clamp(220px, 30vw, 380px);
  min-height: 0;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #eadfca;
  object-fit: contain;
}

.recipe-detail__thumbnail-slider {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.recipe-detail__thumbnail-slider--carousel .recipe-detail__thumbnails {
  max-width: calc(100% - 72px);
}

.recipe-detail__thumbnails {
  display: flex;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  flex: 0 1 auto;
  justify-content: safe center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: none;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
}

.recipe-detail__thumbnails::-webkit-scrollbar {
  display: none;
}

.recipe-detail__thumbnail-arrow {
  display: grid;
  width: 28px;
  height: 34px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid #dfcfbb;
  border-radius: 7px;
  background: #fffaf1;
  color: #17314b;
  cursor: pointer;
  font: 700 1.5rem/1 'Source Sans 3', sans-serif;
}

.recipe-detail__thumbnail-arrow:hover {
  border-color: #ba8a2b;
  background: #f7e6d6;
}

.recipe-detail__thumbnail-arrow:focus-visible {
  outline: 3px solid #2360a5;
  outline-offset: 2px;
}

.recipe-detail__thumbnail {
  width: 92px;
  height: 66px;
  flex: 0 0 92px;
  overflow: hidden;
  padding: 0;
  border: 1px solid #decba9;
  border-radius: 7px;
  background: #fffaf1;
  cursor: pointer;
  scroll-snap-align: center;
}

.recipe-detail__thumbnail[aria-pressed="true"] {
  border: 2px solid #b51f1f;
}

.recipe-detail__thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-detail__section-title {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: #173829;
  font-family: 'Merienda', cursive;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.25;
}

.recipe-detail__section-title img {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
}

.recipe-detail__ingredients::after,
.recipe-detail__preparation::after {
  position: absolute;
  right: 8px;
  bottom: 4px;
  width: 150px;
  height: 230px;
  background: url("../resources/recepty/ingredience.png") bottom right / contain no-repeat;
  content: "";
  opacity: 0.45;
  pointer-events: none;
}

.recipe-detail__ingredients ul,
.recipe-detail__preparation ol {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recipe-detail__ingredients li {
  position: relative;
  z-index: 1;
  padding: 8px 145px 8px 4px;
  border-bottom: 1px dashed rgba(160, 126, 78, 0.35);
  color: #26332b;
  line-height: 1.45;
}

.recipe-detail__ingredients li:last-child {
  border-bottom: 0;
}

.recipe-detail__preparation {
  margin-top: 14px;
  padding-right: clamp(28px, 12vw, 180px);
}

.recipe-detail__preparation::after {
  right: 20px;
  bottom: 10px;
  width: 135px;
  height: 160px;
  background-image: url("../resources/recepty/postup.png");
}

.recipe-detail__preparation ol {
  counter-reset: recipe-step;
}

.recipe-detail__preparation li {
  position: relative;
  min-height: 38px;
  margin: 0 0 10px;
  padding: 4px 0 4px 46px;
  color: #26332b;
  line-height: 1.55;
  counter-increment: recipe-step;
}

.recipe-detail__preparation li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #b51f1f;
  color: #fff;
  content: counter(recipe-step);
  font-weight: 800;
}

.recipe-not-found {
  max-width: 760px;
  margin: 32px auto 56px;
  padding: 32px;
  border: 1px solid #decba9;
  border-radius: 12px;
  background: rgba(255, 250, 241, 0.88);
  text-align: center;
}

.recipe-not-found h1 {
  color: #173829;
  font-family: 'Merienda', cursive;
}

.recipe-card__title-link {
  color: inherit;
  text-decoration: none;
}

.recipe-card__image-link {
  display: block;
  width: 100%;
  height: 100%;
}

.recipe-card__title-link:hover,
.recipe-card__title-link:focus-visible {
  color: var(--recipes-red);
  text-decoration: underline;
}

.recipe-hero .feature-card {
  min-height: 230px;
}

.recipe-category-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 26px;
}

.recipe-category-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 1px solid #decba9;
  border-radius: 9px;
  background: rgba(255, 250, 241, 0.78);
  color: var(--color-navy);
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.recipe-category-button:hover,
.recipe-category-button:focus-visible,
.recipe-category-button[aria-pressed="true"] {
  border-color: var(--color-red);
  background: var(--color-red);
  color: #fff;
}

.recipes-page {
  --recipes-cream: rgba(255, 250, 241, 0.7);;
  --recipes-border: #decba9;
  --recipes-red: #c62828;
  margin-bottom: 56px;
}

.recipes-toolbar {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.recipes-filter {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--recipes-border);
  border-radius: 12px;
  background: rgba(255, 250, 241, 0.7);
}

.recipes-filter__button {
  padding: 8px 15px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #555;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
}

.recipes-filter__button.is-active {
  background: var(--recipes-red);
  color: #fff;
}

.recipes-toolbar__right {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.recipes-sort {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  color: var(--color-navy);
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
}

.recipes-sort select {
  min-width: 166px;
  padding: 9px 28px 9px 11px;
  border: 1px solid var(--recipes-border);
  border-radius: 9px;
  background: var(--recipes-cream);
  color: var(--color-navy);
  font: inherit;
}

.recipes-search {
  display: flex;
  min-width: 250px;
  max-width: 380px;
  flex: 0 1 380px;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid var(--recipes-border);
  border-radius: 12px;
  background: #fff;
  color: var(--color-navy);
}

.recipes-search__icon {
  font-size: 1.8rem;
  line-height: 1;
  transform: rotate(-20deg);
}

.recipes-search input {
  width: 100%;
  min-width: 0;
  padding: 14px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-navy);
  font-family: var(--font-serif);
  font-size: 0.9rem;
}

.recipes-search input::placeholder {
  color: #69716b;
}

.recipes-status {
  min-height: 20px;
  margin: 0 0 10px;
  color: #667066;
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.recipe-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--recipes-border);
  border-radius: 10px;
  background: var(--recipes-cream);
  box-shadow: 0 4px 14px rgba(80, 53, 23, 0.1);
}

.recipe-card__image-wrap {
  aspect-ratio: 1.45;
  overflow: hidden;
  background: #eadfca;
}

.recipe-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.recipe-card__image--placeholder {
  width: 109%;
  margin-left: -16px;
}

.recipe-card:hover .recipe-card__image {
  transform: scale(1.04);
}

.recipe-card__content {
  display: flex;
  min-height: 82px;
  flex: 1;
  flex-direction: column;
  padding: 9px 10px 8px;
}

.recipe-card h2 {
  overflow-wrap: anywhere;
  color: var(--color-navy);
  font-family: var(--font-serif);
  font-size: 0.92rem;
  line-height: 1.25;
}

.recipe-card__footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.recipe-card__meta {
  display: inline-flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 5px;
  color: #555;
  font-family: 'Nunito', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.recipe-card__meta > span {
  font-size: 1.15rem;
}

.recipe-card__favorite {
  flex: 0 0 auto;
  padding: 0 0 0 4px;
  border: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
  -webkit-text-stroke: 1.2px #1f2923;
  transition: color 0.2s ease, transform 0.2s ease;
}

.recipe-card__favorite:hover,
.recipe-card__favorite:focus-visible {
  transform: scale(1.1);
}

.recipe-card__favorite.is-favorite {
  color: var(--color-gold);
  -webkit-text-stroke: 1.2px var(--color-gold);
}

.recipe-card__open {
  display: inline-flex;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--recipes-red);
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.recipe-card__open:hover,
.recipe-card__open:focus-visible {
  background: #a31f1f;
  color: #fff;
  transform: scale(1.08);
}

.recipe-card__open > span {
  display: none;
}

.recipe-card__open::after {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(-45deg);
  margin-left: -3px;
}

.recipes-load-more {
  display: block;
  margin: 28px auto 0;
  padding: 11px 24px;
  border: 1px solid var(--recipes-red);
  border-radius: 10px;
  background: var(--recipes-red);
  color: #fff;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.recipes-load-more[hidden] {
  display: none;
}

.recipes-load-more:hover,
.recipes-load-more:focus-visible {
  background: #a31f1f;
  transform: translateY(-1px);
}

.recipes-load-more:disabled {
  cursor: wait;
  opacity: 0.65;
}

.recipes-empty {
  padding: 36px 20px;
  border: 1px dashed var(--recipes-border);
  border-radius: 14px;
  color: #667066;
  font-family: 'Nunito', sans-serif;
  text-align: center;
}

[data-recipe-card][hidden] {
  display: none;
}

@media (min-width: 1100px) {
  .recipe-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 850px) {
  .recipe-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .recipe-detail__top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }
}

@media (max-width: 650px) {
  .recipe-detail__title {
    font-size: clamp(2.1rem, 10vw, 3rem);
  }

  .recipe-detail__meta {
    gap: 7px 12px;
    font-size: 0.88rem;
  }

  .recipe-detail__top {
    grid-template-columns: 1fr;
  }

  .recipe-detail__main-image {
    height: clamp(220px, 72vw, 340px);
  }

  .recipe-detail__ingredients li {
    padding-right: 110px;
  }

  .recipe-detail__ingredients::after {
    width: 112px;
    height: 145px;
  }

  .recipe-detail__preparation {
    padding-right: 24px;
  }

  .recipe-detail__preparation::after {
    width: 90px;
    height: 110px;
    opacity: 0.2;
  }

  .recipes-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .recipes-toolbar__right {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .recipes-sort {
    justify-content: space-between;
  }

  .recipes-sort select {
    flex: 1;
  }

  .recipes-search {
    min-width: 0;
    max-width: none;
    flex: 0 1 auto;
  }

  .recipe-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .recipe-grid {
    grid-template-columns: 1fr;
  }
}
