/* ── SVG icon base (used here and in icon-checkbox) ── */
.svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.svg-icon svg {
  width: 1.25em;
  height: 1.25em;
}

/* ── Icon checkbox (ingredient check-off) ── */
.icon-checkbox {
  display: contents;
}

.icon-checkbox input[type="checkbox"] {
  display: none;
}

.icon-checkbox__label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  line-height: 1.5;
}

.icon-checkbox__true  { display: none; color: var(--sage-dk); }
.icon-checkbox__false { display: inline-flex; color: var(--paper); }

.icon-checkbox input[type="checkbox"]:checked + label .icon-checkbox__true  { display: inline-flex; }
.icon-checkbox input[type="checkbox"]:checked + label .icon-checkbox__false { display: none; }
.icon-checkbox input[type="checkbox"]:checked + label {
  color: var(--ink-lt);
  text-decoration: line-through;
  text-decoration-color: var(--peach);
}

/* ── Page shell ── */
.recipe-show {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

/* ── Header: two-column, main left / image right ── */
.recipe-show__header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7);
  align-items: start;
}

.recipe-show__header-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

/* ── Back link ── */
.recipe-show__back {
  font-size: var(--text-sm);
  font-weight: 700;
  align-self: flex-start;
}

/* ── Title ── */
.recipe-show__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--ink);
  line-height: 1.1;
  margin: 0;
}

/* ── Description ── */
.recipe-show__description {
  color: var(--ink-lt);
  line-height: 1.55;
}

.recipe-show__description p { margin: 0 0 var(--space-2); }
.recipe-show__description p:last-child { margin-bottom: 0; }

/* ── Tags (reuse .recipe-row__tag pill) ── */
.recipe-show__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

/* ── Controls: wake-lock + edit ── */
.recipe-show__controls {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-top: var(--space-1);
}

/* ── Image inset ── */
.recipe-show__header-aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.recipe-show__image-wrap {
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

.recipe-show__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.recipe-show__image--category {
  opacity: 0.6;
}

.recipe-show__image-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  background: color-mix(in srgb, black 5%, transparent);
}

.recipe-show__image-owner {
  font-size: var(--text-xs);
  color: var(--ink-lt);
}

.recipe-show__image-delete {
  color: var(--ink-lt);
  line-height: 0;
}

.recipe-show__image-delete:hover { color: var(--coral); }

/* ── Thumbnail strip ── */
.recipe-show__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.recipe-show__thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  border: 2.5px solid transparent;
  box-shadow: var(--shadow-sm);
  display: block;
}

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

.recipe-show__thumb--active {
  border-color: var(--coral);
}

.recipe-show__upload-input { display: none; }

.recipe-show__upload-btn {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--paper);
  border: 2.5px dashed var(--peach);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-lt);
}

.recipe-show__upload-btn:hover {
  border-color: var(--coral);
  color: var(--coral);
}

/* ── Two-column body ── */
.recipe-show__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.recipe-show__col-heading {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--coral);
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 3px solid var(--paper);
}

/* ── Ingredients ── */
.recipe-show__ingredient-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.recipe-show__ingredient-list:last-child {
  margin-bottom: 0;
}

/* ── Directions ── */
.recipe-show__steps {
  margin-bottom: var(--space-6);
}

.recipe-show__steps:last-child {
  margin-bottom: 0;
}

.recipe-show__step {
  display: flex;
  gap: var(--space-4);
  align-items: start;
  margin-bottom: var(--space-5);
}

.recipe-show__step:last-child {
  margin-bottom: 0;
}

.recipe-show__step-num {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--coral);
  line-height: 1.3;
  flex-shrink: 0;
  width: 2rem;
  text-align: right;
}

.recipe-show__step-text {
  flex: 1;
  line-height: 1.65;
}

.recipe-show__step-text p { margin: 0 0 var(--space-2); }
.recipe-show__step-text p:last-child { margin-bottom: 0; }

/* ── Section label spacing ── */
.recipe-show__ingredients .section-label,
.recipe-show__directions .section-label {
  margin-top: var(--space-4);
}

/* ── Footer ── */
.recipe-show__footer {
  border-top: 3px solid var(--paper);
  padding-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.recipe-show__note {
  color: var(--ink-lt);
  font-style: italic;
  line-height: 1.55;
}

.recipe-show__note p { margin: 0 0 var(--space-2); }
.recipe-show__note p:last-child { margin-bottom: 0; }

.recipe-show__attribution {
  font-size: var(--text-sm);
  color: var(--ink-lt);
}

.recipe-show__nutrition {
  margin-top: var(--space-2);
  color: var(--ink-lt);
  font-size: var(--text-sm);
}

.recipe-show__nutrition h3 {
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-lt);
  margin-bottom: var(--space-2);
}

/* ── Desktop: sticky two-column body ── */
@media (min-width: 680px) {
  .recipe-show__body {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: var(--space-8);
    align-items: start;
  }

  .recipe-show__ingredients {
    position: sticky;
    top: var(--space-4);
    max-height: calc(100vh - var(--space-8));
    overflow-y: auto;
    padding-right: var(--space-2);
    scrollbar-width: thin;
    scrollbar-color: var(--peach) transparent;
  }
}

/* ── Mobile ── */
@media (max-width: 679px) {
  .recipe-show {
    padding: var(--space-4);
    gap: var(--space-6);
  }

  .recipe-show__header {
    grid-template-columns: 1fr;
  }

  .recipe-show__header-aside {
    order: -1;
  }

  .recipe-show__image {
    aspect-ratio: 16 / 9;
  }

  .recipe-show__title {
    font-size: var(--text-2xl);
  }

  /* ── Tap targets ── */
  .recipe-show__back {
    padding: var(--space-2) 0;
    display: inline-block;
  }

  .icon-checkbox__label {
    min-height: 44px;
    padding: var(--space-1) 0;
  }

  .recipe-show__image-delete {
    padding: var(--space-2);
    margin: calc(-1 * var(--space-2));
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .recipe-show__controls .btn {
    padding: 0.65em var(--space-5);
  }
}
