/**
 * Universal Plywood — Our Company Figma story layout v1.1.62
 *
 * Layout source: supplied designer Figma / approved comparison screenshot.
 * Typography remains controlled by the Elementor widget (v1.1.61 controls).
 * This file only restores the intended content geometry and image proportions.
 */

/* Keep the custom widget free to use its own Figma-width inner shell even when
   Elementor is placed in a conventional boxed parent container. */
.elementor-widget-up_design_company_page,
.elementor-widget-up_design_company_page > .elementor-widget-container{
  width:100%;
  max-width:none;
  overflow:visible;
}

@media (min-width:1201px){
  body:not(.home) .up-company-editable > .up-shell{
    box-sizing:border-box;
    width:min(1438px, calc(100vw - 120px))!important;
    max-width:1438px!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }

  /* Figma: the founding paragraph is a broad text block, not the narrow
     766px measure introduced by an older desktop patch. */
  body:not(.home) .up-company-editable__intro-copy{
    width:min(1040px, 72.32%)!important;
    max-width:1040px!important;
    margin:128px 0 0!important;
  }

  /* Figma row 1: 736 media / 95 gutter / 605 copy = 1436px. */
  body:not(.home) .up-company-editable .up-company-editable__row--story{
    display:grid!important;
    grid-template-columns:minmax(0,736fr) minmax(0,605fr)!important;
    column-gap:clamp(64px,4.95vw,95px)!important;
    row-gap:0!important;
    align-items:center!important;
    width:100%!important;
    max-width:none!important;
    margin-top:128px!important;
  }

  /* Figma row 2: same grid mirrored. */
  body:not(.home) .up-company-editable .up-company-editable__row--statement,
  body:not(.home) .up-company-editable .up-company-editable__row--statement.up-two-col-story--reverse{
    display:grid!important;
    grid-template-columns:minmax(0,605fr) minmax(0,736fr)!important;
    column-gap:clamp(64px,4.95vw,95px)!important;
    row-gap:0!important;
    align-items:center!important;
    width:100%!important;
    max-width:none!important;
    margin-top:128px!important;
  }

  body:not(.home) .up-company-editable .up-company-editable__row--story .up-two-col-story__media,
  body:not(.home) .up-company-editable .up-company-editable__row--statement .up-two-col-story__media{
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
  }

  body:not(.home) .up-company-editable .up-company-editable__row--story .up-two-col-story__media img,
  body:not(.home) .up-company-editable .up-company-editable__row--statement .up-two-col-story__media img{
    display:block!important;
    width:100%!important;
    max-width:none!important;
    height:auto!important;
    aspect-ratio:736 / 560!important;
    object-fit:cover!important;
    object-position:center!important;
  }

  body:not(.home) .up-company-editable .up-company-editable__row--story .up-two-col-story__copy{
    width:100%!important;
    max-width:605px!important;
    min-width:0!important;
    justify-self:end!important;
  }

  body:not(.home) .up-company-editable .up-company-editable__row--statement .up-two-col-story__copy{
    width:100%!important;
    max-width:605px!important;
    min-width:0!important;
    justify-self:start!important;
  }

  body:not(.home) .up-company-editable .up-company-editable__row--story .up-company-editable__row-copy p,
  body:not(.home) .up-company-editable .up-company-editable__row--statement .up-company-editable__row-copy p{
    max-width:100%!important;
  }

  /* Captions sit directly below the media and align to its right edge. */
  body:not(.home) .up-company-editable .up-company-editable__row .up-image-caption{
    width:100%!important;
    margin:20px 0 0!important;
    text-align:right!important;
  }
}

/* Scaled desktop: preserve the Figma ratios instead of switching to the older
   1.12fr/.88fr + 440px-high compressed layout. */
@media (min-width:901px) and (max-width:1200px){
  body:not(.home) .up-company-editable > .up-shell{
    width:calc(100vw - 80px)!important;
    max-width:none!important;
    margin-inline:auto!important;
  }
  body:not(.home) .up-company-editable__intro-copy{
    width:min(1040px, 78%)!important;
    max-width:1040px!important;
  }
  body:not(.home) .up-company-editable .up-company-editable__row--story{
    grid-template-columns:minmax(0,736fr) minmax(0,605fr)!important;
    gap:48px!important;
  }
  body:not(.home) .up-company-editable .up-company-editable__row--statement,
  body:not(.home) .up-company-editable .up-company-editable__row--statement.up-two-col-story--reverse{
    grid-template-columns:minmax(0,605fr) minmax(0,736fr)!important;
    gap:48px!important;
  }
  body:not(.home) .up-company-editable .up-company-editable__row .up-two-col-story__media img{
    width:100%!important;
    height:auto!important;
    aspect-ratio:736 / 560!important;
    object-fit:cover!important;
  }
  body:not(.home) .up-company-editable .up-company-editable__row .up-two-col-story__copy{
    width:100%!important;
    max-width:none!important;
  }
}

/* Tablet/mobile continue to use the theme's purpose-built stacked layouts. */
@media (max-width:900px){
  body:not(.home) .up-company-editable > .up-shell{
    margin-inline:auto!important;
  }
  body:not(.home) .up-company-editable__intro-copy,
  body:not(.home) .up-company-editable .up-company-editable__row .up-two-col-story__copy{
    width:100%!important;
    max-width:100%!important;
  }
}
