/* =========================
   SAFETY RESET
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Prevent horizontal scroll globally (recipe page only) */
.recipe-page {
  overflow-x: hidden;
}

/* =========================
   TOP CONTROLS
========================= */
.recipe-page .back-link {
  display: inline-block;
  margin: 20px;
  font-size: 0.95rem;
}

.recipe-page .recipe-title {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 30px;
}

/* =========================
   MAIN GRID (DESKTOP)
========================= */
.recipe-page .recipe-grid {
  display: grid;

  /* 🔒 SAFE FRACTIONS — no % math overflow */
  grid-template-columns: 3fr 3fr 4fr;

  gap: 24px;

  /* 🔒 MAX WIDTH CONSTRAINT */
  max-width: 1200px;
  margin: 0 auto;

  padding: 0 24px;
  align-items: start;
}

/* =========================
   CONTENT BOXES
========================= */
.recipe-page .recipe-box {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
}

/* =========================
   IMAGE (CHEF)
========================= */
.recipe-page .recipe-image {
  display: flex;
  justify-content: center;
  align-items: flex-start; /* 🔑 prevents vertical clipping */
}

.recipe-page .recipe-image img {
  width: 100%;
  height: auto;            /* 🔑 never force height */
  max-height: 420px;       /* desktop-safe cap */
  object-fit: contain;     /* 🔑 prevents crop */
  border-radius: 12px;
  display: block;
}

/* =========================
   VIDEO (FULL WIDTH)
========================= */
.recipe-page .recipe-video {
  max-width: 1200px;
  margin: 50px auto;
  padding: 0 24px;
}

.recipe-page .recipe-video iframe {
  width: 100%;
  height: 480px;
  border-radius: 12px;
  border: none;
}

/* =========================
   MOBILE & TABLET
========================= */
@media (max-width: 992px) {

  /* Stack layout */
  .recipe-page .recipe-grid {
    grid-template-columns: 1fr;
    padding: 0 16px;
  }

  /* Image smaller but intact */
  .recipe-page .recipe-image img {
    max-height: 300px;
  }

  /* Video scaling */
  .recipe-page .recipe-video iframe {
    height: 280px;
  }

  .recipe-page .recipe-title {
    font-size: 1.8rem;
  }
}
