/* ========================================
   Prep ahead - Backyard Blue
   One row per day: the day on the left, a dashed line, then each
   recipe with its cover and its prep steps.
   ======================================== */

.prep-page-container {
  box-sizing: border-box;
  max-width: 1088px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-lg) var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  color: var(--color-ink);
  line-height: normal;
}

.prep-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm-md);
}

.prep-page-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-display);
}

.prep-groceries-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 44px;
  padding: 0 var(--space-md) 0 var(--space-md);
  border: var(--line);
  border-radius: var(--radius-control);
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}

.prep-groceries-link svg {
  width: 20px;
  height: 20px;
}

.prep-groceries-link:hover {
  background: var(--color-hover);
  color: var(--color-ink);
}

.prep-page-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* ── Day ──────────────────────────────── */
.prep-date-group {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: var(--space-lg);
}

.prep-when {
  margin: 0;
  padding-top: var(--space-sm);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
  font: inherit;
}

.prep-when time {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.prep-dow {
  font-family: var(--font-display);
  font-size: var(--text-headline);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-display);
}

.prep-date {
  font-size: var(--text-body);
  font-weight: var(--weight-bold);
  color: var(--color-ink-soft);
}

.prep-today {
  margin-top: var(--space-xs);
  padding: var(--space-xs) var(--space-sm-md);
  border: var(--line);
  border-radius: var(--radius-sm);
  background: var(--color-ink);
  color: var(--color-paper);
  font-size: var(--text-label);
  font-weight: var(--weight-extrabold);
}

.prep-recipe-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding-left: var(--space-lg);
  border-left: 1.5px dashed var(--color-border);
}

/* ── Recipe ───────────────────────────── */
.prep-recipe-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
}

.prep-recipe-media {
  flex: 0 0 auto;
  width: 203px;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.prep-recipe-cover {
  display: block;
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: var(--line);
  border-radius: var(--radius-cover);
  background: var(--color-cream-dark);
}

.prep-recipe-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prep-recipe-media .channel-attribution {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 0;
  padding: 0 var(--space-2xs);
  color: var(--color-ink-soft);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}

.prep-recipe-media .channel-attribution__avatar {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-round);
  background: var(--color-cream-dark);
}

.prep-recipe-media .channel-attribution__avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prep-recipe-media .channel-attribution__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prep-recipe-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.prep-recipe-link {
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.prep-recipe-link:hover {
  color: var(--color-heeler-dark);
}

/* ── Prep steps ───────────────────────── */
.prep-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.prep-step {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: var(--space-sm-md);
  padding: 0 var(--space-2xs);
  border: 0;
  border-bottom: 1.5px solid var(--color-border);
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.prep-check {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-paper);
  color: var(--color-paper);
  transition: background-color 160ms ease, border-color 160ms ease;
}

.prep-check svg {
  width: 12px;
  height: 12px;
}

.prep-step-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--text-body);
  overflow-wrap: anywhere;
}

.prep-step[aria-pressed="true"] .prep-step-title {
  color: var(--color-ink-soft);
  text-decoration: line-through;
}

.prep-step-when {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 112px;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--color-cream-dark);
  color: var(--color-ink);
  font-size: var(--text-label);
  font-weight: var(--weight-extrabold);
  text-align: center;
  white-space: nowrap;
}

.prep-step[aria-pressed="true"] .prep-step-when {
  background: var(--color-cream-dark);
  color: var(--color-ink-soft);
}

.prep-step-empty {
  margin: 0;
  font-size: var(--text-body);
  color: var(--color-ink-soft);
}

/* ── Ingredients ──────────────────────── */
.prep-ingredient-disclosure {
  interpolate-size: allow-keywords;
}

.prep-ingredient-disclosure::details-content {
  height: 0;
  overflow: clip;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    height 220ms var(--ease-out-soft),
    content-visibility 220ms allow-discrete,
    opacity 160ms var(--ease-out-soft),
    transform 220ms var(--ease-out-soft);
}

.prep-ingredient-disclosure[open]::details-content {
  height: auto;
  opacity: 1;
  transform: none;
}

.prep-ingredient-disclosure summary {
  width: fit-content;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  box-sizing: border-box;
  color: var(--color-heeler-dark);
  font-size: var(--text-label);
  font-weight: var(--weight-extrabold);
  list-style: none;
  cursor: pointer;
}

.prep-ingredient-disclosure summary::-webkit-details-marker {
  display: none;
}

.prep-ingredient-disclosure summary:hover {
  color: var(--color-ink);
}

.prep-ingredient-disclosure summary svg {
  width: 14px;
  height: 14px;
  transition: transform 200ms ease;
}

.prep-ingredient-disclosure[open] summary svg {
  transform: rotate(180deg);
}

.prep-ingredient-hide,
.prep-ingredient-disclosure[open] .prep-ingredient-show {
  display: none;
}

.prep-ingredient-disclosure[open] .prep-ingredient-hide {
  display: inline;
}

.prep-ingredients ul {
  list-style: none;
  margin: calc(var(--space-xs) * -1) 0 0;
  padding: 0;
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-ink);
}

.prep-ingredient-line {
  display: inline;
}

.prep-ingredient-amount { font-weight: var(--weight-extrabold); font-variant-numeric: tabular-nums; }

.prep-ingredient-line + .prep-ingredient-line::before {
  content: " · ";
}

.prep-ingredients p {
  margin: calc(var(--space-xs) * -1) 0 0;
  font-size: var(--text-body);
  color: var(--color-ink-soft);
}

.prep-empty-card {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .prep-check,
  .prep-ingredient-disclosure::details-content,
  .prep-ingredient-disclosure summary svg {
    transition: none;
  }
}

/* ── Phone ────────────────────────────── */
@media (max-width: 767px) {
  .prep-page-container {
    padding: var(--space-md) var(--space-md) var(--space-xl);
  }

  .prep-page-header h1 {
    font-size: var(--text-display-phone);
  }

  .prep-groceries-link {
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-round);
  }

  .prep-groceries-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .prep-date-group {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-sm-md);
  }

  .prep-when {
    flex-direction: row;
    align-items: baseline;
    gap: var(--space-sm-md);
    padding: 0 0 var(--space-sm);
    border-bottom: 1.5px solid var(--color-border);
  }

  .prep-when time {
    flex-direction: row;
    align-items: baseline;
    gap: var(--space-sm-md);
  }

  .prep-dow {
    font-size: var(--text-title);
  }

  .prep-today {
    margin-top: 0;
  }

  .prep-recipe-list {
    gap: var(--space-lg);
    padding-left: 0;
    border-left: 0;
  }

  .prep-recipe-card {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm-md);
  }

  .prep-recipe-media {
    width: 100%;
  }

  .prep-recipe-cover {
    border-radius: var(--radius-cover);
  }

  /* The timing sits under the step text. */
  .prep-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    row-gap: var(--space-sm);
    padding: var(--space-sm-md) var(--space-2xs);
  }

  .prep-check {
    grid-row: span 2;
    margin-top: var(--space-2xs);
  }

  .prep-step-title {
    line-height: var(--leading-body);
  }

  .prep-step-when {
    grid-column: 2;
    justify-self: start;
    width: auto;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-label);
  }
}
