/* Recipe post template: section headings, ingredients, steps, and tools. */
.recipe-post .post-layout {
  align-items: start;
}
.recipe-post .post-kicker {
  justify-content: center;
  text-align: center;
}
.recipe-post .post-aside {
  position: sticky;
  top: 28px;
}
.recipe-post .post-content {
  font-size: 18px;
}
.recipe-content .recipe-section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 0;
  padding-top: 0;
  margin: 74px 0 22px;
  font-size: clamp(34px, 4vw, 52px);
  letter-spacing: -0.075em;
}
.recipe-content .recipe-section-heading::before {
  content: "";
  display: block;
  width: 34px;
  height: 7px;
  background: var(--accent);
  border-radius: 99px;
}
.recipe-content .recipe-section-heading::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
  margin-left: 8px;
}
.recipe-content .recipe-ingredients,
.recipe-content .recipe-method {
  padding: 0;
  margin: 0;
  list-style: none;
}
.recipe-content .recipe-ingredients li,
.recipe-content .recipe-method li {
  position: relative;
  margin: 0;
  padding: 17px 18px 17px 48px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}
.recipe-content .recipe-ingredients li:first-child,
.recipe-content .recipe-method li:first-child {
  border-top: 1px solid var(--line);
}
.recipe-content .recipe-ingredients li::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 20px;
  width: 17px;
  height: 17px;
  border: 1px solid var(--muted);
  border-radius: 50%;
  background: var(--paper);
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}
.recipe-content .recipe-ingredients li::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 24px;
  width: 7px;
  height: 4px;
  border-left: 2px solid var(--paper);
  border-bottom: 2px solid var(--paper);
  transform: rotate(-45deg) scale(0);
  transition: transform 0.2s ease;
}
.recipe-content .recipe-ingredients li.ingredient-checked {
  color: var(--muted);
  text-decoration: none;
  background: rgba(28, 28, 26, 0.035);
}
.recipe-content .recipe-ingredients li.ingredient-checked::before {
  background: var(--accent);
  border-color: var(--accent);
}
.recipe-content .recipe-ingredients li.ingredient-checked::after {
  transform: rotate(-45deg) scale(1);
}
.recipe-content .recipe-method {
  counter-reset: recipe-step;
}
.recipe-content .recipe-method li {
  counter-increment: recipe-step;
  padding-left: 58px;
  cursor: default;
}
.recipe-content .recipe-notes {
  margin: 24px 0 0;
  padding: 23px 26px;
  color: var(--ink);
  background: #e8dfd2;
  border: 0;
  border-left: 4px solid var(--accent);
  font-size: 17px;
}
.recipe-content ul.recipe-notes,
.recipe-content ol.recipe-notes {
  padding-left: 44px;
}
.recipe-post .recipe-tools,
.recipe-post .share-block {
  padding-top: 17px;
}
.recipe-post .recipe-tools .tool-link,
.recipe-post .share-block a,
.recipe-post .share-block button {
  width: 100%;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.recipe-post .recipe-tools .tool-link:hover,
.recipe-post .share-block a:hover,
.recipe-post .share-block button:hover {
  color: var(--accent);
}
@media (max-width: 800px) {
  .recipe-post .post-aside {
    position: static;
  }
  .recipe-content .recipe-section-heading {
    margin-top: 54px;
  }
  .recipe-post .post-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
  }
  .recipe-post .recipe-tools,
  .recipe-post .share-block {
    margin-bottom: 0;
  }
}
.is-dark .recipe-content .recipe-notes {
  background: #302d29;
  color: var(--ink);
}
.recipe-post .post-comments {
  max-width: 680px;
  margin-inline: auto;
}
@media (max-width: 500px) {
  .recipe-post .post-aside {
    display: block;
  }
  .recipe-content .recipe-section-heading {
    font-size: 35px;
  }
  .recipe-content .recipe-ingredients li,
  .recipe-content .recipe-method li {
    padding-top: 14px;
    padding-bottom: 14px;
  }
}

/* ---------------------------------------------------------------------------
   Editorial layer: meta row, learning promise, and the lesson marker.
   Everything here is typography on existing recipe markup. No new blocks.
   --------------------------------------------------------------------------- */

/* Meta row under the title. Fed by internal tags (#30 min, #Går att göra tidigare). */
.recipe-post .recipe-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  margin: 18px 0 0;
}
.recipe-post .recipe-meta:empty {
  display: none;
}
.recipe-post .recipe-meta__item {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.72;
}
.recipe-post .recipe-meta__item + .recipe-meta__item::before {
  content: "·";
  margin-right: 14px;
  opacity: 0.5;
}

/* The learning promise, in her language rather than ours. Quiet by design. */
.recipe-post .recipe-lesson-promise {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  max-width: 34em;
  margin: 22px auto 0;
  font-size: 17px;
  line-height: 1.5;
  text-align: center;
  color: var(--ink);
}
.recipe-post .recipe-lesson-promise__label {
  flex: none;
  padding: 3px 9px;
  border: 1px solid var(--accent);
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}

/* No accent bar on the marked step: the TITTA EFTER block carries it. */

/* Notes section reads as advice, so keep the sub-labels light. */
.recipe-content .recipe-notes strong {
  font-weight: 600;
}

/* New tool buttons inherit the existing recipe-tools styling; only the
   AI hand-off note needs its own rule. */
.recipe-post .recipe-tools__links {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.8;
}
.recipe-post .recipe-tools__links a {
  text-decoration: underline;
}

@media print {
  .recipe-post .recipe-lesson-promise__label,
  .recipe-post .recipe-tools__links {
    display: none;
  }
  .recipe-content .recipe-method li:has(> strong:first-child) {
    border-left: 0;
  }
}

/* Teaching notes for the AI helper only. Never shown, never printed. */
.recipe-content [data-teacher-note],
[data-teacher-note] {
  display: none !important;
}

/* Meta row is cleaned by JS; hide it until then so the hash never flashes. */
.recipe-post .recipe-meta [data-strip-hash] {
  visibility: hidden;
}
.recipe-post .recipe-meta.is-clean [data-strip-hash] {
  visibility: visible;
}



/* ---------------------------------------------------------------------------
   Handla → Förbered → Laga.
   One flow, three moments. Sized for a thumb, in a kitchen, under time pressure.
   --------------------------------------------------------------------------- */

/* Förbered: a short checklist, visually lighter than the shopping list. */
.recipe-content .recipe-prep {
  padding: 0;
  margin: 0;
  list-style: none;
}
.recipe-content .recipe-prep li {
  position: relative;
  padding: 12px 0 12px 40px;
  border-bottom: 1px solid var(--line);
  line-height: 1.45;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.recipe-content .recipe-prep li:first-child {
  border-top: 1px solid var(--line);
}
.recipe-content .recipe-prep li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  background: transparent;
}
.recipe-content .recipe-prep li.ingredient-checked::before {
  background: var(--accent);
  border-color: var(--accent);
}
.recipe-content .recipe-prep li.ingredient-checked::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 6px;
  height: 11px;
  margin-top: -7px;
  border: solid var(--paper);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.recipe-content .recipe-prep li.ingredient-checked {
  opacity: 0.45;
  text-decoration: line-through;
}

/* Laga: steps can be ticked off so an interruption doesn't lose your place. */
.recipe-content .recipe-method li {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease;
}

/* The next unticked step is where she is. Nothing else needs to shout. */
/* Never touch padding-left here: the step number lives in that 58px gutter. */
.recipe-content .recipe-method li.ingredient-checked + li:not(.ingredient-checked) {
  box-shadow: -3px 0 0 var(--accent);
}

/* Tap targets and spacing tighten up on phones, where this is actually used. */
@media (max-width: 700px) {
  .recipe-content .recipe-ingredients li,
  .recipe-content .recipe-prep li,
  .recipe-content .recipe-method li {
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .recipe-content .recipe-section-heading {
    margin-top: 46px;
  }
}

@media print {
  .recipe-content .recipe-method li.ingredient-checked,
  .recipe-content .recipe-prep li.ingredient-checked {
    opacity: 1;
    text-decoration: none;
  }
  .recipe-content .recipe-method li.ingredient-checked + li:not(.ingredient-checked) {
    box-shadow: none;
  }
}

/* ---------------------------------------------------------------------------
   TITTA EFTER and NU KAN DU. One marker, one closing section, no new boxes.
   --------------------------------------------------------------------------- */

/* The cue sits at the end of the step: instruction first, check afterwards. */
.recipe-content .recipe-method li strong:last-child {
  display: block;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  font-size: inherit;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
}
.recipe-content .recipe-method li strong:last-child::before {
  content: "Titta efter";
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Older posts marked at the start of the step still render correctly. */
.recipe-content .recipe-method li strong:first-child:not(:last-child) {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
}


/* ---------------------------------------------------------------------------
   Hjälpläraren. Part of the teaching arc, not a technology feature.
   DU LÄR DIG → TITTA EFTER → HJÄLPLÄRAREN → NU KAN DU
   --------------------------------------------------------------------------- */
.recipe-post .helper {
  padding: 20px 0 22px;
  border-bottom: 1px solid var(--line);
}
.recipe-post .helper__label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
}

.recipe-post .helper__open {
  width: 100%;
  padding: 13px 18px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--accent);
  color: var(--paper);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.recipe-post .helper__open:hover {
  opacity: 0.88;
}
/* Sentence case: the tool column uppercases everything by default, which
   turns three lines of helper copy into a billboard. */
.recipe-post .helper__body,
.recipe-post .helper__handoff,
.recipe-post .helper__explain {
  text-transform: none;
  letter-spacing: 0;
}
.recipe-post .helper__body {
  margin: 8px 0 14px;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.7;
}
.recipe-post .helper__explain {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  text-decoration: underline;
}
.recipe-post .helper__handoff {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.5;
}
.recipe-post .helper__handoff a {
  text-decoration: underline;
}

/* The shopping list is a utility, so it stays a plain line under the teacher. */
.recipe-post .recipe-tools .tool-link {
  margin-top: 4px;
  text-align: left;
  cursor: pointer;
}

@media print {
  .recipe-post .helper {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
   Förbered and Laga behave identically: same box, same strike-through.
   The step number lives inside the box, so nothing gets wider on a phone.
   --------------------------------------------------------------------------- */

/* A visible hint, because a tappable list that looks like prose isn't one. */
.recipe-content .recipe-prep::before,
.recipe-content .recipe-method::before {
  content: "Tryck för att bocka av";
  display: block;
  margin-bottom: 14px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.45;
}

/* The step number becomes the checkbox. */
.recipe-content .recipe-method li::before {
  content: counter(recipe-step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.recipe-content .recipe-method li.ingredient-checked::before {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--paper);
}

/* Checked steps read exactly like checked prep items. */
.recipe-content .recipe-method li.ingredient-checked,
.recipe-content .recipe-prep li.ingredient-checked {
  opacity: 0.42;
  text-decoration: line-through;
}
/* Never strike through the cue itself. */
.recipe-content .recipe-method li.ingredient-checked strong {
  text-decoration: none;
}

/* NU KAN DU gets the weight the old notes card had. It closes the lesson. */
.recipe-content .recipe-takeaway {
  margin: 28px 0 0;
  padding: 23px 26px;
  background: #e8dfd2;
  border-left: 4px solid var(--accent);
  font-size: 17px;
  line-height: 1.55;
  max-width: none;
}
.is-dark .recipe-content .recipe-takeaway {
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 700px) {
  .recipe-content .recipe-takeaway {
    padding: 20px 20px;
  }
}
@media print {
  .recipe-content .recipe-prep::before,
  .recipe-content .recipe-method::before {
    display: none;
  }
}

.recipe-content .tap-hint {
  display: none;
}

/* An empty element must never render as a section card. */
.recipe-content .recipe-takeaway:empty,
.recipe-content .recipe-notes:empty,
.recipe-content .recipe-takeaway:has(> br:only-child) {
  display: none;
}

/* ---------------------------------------------------------------------------
   Laga steps behave exactly like Förbered: a box you tick, text struck through.
   The number lives inside the box until the step is done, then it becomes a
   checkmark — one gutter, one control, no extra chrome.
   --------------------------------------------------------------------------- */
.recipe-content .recipe-method li::before {
  border-color: var(--line);
  border-radius: 5px;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}
/* Ticked: the number disappears and the box fills, like a checkbox. */
.recipe-content .recipe-method li.ingredient-checked::before {
  background: var(--accent);
  border-color: var(--accent);
  color: transparent;
}
.recipe-content .recipe-method li.ingredient-checked::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 23px;
  width: 6px;
  height: 12px;
  border: solid var(--paper);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
/* Same struck-through, faded treatment as Förbered. */
.recipe-content .recipe-method li.ingredient-checked,
.recipe-content .recipe-prep li.ingredient-checked {
  opacity: 0.42;
  text-decoration: line-through;
}
/* The cue stays readable after the step is ticked. */
.recipe-content .recipe-method li.ingredient-checked strong {
  text-decoration: none;
}
.recipe-content .recipe-method li {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

@media print {
  .recipe-content .recipe-method li.ingredient-checked::after {
    display: none;
  }
  .recipe-content .recipe-method li.ingredient-checked::before {
    background: transparent;
    border-color: var(--line);
    color: var(--accent);
  }
}
