/* CMS row count follows enabled layouts. Default geometry is unchanged. */
.apak-page{grid-template-rows:repeat(var(--apak-page-tracks,7),auto)}
.apak-main{grid-row:2 / var(--apak-main-end,7)}
.apak-footer{grid-row:var(--apak-main-end,7)}
.apak-page--plain-header .apak-header{background:var(--apak-ink);padding-bottom:32px}
.apak-opening--local{grid-row:auto;inset:0 0 111px}
.apak-hero:has(.apak-opening--local){isolation:isolate}
[data-apak-motion="none"] [data-apak-reveal]{opacity:1;transform:none;filter:none;transition:none}
.apak-socials{grid-template-columns:none;grid-auto-columns:max-content;grid-auto-flow:column}
/* Preserve the approved adjacent overlaps; keep them inside their owner after reordering. */
.apak-craft:not(:has(+ .apak-expertise)) .apak-craft__media-column{margin-block-end:0}
.apak-about:not(:last-child) .apak-about__media-column{margin-block-end:0}
@media(max-width:1100px){.apak-about:not(:last-child){padding-block-end:40px}}
/* Uploaded decorative icons fit their approved media box without stretching. */
.apak-uploaded-icon{object-fit:contain}
.apak-expertise__icon:has(.apak-uploaded-icon){width:46px;height:47px}
.apak-expertise__card--industrial .apak-expertise__icon:has(.apak-uploaded-icon){width:60px;height:51px}
.apak-expertise__icon .apak-uploaded-icon{width:100%;height:100%}

/* Standard Pages may combine layouts from every canonical APAK page.
   Their source styles use page-local grid row numbers, so editor order owns
   placement when those layout families are mixed. */
.apak-page--mixed-sections{overflow-x:clip}
body:is(.page-id-422,.page-id-423) .apak-main{overflow-x:clip}
.apak-page--mixed-sections .apak-main > .apak-section{
  grid-column:1;
  grid-row:auto;
  min-inline-size:0;
}
.apak-page--mixed-sections > .apak-footer{grid-row:var(--apak-main-end)}

/* Interior templates use a slightly narrower desktop content frame. Keep
   that geometry for their sections without changing Homepage sections. */
@media(min-width:1201px){
  .apak-page--mixed-sections .apak-main > :is(
    .apak-company-opening,
    .apak-company-team,
    .apak-company-chapter,
    .apak-company-leadership,
    .apak-metal-opening,
    .apak-metal-services,
    .apak-metal-closing,
    .apak-contact-opening,
    .apak-contact-content,
    .apak-projects-closing
  ) > .apak-container{width:min(calc(100% - 200px),1300px)}
}

/* Opening sections share header tracks only on their own templates. Within a
   Standard Page they remain full-width, in-flow sections. */
@media(min-width:768px){
  .apak-page--mixed-sections .apak-main > .apak-projects-opening,
  .apak-page--mixed-sections .apak-main > .apak-projects-opening > .apak-container,
  .apak-page--mixed-sections .apak-main > .apak-metal-opening,
  .apak-page--mixed-sections .apak-main > .apak-metal-opening > .apak-container{display:block}
  .apak-page--mixed-sections .apak-projects-opening__row,
  .apak-page--mixed-sections .apak-metal-opening__row{grid-row:auto;grid-template-rows:auto}
  .apak-page--mixed-sections :is(
    .apak-projects-opening__copy-column,
    .apak-projects-opening__media-column,
    .apak-metal-opening__copy-column,
    .apak-metal-opening__media-column
  ){grid-row:1}
}

@media(min-width:1001px){
  .apak-page--mixed-sections .apak-main > .apak-company-opening,
  .apak-page--mixed-sections .apak-main > .apak-company-opening > .apak-container,
  .apak-page--mixed-sections .apak-main > .apak-contact-opening,
  .apak-page--mixed-sections .apak-main > .apak-contact-opening > .apak-container{display:block}
  .apak-page--mixed-sections .apak-company-opening__row,
  .apak-page--mixed-sections .apak-contact-opening__row{grid-row:auto;grid-template-rows:auto}
  .apak-page--mixed-sections :is(
    .apak-company-opening__copy-column,
    .apak-company-opening__media-column,
    .apak-contact-opening__copy-column,
    .apak-contact-opening__media-column
  ){grid-row:1}
}
