/* The film banner defines the left and right edges of the storefront. */
body.studio[data-shop-page="home"] {
  --home-grid-limit: 1280px;
  --home-grid-gutter: 24px;
  --home-grid-width: min(var(--home-grid-limit), calc(100% - var(--home-grid-gutter) - var(--home-grid-gutter)));
}
@media (max-width: 760px) {
  body.studio[data-shop-page="home"] { --home-grid-gutter: 16px; }
}

/* These regions are direct children of full-width site containers. */
body.studio[data-shop-page="home"] :is(.storefront-utility-inner.page-width, .site-header, .reference-home.lubrix-home.page-width),
body.studio[data-shop-page="home"] #main > .lx23 {
  box-sizing: border-box;
  width: var(--home-grid-width) !important;
  max-width: none !important;
  margin-inline: auto !important;
  padding-inline: 0 !important;
}

/* The footer keeps its full-bleed background and shares the content edges. */
body.shop-public.reference-shell.studio[data-shop-page="home"] .site-footer {
  box-sizing: border-box;
  padding-inline: max(var(--home-grid-gutter), calc((100% - var(--home-grid-limit)) / 2)) !important;
}

/* Embedded catalogue and editorial bands already sit inside the shared grid. */
body.studio[data-shop-page="home"] #vyber #catalog:is(.reference-category-browser, .catalog-section),
body.studio[data-shop-page="home"] #vyber-oleje.oil-choice,
body.studio[data-shop-page="home"] #main .lx23 .lx-wrap,
body.studio[data-shop-page="home"] #cerpaci-stanice {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  margin-inline: 0 !important;
  padding-inline: 0 !important;
}

body.studio[data-shop-page="home"] #vyber > .ref-catalog-main {
  min-width: 0;
  padding: 12px var(--home-grid-gutter);
}

/* Reserve the intrinsic proportions of editorial images before lazy loading. */
.lx23 img[loading="lazy"][width][height] {
  aspect-ratio: attr(width type(<number>)) / attr(height type(<number>));
}
