/* /os "built by operators" (WEB-89 v1, shipped as WEB-96): one spread. Wide screens put the heading and the story under
   it in the left column, and the photo beside them, cut tall, its top on the heading's cap line. Phones stack heading,
   story, then the case.
   The rules join components.css's os-handoff layer (layered !important beats the page's unlayered rules) and carry the
   case's ID to beat that layer's older origin rules. */
@layer os-handoff {
  [data-page="os"]:not([data-start-line]) #case.origin-case {
    --origin-text:1 / 13;
    --origin-photo:15 / 25;
    --origin-ratio:4 / 5;
    padding-top:var(--line)!important;
  }
  [data-page="os"]:not([data-start-line]) #case .origin-h {
    margin:0!important;
    padding:0 0 var(--line)!important;
    text-box:trim-start cap alphabetic;
  }
  /* about 70 characters a line at any width, so the story reads as a block rather than a slab across a wide column */
  [data-page="os"]:not([data-start-line]) #case .bc.origin { margin:0!important; padding:0!important; max-width:calc(var(--line) * 26)!important; }
  [data-page="os"]:not([data-start-line]) #case > :is(.frame,.cap,.dots) { margin:0!important; }
  [data-page="os"]:not([data-start-line]) #case > .frame { aspect-ratio:var(--origin-ratio)!important; }
  /* the caption keeps 4.5:1 over the brightest photo: the scrim is at least 70% ink from the caption's first line down */
  [data-page="os"]:not([data-start-line]) #case > .cap {
    background:linear-gradient(to bottom,transparent,color-mix(in srgb,var(--ink) 40%,transparent) calc(var(--line) * .75),color-mix(in srgb,var(--ink) 70%,transparent) calc(var(--line) * 1.75),color-mix(in srgb,var(--ink) 78%,transparent))!important;
  }

  @media (min-width:1024px),(min-width:768px) and (min-aspect-ratio:1/1) and (min-height:500px) {
    [data-page="os"]:not([data-start-line]) #case .origin-rail {
      display:block!important;
      grid-column:var(--origin-text)!important;
      grid-row:1!important;
      align-self:start!important;
      max-width:none!important;
    }
    /* stretch, so the photo fills the row when the story runs taller than the 4:5 cut */
    [data-page="os"]:not([data-start-line]) #case > :is(.frame,.cap,.dots) { grid-column:var(--origin-photo)!important; }
    [data-page="os"]:not([data-start-line]) #case > .frame { grid-row:1!important; align-self:stretch!important; }
    [data-page="os"]:not([data-start-line]) #case > .cap { grid-row:1!important; }
    [data-page="os"]:not([data-start-line]) #case > .dots { grid-row:2!important; margin-top:calc(var(--line) * .5)!important; }
  }

  @media (max-width:767px),(max-width:1023px) and (max-aspect-ratio:9999/10000),(max-width:1023px) and (max-height:499px) {
    [data-page="os"]:not([data-start-line]) #case .origin-rail { display:contents!important; }
    [data-page="os"]:not([data-start-line]) #case :is(.origin-h,.bc.origin,.frame,.cap,.dots) { grid-column:1 / -1!important; }
    [data-page="os"]:not([data-start-line]) #case .origin-h { grid-row:1!important; padding-bottom:calc(var(--line) + 1lh)!important; }
    [data-page="os"]:not([data-start-line]) #case .bc.origin { grid-row:2!important; }
    [data-page="os"]:not([data-start-line]) #case > :is(.frame,.cap) { grid-row:3!important; }
    [data-page="os"]:not([data-start-line]) #case > .frame { margin-top:var(--line)!important; }
    [data-page="os"]:not([data-start-line]) #case > .dots { grid-row:4!important; margin-top:calc(var(--line) * .25)!important; }
  }
  /* compact tablets: a full-width 4:5 photo would be taller than the screen, so it takes a landscape cut */
  @media (min-width:600px) and (max-width:1023px) and (max-aspect-ratio:9999/10000) {
    [data-page="os"]:not([data-start-line]) #case.origin-case { --origin-ratio:4 / 3; }
  }
}
