/**
 * Berke 0.21.9 — canonical surface + media/copy edge enforcement.
 * Release-blocking repair for live QA findings. No stored content/SEO/URL mutation.
 */

/* P-0008 joins the canonical Hero v3 rectangle: visible copy starts at the
   media top edge and useful completion content anchors the copy bottom edge. */
@media (min-width:56.001rem){
  .berke-p8 .berke-p8-hero__layout{
    grid-template-areas:"copy visual"!important;
    grid-template-rows:minmax(0,1fr)!important;
    align-items:stretch!important;
  }
  .berke-p8 .berke-p8-hero__copy{
    padding-block:0!important;
    justify-content:flex-start!important;
    block-size:100%!important;
  }
  .berke-p8 .berke-p8-hero__visual{
    min-block-size:0!important;
    max-block-size:none!important;
    block-size:100%!important;
    aspect-ratio:auto!important;
  }
  .berke-p8 .berke-p8-principles[data-berke-hero-completion]{
    margin-block-start:auto!important;
    padding-block-start:1rem;
  }

  /* Side-by-side generated process visual and copy are one shared rectangle. */
  .berke-p8 .berke-p8-process__story[data-berke-section-edge="v1"]{
    align-items:stretch!important;
  }
  .berke-p8 .berke-p8-process__story[data-berke-section-edge="v1"] > .berke-p8-process__visual,
  .berke-p8 .berke-p8-process__story[data-berke-section-edge="v1"] > .berke-p8-process__story-copy{
    block-size:100%!important;
  }
  .berke-p8 .berke-p8-process__story-copy{
    display:flex;
    flex-direction:column;
    justify-content:center;
  }

  /* P-0007 proof is also a media/copy split and must obey the same physical edges. */
  .berke-p7 .berke-p7-proof .berke-core-container[data-berke-section-edge="v1"]{
    align-items:stretch!important;
  }
  .berke-p7 .berke-p7-proof .berke-core-container[data-berke-section-edge="v1"] > .berke-p7-proof__visual,
  .berke-p7 .berke-p7-proof .berke-core-container[data-berke-section-edge="v1"] > .berke-p7-proof__copy{
    block-size:100%!important;
  }
  .berke-p7 .berke-p7-proof__copy{
    display:flex;
    flex-direction:column;
    justify-content:center;
  }
}

/* The canonical dark-surface contract owns foreground color. These selectors
   are intentionally low-complexity and only reinforce active revenue pages. */
.berke-p8 [data-berke-surface="dark"] :where(h1,h2,h3,h4,h5,h6,p,li,strong,b,small,summary,label),
.berke-p7 [data-berke-surface="dark"] :where(h1,h2,h3,h4,h5,h6,p,li,strong,b,small,summary,label){
  color:var(--berke-color-on-dark,#fff)!important;
}
.berke-p8 [data-berke-surface="dark"] [data-berke-surface="light"] :where(h1,h2,h3,h4,h5,h6,p,li,strong,b,small,span,summary,label),
.berke-p7 [data-berke-surface="dark"] [data-berke-surface="light"] :where(h1,h2,h3,h4,h5,h6,p,li,strong,b,small,span,summary,label){
  color:var(--berke-color-text,#173f55)!important;
}

/* Single-column mode: natural height and semantic order win. */
@media (max-width:56rem){
  .berke-p8 .berke-p8-hero__layout{
    grid-template-areas:"copy" "visual"!important;
    grid-template-rows:auto!important;
  }
  .berke-p8 .berke-p8-hero__copy,
  .berke-p8 .berke-p8-hero__visual{
    block-size:auto!important;
  }
  .berke-p8 .berke-p8-principles[data-berke-hero-completion]{
    margin-block-start:1rem!important;
    padding-block-start:0;
  }
  .berke-p8 .berke-p8-process__story-copy,
  .berke-p7 .berke-p7-proof__copy{
    display:block;
  }
}
