/*
 * Visual subject-safety pass
 *
 * Editorial photographs are supplied in several source ratios.  The previous
 * fixed-height image wells used `cover`, which can remove a face or a product
 * at the top/bottom of a short banner.  These rules keep the full asset in a
 * deliberately framed panel instead of silently cropping it.
 */

/* Desktop brand banners use an 8:3 visual well.  The image remains whole and
 * is framed by the site's existing hero colour when its original ratio differs.
 */
.home-brand-banner__visual {
  align-self: center;
  min-height: 0;
  aspect-ratio: 8 / 3;
  background: linear-gradient(135deg, color-mix(in srgb, var(--hero) 86%, #fff), var(--hero));
}

.home-brand-banner__visual .home-brand-art {
  object-fit: contain;
  object-position: center center;
  padding: clamp(8px, 1.1vw, 16px);
}

/* The fade must not hide a portrait or product at the copy edge. */
.home-brand-banner__visual::after {
  background: linear-gradient(90deg, transparent 62%, color-mix(in srgb, var(--hero) 78%, transparent) 100%);
}

/* Category lead artwork follows the same rule.  It may be supplied by a
 * contributor in portrait, landscape, or square form, so it is never cropped
 * merely to fill a decorative box.
 */
body[class*="site-profile--"] .category-layout .category-visual {
  height: auto;
  min-height: 0;
  aspect-ratio: 8 / 3;
  background: color-mix(in srgb, var(--hero) 12%, #fff);
}

body[class*="site-profile--"] .category-layout .category-visual > img {
  object-fit: contain;
  object-position: center center;
  padding: clamp(6px, .8vw, 12px);
}

/* Work Next uses a real editorial photograph.  Keep the complete 3:2 frame
 * visible rather than favouring its right edge and cutting a person's head.
 */
body.site-profile--work-next .work-editorial__visual {
  overflow: hidden;
  background: #e8ddd7;
}

body.site-profile--work-next .work-editorial__photo {
  aspect-ratio: 3 / 2;
  object-fit: contain;
  object-position: center center;
  background: #e8ddd7;
}

@media (max-width: 767px) {
  /* A taller mobile frame preserves the same content without a thin letterbox. */
  .home-brand-banner__visual {
    aspect-ratio: 4 / 3;
    min-height: 0;
    max-height: none;
  }

  .home-brand-banner__visual .home-brand-art {
    padding: 10px;
  }

  .home-brand-banner__visual::after {
    background: linear-gradient(180deg, transparent 70%, color-mix(in srgb, var(--hero) 68%, transparent) 100%);
  }

  body[class*="site-profile--"] .category-layout .category-visual {
    aspect-ratio: 3 / 2;
  }

  body[class*="site-profile--"] .category-layout .category-visual > img {
    padding: 8px;
  }
}

body .site-shell .topic-index__item.topic-index__item--text {
  grid-template-columns: minmax(0, 1fr) auto;
}

.topic-index__item--text .topic-index__copy {
  flex: 1;
  min-width: 0;
}

.topic-index__item--text .topic-index__copy strong {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

body .site-shell .home-editorial-standard {
  grid-template-columns: minmax(0, 1fr) auto;
}

body .site-shell .home-editorial-standard > a {
  grid-column: auto;
}

body .site-shell .story-card--text {
  border-top: 2px solid var(--accent);
  min-height: 0;
}

body .site-shell .story-card--text .story-body {
  padding: clamp(15px, 2vw, 24px);
}

body .site-header .site-brand-symbol[src*="/assets/identity/"],
body .site-footer .footer-brand-symbol[src*="/assets/identity/"] {
  box-sizing: border-box;
  object-fit: contain;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.site-footer--single .footer-premium-brand {
  padding-bottom: 20px;
  margin-bottom: 0;
}

.site-footer--single .footer-legal {
  padding-top: 16px;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 767px) {
  body .site-shell .home-editorial-standard {
    grid-template-columns: minmax(0, 1fr);
  }

  body .site-shell .home-editorial-standard > a {
    white-space: normal;
  }
}
