/**
 * @file
 * Element normalisation for components that opt out of Site Studio's cascade.
 *
 * Cohesion's generated base stylesheet styles eleven bare elements site-wide —
 * p, h1-h6, ul, ol, li, a and button. A component that inherits those renders
 * one way with Site Studio installed and another way without it.
 *
 * Add `ln-isolated` to a component root to opt in. What it governs is
 * editor-authored markup only: anything carrying an `ln-` class is excluded, so
 * a component still owns its own elements.
 *
 * Specificity is (0,1,1) throughout — enough to beat Cohesion's bare element
 * rules whatever order the stylesheets land in, and the `:not()` keeps it off
 * component-authored markup rather than relying on losing to it.
 *
 * Values reproduce what renders today with Site Studio on. This file is a
 * decoupling change, so it should be invisible.
 *
 * @see css/editor-styles.css, which does this ad hoc for three cases and stays
 *   until every component has opted in.
 */

.ln-isolated :is(p, h1, h2, h3, h4, h5, h6):not(:where([class*="ln-"])) {
  margin-block: 0 1em;
  color: inherit;
  text-align: inherit;
}

/* Editor-authored copy takes the component's typography, never the document's. */
.ln-isolated p:not(:where([class*="ln-"])) {
  font: inherit;
}

.ln-isolated :is(ul, ol):not(:where([class*="ln-"])) {
  margin-block: 0 1em;
  padding-inline-start: 1rem;
}

/* Cohesion puts padding-bottom, a margin-left and its own face on every li. */
.ln-isolated li:not(:where([class*="ln-"])) {
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
}

/* Brand red and underlined, as Site Studio renders it — but at the surrounding
   size, where Cohesion pins inline links to 1rem regardless of their context. */
.ln-isolated a:not(:where([class*="ln-"])) {
  color: var(--ln-color-red, #cf0000);
  font: inherit;
  text-decoration: underline;
}

/* The UA's `bolder` resolves to 400 against the 300 these components set. */
.ln-isolated :is(strong, b):not(:where([class*="ln-"])) {
  font-weight: 700;
}

/* The column gap owns the space around editor copy, not the copy's own margins. */
.ln-isolated :is(p, h1, h2, h3, h4, h5, h6, ul, ol):not(:where([class*="ln-"])):last-child {
  margin-block-end: 0;
}
