/* CHEMSOURCE-CATEGORY-VISUALS-013 — category hero: approved 55/45 split (text left, photo right) when a CMS
   image is assigned; polished full-width text-only hero when not. Loaded AFTER chemsource-site.css and
   market.css on all three category pages so these rules win the cascade. Uses only the existing design tokens. */

/* split activates only when an image exists (.is-split) */
.cat-hero.is-split{
  display:grid;
  grid-template-columns:minmax(0,55fr) minmax(0,45fr);
  gap:clamp(32px,4vw,64px);
  align-items:center;
}
.cat-hero-txt{ min-width:0; }

/* in split mode let the description use the full text column (the global .ph-l caps width for the text-only hero) */
.cat-hero--img .cat-hero-txt .ph-l,
.cat-hero--img .cat-hero-txt .lede{ max-width:none; }

.cat-hero-fig{ margin:0; min-width:0; }
.cat-hero-img{
  display:block; width:100%; height:auto;
  aspect-ratio:4/3;                 /* reserves space => no layout shift while the photo decodes */
  object-fit:cover; object-position:center;
  border-radius:20px;               /* rounded corners per the approved design */
  background:var(--canvas-2,#ECEAE4);
}

/* CHEMSOURCE-CATEGORY-VIDEO-017 — the hero video (native <video> or Bunny embed <iframe>) occupies the SAME 45%
   media column as the image: identical aspect ratio (no layout shift), object-fit cover, and 20px rounded corners.
   It never floats, never goes full-bleed, and stays inside the hero. When both an image and a Bunny embed exist the
   image renders as the poster until the player is activated client-side. */
.cat-hero-vid{
  display:block; width:100%; height:auto;
  aspect-ratio:4/3;                   /* matches .cat-hero-img => reserves space, no CLS */
  object-fit:cover; object-position:center;
  border-radius:20px;
  background:var(--canvas-2,#ECEAE4);
  border:0;
}
iframe.cat-hero-embed{ height:auto; }   /* aspect-ratio governs the box; iframe fills it */
/* an embed's poster image sits in the same cell and is hidden by script once the player loads */
.cat-hero-fig{ position:relative; }
.cat-hero-fig > [data-hero-poster]{ /* poster uses the shared .cat-hero-img sizing already */ }

/* tablet + mobile: stack vertically — text (breadcrumbs, label, heading, description, stats) then media */
@media (max-width:860px){
  .cat-hero.is-split{ grid-template-columns:1fr; gap:24px; }
  .cat-hero-img, .cat-hero-vid{ aspect-ratio:16/10; border-radius:16px; }
}
@media (max-width:520px){
  .cat-hero-img, .cat-hero-vid{ aspect-ratio:16/11; border-radius:14px; }
}
