/* =========================
   RECETA
========================= */

.recipe-wrap {
  padding: 56px 0 80px;
}

.recipe-container {
  max-width: 1240px;
  margin: 0 auto;
}


/* =========================
   ENLACE VOLVER
========================= */

.recipe-back-link {
  display: inline-block;
  margin-bottom: 20px;

  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;

  color: var(--muted);
  text-decoration: none;

  transition: color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.recipe-back-link:hover {
  color: var(--black);
  opacity: 1;
  transform: translateX(-1px);
}

.recipe-back-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
  border-radius: 8px;
}


/* =========================
   HEADER RECETA
========================= */

.recipe-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-bottom: 38px;
}

@media (min-width: 960px) {
  .recipe-top {
    grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
    gap: 40px;
    align-items: center;
  }
}

.recipe-top__text {
  min-width: 0;
}

.recipe-top__image {
  width: 100%;
  max-width: 520px;
  justify-self: center;
}

@media (min-width: 960px) {
  .recipe-top__image {
    justify-self: end;
  }
}


/* =========================
   TEXTO
========================= */

.recipe-title {
  font-family: var(--font-title);
  font-size: 42px;
  line-height: 1.05;
  margin: 0 0 14px;
  color: var(--black);
  letter-spacing: 0.2px;
  text-wrap: balance;
}

@media (min-width: 960px) {
  .recipe-title {
    font-size: 54px;
  }
}

.recipe-summary {
  font-size: 16px;
  line-height: 1.7;
  opacity: 0.9;
  margin: 0 0 18px;
  max-width: 680px;
}

.recipe-description-long {
  margin: 0;
  max-width: 100%;
}

.recipe-description-long p {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
}

.recipe-description-long p:last-child {
  margin-bottom: 0;
}


/* =========================
   VALORACIÓN
========================= */

.recipe-rating {
  margin: 22px 0 12px;
  padding: 18px 20px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 252, 245, 0.98),
    rgba(249, 243, 229, 0.94)
  );
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.05),
    0 1px 0 rgba(255, 255, 255, 0.72) inset;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    opacity 0.22s ease;
}

.recipe-rating:hover {
  transform: translateY(-1px);
  border-color: rgba(212, 175, 55, 0.26);
  box-shadow:
    0 16px 30px rgba(0, 0, 0, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.78) inset;
}

.recipe-rating.is-loading {
  opacity: 0.78;
  pointer-events: none;
}

.recipe-rating.voted {
  animation: recipeRatingPulse 0.45s ease;
}

@keyframes recipeRatingPulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.015);
  }
  100% {
    transform: scale(1);
  }
}

.recipe-rating__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.recipe-rating__heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recipe-rating__label {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  color: #2f261d;
}

.recipe-rating__hint {
  font-size: 12px;
  line-height: 1.3;
  color: #7b6d5f;
  letter-spacing: 0.2px;
}

.recipe-rating__stars {
  display: flex;
  align-items: center;
  gap: 6px;
}

.recipe-rating__star {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  color: #d7cec2;
  text-shadow: none;
  transition:
    transform 0.18s ease,
    color 0.18s ease,
    text-shadow 0.18s ease,
    opacity 0.18s ease;
}

.recipe-rating__star:hover {
  transform: translateY(-1px) scale(1.12);
}

.recipe-rating__star:focus-visible {
  outline: none;
  border-radius: 8px;
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.14);
}

.recipe-rating__star.is-hover,
.recipe-rating__star.is-active {
  color: #f2b01e;
  text-shadow:
    0 0 10px rgba(242, 176, 30, 0.18),
    0 2px 8px rgba(242, 176, 30, 0.22);
}

.recipe-rating__summary {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.recipe-rating__average {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.18);
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.03),
    0 1px 0 rgba(255, 255, 255, 0.72) inset;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  color: #2d241c;
}

.recipe-rating__count-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
  color: #5f5246;
}

.recipe-rating__count {
  font-weight: 700;
  color: #2f261d;
}

.recipe-rating__count-label {
  color: #6f6154;
}

.recipe-rating__message {
  margin: 10px 0 0;
  min-height: 20px;
  font-size: 13px;
  line-height: 1.5;
  color: #76685b;
}


/* =========================
   META
========================= */

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.recipe-meta--cats {
  margin-top: 18px;
  margin-bottom: 0;
}

.recipe-category-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;

  background: linear-gradient(
    135deg,
    rgba(212, 175, 55, 0.16),
    rgba(212, 175, 55, 0.08)
  );
  border: 1px solid rgba(212, 175, 55, 0.22);
  color: var(--gold-ink);

  font-size: 12px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  font-weight: 600;

  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.recipe-category-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.06);
  opacity: 0.95;
}

.recipe-meta--stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.recipe-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 10px 14px;
  border-radius: 999px;

  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.2px;

  background: linear-gradient(
    180deg,
    rgba(255, 253, 248, 0.98),
    rgba(250, 246, 238, 0.96)
  );
  color: var(--black);
  border: 1px solid rgba(212, 175, 55, 0.18);

  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.04),
    0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.recipe-stat--time,
.recipe-stat--servings,
.recipe-stat--difficulty,
.recipe-stat--easy,
.recipe-stat--medium,
.recipe-stat--hard {
  background: linear-gradient(
    180deg,
    rgba(255, 253, 248, 0.98),
    rgba(250, 246, 238, 0.96)
  );
  color: var(--black);
  border-color: rgba(212, 175, 55, 0.18);
}

.recipe-stat--easy,
.recipe-stat--medium,
.recipe-stat--hard {
  color: var(--gold-ink);
}


/* =========================
   ACCIONES RÁPIDAS
========================= */

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

.recipe-actions .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}


/* =========================
   IMAGEN
========================= */

.recipe-top__image {
  position: relative;
  border-radius: 24px;
  overflow: hidden;

  border: 1px solid rgba(0, 0, 0, 0.06);

  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.10),
    0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.recipe-image-tooltip {
  position: relative;
  display: block;
  width: 100%;
}

.recipe-heroimg {
  width: 100%;
  max-width: 100%;
  height: 380px;
  object-fit: cover;
  display: block;
}

.recipe-image-tooltip__text {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);

  width: max-content;
  max-width: calc(100% - 24px);

  padding: 8px 12px;
  border-radius: 8px;

  background: rgba(0, 0, 0, 0.82);
  color: #fff;

  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 5;

  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.recipe-image-tooltip:hover .recipe-image-tooltip__text,
.recipe-image-tooltip:focus-within .recipe-image-tooltip__text {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-2px);
}

@media (min-width: 960px) {
  .recipe-heroimg {
    height: 440px;
  }
}


/* =========================
   ANTES DE EMPEZAR / CONSEJOS
========================= */

.recipe-notes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 0 auto 30px;
}

@media (min-width: 960px) {
  .recipe-notes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    max-width: 100%;
  }
}

.recipe-notes__block {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98),
    rgba(250, 250, 250, 0.98)
  );

  border: 1px solid var(--border);
  border-radius: 22px;

  padding: 24px;

  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.06);
  width: 100%;
}

.recipe-notes__block h2 {
  font-family: var(--font-title);
  font-size: 28px;
  margin: 0 0 20px;
  color: var(--black);
}

.recipe-notes__list {
  list-style: none;
  padding: 0;
  margin: 0;

  display: grid;
  gap: 12px;
}

.recipe-notes__list li {
  position: relative;

  padding: 14px 14px 14px 44px;

  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;

  background: #fcfcfc;

  font-size: 14px;
  line-height: 1.6;
}

.recipe-notes__list li::before {
  content: "•";

  position: absolute;
  left: 18px;
  top: 12px;

  font-size: 20px;
  line-height: 1;
  color: var(--gold-ink);
}


/* =========================
   GRID INGREDIENTES / PASOS
========================= */

.recipe-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 0 auto;
}

@media (min-width: 960px) {
  .recipe-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    align-items: stretch;
  }
}


/* =========================
   BLOQUES
========================= */

.recipe-card-block {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98),
    rgba(250, 250, 250, 0.98)
  );

  border: 1px solid var(--border);
  border-radius: 22px;

  padding: 24px;

  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.06);
  width: 100%;
}

.recipe-card-block h2 {
  font-family: var(--font-title);
  font-size: 28px;
  margin: 0 0 20px;
  color: var(--black);
}

.recipe-card-block--seo {
  margin: 30px auto 0;
  max-width: 100%;
}

.recipe-card-block--seo .recipe-description-long {
  max-width: 860px;
}

.block-empty {
  margin: 0;
  opacity: 0.75;
  line-height: 1.7;
}


/* =========================
   INGREDIENTES
========================= */

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

  display: grid;
  gap: 12px;
}

.ingredients li {
  position: relative;

  padding: 14px 14px 14px 44px;

  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;

  background: #fcfcfc;

  font-size: 14px;
  line-height: 1.55;

  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ingredients li:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.04);
}

.ingredients li::before {
  content: "✓";

  position: absolute;
  left: 14px;
  top: 14px;

  width: 18px;
  height: 18px;

  border-radius: 6px;

  display: grid;
  place-items: center;

  font-size: 11px;
  font-weight: 700;

  background: rgba(212, 175, 55, 0.18);
  color: var(--gold-ink);
}


/* =========================
   PASOS
========================= */

.steps {
  list-style: none;
  padding: 0;
  margin: 0;

  counter-reset: step;

  display: grid;
  gap: 16px;
}

.steps li {
  counter-increment: step;

  position: relative;

  padding: 18px 18px 18px 78px;

  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 18px;

  background: #fcfcfc;

  font-size: 15px;
  line-height: 1.75;

  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.03);
}

.steps li::before {
  content: counter(step);

  position: absolute;
  left: 18px;
  top: 18px;

  width: 40px;
  height: 40px;

  border-radius: 14px;

  display: grid;
  place-items: center;

  font-family: var(--font-title);
  font-size: 19px;

  background: rgba(212, 175, 55, 0.18);
  color: var(--gold-ink);
}

.steps li::after {
  content: "";

  position: absolute;

  left: 60px;
  top: 20px;
  bottom: 20px;

  width: 2px;

  background: linear-gradient(
    to bottom,
    rgba(212, 175, 55, 0.30),
    rgba(212, 175, 55, 0.08)
  );

  border-radius: 2px;
}


/* =========================
   PAGINACIÓN ENTRE RECETAS
========================= */

.recipe-pagination {
  margin: 26px auto 18px;
  padding-top: 14px;

  border-top: 1px solid rgba(212, 175, 55, 0.12);

  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;

  max-width: 860px;
}

.recipe-pagination__link {
  position: relative;

  display: flex;
  flex-direction: column;
  gap: 5px;

  width: 100%;
  min-width: 0;

  padding: 12px 14px 14px;
  border-radius: 16px;
  text-decoration: none;

  background: linear-gradient(
    180deg,
    rgba(255, 252, 245, 0.98),
    rgba(249, 243, 229, 0.94)
  );

  border: 1px solid rgba(212, 175, 55, 0.18);

  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.04),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;

  overflow: hidden;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease;
}

.recipe-pagination__link::before {
  content: "";

  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;

  height: 2px;
  border-radius: 999px;

  background: linear-gradient(
    90deg,
    rgba(212, 175, 55, 0.08),
    rgba(212, 175, 55, 0.45),
    rgba(212, 175, 55, 0.08)
  );
}

.recipe-pagination__link:hover {
  transform: translateY(-1px);
  border-color: rgba(212, 175, 55, 0.26);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.recipe-pagination__link:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(212, 175, 55, 0.12),
    0 12px 24px rgba(0, 0, 0, 0.06);
}

.recipe-pagination__label {
  position: relative;
  z-index: 1;

  display: inline-flex;
  align-items: center;

  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.15px;
  text-transform: uppercase;
  color: var(--gold-ink);
  opacity: 0.9;
}

.recipe-pagination__title {
  position: relative;
  z-index: 1;

  font-size: 15px;
  line-height: 1.28;
  color: var(--black);
  text-wrap: balance;
}

.recipe-pagination__link--prev {
  text-align: left;
  align-items: flex-start;
}

.recipe-pagination__link--next {
  text-align: right;
  align-items: flex-end;
}

@media (min-width: 760px) {
  .recipe-pagination {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .recipe-pagination__link {
    min-height: 74px;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .recipe-pagination {
    gap: 8px;
  }

  .recipe-pagination__link {
    padding: 12px 13px 13px;
    border-radius: 14px;
  }

  .recipe-pagination__title {
    font-size: 15px;
    line-height: 1.26;
  }

  .recipe-pagination__link--next {
    text-align: left;
    align-items: flex-start;
  }
}


/* =========================
   RELACIONADAS
========================= */

.recipe-related {
  margin-top: 46px;
}

.recipe-related__title {
  font-family: var(--font-title);
  font-size: 32px;
  margin: 0 0 20px;
  color: var(--black);
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 960px) {
  .recipe-wrap {
    padding: 40px 0 60px;
  }

  .recipe-title {
    font-size: 36px;
  }

  .recipe-heroimg {
    height: 300px;
  }
}

@media (max-width: 640px) {
  .recipe-title {
    font-size: 30px;
  }

  .recipe-summary {
    font-size: 15px;
  }

  .recipe-description-long p {
    font-size: 15px;
  }

  .recipe-rating {
    padding: 16px 16px;
    border-radius: 16px;
  }

  .recipe-rating__top {
    align-items: flex-start;
    gap: 12px;
  }

  .recipe-rating__label {
    font-size: 15px;
  }

  .recipe-rating__hint {
    font-size: 11px;
  }

  .recipe-rating__stars {
    gap: 4px;
  }

  .recipe-rating__star {
    font-size: 30px;
  }

  .recipe-rating__average {
    min-width: 58px;
    min-height: 36px;
    font-size: 18px;
    padding: 7px 12px;
  }

  .recipe-rating__count-wrap {
    font-size: 13px;
  }

  .recipe-rating__message {
    font-size: 12px;
  }

  .recipe-actions {
    gap: 10px;
  }

  .recipe-actions .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .recipe-heroimg {
    height: 240px;
  }

  .recipe-image-tooltip__text {
    bottom: 10px;
    max-width: calc(100% - 16px);
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 7px;
  }

  .recipe-notes__block {
    padding: 20px;
  }

  .recipe-notes__block h2 {
    font-size: 24px;
  }

  .recipe-card-block {
    padding: 20px;
  }

  .recipe-card-block h2 {
    font-size: 24px;
  }

  .steps li {
    font-size: 14px;
    padding: 16px 16px 16px 70px;
  }

  .steps li::before {
    width: 36px;
    height: 36px;
    font-size: 17px;
  }

  .steps li::after {
    left: 56px;
  }

  .recipe-category-pill,
  .recipe-stat {
    font-size: 13px;
  }

  .recipe-category-pill {
    padding: 7px 12px;
  }

  .recipe-stat {
    padding: 9px 12px;
  }
}


/* =========================
   REDUCCIÓN DE MOVIMIENTO
========================= */

@media (prefers-reduced-motion: reduce) {
  .recipe-back-link,
  .ingredients li,
  .recipe-pagination__link,
  .recipe-category-pill,
  .recipe-image-tooltip__text,
  .recipe-rating,
  .recipe-rating__star {
    transition: none;
  }

  .recipe-back-link:hover,
  .ingredients li:hover,
  .recipe-category-pill:hover,
  .recipe-rating:hover,
  .recipe-rating__star:hover {
    transform: none;
  }

  .recipe-image-tooltip:hover .recipe-image-tooltip__text,
  .recipe-image-tooltip:focus-within .recipe-image-tooltip__text {
    transform: translateX(-50%);
  }

  .recipe-rating.voted {
    animation: none;
  }
}