/* DraperyMill site refinements, 2026-10-23.
 * Enqueue after all existing theme, home, editorial and commerce styles.
 * The plugin adds dm-site-wide to the body; no native block is replaced.
 */

body.dm-site-wide {
  --dm-site-gutter: clamp(20px, 3vw, 56px);
  --dm-site-content-width: calc(100% - var(--dm-site-gutter) - var(--dm-site-gutter));
  --wp--style--global--content-size: 100%;
  --wp--style--global--wide-size: 100%;
}

/* Section backgrounds keep their full width. Content and site chrome share one
 * pair of gutters, replacing the older 1280px cap and fixed 72px gutters.
 */
body.dm-site-wide .wp-site-blocks,
body.dm-site-wide .wp-site-blocks > :is(main, .wp-block-post-content),
body.dm-site-wide .entry-content,
body.dm-site-wide .dm-page {
  width: 100%;
  max-width: none !important;
  margin-inline: 0 !important;
}

body.dm-site-wide .wp-site-blocks :is(.dm-wrap, .dmp-wrap),
body.dm-site-wide .wp-block-template-part :is(.topbar-inner, .nav-inner),
body.dm-site-wide .dm-page :is(.factory-stats, .qc-inner),
body.dm-site-wide .dm-generic {
  box-sizing: border-box;
  width: var(--dm-site-content-width) !important;
  max-width: none !important;
  min-width: 0;
  margin-inline: auto !important;
  padding-inline: 0 !important;
}

/* A wrapper nested inside an already aligned content wrapper must not take a
 * second pair of page gutters. Preserve all existing grid and video behavior.
 */
body.dm-site-wide .wp-site-blocks :is(.dm-wrap, .dmp-wrap) :is(.dm-wrap, .dmp-wrap, .factory-stats, .qc-inner) {
  width: 100% !important;
  max-width: none !important;
  margin-inline: 0 !important;
}

/* The two native four-item PDP strips use the same left/right edges as the
 * gallery, product details and related products. Their responsive grids remain.
 */
body.dm-site-wide .dm-page > :is(.pd-benefits, .pd-trust) {
  box-sizing: border-box;
  width: var(--dm-site-content-width) !important;
  max-width: none !important;
  min-width: 0;
  margin-inline: auto !important;
}
body.dm-site-wide .dm-page > :is(.pd-benefits, .pd-trust) > .dm-wrap {
  width: 100% !important;
  max-width: none !important;
  margin-inline: 0 !important;
}
body.dm-site-wide :is(.pd-benefit, .pd-trust-item) {
  min-width: 0;
}

/* Current sample landing, account and quotation page containers share the same gutters. */
body.dm-site-wide :is(.dmsl-page .dmsl-wrap,.dmv2,.dmv4-fallback,#dmill-public-cart),
body.dm-site-wide.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation) {
  box-sizing: border-box;
  width: var(--dm-site-content-width) !important;
  max-width: none !important;
  margin-inline: auto !important;
  padding-inline: 0 !important;
}
body.dm-site-wide .dmv3-main {max-width:none;}

/* The announcement is static and centered by default. home-feedback.js adds
 * an inert aria-hidden duplicate for its former ticker; hide only that copy.
 */
body.dm-site-wide .wp-block-template-part .topbar-inner {
  justify-content: center;
  gap: 0;
  overflow: visible;
  padding-block: 8px;
}
body.dm-site-wide .topbar-inner .dm-announcement-window {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin-inline: auto;
  overflow: visible;
}
body.dm-site-wide .topbar-inner .dm-announcement-track {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  animation: none !important;
  transform: none !important;
}
body.dm-site-wide .topbar-inner .topbar-left {
  display: flex !important;
  flex: 0 1 auto;
  flex-wrap: wrap !important;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  width: 100%;
  min-width: 0;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1.5;
  text-align: center;
  white-space: normal !important;
}
body.dm-site-wide .topbar-inner .topbar-ticker {
  min-width: 0;
  white-space: normal !important;
  text-align: center;
  overflow-wrap: break-word;
}
body.dm-site-wide .topbar-inner .dm-announcement-track > .topbar-left[aria-hidden="true"],
body.dm-site-wide .topbar-inner .dm-ticker-control {
  display: none !important;
}

/* Projects: center each label within its text column while keeping its icon in
 * the existing separate column. The current menu's eighth item is Projects.
 */
body.dm-site-wide .nav-links > .nav-item:nth-of-type(8) > .nav-drop .dd-link {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}
body.dm-site-wide .nav-links > .nav-item:nth-of-type(8) > .nav-drop .dd-icon {
  align-self: center;
  margin: 0;
}
body.dm-site-wide .nav-links > .nav-item:nth-of-type(8) > .nav-drop .dd-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 36px;
  text-align: center;
  white-space: normal;
}
body.dm-site-wide .nav-links > .nav-item:nth-of-type(8) > .nav-drop .dd-text strong {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: break-word;
}

@media (max-width: 640px) {
  body.dm-site-wide .topbar-inner .topbar-left {
    row-gap: 5px;
  }
  body.dm-site-wide .topbar-inner .topbar-left > .dm-tag {
    margin: 0;
  }
}
