/* real-factory-steps — scoped to ol.steps.hll-rfs-steps on Factory and OEM only.
   Palette: #252525, #FAFAF8, #FFFFFF; gold #8C6835 accents only.
   Desktop 3 columns (>1024), tablet (≤1024, inc. 768–900) 2 columns,
   mobile (≤700) 1 column. Same-row 4:3 frames are top-aligned via subgrid
   on desktop/tablet; single-column is unchanged (text then image, no shared
   rows). Visual order is unchanged: step number/title/text, then the still. */

.v9p ol.steps.hll-rfs-steps{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:28px 20px;
  align-items:stretch;
  list-style:none;
  margin:0;
  padding:0;
}

@media (max-width:1024px){
  .v9p ol.steps.hll-rfs-steps{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:24px 14px;
  }
}

@media (max-width:700px){
  .v9p ol.steps.hll-rfs-steps{
    grid-template-columns:1fr;
    gap:28px;
  }
}

/* Each card spans three parent-grid rows (title, body, figure) so image
   frames in the same visual row share a track and start at the same y.
   Step numbers live on h3::before (not a grid item). A toggle-on
   figcaption sits inside the figure, under the 4:3 frame, and does not
   move the frame top. */
.v9p ol.steps.hll-rfs-steps > li.step{
  display:grid;
  grid-template-rows:subgrid;
  grid-row:span 3;
  align-items:start;
  min-width:0;
  margin:0;
}

@media (max-width:700px){
  .v9p ol.steps.hll-rfs-steps > li.step{
    grid-template-rows:auto auto 1fr;
    grid-row:auto;
  }
}

.v9p ol.steps.hll-rfs-steps > li.step h3{
  margin-top:0;
}

.v9p ol.steps.hll-rfs-steps > li.step > p{
  margin:0 0 16px;
}

/* Image frame: 4:3, cover, never wider than the no-upscale cap on the figure.
   position:relative + absolutely placed picture/img so the still's intrinsic
   ratio cannot shrink the box (the 1702×957 polishing still is ~16:9). */
.v9p ol.steps.hll-rfs-steps .hll-rfs-fig{
  margin:0;
  width:100%;
  justify-self:stretch;
  align-self:start;
}

@media (max-width:700px){
  .v9p ol.steps.hll-rfs-steps .hll-rfs-fig{
    margin:auto 0 0;
    align-self:stretch;
  }
}

.v9p ol.steps.hll-rfs-steps .hll-rfs-fig.hll-rf-fig--1380{
  /* 01 workstation 1380×920: 4:3 cover without upscaling caps at 920*(4/3)=1226.67 */
  max-width:min(100%,1226px);
}

.v9p ol.steps.hll-rfs-steps .hll-rfs-fig.hll-rf-fig--1702{
  /* Default cap for 1702-wide stills. Polishing (957h) is tighter: 957*(4/3)=1276. */
  max-width:min(100%,1513px);
}

.v9p ol.steps.hll-rfs-steps .hll-rfs-fig.hll-rfs-fig--polishing{
  max-width:min(100%,1276px);
}

.v9p ol.steps.hll-rfs-steps .hll-rfs-fig.hll-rf-fig--1152{
  /* AI stills 1152×864 are already 4:3; no-upscale cap is the native width. */
  max-width:min(100%,1152px);
}

/* Injected only when HLL_RFS_AI_LABEL is on. Sits under the 4:3 frame;
   does not change column layout or frame size. */
.v9p ol.steps.hll-rfs-steps .hll-rfs-fig--ai .hll-rfs-ai-label{
  font-size:12px;
  font-weight:400;
  color:#6B4D20;
  margin-top:10px;
}

.v9p ol.steps.hll-rfs-steps .hll-rfs-frame{
  aspect-ratio:4 / 3;
  overflow:hidden;
  width:100%;
  position:relative;
  background:#FAFAF8;
}

.v9p ol.steps.hll-rfs-steps .hll-rfs-frame picture,
.v9p ol.steps.hll-rfs-steps .hll-rfs-frame img{
  display:block;
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  max-width:none;
}

/* Polishing still is 1702×957 (~16:9; mobile 1200×675, same crop). A default
   4:3 cover keeps the full height and crops the sides, so the workstations
   and people sit in a ceiling-heavy band. Map a 4:3 window of 1133×850 at
   (227,107) on the desktop still — same relative window on mobile — so the
   enclosed stations and people fill the equal-size frame. The window is
   smaller than the native file (no upscaling at the ~427px column). */
.v9p ol.steps.hll-rfs-steps .hll-rfs-fig--polishing .hll-rfs-frame img{
  width:calc(1702 / 1133 * 100%);
  height:calc(957 / 850 * 100%);
  inset:auto;
  left:calc(-227 / 1133 * 100%);
  top:calc(-107 / 850 * 100%);
  object-fit:fill;
  object-position:center;
}
