/* The four cooking sliders and their sample recipe (cooking-sliders.js). Owner note, November 8.
   One colour per slider, used three ways: the thumb, the pencil highlight under the slider's name, and the
   highlight under the matching word in the recipe. Every highlight sits under a word, never alone. */
/* taste-gate: allow T7 because these are Frank's hard-stop pencil highlights under a word (the same idiom as the cookware group headings) and one tick on the slider track, not a gradient wash on a surface. */
/* taste-gate: allow T12 because the owner asked for a small sample-recipe icon: the glyph sits in a 44px button on touch, and 36px applies only to a fine pointer on desktop per FRANK-DESIGN's desktop density rule. */
.cook-style-stage {
  --axis-technique: #2f6b52; --axis-spice: #a93628; --axis-ingredients: #b97c12; --axis-cleanup: #4a6f93;
  --surface: var(--white);
  display: grid; gap: 20px; min-width: 0; padding-top: 6px;
}
.cook-style-stage [data-axis="technique"] { --axis: var(--axis-technique); }
.cook-style-stage [data-axis="spice"] { --axis: var(--axis-spice); }
.cook-style-stage [data-axis="ingredients"] { --axis: var(--axis-ingredients); }
.cook-style-stage [data-axis="cleanup"] { --axis: var(--axis-cleanup); }
.axis-mark { background: linear-gradient(transparent 68%, color-mix(in srgb, var(--axis) 34%, var(--surface)) 68%); padding: 0 2px; margin: 0 -2px; }

.cook-style-stage .cook-sliders { display: grid; gap: 26px; min-width: 0; align-content: start; }
.cook-style-stage .cook-sliders-head { position: sticky; top: 58px; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -4px -8px; padding: 6px 4px; background: var(--surface); }
#app .cook-style-stage .cook-sliders-head h3 { margin: 0; font: normal 22px/1.2 Georgia, serif; color: var(--ink); }
#app .sample-recipe-button { flex: none; display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 1px solid var(--wheat-line); border-radius: 50%; background: var(--wheat); color: var(--ink); cursor: pointer; }
#app .sample-recipe-button svg { width: 22px; height: 22px; }
#app .sample-recipe-button:hover { background: var(--ochre); }
#app .sample-recipe-button[aria-expanded="true"] { background: var(--green); border-color: var(--green); color: var(--white); }
#app .sample-recipe-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.cook-style-stage .cook-slider { display: grid; gap: 2px; min-width: 0; }
#app .cook-style-stage .cook-slider > label { margin: 0; font-weight: 700; font-size: 16px; justify-self: start; }
.cook-style-stage .cook-slider-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 10px; align-items: center; }
.cook-style-stage .cook-slider-endwrap { position: relative; display: block; width: 48px; height: 48px; }
#app .cook-style-stage .cook-slider-end { display: grid; place-items: center; width: 48px; height: 48px; min-height: 48px; padding: 0; border: 1px solid transparent; border-radius: 12px; background: color-mix(in srgb, var(--axis) 14%, var(--surface)); cursor: pointer; }
#app .cook-style-stage .cook-slider-end:hover, #app .cook-style-stage .cook-slider-end[aria-expanded="true"] { border-color: var(--axis); }
#app .cook-style-stage .cook-slider-end:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cook-style-stage .cook-slider-icon { width: 40px; height: 40px; object-fit: contain; pointer-events: none; }
.cook-style-stage .cook-slider-tip { pointer-events: none; /* a tap on whatever it covers goes through, and closes it */ position: absolute; z-index: 8; bottom: calc(100% + 9px); box-sizing: border-box; width: max-content; max-width: min(300px, calc(100vw - 48px)); padding: 10px 12px; border: 1px solid var(--ink); border-radius: 10px; background: var(--white); color: var(--ink); font: italic 15px/1.4 Georgia, serif; box-shadow: 0 4px 10px rgb(36 57 48 / .16); }
.cook-style-stage .cook-slider-tip[hidden] { display: none; }
.cook-style-stage .cook-slider-tip[data-side="low"] { left: 0; }
.cook-style-stage .cook-slider-tip[data-side="high"] { right: 0; }
.cook-style-stage .cook-slider-tip::after { content: ""; position: absolute; top: 100%; width: 10px; height: 10px; margin-top: -5px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: var(--white); transform: rotate(45deg); }
.cook-style-stage .cook-slider-tip[data-side="low"]::after { left: 18px; }
.cook-style-stage .cook-slider-tip[data-side="high"]::after { right: 18px; }

/* A neutral track with one tick at the middle: these are leanings, not amounts, so nothing fills. */
#app .cook-style-stage .cook-slider input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; min-height: 44px; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
#app .cook-style-stage .cook-slider input[type=range]:focus { outline: none; box-shadow: none; }
.cook-style-stage .cook-slider input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, transparent calc(50% - 1px), var(--muted) calc(50% - 1px), var(--muted) calc(50% + 1px), transparent calc(50% + 1px)) center / 100% 14px no-repeat, var(--line); }
.cook-style-stage .cook-slider input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, transparent calc(50% - 1px), var(--muted) calc(50% - 1px), var(--muted) calc(50% + 1px), transparent calc(50% + 1px)) center / 100% 14px no-repeat, var(--line); }
.cook-style-stage .cook-slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border: 3px solid var(--white); border-radius: 50%; background: var(--axis); box-shadow: 0 0 0 1px var(--axis), 0 2px 5px rgb(36 57 48 / .25); }
.cook-style-stage .cook-slider input[type=range]::-moz-range-thumb { box-sizing: border-box; width: 28px; height: 28px; border: 3px solid var(--white); border-radius: 50%; background: var(--axis); box-shadow: 0 0 0 1px var(--axis), 0 2px 5px rgb(36 57 48 / .25); }
.cook-style-stage .cook-slider input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--axis), 0 0 0 4px var(--white), 0 0 0 6px var(--focus); }
.cook-style-stage .cook-slider input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 1px var(--axis), 0 0 0 4px var(--white), 0 0 0 6px var(--focus); }
.cook-style-stage .cook-slider-value { margin: 0; min-height: 21px; padding: 0 58px; text-align: center; color: var(--muted); font: italic 15px/1.4 Georgia, serif; }

/* The sample: beside the sliders when there is room, a short sheet at the bottom of the screen on a phone.
   Either way the sliders stay in reach, and the recipe changes as they move. */
.sample-recipe { box-sizing: border-box; min-width: 0; padding: 16px 18px 18px; border: 1px solid var(--line); border-radius: var(--panel-radius); background: var(--white); color: var(--ink); overscroll-behavior: contain; }
.sample-recipe[hidden] { display: none; }
.sample-recipe-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sample-recipe-kicker { margin: 0 0 2px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
#app .sample-recipe h3 { margin: 0; font: normal 22px/1.2 Georgia, serif; color: var(--green); outline: none; text-wrap: balance; }
.sample-recipe-meta { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
#app .sample-recipe-close { flex: none; display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; margin: -8px -10px 0 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
#app .sample-recipe-close svg { width: 18px; height: 18px; }
#app .sample-recipe-close:hover { background: var(--sage); }
#app .sample-recipe-close:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.sample-recipe-axes { display: grid; gap: 5px; margin: 14px 0 10px; padding: 0; list-style: none; font-size: 14px; line-height: 1.35; }
.sample-recipe-axes .axis-mark { font-weight: 700; }
.sample-recipe-note { margin: 0 0 4px; font: italic 15px/1.45 Georgia, serif; color: var(--ink); }
#app .sample-recipe h4 { margin: 16px 0 6px; font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1.2; letter-spacing: .02em; color: var(--ink); }
.sample-recipe-list, .sample-recipe-steps { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.45; }
.sample-recipe-list li, .sample-recipe-steps li { margin: 0 0 5px; }
.sample-recipe-steps li { margin-bottom: 9px; }
.axis-tag { display: block; width: max-content; margin: 0 0 1px; font-size: 12px; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.sample-recipe-list { list-style: none; padding-left: 0; }
.sample-recipe-list li { padding-left: 12px; border-left: 3px solid transparent; }
.sample-recipe-list li.from-axis { border-left-color: color-mix(in srgb, var(--axis) 55%, var(--white)); margin-bottom: 0; padding-bottom: 5px; }
.sample-recipe-list li.from-axis .axis-tag { margin-top: 2px; }
.sample-recipe-wash { margin: 12px 0 0; font-size: 14px; }
.sample-recipe-wash .axis-mark { font-weight: 700; }
.sample-recipe-disclaimer { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.4; }

@media (min-width: 860px) {
  .cook-style-stage.has-sample { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); column-gap: 26px; align-items: start; }
  .cook-style-stage.has-sample .sample-recipe { position: sticky; top: 76px; max-height: calc(100dvh - 100px); overflow: auto; }
  .cook-style-stage.has-sample .cook-slider-value { padding: 0 8px; }
}
@media (max-width: 859px) {
  .sample-recipe { position: sticky; bottom: 0; z-index: 7; max-height: 46dvh; overflow: auto; margin: 0 -8px; border-radius: 12px 12px 0 0; border-bottom: 0; box-shadow: 0 -6px 12px rgb(36 57 48 / .18); padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}
@media (max-width: 700px) {
  .cook-style-stage { --surface: var(--paper); }
  .cook-style-stage .cook-sliders-head { top: 118px; }
  .cook-style-stage .cook-slider-value { padding: 0 8px; }
}
@media (hover: hover) and (pointer: fine) and (min-width: 701px) {
  #app .sample-recipe-button { width: 36px; height: 36px; min-height: 36px; }
  #app .sample-recipe-button svg { width: 19px; height: 19px; }
}
@media (forced-colors: active) {
  .cook-style-stage .cook-slider-end, .sample-recipe-button { border-color: ButtonText !important; }
  .axis-mark { background: none; text-decoration: underline; }
  .cook-style-stage .cook-slider input[type=range]::-webkit-slider-thumb { background: Highlight; border-color: Canvas; }
  .cook-style-stage .cook-slider input[type=range]::-moz-range-thumb { background: Highlight; border-color: Canvas; }
}
.cook-style-stage .visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
