/* RJG Mediaworks: Divi bridge.
   The prototype stylesheet (site.css + css/pages/*.css) is written for plain HTML. Divi wraps every module in extra
   boxes and gives sections, groups, headings, lists and links its own defaults. This file, printed BEFORE site.css
   (and after Divi's inline CSS), makes Divi's boxes invisible or neutral so the prototype rules apply unchanged.

   Conventions set by _divi/convert.py:
     .rjg-t   transparent structure (the row and column Divi needs around every section's content)
     .rjg-b   a Divi section/group that stands for a prototype element (kept as a real box, reset to a plain block)
     .rjg-i   neutral wrapper around inline-start Text content (stops WordPress wpautop adding <p>)
   Selectors use :where(.rjg) so they weigh the same as the prototype's single-class rules; the later rules in
   site.css and css/pages/*.css then win ties. Add a rule here only for a Divi default you can see leaking. */

/* ---------- 1. Divi's structure and module wrappers do not generate boxes ---------- */
.rjg .rjg-t,
.rjg .rjg-t > .et_pb_column,
.rjg .et_pb_text,
.rjg .et_pb_text_inner,
.rjg .et_pb_code,
.rjg .et_pb_code_inner,
.rjg .rjg-i { display: contents; }

/* ---------- 2. sections and groups that carry prototype classes: plain blocks ---------- */
:where(.rjg) .rjg-b {
  display: block; flex-direction: row; flex-wrap: nowrap; align-items: normal; justify-content: normal;
  column-gap: 0; row-gap: 0; --horizontal-gap: 0px; --vertical-gap: 0px;
  width: auto; max-width: none; min-height: 0; margin: 0; padding: 0; border: 0;
  background-color: transparent; text-align: inherit;
}
:where(.rjg) .rjg-b { margin-bottom: 0 !important; } /* Divi's phone/tablet 30px module gap; the .m.css copies of the prototype margins load after this */
:where(.rjg li).rjg-b { display: list-item; list-style: none; }
:where(.rjg) .et_pb_text, :where(.rjg) .et_pb_code { line-height: inherit; font-size: inherit; font-weight: inherit; color: inherit; text-align: inherit; }
/* Divi prints each text module's own "text-align: start" (.et_pb_text_N, one-class weight). When the Divi cache is cold it prints it in the
   footer, AFTER this file, and it won (centred text turned left-aligned); two classes win in either order. */
.rjg .et_pb_text, .rjg .et_pb_code { text-align: inherit; }
/* new sections Ryan adds are transparent (dark page shows through); a background set in the builder still wins */
:where(.rjg) .et_pb_section { background-color: transparent; }

/* ---------- 3. Divi's global element defaults ---------- */
body.rjg { font: 400 16px/1.55 var(--sans); letter-spacing: -.005em; color: var(--text); background: var(--bg); overflow-x: clip; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html, .rjg #page-container, .rjg #et-main-area, .rjg #main-content, .rjg #main-content .entry-content { background: var(--bg); }
:where(.rjg) h1, :where(.rjg) h2, :where(.rjg) h3, :where(.rjg) h4, :where(.rjg) h5, :where(.rjg) h6 { padding: 0; color: inherit; font-family: inherit; font-weight: inherit; line-height: inherit; }
:where(.rjg) p { padding: 0; }
:where(.rjg) a { color: inherit; }
:where(.rjg) strong, :where(.rjg) b { font-weight: inherit; }
:where(.rjg) em, :where(.rjg) i, :where(.rjg) cite { font-style: normal; }
:where(.rjg) blockquote { margin: 0; padding: 0; border: 0; }
:where(.rjg) img { max-width: 100%; }
.rjg .container { max-width: none; }
.rjg .entry-content ul, .rjg .entry-content ol,
.rjg .et-l--header ul, .rjg .et-l--header ol,
.rjg .et-l--footer ul, .rjg .et-l--footer ol { list-style: none; list-style-position: outside; padding: 0; line-height: inherit; }
.rjg .entry-content ul li ul, .rjg .entry-content ol li ol, .rjg .entry-content ol li ul { padding: 0; }
:where(.rjg) input, :where(.rjg) textarea, :where(.rjg) select, :where(.rjg) button { -webkit-appearance: none; appearance: none; }
:where(.rjg) button { font: inherit; color: inherit; }

/* ---------- 4. things Divi adds around the page ---------- */
.rjg .et_builder_inner_content { z-index: auto; }
.rjg.et_fixed_nav.et_show_nav #page-container { padding-top: 0 !important; }

/* ---------- 5. prototype rules written with a child combinator (parent > *) meet Divi's module wrappers ---------- */
/* The wrapper boxes are display: contents, so the rule would land on a wrapper and do nothing: repeat it one level down. */
.rjg .acc__in .et_pb_text_inner > * { max-width: 68ch; padding: 0 0 clamp(22px, 2.6vw, 32px); color: rgba(245, 245, 244, .72); }

/* ---------- 6. the 404 page is a Theme Builder BODY layout (builder P): Divi's body defaults need the same resets as the header/footer ---------- */
.page-404 .container::before, .page-404 .container::after { content: none; display: none; } /* Divi's grey divider rule down every .container */
.page-404 .et-l--body ul, .page-404 .et-l--body ol { padding: 0; list-style: none; list-style-position: outside; line-height: inherit; }
