/* =============================================================================
   Fallback content styling
   =============================================================================
   Basic, readable styling for pages that are NOT rendered by Bricks — e.g. a
   page the client published empty, or one edited with the WordPress/Gutenberg
   editor as an exception. The Bricks builder owns all designed pages; this file
   is only a safety net so non-builder content never ends up unstyled.

   Loading: enqueued (in inc/setup.php) only when Bricks\Helpers::render_with_bricks()
   is false for the current page, so it never loads on builder-designed pages.

   Scope: every rule is nested under #brx-content — the wrapper the parent theme
   puts around default/WordPress-rendered content (see bricks/single.php and
   bricks/template-parts/page.php). The Bricks-built header and footer render
   OUTSIDE this wrapper, so they are never affected even on a fallback page.

   Values: brand tokens are referenced as var(--token, <fallback>). When Bricks'
   global CSS is loaded the brand tokens apply (and the document root is 10px, so
   the token's own sizing is correct). The raw fallbacks are sized for a 16px root
   — the truly-bare case where Bricks global CSS, and therefore the tokens and the
   10px root, are absent. This is the documented exception to the "tokens only"
   rule in CSS-GUIDELINES.md: a fallback sheet must stand on its own.
   ============================================================================= */

#brx-content {
  /* Container: centered, capped width, comfortable padding.
     Layout dimensions use px/vw (not rem) so they're independent of the
     document root font-size, which is 10px when Bricks' global CSS is loaded
     and 16px when it isn't. */
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 40px);
  /* No top padding: the full-width hero banner below sits flush to the top
     (behind the fixed header), then content follows after the banner. */
  padding-top: 0;
  padding-bottom: clamp(40px, 6vw, 80px);

  color: var(--colors-primary-dark-blue-100, #1d1d1b);
  font-size: var(--fs-body-s, 1.125rem);
  line-height: 1.6;
  word-break: break-word;
}

/* Top hero banner — a solid blue band, full viewport width, ~300px tall.
   It sits behind the fixed (white-text) site header to give it a backdrop, and
   pushes the actual content down below it. Full-bleed out of the centered
   container via the left:50% / translateX(-50%) / 100vw technique (works because
   #brx-content is horizontally centered in the viewport). */
#brx-content::before {
  content: "";
  display: block;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 15rem;
  margin-bottom: clamp(32px, 5vw, 64px);
  background-color: var(--colors-primary-dark-blue-100);
  backdrop-filter: blur(15px);
}

/* Headings
   --------------------------------------------------------------------------- */

#brx-content :where(h1, h2, h3, h4, h5, h6) {
  color: var(--colors-primary-dark-blue-100, #15233d);
  line-height: 1.2;
  font-weight: 700;
  margin-block: 1.5em 0.6em;
}

#brx-content :where(h1, h2, h3, h4, h5, h6):first-child {
  margin-top: 0;
}

#brx-content h1 { font-size: var(--fs-h-xs, clamp(2rem, 5vw, 2.75rem)); }
#brx-content h2 { font-size: var(--fs-l-sm, clamp(1.6rem, 4vw, 2.25rem)); }
#brx-content h3 { font-size: var(--fs-l-sm, clamp(1.4rem, 3vw, 1.75rem)); }
#brx-content h4 { font-size: var(--fs-m-lg, clamp(1.2rem, 2.5vw, 1.4rem)); }
#brx-content h5 { font-size: var(--fs-m-md, 1.2rem); }
#brx-content h6 { font-size: var(--fs-m-sm, 1.05rem); }

/* Text & flow
   --------------------------------------------------------------------------- */

#brx-content p,
#brx-content ul,
#brx-content ol,
#brx-content blockquote,
#brx-content table,
#brx-content figure,
#brx-content pre {
  margin-block: 0 1.25em;
}

#brx-content > *:last-child {
  margin-bottom: 0;
}

#brx-content :where(ul, ol) {
  padding-left: 1.5em;
}

#brx-content li {
  margin-block: 0.25em;
}

#brx-content li > :where(ul, ol) {
  margin-block: 0.25em;
}

/* Links
   --------------------------------------------------------------------------- */

#brx-content a {
  color: var(--colors-text-highlight-turquoise, #03989e);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  transition: opacity 0.2s ease;
}

#brx-content a:hover {
  opacity: 0.7;
}

#brx-content a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Blockquote
   --------------------------------------------------------------------------- */

#brx-content blockquote {
  margin-inline: 0;
  padding: 0.5em 0 0.5em 1.25em;
  border-left: 4px solid var(--colors-primary-turquoise-100, #03989e);
  font-style: italic;
}

#brx-content blockquote cite {
  display: block;
  margin-top: 0.5em;
  font-style: normal;
  font-size: 0.875em;
  opacity: 0.75;
}

/* Media
   --------------------------------------------------------------------------- */

#brx-content :where(img, video, iframe) {
  max-width: 100%;
  height: auto;
}

#brx-content img {
  border-radius: 0.5rem;
}

#brx-content figure {
  margin-inline: 0;
}

#brx-content figcaption {
  margin-top: 0.5em;
  font-size: 0.875em;
  opacity: 0.75;
  text-align: center;
}

/* Tables
   --------------------------------------------------------------------------- */

#brx-content table {
  width: 100%;
  border-collapse: collapse;
}

#brx-content :where(th, td) {
  padding: 0.6em 0.8em;
  border: 1px solid var(--colors-primary-dark-blue-20, rgba(0, 0, 0, 0.12));
  text-align: left;
}

#brx-content th {
  background: var(--colors-primary-light-blue-20, rgba(0, 0, 0, 0.04));
  font-weight: 700;
}

/* Code
   --------------------------------------------------------------------------- */

#brx-content :where(code, kbd, pre) {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

#brx-content :where(code, kbd) {
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
  background: var(--colors-primary-light-blue-20, rgba(0, 0, 0, 0.06));
}

#brx-content pre {
  padding: 1em 1.25em;
  border-radius: 0.5rem;
  overflow-x: auto;
  background: var(--colors-primary-dark-blue-100, #15233d);
  color: var(--colors-primary-white-100, #fff);
}

#brx-content pre code {
  padding: 0;
  background: none;
}

#brx-content hr {
  margin-block: 2em;
  border: 0;
  border-top: 1px solid var(--colors-primary-dark-blue-20, rgba(0, 0, 0, 0.12));
}

/* Buttons (Gutenberg button block + generic) */

#brx-content :where(.wp-block-button__link, .wp-element-button, button) {
  display: inline-block;
  padding: 0.8em 1.6em;
  border: 0;
  border-radius: 0.5rem;
  background: var(--colors-primary-red-100, #e3000f);
  color: var(--colors-primary-white-100, #fff);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

#brx-content :where(.wp-block-button__link, .wp-element-button, button):hover {
  opacity: 0.85;
}

/* Gutenberg alignment helpers
   --------------------------------------------------------------------------- */

#brx-content :where(.aligncenter) {
  margin-inline: auto;
}

#brx-content :where(.alignleft) {
  float: left;
  margin: 0 1.5em 1em 0;
}

#brx-content :where(.alignright) {
  float: right;
  margin: 0 0 1em 1.5em;
}

/* Let wide/full-width blocks break out of the capped reading width */
#brx-content :where(.alignwide) {
  width: min(100% + 192px, 96vw);
  margin-inline: calc(50% - min(50% + 96px, 48vw));
  max-width: none;
}

#brx-content :where(.alignfull) {
  width: 96vw;
  margin-inline: calc(50% - 48vw);
  max-width: none;
}

/* "Nothing found" state (parent theme default archive output) */

#brx-content .bricks-no-posts-wrapper {
  text-align: center;
}
