/* Scope to this template only */
.gutenberg-fullwidth {
  /* Remove any unintended overflow clipping on full-bleed blocks */
  overflow-x: hidden;
}

/* Let the main content span full width, not Divi's fixed container */
.gutenberg-fullwidth #main-content .container,
.gutenberg-fullwidth .et_pb_row,
.gutenberg-fullwidth .et_pb_section,
.gutenberg-fullwidth .et-main-area {
  max-width: none !important;
  width: 100% !important;
  padding-left: 0;
  padding-right: 0;
}

/* Base reading width for normal blocks (paragraphs, images without alignment, etc.) */
.gutenberg-fullwidth .entry-content > * {
  /* Center “regular” content in a comfortable measure */
  max-width: 1400px;          /* adjust to your brand’s content width */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;         /* small side breathing room */
  padding-right: 1rem;
  box-sizing: border-box;
}

/* Wide-aligned blocks */
.gutenberg-fullwidth .entry-content .alignwide {
  max-width: 1600px;          /* a bit wider than the base content */
}

/* Full-aligned blocks (true edge-to-edge) */
.gutenberg-fullwidth .entry-content .alignfull {
  max-width: none !important;
  width: 100vw;                /* span the full viewport */
  margin-left: 50%;
  transform: translateX(-50%); /* center the 100vw box within the page flow */
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Ensure all nested elements within alignfull also have no padding */
.gutenberg-fullwidth .entry-content .alignfull > *,
.gutenberg-fullwidth .entry-content .alignfull .wp-block-group__inner-container,
.gutenberg-fullwidth .entry-content .alignfull .wp-block-cover__inner-container {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Make media blocks behave nicely at full width */
.gutenberg-fullwidth .entry-content .alignfull img,
.gutenberg-fullwidth .entry-content .alignwide img {
  width: 100%;
  height: auto;
  display: block;
}

/* Remove any default floats causing unexpected gutters */
.gutenberg-fullwidth .entry-content .wp-block-image,
.gutenberg-fullwidth .entry-content .wp-block-cover,
.gutenberg-fullwidth .entry-content .wp-block-gallery,
.gutenberg-fullwidth .entry-content .wp-block-media-text {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

/* Prevent Divi from forcing a sidebar layout */
.gutenberg-fullwidth .container:before,
.gutenberg-fullwidth .container:after {
  content: none;
}

/* Remove any Divi default padding on article and main elements on mobile */
@media (max-width: 782px) {
  .gutenberg-fullwidth article {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  .gutenberg-fullwidth .entry-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  /* Ensure the main content area has no padding */
  .gutenberg-fullwidth #main-content,
  .gutenberg-fullwidth .et-main-area {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}