/* About: The five additional recipe layouts used by the editor and the public website (HQ R-199).
   The layout frame gets the same content slots in both places, and responds to the available width. */

:where(.recipe-layout) {
  container-type: inline-size;
  --layout-ink: #191919;
  --layout-paper: #fff4e9;
  --layout-radius: 14px;
}

.recipe-layout[data-layout="recipe-card"] .recipe-layout-frame {
  max-width: 62rem;
  margin-inline: auto;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--layout-ink);
  border-radius: var(--layout-radius);
  background: var(--layout-paper);
}

.recipe-layout[data-layout="recipe-card"] .recipe-layout-hero {
  padding: clamp(18px, 4cqw, 38px);
  background: #fff8ed;
  border-bottom: 2px dashed #ac7067;
}

.recipe-layout[data-layout="recipe-card"] .recipe-layout-photo img {
  border-radius: 4px;
  aspect-ratio: 1;
  border: 1px solid var(--layout-ink);
}

.recipe-layout[data-layout="recipe-card"] .recipe-layout-body {
  margin-top: 0;
  padding: clamp(18px, 4cqw, 38px);
}

.recipe-layout[data-layout="recipe-card"] .recipe-layout-section {
  border-top: 1px solid var(--layout-ink);
}

.recipe-layout[data-layout="prep-board"] .recipe-layout-hero {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #828b70;
}

.recipe-layout[data-layout="prep-board"] .recipe-layout-photo img {
  aspect-ratio: 3 / 2;
}

.recipe-layout[data-layout="prep-board"] [data-recipe-section="ingredients"] {
  padding: clamp(14px, 3cqw, 24px);
  border: 1px solid #828b70;
  border-radius: var(--layout-radius);
  background: #e8eadc;
}

.recipe-layout[data-layout="prep-board"] [data-recipe-section="ingredients"] ul {
  padding-inline-start: 0;
  list-style: none;
}

.recipe-layout[data-layout="prep-board"] .recipe-ingredient-check {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  cursor: pointer;
}

.recipe-layout[data-layout="prep-board"] .recipe-ingredient-check input {
  width: 1rem;
  height: 1rem;
  flex: none;
  accent-color: #505b3c;
}

.recipe-layout[data-layout="prep-board"] .recipe-ingredient-check:has(input:checked) span {
  opacity: 0.72;
  text-decoration: line-through;
}

.recipe-layout[data-layout="step-by-step"] .recipe-layout-hero {
  align-items: end;
  padding-bottom: 1.25rem;
  border-bottom: 4px solid #ae4837;
}

.recipe-layout[data-layout="step-by-step"] .recipe-layout-photo img {
  aspect-ratio: 2 / 1;
}

.recipe-layout[data-layout="step-by-step"] .recipe-layout-body,
.recipe-layout[data-layout="sunday-table"] .recipe-layout-body {
  grid-template-columns: minmax(0, 1fr);
}

.recipe-layout[data-layout="step-by-step"] [data-recipe-section="ingredients"] {
  padding: clamp(14px, 3cqw, 24px);
  border: 1px solid #c6a899;
  border-radius: var(--layout-radius);
  background: #f9e3d7;
}

.recipe-layout[data-layout="step-by-step"] [data-recipe-section="method"] ol {
  display: grid;
  gap: 0.65rem;
  padding-left: 0;
}

.recipe-layout[data-layout="step-by-step"] [data-recipe-section="method"] li {
  padding: 0.65em 0.8em;
  border: 1px solid #dbc3b3;
  border-radius: 10px;
  background: var(--layout-paper);
}

.recipe-layout[data-layout="step-by-step"] [data-recipe-section="method"] li::marker {
  content: "";
}

.recipe-layout[data-layout="step-by-step"] .recipe-method-number {
  display: inline-grid;
  min-width: 2rem;
  min-height: 2rem;
  place-items: center;
  border-radius: 999px;
  background: #f6d9cd;
  color: #802d27;
  font-weight: 800;
}

.recipe-layout[data-layout="step-by-step"] .recipe-method-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.recipe-layout[data-layout="sunday-table"] .recipe-layout-hero {
  overflow: hidden;
  gap: 0;
  border-radius: var(--layout-radius);
  background: #842d2c;
  color: #fff4e9;
}

.recipe-layout[data-layout="sunday-table"] .recipe-layout-story {
  padding: clamp(20px, 4cqw, 42px);
}

.recipe-layout[data-layout="sunday-table"] .recipe-layout-kicker {
  color: #ffed8f;
}

.recipe-layout[data-layout="sunday-table"] .recipe-layout-story textarea::placeholder {
  color: #f5d9c6;
}

.recipe-layout[data-layout="sunday-table"] .recipe-layout-story textarea:focus {
  background: rgb(255 255 255 / 12%);
  outline: 1px solid #f5d9c6;
}

.recipe-layout[data-layout="sunday-table"] .recipe-layout-photo {
  height: 100%;
  order: -1;
}

.recipe-layout[data-layout="sunday-table"] .recipe-layout-photo img {
  min-height: 100%;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0;
  object-fit: cover;
}

.recipe-layout[data-layout="sunday-table"] .recipe-layout-body {
  width: min(100%, 62ch);
  margin-inline: auto;
}

.recipe-layout[data-layout="quick-cook"] .recipe-layout-frame {
  max-width: 68rem;
  margin-inline: auto;
}

.recipe-layout[data-layout="quick-cook"] .recipe-layout-hero {
  grid-template-columns: minmax(0, 1fr) minmax(50px, 20%);
  padding-block: 1rem;
  border-block: 1px solid #ac7067;
}

.recipe-layout[data-layout="quick-cook"] .recipe-layout-hero:not(:has(.recipe-layout-photo:not([hidden]))) {
  grid-template-columns: minmax(0, 1fr);
}

.recipe-layout[data-layout="quick-cook"] .recipe-layout-photo img {
  aspect-ratio: 1;
  border-radius: 100%;
}

.recipe-layout[data-layout="quick-cook"] .recipe-layout-body {
  margin-top: 0;
}

.recipe-layout-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block: 1rem;
}

.recipe-layout-jump a {
  display: inline-flex;
  padding: 0.32rem 0.8rem;
  border: 1px solid #ac7067;
  border-radius: 999px;
  color: #7e2928;
  text-decoration: none;
  font-weight: 700;
}

.recipe-layout-jump a:hover {
  background: #f5dfd2;
}

.recipe-layout-section[id] {
  scroll-margin-top: 5rem;
}

@container (min-width: 560px) {
  .recipe-layout[data-layout="recipe-card"] .recipe-layout-hero:has(.recipe-layout-photo:not([hidden])) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 26%);
  }

  .recipe-layout[data-layout="recipe-card"] .recipe-layout-body {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }

  .recipe-layout[data-layout="prep-board"] .recipe-layout-body {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.35fr);
    align-items: start;
  }

  .recipe-layout[data-layout="prep-board"] [data-recipe-section="ingredients"] {
    position: sticky;
    top: 1rem;
  }

  .recipe-layout[data-layout="step-by-step"] [data-recipe-section="ingredients"] > ul {
    columns: 2;
  }

  .recipe-layout[data-layout="sunday-table"] .recipe-layout-hero:has(.recipe-layout-photo:not([hidden])) {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  }
}

@container (max-width: 559px) {
  .recipe-layout[data-layout="recipe-card"] .recipe-layout-hero,
  .recipe-layout[data-layout="prep-board"] .recipe-layout-hero,
  .recipe-layout[data-layout="step-by-step"] .recipe-layout-hero,
  .recipe-layout[data-layout="sunday-table"] .recipe-layout-hero,
  .recipe-layout[data-layout="recipe-card"] .recipe-layout-body,
  .recipe-layout[data-layout="prep-board"] .recipe-layout-body,
  .recipe-layout[data-layout="quick-cook"] .recipe-layout-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .recipe-layout[data-layout="quick-cook"] .recipe-layout-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .recipe-layout[data-layout="quick-cook"] .recipe-layout-photo {
    max-width: 5rem;
    order: -1;
  }

  .recipe-layout[data-layout="recipe-card"] .recipe-layout-photo {
    width: min(55%, 11rem);
  }
}
