/* 

Setting global spacing variables as equal to the --two-spacer variable as that's what's used in the header and footer currently;
this can change to match any desired general spacing/margins.

Default width is set as 800px with a global horiz. spacing margin on each side;
for screens above 1600px, this is instead set to 1200px with the same guaranteed margins.

Wide widths, 'alignfull' elements, are given full-width minus a standard horiz. margin on each side;
for screens above 1600px, this is changed to assign a width of 1600px while maintaining the same margins.

*/

:root {
  --global--spacing-horizontal: var(--two-spacer);
  --global--spacing-vertical: var(--two-spacer);
  --responsive--aligndefault-width: calc(1000px - (2 * var(--six-spacer)));;
  --responsive--alignwide-width: calc(100vw - (2 * var(--six-spacer)));
  --responsive--alignfull-width: 100%;
  --responsive--alignright-margin: var(--global--spacing-horizontal);
  --responsive--alignleft-margin: var(--global--spacing-horizontal);
}

@media only screen and (max-width: 991px) {
  :root {
    --responsive--aligndefault-width: calc(1000px - (2 * var(--two-spacer)));;
    --responsive--alignwide-width: calc(1600px - (2 * var(--two-spacer)));
  }
}

.post-thumbnail,
.entry-content .wp-audio-shortcode,
.entry-content > *:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.wp-block-separator):not(.woocommerce),
*[class*=inner-container] > *:not(.entry-content):not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.wp-block-separator):not(.woocommerce),
.default-max-width,
.is-style-wide:not(.alignwide):not(.alignfull) {
  max-width: var(--responsive--aligndefault-width);
  width: var(--responsive--aligndefault-width);
  margin-left: auto;
  margin-right: auto;
}

.widget-area,
.pagination,
.comments-pagination,
.post-navigation,
.site-footer,
.site-header,
.alignwide,
.is-style-alignwide,
.is-style-wide.alignwide,
.wide-max-width {
  max-width: 1600px;
  width: var(--responsive--alignwide-width);
  margin-left: auto;
  margin-right: auto;
}

.alignfull,
.wp-block-group .wp-block-group__inner-container > *.alignfull,
.full-max-width {
  max-width: var(--responsive--alignfull-width);
  width: var(--responsive--alignfull-width);
  margin-left: auto;
  margin-right: auto;
}

.entry-header .post-thumbnail,
.singular .post-thumbnail,
.alignfull [class*=inner-container] > .alignwide,
.alignwide [class*=inner-container] > .alignwide {
  width: var(--responsive--alignwide-width);
  max-width: var(--responsive--alignfull-width);
  margin-left: auto;
  margin-right: auto;
}

.entry-content > .alignleft {
  margin-left: var(--responsive--alignleft-margin);
  margin-right: auto;
  }

.entry-content > .alignright {
  margin-left: auto;
  margin-right: var(--responsive--alignright-margin);
}

/*

Setting vertical margins and responsive widths on top-level wrappers and content wrappers.

*/

.site-header,
.site-main,
.widget-area,
.site-footer {
  padding-top: var(--global--spacing-vertical);
  padding-bottom: var(--global--spacing-vertical);
  margin-left: auto;
  margin-right: auto;
}

/*

'Main' children margin exceptions

*/

.site-main > *:first-child {
  margin-top: 0;
}
.site-main > *:last-child {
  margin-bottom: 0;
}

/*

Setting default vertical spacing

*/

.entry-content > *,
.spacing-general > * {
  margin-top: var(--six-spacer);
}
@media screen and (max-width: 991px) {
  .entry-content > *,
  .spacing-general > * {
    margin-top: var(--four-spacer);
  }
}

body.single-post .entry-content > *,
body.single-post .spacing-general > * {
  margin-top: var(--three-spacer);
}

.wp-block-group > *,
.wp-block-column > *,
.wp-block-group-manual > *,
[class*=inner-container] > *,
.wp-block-list li,
.spacing-minimal > * {
  margin-top: var(--two-spacer);
}

.entry-content > *:first-child,
.wp-block-group > *:first-child,
.wp-block-column > *:first-child,
[class*=inner-container] > *:first-child,
.wp-block-list li:first-child,
.spacing-general > *:first-child,
.spacing-minimal > *:first-child {
  margin-top: 0 !important;
}

@media screen and (max-width: 1600px) {
  .widget-area, .pagination, .comments-pagination, .post-navigation, .site-footer, .site-header, .alignwide, .wide-max-width {
      max-width: 100%;
      width: auto;
      margin-left: var(--six-spacer);
      margin-right: var(--six-spacer);
  }
}
@media screen and (max-width: 991px) {
  .widget-area, .pagination, .comments-pagination, .post-navigation, .site-footer, .site-header, .alignwide, .wide-max-width {
      margin-left: var(--two-spacer);
      margin-right: var(--two-spacer);
  }
}

@media screen and (max-width: 991px) {
  .post-thumbnail,
  .entry-content .wp-audio-shortcode, 
  .entry-content > *:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.wp-block-separator):not(.woocommerce),
  *[class*=inner-container] > *:not(.entry-content):not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright) {
    max-width: 100%;
    width: auto;
    margin-left: var(--global--spacing-horizontal);
    margin-right: var(--global--spacing-horizontal);
  }

  .wp-block-cover, .wp-block-cover-image {
    width: inherit;
  }

  .wp-block-columns.alignfull {
    margin: 0;
  }
}

.entry-content .has-background {
  padding: var(--six-spacer);
}
@media screen and (max-width: 991px) {
  .entry-content .has-background {
    padding: var(--four-spacer) var(--two-spacer);
  }
}

.wp-block-group-is-layout-constrained > .alignwide {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Set negative margin if first item is div with rounded top corners */
.entry-content h1.sr-only ~ .is-style-rounded-top-edges {
  margin-top: -1rem !important;
}

/* .has-background already adds padding, so if an .alignwide element is nested inside, override the default additional margin */
.alignfull.has-background > .alignwide {
  margin-left: auto !important;
  margin-right: auto !important;
}

.alignfull.has-background + .alignfull.has-background {
  margin-top: 0 !important;
}