/**
 * @file
 * Wide content
 *
 * This component breaks out of the layout-content-narrow grid layout using a
 * combination of carefully calculated negative margins and widths. It is used
 * on the article's default image field.
 */

@import "../base/media-queries.pcss.css";

.wide-content {
  margin-block-start: var(--sp0-5);
  margin-block-end: var(--sp2);
  margin-inline-start: 0;
  margin-inline-end: 0;

  @media (--grid-md) {
    width: calc(var(--grid-col-count) * var(--grid-col-width) + var(--grid-gap-count) * var(--grid-gap));
    margin-block: var(--sp2) var(--sp4);
    margin-inline-start: calc(-1 * ((var(--grid-col-width) + var(--grid-gap))));
  }

  @media (--lg) {
    width: calc(12 * var(--grid-col-width) + 11 * var(--grid-gap));
    margin-inline-start: calc(-1 * (var(--grid-col-width) + var(--grid-gap)));
  }
}

/* Ensure that image doesn't overlap sidebar. */
.sidebar-grid .wide-content {
  @media (--lg) {
    width: calc(9 * var(--grid-col-width) + 8 * var(--grid-gap));
  }

  @media (--xl) {
    width: calc(10 * var(--grid-col-width) + 9 * var(--grid-gap));
  }
}

/* Ensure that image doesn't overlap layout builder sections when editing layouts. */
.layout-builder .wide-content,
.region--hero .wide-content {
  max-width: 100%;
  margin-inline: 0;
}
