/* Structured cooking steps (recipe show page) + full-screen cooking mode. */

/* ---- Steps on the recipe page --------------------------------------- */

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

.recipe-step {
  counter-increment: recipe-step;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 1rem 3rem;
  position: relative;
  border-bottom: 1px solid var(--neutral-colour);
}

.recipe-step::before {
  content: counter(recipe-step);
  position: absolute;
  left: 0;
  top: 1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary-colour);
  color: var(--white);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recipe-step__instruction { line-height: 1.5; }

.recipe-step__timer {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--secondary-colour);
}

.recipe-step__ingredients {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.recipe-step__components {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.recipe-step__components-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.recipe-step__component-chip {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-colour);
  background: var(--neutral-colour);
  border-radius: 1rem;
}

/* ---- Full-screen cooking mode --------------------------------------- */

.cooking-body { margin: 0; background: var(--background-colour); }

.ck {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.ck-empty {
  max-width: 32rem;
  margin: 4rem auto;
  text-align: center;
  padding: 1rem;
}

.ck-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.ck-exit {
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  color: var(--text-colour);
  padding: 0.25rem 0.5rem;
}
.ck-exit:hover { color: var(--primary-colour); }

.ck-title {
  flex: 1;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ck-servings { display: flex; align-items: center; gap: 0.5rem; }
.ck-servings label { font-weight: 700; font-size: 0.9rem; }
.ck-servings-input { width: 4rem; text-align: center; }

.ck-progress { height: 6px; background: var(--neutral-colour); }
.ck-progress-bar {
  height: 100%;
  width: 0;
  background: var(--primary-colour);
  transition: width 0.3s ease;
}

/* Finished-timer alerts: a floating stack pinned below the bar, always visible. */
.ck-alerts {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 1rem;
}
.ck-alerts:not(:empty) { padding: 0.75rem 1rem; }

.ck-alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--secondary-colour);
  color: var(--white);
  box-shadow: var(--shadow-md);
  animation: ck-alert-pulse 1.2s ease-in-out infinite;
}
.ck-alert-text { flex: 1; font-weight: 700; }

/* Solid, high-contrast buttons on the coloured alert banner. */
.ck-alert .btn {
  background: var(--white);
  color: var(--text-colour);
  border: 1px solid var(--white);
}
.ck-alert .btn:hover {
  background: var(--neutral-colour);
  border-color: var(--neutral-colour);
  color: var(--text-colour);
}

@keyframes ck-alert-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.78; }
}

@media (prefers-reduced-motion: reduce) {
  .ck-alert { animation: none; }
}

.ck-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.ck-step {
  max-width: 40rem;
  width: 100%;
  text-align: center;
}

.ck-step-num {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-colour);
}
.ck-step-total { color: var(--text-secondary); font-weight: 400; }

.ck-step-component {
  margin-top: 0.25rem;
  font-style: italic;
  color: var(--text-secondary);
}

.ck-step-component-eyebrow {
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--primary-colour);
  margin-right: 0.3rem;
}

.ck-step-text {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  line-height: 1.4;
  margin: 1rem 0;
}

/* simple_format wraps each paragraph in <p>; keep our own spacing instead of
   the browser default so multi-paragraph instructions read cleanly. */
.ck-step-text p { margin: 0; }
.ck-step-text p + p { margin-top: 0.75em; }

.ck-step-components {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin: 1rem auto 0;
  max-width: 28rem;
}

.ck-step-component-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.ck-step-components-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.ck-step-component-chip {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  background: var(--primary-colour);
  border-radius: 1rem;
}

.ck-step-ingredients {
  list-style: none;
  margin: 1.5rem auto 0;
  padding: 1rem;
  max-width: 28rem;
  background: var(--white);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-sm);
}
.ck-step-ingredients { text-align: left; }
.ck-step-ingredients li { padding: 0.35rem 0; font-size: 1.1rem; }
.ck-step-ingredients li + li { border-top: 1px solid var(--neutral-colour); }

.ck-ingredient-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}
.ck-ingredient-check {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  accent-color: var(--primary-colour);
}
.ck-step-ingredient.is-checked .ck-ingredient-text {
  text-decoration: line-through;
  opacity: 0.55;
}
.ck-ingredient-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ck-ingredient-note {
  margin-top: 0.15rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.ck-timer { margin-top: 1.5rem; }
.ck-timer-display {
  margin-left: 0.75rem;
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--secondary-colour);
}

.ck-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}
.ck-nav-btn { min-width: 6rem; }
.ck-counter { font-weight: 700; font-variant-numeric: tabular-nums; }

.ck-done {
  max-width: 40rem;
  width: 100%;
  padding: 2rem;
  text-align: center;
}
.ck-done h2 { margin-top: 0; }
