.nordic-recipe-details-page h1,
.nordic-recipe-details-page h2,
.nordic-recipe-details-page h3,
.nordic-recipe-details-page h4,
.nordic-recipe-details-page h5,
.nordic-recipe-details-page h6 {
  font-family: "Farro", sans-serif;
  font-weight: 700;
}

.nordic-recipe-details-page {
  --rd-brand-deep: var(--brand-deep, #223947);
  --rd-brand-deep-2: var(--brand-deep-2, #1a2d38);
  --rd-brand-warm: var(--brand-warm, #7d1d1d);
  --rd-brand-accent: var(--brand-accent, #e6ba40);
  --rd-brand-heading: var(--brand-heading, #4d2000);
  --rd-brand-light: var(--brand-light, #ebebeb);
  --rd-surface: rgba(255, 255, 255, 0.92);
  --rd-surface-soft: rgba(241, 241, 241, 0.86);
  --rd-border: rgba(34, 57, 71, 0.18);
  --rd-description-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 243, 243, 0.94) 100%);
  --rd-description-border: rgba(34, 57, 71, 0.12);
  --rd-description-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 14px rgba(20, 34, 43, 0.04);
  --rd-description-text: color-mix(in srgb, var(--rd-brand-deep-2) 88%, var(--rd-brand-deep) 12%);
  --rd-text: var(--rd-brand-deep);
  --rd-text-soft: rgba(34, 57, 71, 0.82);
  --rd-scroll-top: 110px;
  --rd-scroll-bottom: 24px;
  --rd-panel-height: calc(100svh - var(--rd-scroll-top) - var(--rd-scroll-bottom));
  font-family: "Fira Sans", sans-serif;
  font-weight: 400;
  width: min(1500px, 100% - 24px);
  margin: 16px auto 48px;
  color: var(--rd-text);
}

.nordic-recipe-details-page p,
.nordic-recipe-details-page a,
.nordic-recipe-details-page button {
  font-family: "Fira Sans", sans-serif;
  font-weight: 400;
}

.nordic-recipe-details-page button {
  font-weight: 500;
}

.recipe-details-head {
  margin-bottom: 14px;
}

.recipe-details-breadcrumb {
  margin: 0 0 10px;
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 8px;
  row-gap: 4px;
  color: var(--rd-text-soft);
  font-size: 16px;
  font-family: "Fira Sans", sans-serif;
  font-weight: 500;
  line-height: 1.45;
}

.recipe-details-breadcrumb a {
  color: var(--rd-brand-deep);
  text-decoration: none;
  font-family: "Fira Sans", sans-serif;
  font-weight: 500;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.recipe-details-breadcrumb a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.recipe-details-breadcrumb-current {
  color: var(--rd-brand-heading);
  text-decoration: none;
  font-family: "Fira Sans", sans-serif;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.recipe-details-head h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  color: var(--rd-brand-deep-2);
}

.recipe-details-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: stretch;
  height: auto;
  overflow: visible;
}

.recipe-details-left {
  display: grid;
  gap: 16px;
  min-width: 0;
  position: static;
  top: auto;
  align-self: start;
  height: auto;
}

.recipe-details-right {
  display: grid;
  gap: 20px;
  min-width: 0;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: visible;
  padding-right: 0;
  overscroll-behavior: auto;
  scrollbar-gutter: auto;
  -webkit-overflow-scrolling: auto;
  align-content: start;
}

.recipe-details-right::-webkit-scrollbar {
  width: 8px;
}

.recipe-details-right::-webkit-scrollbar-thumb {
  background: rgba(34, 57, 71, 0.28);
  border-radius: 999px;
}

.recipe-image-card,
.recipe-details-right > * {
  opacity: 0;
  transform: translateY(10px);
  animation: rd-reveal 520ms ease-out forwards;
}

.recipe-image-card {
  animation-delay: 60ms;
}

.recipe-details-right > *:nth-child(1) { animation-delay: 120ms; }
.recipe-details-right > *:nth-child(2) { animation-delay: 180ms; }
.recipe-details-right > *:nth-child(3) { animation-delay: 240ms; }
.recipe-details-right > *:nth-child(4) { animation-delay: 300ms; }

@keyframes rd-reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.recipe-image-card {
  margin: 0;
  border: 1px solid rgba(230, 186, 64, 0.28);
  border-radius: 24px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 16px 34px rgba(20, 34, 43, 0.18);
  aspect-ratio: 1 / 1;
  height: auto;
  position: relative;
}

.recipe-image-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 1;
  background: transparent;
}

.recipe-image-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 24px 28px;
  background: linear-gradient(180deg, rgba(8, 14, 22, 0) 0%, rgba(8, 14, 22, 0.72) 62%, rgba(8, 14, 22, 0.88) 100%);
}

.recipe-image-overlay h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(34px, 3.1vw, 54px);
  line-height: 1.06;
}

.recipe-image-overlay p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(17px, 1.25vw, 24px);
  line-height: 1.28;
}

.recipe-image-overlay {
  display: none;
}

.recipe-image-card__fallback {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.7) 0, rgba(255, 255, 255, 0) 44%),
    linear-gradient(145deg, #eef3ef, #e2eae4);
  color: #5f6d67;
  font-size: 15px;
  line-height: 1.4;
}

.recipe-image-card__fallback::before {
  content: "Image coming soon";
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(95, 109, 103, 0.36);
  background: rgba(255, 255, 255, 0.74);
}

.ingredients-card,
.detail-card {
  background: color-mix(in srgb, var(--rd-surface) 94%, #ffffff 6%);
  border: 1px solid color-mix(in srgb, var(--rd-border) 85%, transparent 15%);
  border-radius: 22px;
  padding: 20px;
  min-width: 0;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(20, 34, 43, 0.08);
}

.ingredients-card h2,
.detail-card h2 {
  margin: 0 0 12px;
  font-size: 20px;
  color: var(--rd-brand-deep-2);
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ingredients-card h2::before,
.detail-card h2::before {
  content: "";
  width: 4px;
  height: 24px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--rd-brand-warm), var(--rd-brand-accent));
  flex: 0 0 auto;
}

.ingredients-card ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  color: var(--rd-text);
  line-height: 1.6;
  list-style: none;
}

.detail-card p {
  margin: 0;
  color: var(--rd-text);
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ingredients-card > p {
  margin: 0;
  color: var(--rd-text-soft);
  font-style: italic;
  line-height: 1.55;
}

.ingredients-card li {
  position: relative;
  padding: 8px 0 8px 28px;
  border-bottom: 1px dashed rgba(34, 57, 71, 0.2);
}

.ingredients-card li:last-child {
  border-bottom: 0;
}

.ingredients-card li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--rd-brand-warm), var(--rd-brand-accent));
  box-shadow: 0 0 0 3px rgba(230, 186, 64, 0.24);
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.nutrition-grid p {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(34, 57, 71, 0.16);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94) 0%, var(--rd-surface-soft) 100%);
  color: var(--rd-brand-deep-2);
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.nutrition-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--rd-brand-deep);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Match the recipe description card's inner palette to the Nutrition mini-cards. */
.detail-card--description.detail-card--image-description {
  border: 1px solid var(--rd-description-border) !important;
  background: var(--rd-description-bg) !important;
  box-shadow: var(--rd-description-shadow);
}

.recipe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 2px;
}

.recipe-actions--standalone {
  margin-top: 2px;
  padding-bottom: 8px;
}

.recipe-actions--desktop {
  display: flex;
}

.recipe-actions--mobile {
  display: none;
}

.recipe-action-btn {
  appearance: none;
  border: 1px solid rgba(34, 57, 71, 0.3);
  background: var(--rd-brand-light);
  color: var(--rd-brand-deep);
  border-radius: 999px;
  min-height: 42px;
  padding: 10px 18px;
  font-size: 14px;
  font-family: "Fira Sans", sans-serif;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.22s ease, color 0.22s ease, transform 0.2s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.recipe-action-btn__icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.recipe-action-btn:hover {
  transform: translateY(-1px);
  background: var(--rd-brand-accent);
  color: var(--rd-brand-heading);
  border-color: rgba(230, 186, 64, 0.62);
  box-shadow: 0 8px 14px rgba(34, 57, 71, 0.16);
}

.recipe-action-btn:focus-visible {
  outline: 3px solid rgba(230, 186, 64, 0.58);
  outline-offset: 2px;
}

.recipe-action-btn--primary {
  background: var(--rd-brand-warm);
  color: var(--rd-brand-light);
  border-color: var(--rd-brand-warm);
}

.recipe-action-btn--primary:hover {
  background: var(--rd-brand-heading);
  color: var(--rd-brand-accent);
  border-color: var(--rd-brand-heading);
}

.detail-card ol {
  counter-reset: procedure-step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  color: var(--rd-text);
  line-height: 1.62;
  list-style: none;
}

.detail-card ol li {
  counter-increment: procedure-step;
  position: relative;
  padding: 9px 0 9px 42px;
  border-bottom: 1px dashed rgba(34, 57, 71, 0.2);
}

.detail-card ol li:last-child {
  border-bottom: 0;
}

.detail-card ol li::before {
  content: counter(procedure-step);
  position: absolute;
  left: 0;
  top: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--rd-surface-soft);
  border: 1px solid rgba(34, 57, 71, 0.2);
  color: var(--rd-brand-deep-2);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}

.ingredients-card li,
.detail-card li {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.recipe-action-btn:disabled,
.recipe-action-btn[aria-disabled="true"] {
  background: rgba(235, 235, 235, 0.78);
  color: rgba(34, 57, 71, 0.5);
  border-color: rgba(34, 57, 71, 0.22);
  cursor: not-allowed;
  transform: none;
}

.recipe-action-btn:disabled:hover,
.recipe-action-btn[aria-disabled="true"]:hover {
  background: rgba(235, 235, 235, 0.78);
  color: rgba(34, 57, 71, 0.5);
  border-color: rgba(34, 57, 71, 0.22);
}

/* Oats-recipe style while keeping Nordic palette */
.recipe-summary {
  display: grid;
  gap: 20px;
  margin-bottom: 8px;
}

.recipe-summary__title {
  margin: 0;
  font-size: clamp(56px, 5.1vw, 88px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--rd-brand-deep);
}

.recipe-quick-info {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.quick-badge {
  min-width: 0;
  border-radius: 14px;
  border: 1px solid rgba(230, 186, 64, 0.24);
  background: color-mix(in srgb, var(--rd-brand-light) 90%, white 10%);
  padding: 16px 10px;
  text-align: center;
  display: grid;
  gap: 6px;
  align-content: start;
}

.quick-badge__icon {
  font-size: 20px;
  line-height: 1;
  color: var(--rd-brand-warm);
}

.quick-badge__label {
  font-size: 16px;
  color: color-mix(in srgb, var(--rd-brand-deep) 64%, #7d6d60 36%);
  font-weight: 600;
}

.quick-badge__value {
  font-size: clamp(34px, 2.9vw, 52px);
  font-weight: 700;
  line-height: 1.08;
  color: var(--rd-brand-deep);
}

.recipe-details-right .detail-card,
.recipe-details-right .ingredients-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.recipe-details-right .detail-card--description h2,
.recipe-details-right .detail-card--description h2::before {
  display: none;
}

.recipe-details-right .detail-card--description p {
  font-size: clamp(1rem, 1.1vw, 1.18rem);
  color: var(--rd-description-text);
  line-height: 1.72;
}

.recipe-details-right .ingredients-card h2,
.recipe-details-right .detail-card--procedure h2,
.recipe-details-right .detail-card--nutrition h2 {
  font-size: clamp(1.3rem, 1.8vw, 1.95rem);
}

.recipe-details-right .ingredients-card li {
  font-size: clamp(1.04rem, 1.22vw, 1.16rem);
  border-bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 0;
  min-height: 20px;
  padding-top: 1px;
  padding-bottom: 1px;
  margin-bottom: 1px;
}

.recipe-details-right .ingredients-card .ingredient-product-label {
  font-family: "Fira Sans", sans-serif;
  font-size: 1em;
  font-weight: 800 !important;
  text-decoration: none;
  color: inherit;
}

.recipe-details-right .ingredients-card li::before {
  position: static;
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  margin-top: 0;
  background: var(--rd-brand-accent);
  box-shadow: none;
}

.recipe-details-right .detail-card--procedure ol li {
  font-size: clamp(1.2rem, 1.24vw, 1.2rem);
  display: block;
  min-height: 32px;
  padding: 0 0 0 42px;
  border-bottom: 0;
}

.recipe-details-right .detail-card--procedure ol {
  gap: 8px;
}

.recipe-details-right .detail-card--procedure ol li::before {
  position: absolute;
  left: 0;
  top: 2px;
  width: 28px;
  height: 28px;
  font-size: 14px;
  font-weight: 700;
  color: var(--rd-brand-heading);
  background: color-mix(in srgb, var(--rd-brand-warm) 14%, white 86%);
  border: 1px solid color-mix(in srgb, var(--rd-brand-deep) 16%, transparent 84%);
  box-shadow: none;
}

@media (max-width: 1024px) {
  .recipe-details-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    height: auto;
    overflow: visible;
  }

  .recipe-details-left {
    position: static;
    top: auto;
    height: auto;
  }

  .recipe-details-right {
    height: auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .recipe-image-card img {
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
    object-fit: cover;
  }

  .recipe-actions--desktop {
    display: none;
  }

  .recipe-actions--mobile {
    display: flex;
  }

  .recipe-summary {
    gap: 14px;
    margin-bottom: 2px;
  }

  .recipe-summary__title {
    font-size: clamp(34px, 8vw, 52px);
    line-height: 1;
  }

  .recipe-quick-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .quick-badge {
    padding: 12px 10px;
    gap: 4px;
  }

  .quick-badge__icon {
    font-size: 16px;
  }

  .quick-badge__label {
    font-size: 14px;
  }

  .quick-badge__value {
    font-size: clamp(28px, 6vw, 38px);
  }

  .nutrition-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .nordic-recipe-details-page {
    width: min(1500px, 100% - 16px);
  }

  .recipe-details-head {
    margin-bottom: 14px;
  }

  .recipe-details-breadcrumb {
    font-size: 14px;
    row-gap: 3px;
  }

  .recipe-details-head h1 {
    font-size: clamp(24px, 7vw, 34px);
    line-height: 1.16;
  }

  .recipe-summary__title {
    font-size: clamp(28px, 8.5vw, 40px);
  }

  .ingredients-card,
  .detail-card {
    padding: 16px 14px 18px;
  }

  .ingredients-card h2,
  .detail-card h2 {
    font-size: 19px;
    margin-bottom: 12px;
  }

  .detail-card p {
    font-size: 15px;
    line-height: 1.72;
  }

  .ingredients-card ul,
  .detail-card ol {
    gap: 10px;
  }

  .ingredients-card li {
    padding: 8px 0 8px 24px;
  }

  .ingredients-card li::before {
    width: 10px;
    height: 10px;
  }

  .detail-card ol li {
    padding: 8px 0 8px 34px;
  }

  .detail-card ol li::before {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .recipe-details-right .detail-card--procedure ol li {
    min-height: 28px;
    padding-left: 36px;
    font-size: clamp(1rem, 4.1vw, 1.08rem);
  }

  .recipe-details-right .detail-card--procedure ol li::before {
    top: 1px;
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .recipe-action-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .nordic-recipe-details-page {
    width: min(1240px, 100% - 16px);
  }

  .ingredients-card,
  .detail-card {
    border-radius: 14px;
    padding: 14px 12px 16px;
  }

  .detail-card p {
    font-size: 14px;
    line-height: 1.74;
  }

  .recipe-quick-info {
    gap: 8px;
  }

  .quick-badge {
    border-radius: 10px;
    padding: 10px 8px;
  }

  .quick-badge__label {
    font-size: 12px;
  }

  .quick-badge__value {
    font-size: 30px;
  }

  .nutrition-grid p {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .recipe-image-card,
  .recipe-details-right > * {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .recipe-action-btn {
    transition: none;
  }
}
