/* v178 — homepage display-copy guardrails.
   This does not redesign the page. It adds safer wrapping, consistent display-copy behaviour,
   and long-copy fallbacks for future automated updates. */

[data-home-slot]{
  text-wrap:balance;
}
p[data-home-slot],
.bg164-editor-list a[data-home-slot],
.hero-grid > .column .story.panel p[data-home-slot],
.newsletter p[data-home-slot]{
  text-wrap:pretty;
}

/* Large display lines are controlled by the display-copy file. */
[data-home-slot="feature.headline"],
[data-home-slot="editor.headline"],
[data-home-slot="newsletter.headline"]{
  overflow-wrap:normal;
  word-break:normal;
}
[data-home-mode="spans"]{
  display:block;
}
[data-home-mode="spans"] > span{
  display:block;
}

/* Emergency classes applied by JS if future copy approaches limits. */
.hero-grid > .lead h1.bg-copy-long{
  font-size:clamp(42px,3.48vw,60px) !important;
  max-width:420px !important;
}
.hero-grid > .column .story.panel h2.bg-copy-long{
  font-size:clamp(22px,1.72vw,29px) !important;
  line-height:.98 !important;
  max-width:15ch !important;
}
.bg164-editor-title h2.bg-copy-long{
  font-size:clamp(34px,2.55vw,47px) !important;
  line-height:1.02 !important;
}
.newsletter h2.bg-copy-long{
  font-size:clamp(42px,4.25vw,78px) !important;
  line-height:.96 !important;
}

/* Over-limit copy should still not burst the layout if someone ignores the checker. */
.bg-copy-over-limit{
  overflow-wrap:anywhere;
}
.hero-grid > .column .story.panel p.bg-copy-over-limit,
.bg164-editor-list a.bg-copy-over-limit{
  font-size:.92em !important;
  line-height:1.18 !important;
}

/* Never clip text-heavy homepage panels merely because content changed. */
.hero-grid > .lead,
.hero-grid > .column,
.hero-grid > .bg164-editor-note,
.hero-grid > .column .story.panel{
  overflow:clip;
}
@supports not (overflow: clip){
  .hero-grid > .lead,
  .hero-grid > .column,
  .hero-grid > .bg164-editor-note,
  .hero-grid > .column .story.panel{ overflow:hidden; }
}

@media (max-width:1180px){
  .hero-grid > .lead h1.bg-copy-long{
    font-size:clamp(46px,6vw,66px) !important;
    max-width:620px !important;
  }
  .bg164-editor-title h2.bg-copy-long{
    font-size:clamp(38px,5.3vw,56px) !important;
  }
}
