/*
 Theme Name:        New Media Relations
 Theme URI:         https://bricksbuilder.io/
 Description:       Child theme of Bricks, developed by New Media Relations
 Author:            New Media Relations
 Author URI:        https://newmediarelations.nl
 Template:          bricks
 Version:           1.3.58
 Text Domain:       nmr-brx-child
 Requires at least: 6.6
 Tested up to:      7.1
 Requires PHP:      7.4
 Update URI:        https://newmediarelations.nl
*/

/* ==========================================
   GUTENBERG FIXES - CORE FRAMEWORK NATIVE
   ========================================== */

/* Layout */
.alignfull {
  width: 100vw;
  max-width: 100vw;
  left: auto;
  right: auto;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Constrain non-aligned children of a constrained context to the content width. */
.is-layout-constrained > :where(:not(.alignfull):not(.alignleft):not(.alignright)) {
  box-sizing: border-box;
  max-width: var(--max-screen-width);
  margin-inline: auto;
}

/* A full-bleed child inside a constrained context stays full-bleed. */
.is-layout-constrained > .alignfull {
  max-width: none;
}

/* Full-bleed sections span the viewport */
.alignfull > :where(:not(.alignfull)) {
  box-sizing: border-box;
  padding-inline: var(--space-m);
}

/* Cover blocks: background fills the full-bleed box, content re-constrains. */
.wp-block-cover.alignfull > .wp-block-cover__inner-container {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--max-screen-width);
  margin-inline: auto;
  padding-inline: var(--space-m);
}

/* Responsive fixes */
@media (max-width: 991px) {
  .wp-block-media-text__content {
    order: -1 !important;
  }
}

/* Utilities */
.wp-block-table {
  overflow-x: auto;
}

img, video {
  max-width: 100%;
  height: auto;
}

/* Links */
a:where(:not(.wp-element-button)) {
    text-decoration: none !important;
}

/* Let nested layout blocks (groups/columns) inherit the Core Framework gap. */
.brxe-post-content {
  --wp--style--block-gap: var(--space-m);
}

/* Vertical rhythm between top-level blocks */
:where(.brxe-post-content) > * {
  margin-block: 0;
}

:where(.brxe-post-content) > * + * {
  margin-block-start: var(--space-m);
}

/* Air above a heading that starts a new section. */
:where(.brxe-post-content :is(h1, h2, h3, h4, h5, h6, .wp-block-heading):not(:first-child)) {
  margin-block-start: var(--space-l);
}

/* Stacked headings (pretitle + title) stay tight — preserves that pattern. */
:where(.brxe-post-content :is(h1, h2, h3, h4, h5, h6, .wp-block-heading) + :is(h1, h2, h3, h4, h5, h6, .wp-block-heading)) {
  margin-block-start: var(--space-2xs);
}

/* Room below a heading, before the copy it introduces (fixes the snug gap). */
:where(.brxe-post-content :is(h1, h2, h3, h4, h5, h6, .wp-block-heading) + :is(p, ul, ol, .wp-block-paragraph, .wp-block-list, .wp-block-quote)) {
  margin-block-start: var(--space-s);
}

/* Column gap from Core Framework, not Gutenberg's default 2em. */
:where(.brxe-post-content .wp-block-columns) {
  gap: var(--space-m);
}
