/* P7-D2-H: public layout only. Never load in wp-admin. */
:root {
  --yy-content-max: 1440px;
  --yy-content-gutter: clamp(16px, 3vw, 32px);
  --yy-content-side: max(var(--yy-content-gutter), calc((100% - var(--yy-content-max)) / 2));
}

/* Astra chrome, ordinary pages and single items share one outer edge. */
.site-header .ast-container,
.site-footer .ast-builder-grid-row-container,
.site-footer .ast-container,
body:not(.home):not(.page-id-1258):not(.page-id-1261):not(.page-id-1370):not(.page-id-1371):not(.page-id-495):not(.page-id-1262):not(.post-type-archive-yy_solution):not(.post-type-archive-yy_project) #content > .ast-container,
body.single-product .site-content .ast-container,
body.single-yy_solution .site-content .ast-container,
body.single-yy_project .site-content .ast-container {
  box-sizing: border-box;
  max-width: var(--yy-content-max);
  width: calc(100% - 2 * var(--yy-content-gutter));
  margin-inline: auto;
  padding-inline: 0;
}
.site-footer .site-primary-footer-wrap[data-section] .ast-builder-grid-row,
.site-footer .site-below-footer-wrap[data-section] .ast-builder-grid-row {
  box-sizing: border-box;
  max-width: var(--yy-content-max);
  width: calc(100% - 2 * var(--yy-content-gutter));
  margin-inline: auto;
}
/* Astra's Customizer emits #masthead .ast-container { max-width: 100%; padding: 35px; }.
   Scope the override to the primary header so its content follows the 1440px edge. */
#masthead .site-primary-header-wrap.ast-container {
  max-width: var(--yy-content-max);
  width: calc(100% - 2 * var(--yy-content-gutter));
  margin-inline: auto;
  padding-inline: 0;
}

/* Full-bleed backgrounds retain their width; only their content is aligned. */
body .yy-editorial,
body .yy-support,
body .yy-p7-projects {
  box-sizing: border-box;
  max-width: none;
  width: 100%;
  margin-inline: 0;
  padding-inline: 0;
}
.entry-content[data-ast-blocks-layout] > :is(.yy-home, .yy-catalogue, .yy-editorial, .yy-support, .yy-p7-projects, .yy-about, .yy-contact) {
  max-width: none;
  width: 100%;
  margin-inline: 0;
  padding-inline: 0;
}
body .yy-home .yy-section,
body .yy-b2b .yy-section,
body .yy-catalogue > .yy-section,
body .yy-about .yy-section,
body .yy-contact .yy-section {
  box-sizing: border-box;
  max-width: none;
  width: 100%;
  margin-inline: 0;
  padding-inline: var(--yy-content-side);
}
body .yy-home .yy-section.is-layout-constrained > *,
body .yy-catalogue > .yy-section.is-layout-constrained > * {
  max-width: var(--yy-content-max);
  margin-inline: auto;
}
body .yy-b2b .yy-hero,
body .yy-catalogue > .yy-hero,
body .yy-catalogue > .yy-cta,
body .yy-about .yy-about-hero,
body .yy-contact .yy-contact-hero,
body .yy-editorial .yy-editorial-hero,
body .yy-support .yy-support-hero,
body .yy-p7b-archive-hero,
body .yy-p7-projects .yy-p7-projects-hero {
  box-sizing: border-box;
  max-width: none;
  width: 100%;
  margin-inline: 0;
  padding-inline: var(--yy-content-side);
}
body .yy-p7b-archive-list,
body .yy-p7-projects .yy-p7-projects-body {
  box-sizing: border-box;
  max-width: var(--yy-content-max);
  width: calc(100% - 2 * var(--yy-content-gutter));
  margin-inline: auto;
  padding-block: clamp(48px, 5vw, 80px);
  padding-inline: 0;
}
body .yy-editorial .yy-editorial-list,
body .yy-support .yy-support-list,
body .yy-about .yy-section,
body .yy-contact .yy-section {
  padding-inline: var(--yy-content-side);
}
/* Gutenberg's page-specific inline CSS is emitted after theme styles. */
body.page-id-494 .yy-home .yy-section,
body.page-id-1258 .yy-catalogue > .yy-section,
body.page-id-495 .yy-about .yy-section,
body.page-id-1262 .yy-contact .yy-section {
  max-width: none;
  width: 100%;
  padding-inline: var(--yy-content-side);
}
body.page-id-494 .yy-home .yy-section.is-layout-constrained > *,
body.page-id-1258 .yy-catalogue > .yy-section.is-layout-constrained > * {
  max-width: var(--yy-content-max);
}
body.page-id-1370 .yy-editorial .yy-editorial-hero,
body.page-id-1370 .yy-editorial .yy-editorial-list,
body.page-id-1371 .yy-support .yy-support-hero,
body.page-id-1371 .yy-support .yy-support-list,
body.page-id-495 .yy-about .yy-about-hero,
body.page-id-1262 .yy-contact .yy-contact-hero,
body.page-id-1261 .yy-p7-projects .yy-p7-projects-hero {
  max-width: none;
  width: 100%;
  padding-inline: var(--yy-content-side);
}
body.page-id-1258 .yy-catalogue > .yy-hero,
body.page-id-1258 .yy-catalogue > .yy-cta {
  box-sizing: border-box;
  max-width: none;
  width: 100%;
  margin-inline: 0;
  padding-inline: var(--yy-content-side);
}
body.page-id-1261 .yy-p7-projects .yy-p7-projects-body {
  box-sizing: border-box;
  max-width: var(--yy-content-max);
  width: calc(100% - 2 * var(--yy-content-gutter));
  margin-inline: auto;
  padding-inline: 0;
}
.yy-ui-content-system {
  max-width: var(--yy-content-max);
}

/* Four editorial columns at wide desktop; the existing product mega menu is independent. */
.yy-ui-content-system .yy-ui-content-grid,
.yy-ui-editorial .yy-ui-editorial-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}
.yy-ui-content-card,
.yy-ui-editorial-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.yy-ui-content-card .yy-ui-content-art,
.yy-ui-editorial-card .yy-ui-editorial-image {
  aspect-ratio: 16 / 9;
  flex: none;
}
.yy-ui-content-card .yy-ui-content-art img,
.yy-ui-editorial-card .yy-ui-editorial-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.yy-ui-content-card h3,
.yy-ui-editorial-card h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.yy-ui-content-card p,
.yy-ui-editorial-card p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.yy-ui-solutions .yy-ui-content-card p {
  -webkit-line-clamp: 4;
}
.yy-ui-content-card .yy-ui-content-link,
.yy-ui-editorial-card .yy-ui-editorial-link {
  margin-top: auto;
  padding-top: 14px;
}

/* Astra's 921px switch remains unchanged; fit the last desktop interval. */
@media (min-width: 922px) and (max-width: 1120px) {
  .site-header .main-header-menu {
    display: flex;
    flex-wrap: nowrap;
  }
  .site-header .main-header-menu > .menu-item > .menu-link {
    padding-inline: 6px;
    font-size: 13px;
    white-space: nowrap;
  }
  .site-header .ast-header-button-1 .ast-custom-button {
    padding-inline: 10px;
    white-space: nowrap;
  }
}

@media (max-width: 1379px) {
  .yy-ui-content-system .yy-ui-content-grid,
  .yy-ui-editorial .yy-ui-editorial-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1024px) {
  .yy-ui-content-system .yy-ui-content-grid,
  .yy-ui-editorial .yy-ui-editorial-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .yy-ui-content-system .yy-ui-content-grid,
  .yy-ui-editorial .yy-ui-editorial-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
