/* ================================================================
   SHEFRONT V29 — PUBLIC LAYOUT SAFETY
   ================================================================ */

/* Category Focus: prevent long headlines/bylines from colliding across cards. */
.sf27-home-focus{overflow:hidden}
.sf27-home-focus .sf8-heading{min-width:0;flex-wrap:wrap;align-items:flex-end}
.sf27-home-focus .sf8-heading>div{min-width:0;max-width:calc(100% - 110px)}
.sf27-home-focus .sf8-heading h2{max-width:100%;overflow-wrap:anywhere;word-break:normal}
.sf27-home-focus-grid{align-items:start}
.sf27-home-focus-grid>a{
  display:grid;
  grid-template-rows:auto auto auto auto;
  align-content:start;
  min-width:0;
  width:100%;
  overflow:hidden;
}
.sf27-home-focus-grid img{display:block;max-width:100%;min-width:0}
.sf27-home-focus-grid small,.sf27-home-focus-grid span{
  min-width:0;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.sf27-home-focus-grid h3{
  min-width:0;
  max-width:100%;
  overflow:hidden;
  overflow-wrap:anywhere;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  line-clamp:3;
  min-height:3.54em;
}

/* Article media: keep body images/galleries inside the actual article column.
   V27 negative breakout margins could enter the left/right text rails on desktop. */
.sf9-body .sf26-body-image,
.sf9-body .sf27-image-full,
.sf9-body .sf27-gallery,
.sf9-body .sf28-gallery-single{
  box-sizing:border-box;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin-left:0!important;
  margin-right:0!important;
  clear:both;
}
.sf9-body .sf26-body-image img,
.sf9-body .sf27-gallery img{
  display:block;
  width:100%;
  max-width:100%;
}
.sf9-body .sf27-gallery-grid{
  width:100%;
  max-width:100%;
  min-width:0;
}
.sf9-body .sf27-gallery-item{
  min-width:0;
  max-width:100%;
}
.sf9-body .sf26-body-image figcaption,
.sf9-body .sf27-gallery-item span{
  max-width:100%;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.sf9-body{overflow-wrap:anywhere}

/* Keep contributor/public UI from accidentally reintroducing view-count helper spans. */
.cms-dashboard .sf29-private-view-count,
.profile-metrics .sf29-private-view-count{display:none!important}

@media(max-width:1120px){
  .sf27-home-focus-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:860px){
  .sf27-home-focus-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .sf27-home-focus .sf8-heading>div{max-width:100%}
}
@media(max-width:560px){
  .sf27-home-focus-grid{grid-template-columns:1fr}
  .sf27-home-focus-grid h3{min-height:0;-webkit-line-clamp:4;line-clamp:4}
  .sf27-home-focus-grid small,.sf27-home-focus-grid span{white-space:normal}
}

.sf27-contributor-stats{grid-template-columns:repeat(5,minmax(0,1fr))}
@media(max-width:1000px){.sf27-contributor-stats{grid-template-columns:repeat(3,1fr)}}
@media(max-width:760px){.sf27-contributor-stats{grid-template-columns:repeat(2,1fr)}}
