/* Applied only after the PHP runtime has verified parent 227 or one actual native child. */
body.dhsf-food-parent-refined,
body.dhsf-native-child-view {
  --dhsf-ink: #35402b;
  --dhsf-olive: #59633f;
  --dhsf-clay: #a55f3f;
  --dhsf-cream: #f7f1e6;
  --dhsf-rule: #d8cfbc;
}

body.dhsf-food-parent-refined .dhr-page,
body.dhsf-native-child-view .dhr-page {
  box-sizing: border-box;
  width: min(92%, 1180px);
  margin-inline: auto;
}

body.dhsf-food-parent-refined .dhr-page *,
body.dhsf-native-child-view .dhr-page *,
body.dhsf-food-parent-refined .dhr-page *::before,
body.dhsf-native-child-view .dhr-page *::before,
body.dhsf-food-parent-refined .dhr-page *::after,
body.dhsf-native-child-view .dhr-page *::after {
  box-sizing: border-box;
}

/* Parent 227 refiner: the title stays on the left edge, category rail stays far
   left, the existing developed art occupies the right main column, and the
   existing footer/brand is retained at the bottom. No source node is inserted,
   removed, or rewritten. */
body.dhsf-food-parent-refined .dhr-page > h1 {
  max-width: none;
  margin: 0 0 clamp(1.25rem, 2.5vw, 2.5rem);
  color: var(--dhsf-ink);
  text-align: left;
}

body.dhsf-food-parent-refined .dhs-food-layout {
  display: grid;
  grid-template-columns: minmax(168px, 220px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.25rem, 4vw, 4.5rem);
}

body.dhsf-food-parent-refined .dhs-food-sidebar {
  grid-column: 1;
  align-self: start;
}

body.dhsf-food-parent-refined .dhs-food-category-tabs {
  display: grid;
  gap: 0.45rem;
  position: sticky;
  top: 1rem;
}

body.dhsf-food-parent-refined .dhs-food-category-tabs > a[data-food-category] {
  display: block;
  min-height: 2.7rem;
  padding: 0.58rem 0.72rem;
  border: 1px solid var(--dhsf-rule);
  border-radius: 2px;
  background: var(--dhsf-cream);
  color: var(--dhsf-ink);
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  overflow-wrap: anywhere;
}

body.dhsf-food-parent-refined .dhs-food-category-tabs > a[data-food-category]:hover,
body.dhsf-food-parent-refined .dhs-food-category-tabs > a[data-food-category]:focus-visible {
  border-color: var(--dhsf-olive);
  background: #ece6d8;
  color: var(--dhsf-ink);
}

body.dhsf-food-parent-refined .dhs-food-main {
  grid-column: 2;
  min-width: 0;
}

body.dhsf-food-parent-refined .dhs-food-main .dhr-main-art,
body.dhsf-food-parent-refined .dhr-recipes-art {
  margin: 0;
}

body.dhsf-food-parent-refined .dhr-main-art img,
body.dhsf-food-parent-refined .dhr-recipes-art img {
  display: block;
  width: 100%;
  height: auto;
}

body.dhsf-food-parent-refined .dhr-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: clamp(2rem, 6vw, 4.5rem);
  padding-top: 1rem;
  border-top: 1px solid var(--dhsf-rule);
  color: var(--dhsf-olive);
}

/* Each child body has exactly title, unique verified category art, and an empty
   future-recipes section. The empty section has no artificial height or notice. */
body.dhsf-native-child-view .dhr-page.dhs-food-native-category {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  grid-template-areas: "title art" "future future";
  align-items: start;
  gap: clamp(1rem, 3vw, 3.25rem);
  padding-block: clamp(1.5rem, 4vw, 4rem);
}

body.dhsf-native-child-view .dhr-page.dhs-food-native-category > h1 {
  grid-area: title;
  margin: 0;
  color: var(--dhsf-ink);
  text-align: left;
}

body.dhsf-native-child-view .dhs-food-native-art {
  grid-area: art;
  width: 100%;
  margin: 0;
}

body.dhsf-native-child-view .dhs-food-native-art img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(58vw, 600px);
  object-fit: contain;
}

body.dhsf-native-child-view .dhs-food-native-recipes:empty {
  grid-area: future;
  min-height: 0;
  margin: 0;
  padding: 0;
}

@media (max-width: 719px) {
  body.dhsf-food-parent-refined .dhs-food-layout {
    display: block;
  }

  body.dhsf-food-parent-refined .dhs-food-sidebar {
    margin-bottom: 1.25rem;
  }

  body.dhsf-food-parent-refined .dhs-food-category-tabs {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.dhsf-food-parent-refined .dhs-food-category-tabs > a[data-food-category] {
    min-height: 3.1rem;
    text-align: center;
  }

  body.dhsf-native-child-view .dhr-page.dhs-food-native-category {
    display: block;
  }

  body.dhsf-native-child-view .dhr-page.dhs-food-native-category > h1 {
    margin-bottom: 1rem;
  }

  body.dhsf-native-child-view .dhs-food-native-art img {
    max-height: min(78vw, 410px);
  }
}
