/* Guided cooking is an optional layer on the existing recipe page. */
.guided-controls {
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 18px 0 0;
  padding: 8px clamp(20px, 4vw, 40px) 12px;
  border: 0;
  background: transparent;
}
.guided-controls[hidden], .guided-exit[hidden] { display: none; }
.guided-pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: min(100%, 430px);
}
.guided-count[hidden] { display: none; }
.guided-count {
  color: var(--muted);
  font: 20px/1.2 var(--hand);
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}
.guided-controls .quiet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 16px/1.25 var(--sans);
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
.guided-controls .guided-previous { justify-self: start; }
.guided-controls .guided-next { justify-self: end; }
.guided-controls .ui-icon { width: 22px; height: 22px; }
.guided-controls .ui-icon--flip-x { display: inline-flex; transform: scaleX(-1); }
.guided-controls .quiet:not(:disabled):hover { color: var(--brick); }
.guided-controls .quiet:disabled { opacity: .45; cursor: default; }
.guided-controls .quiet:focus-visible { outline: 2px solid var(--brick); outline-offset: 3px; }
.method-heading h2[tabindex="-1"]:focus { outline: none; }

body.guided-on .cooking-layout { grid-template-columns: minmax(0, 1fr); }
body.guided-on .cooking-layout > aside { display: none; }
body.guided-on .cooking-layout > .method { grid-column: 1; width: min(100%, 880px); margin-inline: auto; overflow-x: clip; }
body.guided-on .method > :is(section,aside):not(.guided-stage) { display:none; }
body.guided-on .method > .recipe-timing-summary { display:none; }
.method > .guided-stage[hidden] { display:none; }
body.guided-on .method > .guided-stage {
  position: relative;
  margin-top: 28px;
  border: 0;
  background: transparent;
  overflow: visible;
  isolation: isolate;
}
body.guided-on .method .guided-stage ol {
  display: grid;
  min-height: 360px;
  padding: 12px 14px calc(30px + var(--stack-size)*4px);
  box-sizing: border-box;
}
body.guided-on .method .guided-stage ol > li {
  --guided-card: #f8eedc;
  grid-area: 1 / 1;
  align-self: stretch;
  visibility: hidden;
  pointer-events: none;
  box-sizing: border-box;
  padding: clamp(28px, 4vw, 40px);
  border: 0;
  background-color: var(--guided-card);
  background-image: url('/assets/menu-soft-paper.png');
  background-position: center;
  background-size: cover;
  background-blend-mode: multiply;
  transform-origin: 50% 80%;
}
body.guided-on .method .guided-stage ol > li:nth-child(6n+1) { --guided-card: #f7ead7; }
body.guided-on .method .guided-stage ol > li:nth-child(6n+2) { --guided-card: #f7eee1; }
body.guided-on .method .guided-stage ol > li:nth-child(6n+3) { --guided-card: #eef1e7; }
body.guided-on .method .guided-stage ol > li:nth-child(6n+4) { --guided-card: #f8eae2; }
body.guided-on .method .guided-stage ol > li:nth-child(6n+5) { --guided-card: #f2eee0; }
body.guided-on .method .guided-stage ol > li.guided-current { visibility: visible; pointer-events: auto; }
body.guided-on .method .guided-stage ol > li.guided-under { visibility: visible; pointer-events: none; }
body.guided-on .method .guided-stage ol > li.guided-under > * { visibility: hidden; }
body.guided-on .method .guided-stage ol > li::before { content: none !important; display: none !important; }
body.guided-on .method .guided-stage li p { font-size: 18px; line-height: 1.65; }

.guided-welcome[hidden] { display: none; }
.method.guided-intro > .guided-stage ol { visibility: hidden; }
.guided-welcome {
  box-sizing: border-box;
  position: absolute;
  z-index: 1;
  inset: 12px 14px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border: 0;
  background: #f8eedc url('/assets/menu-soft-paper.png') center / cover;
  text-align: center;
}
.guided-welcome > img { width: 48px; height: 60px; object-fit: contain; }
.guided-welcome-eyebrow { margin: 10px 0 6px; color: var(--brick); font: 16px/1.2 var(--hand); letter-spacing: .1em; text-transform: uppercase; }
.guided-welcome h3 { max-width: 22ch; margin: 0; font: 30px/1.15 var(--serif); }
.guided-overview-times { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: min(100%, 440px); margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.guided-overview-times > div { min-width: 0; }
.guided-overview-times dt { margin-bottom: 4px; color: var(--brick); font: 15px/1.2 var(--hand); letter-spacing: .08em; text-transform: uppercase; }
.guided-overview-times dd { margin: 0; color: var(--ink); font: 14px/1.35 var(--sans); }
.guided-welcome-signature { margin: 16px 0 0; color: var(--brick); font: 18px/1.2 var(--hand); text-transform: uppercase; }

.guided-step-context { display: none; }
body.guided-on .guided-step-context { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; margin-top: 22px; }
.guided-step-time { display: inline-flex; align-items: center; gap: 7px; padding: 0 0 5px; border-bottom: 1px solid var(--brick); color: var(--burgundy); font: 16px/1.3 var(--hand); letter-spacing: .04em; text-transform: uppercase; }
.guided-step-time img { width: 18px; height: 18px; }
body.guided-on .method li .guided-step-reminder {
  box-sizing: border-box;
  width: min(100%, 490px);
  margin: 0;
  padding: 17px 20px 19px;
  border: 0;
  background-color: #f7f0e2;
  background-image: url('/assets/menu-soft-paper.png');
  background-position: center;
  background-size: cover;
  background-blend-mode: multiply;
  color: var(--ink);
  font: 14px/1.55 var(--sans);
}
body.guided-on .method li .guided-step-reminder[data-paper="lined"] {
  background-image: repeating-linear-gradient(to bottom, transparent 0 30px, rgba(101, 105, 111, .16) 30px 31px), url('/assets/menu-soft-paper.png');
  background-position: 0 9px, center;
  background-size: auto, cover;
  background-blend-mode: normal, multiply;
}
body.guided-on .method li .guided-step-reminder[data-note-kind="tip"] {
  background-color: #f6e8e0;
}
.guided-step-reminder strong { display: block; margin-bottom: 9px; color: var(--brick); font: 14px/1.2 var(--hand); letter-spacing: .08em; text-transform: uppercase; }
.guided-step-reminder[data-note-kind="tip"] strong::before { content: '✳'; margin-right: 8px; font-family: var(--sans); font-size: 12px; }

.guided-amounts { display: none; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
body.guided-on .guided-amounts { display: flex; }
.guided-amounts[hidden] { display: none !important; }
.guided-amounts-label {
  width: 100%;
  margin-bottom: 2px;
  color: var(--brick);
  font: 16px/1.2 var(--hand);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.guided-amounts-item {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 5px 9px;
  background: var(--wheat);
  color: var(--ink);
  font: 14px/1.35 var(--sans);
  overflow-wrap: anywhere;
}
.guided-amounts-item strong { font-weight: 600; }

.guided-finish[hidden] { display: none; }
.guided-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.guided-confetti span { position: absolute; top: 43%; left: 50%; width: 7px; height: 12px; opacity: 0; background: var(--brick); }
.guided-confetti span:nth-child(3n) { width: 8px; height: 8px; border-radius: 50%; background: var(--tag-blue); }
.guided-confetti span:nth-child(3n + 2) { background: var(--burgundy); }
.guided-finish {
  box-sizing: border-box;
  position: absolute;
  z-index: 30;
  inset: 12px 14px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 0;
  background: #f8eedc url('/assets/menu-soft-paper.png') center / cover;
  text-align: center;
}
.guided-finish img { width: 56px; height: 72px; object-fit: contain; }
.guided-finish-spark { position: absolute; top: 16px; right: 22%; color: var(--brick); font-size: 23px; }
.guided-finish-eyebrow { margin: 12px 0 6px; color: var(--brick); font-size: 17px; letter-spacing: .08em; text-transform: uppercase; }
.guided-finish h3 { margin: 0; font: 32px/1.15 var(--serif); }
.guided-finish-share { max-width: 40ch; margin: 18px 0 0; color: var(--ink); font: 14px/1.5 var(--sans); }
.guided-finish-share a { color: var(--brick); text-decoration: underline; text-underline-offset: 3px; }
.guided-finish-share a:focus-visible { outline: 2px solid var(--brick); outline-offset: 3px; }
.guided-finish:not([hidden]) img { animation: guided-stamp 650ms cubic-bezier(.2, .8, .3, 1) both; }
.guided-finish:not([hidden]) .guided-finish-spark { animation: guided-spark 750ms ease-out 120ms both; }
.guided-finish:not([hidden]) .guided-confetti span { animation: guided-burst 1s ease-out var(--burst-delay) both; }
.guided-finish:not([hidden]) :is(.guided-finish-eyebrow, h3, .guided-finish-share) { animation: guided-arrive 450ms ease-out 160ms both; }
@keyframes guided-stamp { from { opacity: 0; transform: translateY(-16px) rotate(-10deg) scale(1.2); } 65% { opacity: 1; transform: translateY(3px) rotate(3deg) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes guided-spark { from { opacity: 0; transform: scale(.3) rotate(-50deg); } 55% { opacity: 1; transform: scale(1.25) rotate(12deg); } to { opacity: 1; transform: none; } }
@keyframes guided-arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes guided-burst { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) translate(var(--burst-x), var(--burst-y)) rotate(var(--burst-turn)); } }

@media (max-width: 700px) {
  body.guided-on .method > .guided-stage { margin-top: 20px; }
  body.guided-on .method .guided-stage ol { min-height: 440px; padding: 10px 10px calc(24px + var(--stack-size)*4px); }
  body.guided-on .method .guided-stage ol > li { padding: 28px 20px 34px; }
  body.guided-on .method .guided-stage li p { font-size: 16px; line-height: 1.7; }
  .guided-welcome { inset: 10px 10px 22px; padding: 16px; }
  .guided-welcome h3 { font-size: 25px; }
  .guided-overview-times { gap: 6px; margin-top: 18px; padding-top: 14px; }
  .guided-overview-times dt { font-size: 13px; }
  .guided-overview-times dd { font-size: 13px; }
  .guided-step-time { font-size: 15px; }
  .guided-amounts { gap: 10px; margin-top: 30px; }
  .guided-amounts-label { font-size: 15px; }
  .guided-amounts-item { max-width: 100%; }
  .guided-controls { padding: 12px 20px 18px; }
  .guided-pager { gap: 6px; }
  .guided-controls .quiet { gap: 4px; font-size: 15px; }
  .guided-controls .ui-icon { width: 19px; height: 19px; }
  .guided-count { font-size: 18px; }
  .guided-finish { inset: 10px 10px 22px; }
  .guided-finish h3 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .guided-finish:not([hidden]) :is(img, .guided-finish-spark, .guided-finish-eyebrow, h3, .guided-finish-share, .guided-confetti span) { animation: none; }
}
@media print {
  .guided-controls, .guided-stage { display: none !important; }
  body.guided-on .cooking-layout > aside { display: block !important; }
  body.guided-on .cooking-layout > .method { width: auto; margin: 0; overflow: visible; }
  body.guided-on .method > :is(section,aside):not(.guided-stage) { display:block !important; }
  body.guided-on .method > .recipe-timing-summary { display:grid !important; }
}
