.middle.recipe {
  display: flex;
  flex-flow: column;
  gap: 1.5rem;
  padding: 1rem;
  max-width: 100%;
}

.middle.recipe > .recipe-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-border);
}

.middle.recipe > .recipe-header > .recipe-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.middle.recipe > .recipe-header > .recipe-title-row > h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--font-color);
  margin: 0;
  line-height: 1.2;
}

.middle.recipe > .recipe-header > .recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.middle.recipe > .recipe-header > .recipe-meta > .category {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background-color: var(--color-orange);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.middle.recipe > .recipe-header > .recipe-meta > .tag {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background-color: var(--color-gray-bg-light);
  color: var(--color-gray-text);
  font-size: 0.8rem;
  border-radius: 4px;
}

.middle.recipe > .recipe-content {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

.middle.recipe > .recipe-content > .ingredients-section {
  background-color: var(--color-gray-bg-lighter);
  border-radius: 8px;
  padding: 1.5rem;
  position: sticky;
  top: 1rem;
}

.middle.recipe > .recipe-content > .ingredients-section > h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--font-color);
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-orange);
}

.middle.recipe > .recipe-content > .ingredients-section > .ingredients-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.middle.recipe > .recipe-content > .ingredients-section > .ingredients-list > li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--font-color);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-gray-border-lighter);
}

.middle.recipe > .recipe-content > .ingredients-section > .ingredients-list > li:last-child {
  border-bottom: none;
}

.middle.recipe > .recipe-content > .ingredients-section > h2:last-of-type {
  margin-top: 1.5rem;
}

.middle.recipe > .recipe-content > .ingredients-section > h2:nth-of-type(2) {
  margin-top: 1.5rem;
}

.middle.recipe > .recipe-content > .recipe-main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.middle.recipe > .recipe-content > .recipe-main > .instructions-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.middle.recipe > .recipe-content > .recipe-main > .instructions-section > h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--font-color);
  margin: 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-orange);
}

.middle.recipe > .recipe-content > .recipe-main > .instructions-section > .instructions {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--font-color);
  white-space: pre-wrap;
  font-family: inherit;
  background: transparent;
  border: none;
  margin: 0;
  padding: 0;
}

.middle.recipe > .recipe-content > .recipe-main > .images {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.middle.recipe > .recipe-content > .recipe-main > .images > figure {
  margin: 0;
  padding: 0;
}

.middle.recipe > .recipe-content > .recipe-main > .images > figure > img {
  width: 100%;
  max-width: 600px;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.middle.recipe > .bottom-links {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.middle.recipe > .bottom-links .back-link {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.recipe .edit-link {
  margin-top: 1.5rem;
}

.recipe .edit-link a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 36px;
  padding: 0 1rem;
  background-color: var(--color-button);
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;

  &:hover {
    opacity: 0.9;
  }

  & svg,
  & img {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    filter: invert(1);
  }
}

.middle.recipe > .back-link a {
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--color-gray-text-light);
  padding: 0.4rem 0.8rem;
  transition: color 0.2s;
}

.middle.recipe > .back-link a:hover {
  color: var(--color-orange);
}

.middle.recipe > .bottom-links .report-link a {
  text-decoration: none;
  font-size: 0.85rem;
  color: #52525b;
  padding: 0.4rem 0.8rem;
  transition: color 0.4s;
}

.middle.recipe > .bottom-links .report-link a:hover {
  color: var(--color-orange);
}

@media (max-width: 900px) {
  .middle.recipe {
    padding: 0.5rem;
  }

  .middle.recipe > .recipe-content {
    grid-template-columns: 1fr;
  }

  .middle.recipe > .recipe-content > .ingredients-section {
    position: static;
    order: -1;
  }

  .middle.recipe > .recipe-header > h1 {
    font-size: 1.6rem;
  }
}
